key: cord-0809449-gfolei1z authors: Zhang, Beini; Liu, Yiteng; Song, Qi; Li, Bo; Chen, Xuee; Luo, Xiao; Wen, Weijia title: A new dynamic deep learning noise elimination method for chip-based real-time PCR date: 2022-04-02 journal: Anal Bioanal Chem DOI: 10.1007/s00216-022-03950-7 sha: 34ee7c2e4f0bc83949511af21c65ecf33b1cffa9 doc_id: 809449 cord_uid: gfolei1z Point-of-care (POC) real-time polymerase chain reaction (PCR) has become one of the most important technologies for many fields such as pathogen detection and water-quality monitoring. POC real-time PCR usually adopts chips with small-volume chambers for portability, which is more likely to produce complex noise that seriously affects the accuracy. Such complex noises are difficult to be eliminated by the traditional fixed area algorithm that is most commonly used at present because they usually have random shape, location, and brightness. To address this problem, we proposed a novel image analysis method, Dynamic Deep Learning Noise Elimination Method (DIPLOID), in this paper. Our new method could recognize and output the mask of the interference by Mask R-CNN, and then subtract the interference and select the maximum valid contiguous area for brightness analysis by dynamic programming. Compared with the traditional method, DIPLOID increased the accuracy, sensitivity, and specificity from 57.9 to 94.6%, 49.1 to 93.9%, and 65.9 to 95.2%, respectively. DIPLOID has great anti-interference, robustness, and sensitivity, which can reduce the impact of complex noise as much as possible from the aspect of the algorithm. As shown in the experiments of this paper, our method significantly improved the accuracy to over 94% under the complex noise situation, which could make the POC real-time PCR have greater potential in the future. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1007/s00216-022-03950-7. With the global pandemic of the Coronavirus Disease 2019 , the point-of-care (POC) real-time polymerase chain reaction (PCR) that based on microfluidic chips is becoming an important detection method because of its portability and rapidity, which also has many other application scenarios such as community testing [1, 2] , veterinary testing [3] , and water quality detection [4] . POC Weijia Wen phwen@ust.hk PCR can greatly reduce the cost of transporting samples and allow testing, diagnosis, and treatment to be conveniently performed in the same location, which is important for controlling the spread of epidemics [5, 6] . However, because the POC real-time PCR is usually designed with small volume chambers for portability and flexibility, and the liquid often requires external power to drive and heat [7] . So it is more likely to cause pressure variation, temperature changes, and mass transport on the surface because of the limited vertical space, which may lead to a variety of interference problems such as bubbles, self-luminous debris, and light spots [8, 9] . The bubble problem is one of the most critical factors affecting the accuracy of the PCR because it not only influences the brightness value of a large area [10] but also may lead to a series of problems such as liquid leakage and evaporation, so it may increase the probability of producing other complex noises [8] . And complex noise is very likely to affect the accuracy of detection results, resulting in false-positive or falsenegative results [11] . To solve these problems, researchers have spent a lot of effort to improve the hardware of PCR detectors, such as utilizing the gas barrier [12] or using the interface cladding technique on chips to reduce the generation of bubbles [8] . However, these hardware-based improvements are expensive and increase the difficulty of the chip fabrication [13, 14] . In fact, the effect of complex noises can be reduced as much as possible by powerful algorithms at a lower cost, as long as they do not affect the brightness variation of all areas within chambers. Different analysis methods may produce completely different results for these complicated problems. At present, industry and academia mainly rely on the traditional algorithm that calculates average brightness with predetermined fixed area for PCR Image Analysis [15, 16] . The fixed calculated area pattern makes this method to be less robust if there is complex noise in the selected area, it may dramatically affect the brightness and cause false-positive or false-negative results directly because the complex noise has great randomness in brightness, location, and occurrence time [10, 15] . Actually, with the development of deep neural networks in the field of image processing, many complicated problems such as irregular noise and target recognition, which are hard to be solved by traditional algorithms can be effectively handled now [17, 18] . As a deep neural network with the functions of target recognition and segmentation, Mask R-CNN has been widely used for many fields such as radar image recognition [19] , diseases detection [20] , and ship detection [21] . But such an effective method has not been introduced into the field of noise recognition for real-time PCR. Therefore, we proposed a novel Dynamic Deep Learning Noise Elimination Method (DIPLOID) in this paper. Our new method is based on Mask R-CNN and dynamic optimal area selection algorithm (DANA). DIPLOID could automatically recognize and eliminate complicated noises and dynamically select the optimal calculating region. With the growing problems such as infectious diseases and environmental pollution, the importance of POC devices is daily increasing. It has great application potential for areas such as isolation facilities, customs, and reservoir [22] [23] [24] . And accuracy is one of the most important requirements of POC devices. DIPLOID would identify impurities by Mask R-CNN first, then remove impurities and use threshold segmentation to select the preliminary affected area by DANA algorithm, and finally used dynamic programming to select the largest continuous area to calculate the average brightness. With these measurements, DIPLOID could significantly increase the accuracy for experiment images that own impurity interference. As shown in the experiments of this paper, our method increased the accuracy from 57.9 to 94.6% compared with the traditional method. Besides, it decreased the False Positive Rate (FPR) from 34.1 to 4.8% and reduced the False Negative Rate (FNR) from 50.9 to 6.1%, respectively. Compared with the traditional algorithm, the performance improvement of our method is very significant. In addition, our method is more sensitive to brightness variety and more robust to noise interference. So it can improve the accuracy of POC real-time PCR, and make the portable PCR a broader application prospect. In this study, we tested the performance of our method using the standard pathogen RNA sample (COVID-19) and real DNA sample (Escherichia coli ATCC 8739). COVID-19 Nucleic Acid Detection Kit (Fluorescent RT-PCR) was purchased from Jiangsu Diagnostics Biotechnology Co Ltd (202103003EN, China). The standard sample, Certified Reference Material of 2019 Novel Corona Virus (2019-nCoV) Ribonucleic Acid Genome (SN:2020-02, GBW(E) 091099, National Institute of Metrology, China) consists of 8.04×10 2 copy/μL E gene, 6.89 ×10 2 copy/μL ORFlab gene, and 1.36×10 3 copy/μL N gene (Genome coordinate: 1320115600, GenBank No. NC 045512). Escherichia coli (ATCC 8739) was originally obtained from Guangdong Huankai Microbial Technology Co LTD, and the strain was activated and cultivated with the Lysogeny Broth (LB) medium as the real samples we used. Nucleic acid was extracted from a 1 ml overnight culture by Wizard Genomic DNA Purification Kit (Promega). In this work, the standard RNA sample and real DNA sample were diluted in TE buffer (17890, Thermal Fisher Scientific) on a scale of 500 and 100000 as template nucleic acid. SWM-01 PCR Nucleic Acids Analyzer (SN:202003010EN, Shineway, China) and microfluidic PCR chip (BS-C3-12/ BS-C6-12, Shineway, China) were used for nucleic acid amplification and shown in Fig. 1 . For RNA standard sample, the total reaction volume is 25 μL which consists of 16 μL RT-PCR Buffer Master Mix, 2 μL COVID-19 Reaction Solution, 2 μL RT-PCR Enzyme Mix, and 5 μL 500-fold diluted RNA Reference Material. For DNA real sample, a 25 μL reaction volume containing 12.5 μL TaqManTM Fast Advanced Master Mix (ThermoFisher, USA), 1 μL INVOA Primer F (10 μM), 1 μL INVOA Primer R (10 μM), 0.5 μL INVOA Probe P (10 μM), 5 μL Rnase-free H 2 O from Escherichia coli (universal) qPCR test kit (Invitrogen), and 5 μL diluted Escherichia coli (ATCC 8739) DNA. Then, 12 μL mixture was independently loaded in the microchip with bubbles that easily be generated by the air-containing pipette tip. According to the users' manual of SWM-01, we set up the following conditions for thermal cycling of COVID-19 RNA standard sample: (1) Reverse transcription: 50 • C for 15 min; (2) pre-cycle: 95 • C for 3 min; (3) 45 thermal cycles: 95 • C for 10 s and 60 • C for 40 s, with a total reaction time of 55.5 min; and Escherichia coli (ATCC 8739) DNA sample according to the following conditions: (1) pre-cycle: 95 • C for 3 min; (2) 45 thermal cycles: 95 • C for 10 s and 55 • C for 40 s, with a total reaction time of 40.5 min. Through the excitation of the blue LED (470nm), the fluorescent images were collected by complementary the metal oxide semiconductor (CMOS) with the resolution of 800 × 480 pixels. It should be noted that the DIPLOID image analysis method proposed in this paper has universal validity, and the types of experiment samples do not affect the effectiveness of the algorithm because they have the same luminescence mechanism. Deep learning networks have achieved great success in visual recognition fields such as autonomous driving and face recognition, but one of the most serious limitations for deep learning is the lack of data [25] . The requirement of the large dataset limits the application of deep learning networks in many fields that data is expensive or hard to obtain. To solve this dilemma, deep learning networks based on the small dataset with effective data augmentation methods are becoming more and more popular recently [26, 27] . Because of the high cost to acquire PCR images, we adopted the randomly targets copy strategy [28] combines with the image rotation method [29] as the data augmentation method in this paper. We first randomly copied and pasted impurities with different brightness and size to augment the images, then doubled all data again by rotating them 180 • . This step not only quickly increased the number of training images but also simulated more patterns of noise, which could improve the training efficiency of the model. The original training dataset contains 450 images, the validation dataset contains 50 images, and the testing dataset contains 1350 images. After augmentation, the original training images were increased from 450 to 1800. The dataset is labeled with polygon box by via-2.0.10, and all annotation information of the training dataset and the testing dataset is stored in two JSON files named VIA REGION DATA respectively. We could divide the prediction results into four types: False Negative (FN), True Negative (TN), False Positive (TP), and True Positive (TP). The key factors which present the precision of the prediction results are False Positive Rate (FPR), False Negative Rate (FNR), and Accuracy (ACC) [30] [31] [32] : The dataset of the current study is available from the corresponding author on reasonable request. In this paper, a novel dynamic deep learning noise elimination method based on Mask R-CNN and dynamic selection is proposed as Fig. 2 shows. The DIPLOID could be mainly divided into two parts: interference identification and dynamic selection, which are processed by Mask R-CNN and DANA respectively. First, the Mask R-CNN will identify impurities and output masks for the input images. The ground truth we used to train Mask R-CNN is the manually labeled bubbles and noise. The output of the Mask R-CNN is the recognition result and the mask of impurities, which are shown in Fig. 2 (B) and (C) respectively. Second, the DANA will subtract the impurity regions from original images through the cv2.subtract function. The input image shown in Fig. 2(A) is used as the minuend, and the mask is used as the subtrahend. After subtractions, the gray value of the original corresponding impurity area is perfectly reduced to 0, and pixels in other areas are retained at their original values, and the subtraction result is shown in Fig. 2(D) . Third, the DANA will calculate the Maximum Valid Contiguous Area (MVCA) from the subtraction result. DANA will construct a dynamic programming list (DP) for realizing this task. The subtraction result is binarized by the dynamic selection method with the background mean value as the threshold. The pixels below the threshold are set to 0, and the pixels above the threshold are set to 1. Fourth, the dynamic selection method is used to calculate the maximum square ( Fig. 2(G) ) with all values of 1 for calculating the brightness curve. According to the dynamically selected region, the average gray value in the region is calculated and the brightness change curve is output to make predictions ( Fig. 2(H) ), where the x-axis of the curve is the cycle number and the y-axis is the brightness value. Last but not least, the cycle threshold (CT) values are used to predict the results of curves, which is the most commonly used method at present [33] . For CT values, it is the x-axis value of the intersection point between the brightness curve and a straights line y = 10 * std + C 3 , where C 3 is the brightness value of cycle 3 and the std is the standard deviation from cycle 3 to cycle 15. After calculating the intersection point (x i , y i ) between the brightness curve and the straight line, if x i ≤ 37 then the prediction is positive, if x i ≥ 40 then the prediction is negative, and if 37