Method for identification and detection of single cell droplets
Patent Information
- Application Number
- CN202611055828.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-09-25
AI Technical Summary
但当前该类检测平台仍存在关键技术短板,核心局限在于液滴内单细胞识别与计数依赖人工肉眼观测、传统阈值分割等常规图像处理方式,自动化程度低、识别精度差,无法精准区分空液滴、单细胞液滴与多细胞液滴,难以实现高通量、智能化的单细胞液滴筛选与定位
1、本发明搭建适配显微单细胞检测的YOLO深度学习检测网络,依托该网络完成单细胞特征学习与模型迭代训练,突破了传统人工检测的局限。训练过程中融合边界框回归损失、目标置信度损失、类别分类损失构建完整总损失函数,通过反向传播机制逐层微调网络权重参数,持续优化模型预测精度,有效修正细胞框定位偏差、目标置信度判别误差以及细胞类别预测误差,使模型能够精准学习显微图像中单细胞的形态特征,大幅提升模型对单细胞的检测准确性与稳定性。
Smart Images

Figure CN122821099A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of single-cell metabolomics detection and intelligent image recognition technology. Specifically, it relates to a method for identifying and counting single cells within droplets based on the YOLO algorithm, as well as a method for identifying and detecting single-cell droplets. It is particularly suitable for the accurate positioning and number counting of single-cell droplets in the context of surface-enhanced Raman spectroscopy (SERS) single-cell metabolomics detection. Background Technology
[0002] Single-cell analysis is a revolutionary research technology in the life sciences, breaking through the limitations of traditional population-based cell detection with its averaging approach. It can resolve individual differences in single cells at ultra-high resolution, precisely revealing the microscopic mechanisms of cellular life activities and providing core technical support for research on cellular heterogeneity, disease mechanism exploration, and biomarker screening. Currently, single-cell genomics, epigenomics, and proteomics technologies are becoming increasingly mature, enabling high-throughput and high-precision detection applications. However, the development of single-cell metabolomics technology is relatively lagging.
[0003] Metabolomics focuses on the dynamic changes of small molecule metabolites within cells, directly reflecting the real-time physiological state and functional activity of cells, and is a core dimension for elucidating cellular life activities. However, compared with other omics technologies, single-cell metabolomics faces significant technical barriers: on the one hand, the content of small metabolic molecules within cells is extremely low, their structures are complex, their metabolic dynamics are rapid, and they cannot be amplified like nucleic acids and proteins, making detection extremely difficult; on the other hand, existing detection methods have cumbersome procedures, low throughput, and insufficient stability, which greatly limits the large-scale application and technological iteration of single-cell metabolomics.
[0004] Currently, the mainstream detection platforms for single-cell metabolomics are mainly divided into three categories: microscopy, spectroscopy, and mass spectrometry. Among them, surface-enhanced Raman spectroscopy (SERS) has become the preferred detection solution for single-cell metabolomics due to its unique technical advantages. This technology relies on the plasma enhancement effect of nanomaterials to achieve single-molecule-level metabolite signal detection. It boasts advantages such as simple sample processing, high detection sensitivity and specificity, no sample damage, and low detection cost, perfectly meeting the detection needs of trace metabolites in single cells and is widely used in research scenarios such as single-cell metabolic characteristic analysis and cell state identification.
[0005] Existing single-cell metabolic detection based on surface-enhanced Raman spectroscopy often incorporates microdroplet encapsulation technology. This technology uses microfluidic droplet systems to achieve independent encapsulation and isolated detection of single cells, avoiding interference from environmental impurities and ensuring the accuracy of single-cell detection. However, current detection platforms still suffer from key technological shortcomings. The core limitation lies in the reliance on manual visual observation and conventional image processing methods such as traditional threshold segmentation for single-cell identification and counting within droplets. This results in low automation, poor recognition accuracy, and an inability to accurately distinguish between empty droplets, single-cell droplets, and multi-cell droplets, hindering high-throughput, intelligent single-cell droplet screening and localization.
[0006] Traditional manual identification and counting methods are time-consuming, labor-intensive, highly subjective, and prone to errors, making them unsuitable for high-throughput detection scenarios. Meanwhile, traditional image segmentation algorithms are weak in recognizing cell edges and overlapping areas in droplet images, easily leading to missed detections and false detections. This makes it difficult to accurately count the number of cells within droplets and locate effective single-cell droplets, directly resulting in low validity of subsequent SERS metabolic detection data and limited detection throughput. This severely restricts the industrialization and large-scale scientific research application of surface-enhanced Raman single-cell metabolomics technology. Summary of the Invention
[0007] To address the problems existing in the above-mentioned technologies, the present invention first provides a cell identification and counting method based on the YOLO algorithm, which includes the following steps: A YOLO single-cell detection model was constructed and trained. The model training was performed by minimizing the total loss function through backpropagation. The total loss function was based on bounding box regression loss, target confidence loss, and category classification loss. The trained YOLO single-cell detection model is used to perform single-cell inference on the samples.
[0008] Preferably, the formula for minimizing the total loss function during backpropagation is: , in, Indicates the total loss. This represents the bounding box regression loss. Indicates the target confidence loss. This represents the category classification loss; , and These represent the weights of the corresponding loss terms; , Where B represents the prediction box. This represents the actual annotation box. Indicates a complete intersection and union ratio; , , , , in, Indicates the center point of the prediction box Center point of the real frame The square of the Euclidean distance between them This represents the diagonal length of the smallest bounding rectangle that simultaneously encloses the predicted bounding box and the ground truth bounding box. and Indicates the width and height of the prediction box. and Indicates the actual width and height of the bounding box; , in, Indicates whether the candidate box contains a single cell, and if it does. excluding time ; This indicates the probability that the model predicts the candidate box contains a single cell; , in, Indicates the total number of categories. Indicates the first The true label of the class, The model predicts the number of... The probability of a class.
[0009] Preferably, the trained YOLO single-cell detection model is used for single-cell inference: a confidence threshold is set, and candidate boxes below the threshold are not output as valid single-cell results; , in, This indicates the final detection confidence level. This represents the probability that a single cell target exists within the candidate box. This represents the probability that a cell belongs to a specified cell category given the existence of a single cell.
[0010] Preferably, The training set images used for model training include the following steps: S1: Acquire cell microscopic images and build the original dataset; S2: Annotate individual cell targets and generate YOLO format labels: S3: Preprocess the training images and labels; S4: Augment the training set.
[0011] Preferably, in step S1, microscopic images containing cells are acquired; for each image, the acquired data includes: time, sample number, microscopic magnification, and field of view position; the images are divided into training images, verification images, and test images.
[0012] In step S2, individual cells in each microscopic image are labeled to obtain the bounding rectangle of each cell; the labeling box includes the target category, the x-coordinate of the center point of the box, the y-coordinate of the center point of the box, the width of the box, and the height of the box. If the original image width is Height is The coordinates of the top left corner of the annotation box are The coordinates of the lower right corner are Then the YOLO tags adopt a normalized format: class_id (category), ; , , , , in, This represents the x-coordinate of the center point of the normalized annotation box. This represents the ordinate of the center point of the normalized annotation box. Indicates the normalized box width. Indicates the height of the normalized bounding box; In step S3, after reading the image, the YOLO model scales and fills images that do not conform to the input size; the model also accepts grayscale image input; for images with uneven brightness, white balance, contrast enhancement, or normalization processing can be performed; the pixel normalization formula is: , in, Represents pixels In the passage The original grayscale or color value on the image. This represents the normalized pixel value; In S4, the operations performed on the training image include at least one: horizontal flipping, random vertical flipping, random rotation, random translation, random scaling, mosaic enhancement, color perturbation, and Gaussian noise superposition. The modified images are added to the training image set as augmented images. When performing geometric transformations on an image, the coordinates of the bounding boxes are updated synchronously to ensure that the transformed bounding boxes still enclose the corresponding individual cell targets.
[0013] Preferably, the step of constructing and training the YOLO single-cell detection model is S5; the step of performing single-cell inference using the trained YOLO model is S6; after S6, the following steps are also included: S7: Filter, remove duplicates, and count candidate detection boxes; S8: Save the recognition results and output them to the host computer or client.
[0014] Preferably, in step S7, the candidate boxes output by the YOLO single-cell detection model are filtered by a confidence threshold and subjected to non-maximum suppression. For multiple overlapping candidate boxes generated by the same cell, the candidate box with the highest confidence is retained, and the remaining candidate boxes with an overlap exceeding the threshold are deleted. The final set of retained detection boxes is the set of identified cells, and the number of elements in the set is the cell count result. Predicted boxes are filtered using a confidence threshold to obtain a preliminary candidate set. : , in, This represents the set of candidate boxes after being filtered by confidence level. Indicates the first One candidate box, Indicates the first The confidence level of each candidate box. Indicates the confidence threshold; To eliminate redundant detections, the following rejection logic is executed for candidate boxes in the set: If and , then delete ;in The preset overlap threshold; The final number of recognitions is obtained by counting the number of elements in the retained bounding box set after all processing: , in, This represents the final set of individual cell detection boxes retained after nonmaximum suppression. This indicates the number of elements in the set, i.e., the total number of cells identified; In step S8, for each identified cell, the system outputs the coordinates of the top left corner of the bounding box (x, y), width, height, confidence, and class name. The system further records the image name, recognition timestamp, processing time, cell list (cells), and total number of cells (cell_count), and saves them as a JSON file with the same name as the input image. The file is stored in the results directory and handed over to the system for further processing.
[0015] This invention provides a method for identifying and detecting single-cell droplets, characterized by comprising the following steps: Step 1: Identify specific single-cell droplets; identify single-cell droplets using the methods described above; Step 2: Automatically plan the detection path for the non-cellular regions of single-cell droplets; Step 3: Autofocus the image; Step 4: Perform surface-enhanced Raman spectroscopy detection of single-cell metabolites according to the detection path.
[0016] Preferably, step two includes the following steps: Step 1: Obtain the complete outline of the droplet and the set of position coordinates of internal cells; Step 2: Calculate the indentation distance : Traverse each cell Calculate the shortest distance from it to the edge of the droplet profile. Indentation distance for Half of it, to obtain the inward shrinkage area ; Step 3: Obtain the cell region for single-cell recognition, based on distance. Obtaining expanded areas ; Step 4: Calculate the final effective safe area ; Step 5: In the safe area The system generates a planned path according to the set step size and number of detection points. If there are not enough points, the step size is automatically reduced until enough detection points are generated. If there are too many points, the distance from the test points to the edge is calculated, sorted from smallest to largest, test points close to the edge are deleted, and the center point is retained to minimize the interference of the droplet boundary. Finally, a reliable path is returned.
[0017] Preferably, step three, image autofocus, includes the following steps: Step 1: Obtain the current Z-axis voltage Set voltage spacing ,by Five equally spaced voltage groups are generated around the center. The calculation formula is as follows: , Step 2: Cyclicly control the Z-axis movement to each voltage group Acquire microscopic images at the corresponding locations. ; Step 3: Image effective region extraction: Based on the previous droplet recognition results, extract the effective region from the image. The droplet is divided into two complete regions. Eliminate background and interference areas; Step 4: Sharpness score calculation: The Laplace variance algorithm is used to calculate the droplet region. Clarity score A higher score indicates a clearer image, as shown in the formula below: , Step 5: Lock in the optimal initial voltage: Iterate through 5 sets of sharpness scores Record the voltage with the highest score ; Step 6: Set the voltage search range for high-precision focusing ,by Expand the search scope by focusing on the central point: Set precision threshold That is, target control precision, golden ratio ; Step 7: Calculate the initial search point and , ; Step 8: Collect voltage and Corresponding image and Calculate the sharpness score using the method in step 4. and ; Step 9: Iteratively optimize the search interval: If This indicates that the optimal voltage is within the range Internal update Recalculate ; like This indicates that the optimal voltage is within the range. Internal update Recalculate ;like :renew Recalculate and ; Step 10: Termination condition determination: When the length of the search interval... When the iteration terminates, the midpoint of the interval is taken as the optimal focusing voltage. , The Z-axis is moved according to the optimal focusing voltage to focus on the final detection position, and the surface-enhanced Raman spectroscopy detection of single-cell metabolites in the droplet begins through the aforementioned planned path.
[0018] The beneficial effects of this invention are as follows: 1. This invention constructs a YOLO deep learning detection network adapted for microscopic single-cell detection. Based on this network, single-cell feature learning and iterative model training are completed, overcoming the limitations of traditional manual detection. During training, a complete total loss function is constructed by integrating bounding box regression loss, target confidence loss, and category classification loss. The network weight parameters are fine-tuned layer by layer through backpropagation, continuously optimizing the model's prediction accuracy and effectively correcting cell box localization errors, target confidence discrimination errors, and cell category prediction errors. This enables the model to accurately learn the morphological features of single cells in microscopic images, significantly improving the model's accuracy and stability in single-cell detection.
[0019] 2. This invention utilizes a trained YOLO detection model to achieve intelligent identification and counting of single cells within droplets, accurately pinpointing the target location of single-cell droplets in microscopic images. Through forward inference, the model automatically outputs the detection box coordinates, target confidence score, and cell classification results for each single cell. This eliminates the need for manual visual observation and annotation, enabling rapid and accurate location and automated counting of single-cell droplets. It effectively avoids problems such as missed detections, false detections, large statistical errors, and low efficiency associated with manual detection, significantly improving the automation level and detection accuracy of single-cell droplet localization and counting.
[0020] 3. This invention deeply integrates YOLO single-cell intelligent detection technology with surface-enhanced Raman spectroscopy detection technology. Relying on high-precision single-cell droplet positioning results, it achieves automated planning and detection of Raman spectra of single-cell metabolites within single-cell droplets. Compared to traditional methods that rely on manual cell positioning, manual adjustment of the detection field of view, and individual sample spectrum acquisition, this invention can accurately match target single cells to complete automatic spectral acquisition and analysis, avoiding the random errors and cumbersome operations caused by manual operation. This significantly improves the efficiency and accuracy of single-cell metabolite spectral detection, achieving integrated automated operation of single-cell identification, positioning, and counting. Attached Figure Description
[0021] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 These are images of single-cell real-world annotations generated by this invention.
[0023] Figure 2 These are single-cell predicted images annotated by the YOLO single-cell detection model of this invention.
[0024] Figure 3This is an image of a single-cell droplet image that has been processed through path planning to form a detection site according to the present invention. Detailed Implementation
[0025] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] Example 1:
[0027] The cell identification and counting method based on the YOLO algorithm in this embodiment includes the following steps: A YOLO single-cell detection model was constructed and trained. The model training was performed by minimizing the total loss function through backpropagation. The total loss function was based on bounding box regression loss, target confidence loss, and category classification loss. The trained YOLO single-cell detection model is used to perform single-cell inference on the samples.
[0028] In this embodiment, a YOLO deep learning detection network is built specifically to identify single cells in microscopic images; labeled microscopic images are prepared in advance: the location of each single cell is marked on the image (with an outer label box, such as...). Figure 1 (The cells are marked with red boxes) and their species are fed into the model for training.
[0029] Model training is performed by minimizing the total loss function through backpropagation. Images are fed into the YOLO detection network, and the model automatically predicts: the coordinates of each candidate box, whether the box contains a single cell, and the cell type. The difference between the predicted results and the manually labeled ground truth is the loss. The total loss consists of three parts: bounding box regression loss: the position and size error between the predicted cell bounding box and the ground truth bounding box; the more the box deviates from the real cell, the greater this loss is; target confidence loss: the confidence error in determining whether there is a single cell in the box; low confidence for boxes with single cells and high confidence for empty boxes or boxes with multiple cells will increase the loss; class classification loss: the error between the real cell class and the model's predicted class probability; the more inaccurate the class prediction, the higher the loss. Backpropagation: Based on the total loss, fine-tune the network weight parameters layer by layer from the output layer back, iterating continuously to reduce the overall total loss until the model predictions increasingly match the labeled true values, thus completing the training.
[0030] The trained YOLO single-cell detection model is used to perform single-cell inference on the samples: After training is completed and the parameters are fixed, the unlabeled microscopic sample image to be tested is input into the model. The model only performs forward calculations and directly and automatically outputs: the location boxes of all single cells in the image, the target confidence, and the cell classification results, realizing automated single-cell identification and localization. This process is called inference. Figure 2 This is a single-cell prediction image labeled by the YOLO single-cell detection model of this invention. The blue box indicates the location predicted by the model, Cell represents the type of prediction by the model, and 0.62 represents the confidence level of the model prediction.
[0031] Example 2:
[0032] Based on Example 1, in this example, the formula for minimizing the total loss function during backpropagation is: , in, Indicates the total loss. This represents the bounding box regression loss. Indicates the target confidence loss. This represents the category classification loss; , and These represent the weights of the corresponding loss terms; , Where B represents the prediction box. This represents the actual annotation box. Indicates a complete intersection and union ratio; , , , , in, Indicates the center point of the prediction box Center point of the real frame The square of the Euclidean distance between them This represents the diagonal length of the smallest bounding rectangle that simultaneously encloses the predicted bounding box and the ground truth bounding box. and Indicates the width and height of the prediction box. and Indicates the actual width and height of the bounding box; , in, Indicates whether the candidate box contains a single cell, and if it does. excluding time ; This indicates the probability that the model predicts the candidate box contains a single cell; , in, Indicates the total number of categories. Indicates the first The true label of the class, The model predicts the number of... The probability of a class.
[0033] More specific application steps are as follows: The augmented training set is input into the YOLO detection network. The YOLO network consists of a backbone feature extraction module, a feature fusion module, and a detection head. The backbone module extracts individual cell edge, texture, morphology, and local contrast features. The feature fusion module fuses cell information at different scales. The detection head outputs candidate box coordinates, class probabilities, and target confidence at multiple scales.
[0034] During model training, the total loss function is minimized through backpropagation.
[0035] The YOLO network sequentially undergoes three levels of processing: backbone feature extraction module, feature fusion module, and detection head, to complete cell feature extraction, multi-scale feature integration, and detection result output step by step. The core feature extraction module takes an augmented cell microscopic image as input and extracts low-level and deep features of the image layer by layer through multi-layer convolution operations. It learns image features related to single cell edges, textures, morphology, and local contrast. The original large image is downsampled and compressed multiple times to transform the concrete information of single cells scattered in the original image into a multi-channel abstract feature map, providing basic feature data for subsequent localization and classification.
[0036] Feature fusion module: The main output contains feature maps of various sizes: shallow features have high resolution and focus on small single-cell details, while deep features have a large receptive field and are suitable for the recognition of larger targets or low-resolution features. This module completes the fusion of deep and shallow features through upsampling, downsampling, and feature stitching operations, and integrates single-cell features of different scales to make up for the shortcomings of single features in extracting cells of large size and dense adhesion. The fused comprehensive feature map is then output for the detection head to use.
[0037] Detection head module: Based on the fused multi-scale feature map, convolutional prediction is performed on multiple feature branches of different scales. Each branch outputs three types of prediction results simultaneously: coordinates of single-cell candidate bounding boxes (x, y, w, h); target confidence of single cells within the bounding box; and prediction probability of each cell category.
[0038] The three output prediction parameters correspond to three losses: the bounding box loss is calculated by the deviation of the candidate box coordinates from the true value, the confidence loss is calculated by the difference between the confidence score and the true value, and the classification loss is calculated by cross-entropy of the class probability. The total loss is then obtained by weighting the weight coefficients and using backpropagation to correct the network parameters of the three modules in reverse, and the model is iterated and optimized repeatedly.
[0039] Example 3: Based on Example 1, this example utilizes the trained YOLO single-cell detection model for single-cell inference: Set an inference confidence threshold; candidate boxes below this threshold will not be output as valid single-cell results. Specifically, during deployment, the server loads the trained weight file best.pt and continuously monitors the image storage directory using a directory monitoring module. Upon detecting a new .jpg image, the system waits for the file to finish writing, reads the image matrix using OpenCV, and then calls the YOLO model to perform inference. In this project, the inference confidence threshold is preferably set to 0.25; candidate boxes below this threshold are not output as valid single-cell results.
[0040] , in, This indicates the final detection confidence level. This represents the probability that a single cell target exists within the candidate box. This represents the probability that a cell belongs to a specified cell category given the existence of a single cell.
[0041] Example 4: Based on Example 1, in this example, the source of the training set images used for model training includes the following steps: S1: Acquire cell microscopic images and establish a raw dataset; in S1, acquire microscopic images containing cells; record the acquired data for each image, including: time, sample number, microscopic magnification, and field of view position; divide the images into training images, validation images, and test images. The division ratio is, for example, 7:2:1, 8:1:1, or adjusted according to the number of samples. The training images are responsible for parameter learning and optimization, the validation set is used for training process tuning and overfitting monitoring, and the test set independently evaluates the actual generalization ability of the model. The three work together to ensure reliable model training and objective and reliable detection results.
[0042] S2: Labeling individual cell targets and generating YOLO format labels: In S2, individual cells in each microscopic image are labeled (manual or semi-automatic labeling to obtain the true value), and the bounding rectangle of each cell is obtained; the labeling box includes the target category, the x-coordinate of the center point of the box, the y-coordinate of the center point of the box, the width of the box, and the height of the box; If the original image width is Height is The coordinates of the top left corner of the annotation box are The coordinates of the lower right corner are Then the YOLO tags adopt a normalized format: class_id (category), ; , , , , in, This represents the x-coordinate of the center point of the normalized annotation box. This represents the ordinate of the center point of the normalized annotation box. Indicates the normalized box width. This represents the height of the normalized bounding box.
[0043] S3: Preprocessing of training images and labels; in S3, after reading the image, the YOLO model will scale and pad images that do not conform to the input size; the model also accepts grayscale image input; for images with uneven brightness, white balance, contrast enhancement, or normalization processing can be performed; the pixel normalization formula is: , in, Represents pixels In the passage The original grayscale or color value on the image. This represents the normalized pixel value.
[0044] S4: Data augmentation of the training set. In S4, the operations performed on the training images include at least one: horizontal flipping, random vertical flipping, random rotation, random translation, random scaling, mosaic enhancement, color perturbation, and Gaussian noise superposition; the transformed images are added to the training image set as augmented images; when performing geometric transformations on the images, the coordinates of the bounding boxes are updated synchronously to ensure that the transformed bounding boxes still enclose the corresponding single cell targets.
[0045] The steps for building and training the YOLO single-cell detection model are S5; the steps for performing single-cell inference using the trained YOLO model are S6. Following S6, the following steps are also included: S7: Filter, remove duplicates, and count candidate detection boxes; S8: Save the recognition results and output them to the host computer or client.
[0046] In step S7, the candidate boxes output by the YOLO single-cell detection model undergo confidence threshold filtering and non-maximum suppression. For multiple overlapping candidate boxes generated by the same cell, the candidate box with the highest confidence is retained, while other candidate boxes with an overlap exceeding the threshold are deleted. The final set of retained detection boxes is the set of identified cells, and the number of elements in the set is the cell count result. Predicted boxes are filtered using a confidence threshold to obtain a preliminary candidate set. : , in, This represents the set of candidate boxes after being filtered by confidence level. Indicates the first One candidate box, Indicates the first The confidence level of each candidate box. This represents the confidence threshold; in this embodiment... The preferred value is 0.25; To eliminate redundant detections, the following rejection logic is executed for candidate boxes in the set: If and , then delete ;in The preset overlap threshold; The final number of recognitions is obtained by counting the number of elements in the retained bounding box set after all processing: , in, This represents the final set of individual cell detection boxes retained after nonmaximum suppression. This indicates the number of elements in the set, i.e., the total number of cells identified; In addition, in S8, for each identified cell, the system outputs the coordinates of the top left corner of the bounding box (x, y), width, height, confidence, and class name. The system further records the image name, recognition timestamp, processing time, cell list (cells), and total number of cells (cell_count), and saves them as a JSON file with the same name as the input image. The file is stored in the results directory and handed over to the system for further processing.
[0047] Example 5: This embodiment provides a method for identifying and detecting single-cell droplets, which includes the following steps: Step 1: Identify specific single-cell droplets; identify single-cell droplets using the method described in the previous embodiments; Step 2: Automatically plan the detection path for the non-cellular regions of single-cell droplets; Step 3: Autofocus the image; Step 4: Perform surface-enhanced Raman spectroscopy detection of single-cell metabolites according to the detection path.
[0048] Example 6:
[0049] Based on Example 5, in this example, step two includes the following steps: Step 1: Obtain the complete outline of the droplet and the set of coordinates of the internal cells (the coordinate set is the set of coordinate data of the detection box); Step 2: Calculate the indentation distance : Traverse each cell Given the set of position coordinates, calculate the shortest distance from the droplet's profile edge. Indentation distance for Half of it, to obtain the inward shrinkage area ; Step 3: Obtain the cell region for single-cell recognition, based on distance. Obtaining expanded areas ; Step 4: Calculate the final effective safe area ; Step 5: In the safe area The system generates a planned path according to the set step size and number of detection points. If there are not enough points, the step size is automatically reduced until enough detection points are generated. If there are too many points, the distance from the test points to the edge is calculated, sorted from smallest to largest, test points close to the edge are deleted, and the center point is retained to minimize the interference of the droplet boundary. Finally, a reliable path is returned.
[0050] like Figure 3 The image shown is a path planning diagram, in which the droplet outline is represented by a solid red line, the single-cell region is represented by a dashed red line, and the detection path for surface-enhanced Raman spectroscopy of single-cell metabolites is marked by yellow dotted lines. Each yellow dot represents a detection site, for a total of 100 detection sites. Through detection, 100 surface-enhanced Raman spectra of the single-cell metabolite can be obtained.
[0051] In addition, the image autofocus in step three includes the following steps: Step 1: Obtain the current Z-axis voltage (unit: ), set voltage spacing ,by Five equally spaced voltage groups are generated around the center. The calculation formula is as follows: , Step 2: Cyclicly control the Z-axis movement to each voltage group Acquire microscopic images at the corresponding locations. ; Step 3: Image effective region extraction: Based on the previous droplet recognition results, extract the effective region from the image. The droplet is divided into two complete regions. Eliminate background and interference areas; Step 4: Sharpness Score Calculation: The droplet region is calculated using the Laplacian variance algorithm. Clarity score A higher score indicates a clearer image, as shown in the formula below: , Step 5: Lock in the optimal initial voltage: Iterate through 5 sets of sharpness scores Record the voltage with the highest score ; Step 6: Set the voltage search range for high-precision focusing ,by Expand the search scope by focusing on the central point: Set precision threshold That is, target control precision, golden ratio ; Step 7: Calculate the initial search point and , ; Step 8: Collect voltage and Corresponding image and Calculate the sharpness score using the method in step 4. and ; Step 9: Iteratively optimize the search interval: If This indicates that the optimal voltage is within the range Internal update Recalculate ; like This indicates that the optimal voltage is within the range. Internal update Recalculate ;like :renew Recalculate and ; Step 10: Termination condition determination: When the length of the search interval... When the iteration terminates, the midpoint of the interval is taken as the optimal focusing voltage. , The Z-axis is moved according to the optimal focusing voltage to focus on the final detection position, and the surface-enhanced Raman spectroscopy detection of single-cell metabolites in the droplet begins through the aforementioned planned path.
[0052] In this embodiment, a Z-axis piezoelectric displacement stage of existing technology is used to control the displacement of the objective lens in the Z-axis direction. The voltage change corresponds to the change in the working distance between the objective lens and the sample under test, so as to achieve the purpose of precise autofocus. Based on this, the above-mentioned focus adjustment change is realized to obtain a clear image.
[0053] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A cell identification and counting method based on the YOLO algorithm, characterized in that, Includes the following steps: A YOLO single-cell detection model was constructed and trained. The model training was performed by minimizing the total loss function through backpropagation. The total loss function was based on bounding box regression loss, target confidence loss, and category classification loss. The trained YOLO single-cell detection model is used to perform single-cell inference on the samples.
2. The cell identification and counting method based on the YOLO algorithm according to claim 1, characterized in that, The formula for minimizing the total loss function during backpropagation is: , in, Indicates the total loss. This represents the bounding box regression loss. Indicates the target confidence loss. This represents the category classification loss; , and These represent the weights of the corresponding loss terms; , Where B represents the prediction box. This represents the actual annotation box. Indicates a complete intersection and union ratio; , , , , in, Indicates the center point of the prediction box Center point of the real frame The square of the Euclidean distance between them This represents the diagonal length of the smallest bounding rectangle that simultaneously encloses the predicted bounding box and the ground truth bounding box. and Indicates the width and height of the prediction box. and Indicates the actual width and height of the bounding box; , in, Indicates whether the candidate box contains a single cell, and if it does. excluding time ; This indicates the probability that the model predicts the candidate box contains a single cell; , in, Indicates the total number of categories. Indicates the first The true label of the class, The model predicts the number of... The probability of a class.
3. The cell identification and counting method based on the YOLO algorithm according to claim 1, characterized in that, Single-cell inference is performed using the trained YOLO single-cell detection model: a confidence threshold is set, and candidate boxes below the threshold are not output as valid single-cell results. , in, This indicates the final detection confidence level. This represents the probability that a single cell target exists within the candidate box. This represents the probability that a cell belongs to a specified cell category given the existence of a single cell.
4. The cell identification and counting method based on the YOLO algorithm according to claim 1, characterized in that, The training set images used for model training include the following steps: S1: Acquire cell microscopic images and build the original dataset; S2: Annotate individual cell targets and generate YOLO format labels: S3: Preprocess the training images and labels; S4: Augment the training set.
5. The cell identification and counting method based on the YOLO algorithm according to claim 4, characterized in that, In step S1, microscopic images containing cells are acquired; for each image, the acquired data includes: time, sample number, microscopic magnification, and field of view position; the images are divided into training images, validation images, and test images. In step S2, individual cells in each microscopic image are labeled to obtain the bounding rectangle of each cell; the labeling box includes the target category, the x-coordinate of the center point of the box, the y-coordinate of the center point of the box, the width of the box, and the height of the box. If the original image width is Height is The coordinates of the top left corner of the annotation box are The coordinates of the lower right corner are Then the YOLO tags adopt a normalized format: class_id (category), ; , , , , in, This represents the x-coordinate of the center point of the normalized annotation box. This represents the ordinate of the center point of the normalized annotation box. Indicates the normalized box width. Indicates the height of the normalized bounding box; In step S3, after reading the image, the YOLO model scales and fills images that do not conform to the input size; the model also accepts grayscale image input; for images with uneven brightness, white balance, contrast enhancement, or normalization processing can be performed; the pixel normalization formula is: , in, Represents pixels In the passage The original grayscale or color value on the image. This represents the normalized pixel value; In S4, the operations performed on the training image include at least one: horizontal flipping, random vertical flipping, random rotation, random translation, random scaling, mosaic enhancement, color perturbation, and Gaussian noise superposition. The modified images are added to the training image set as augmented images. When performing geometric transformations on an image, the coordinates of the bounding boxes are updated synchronously to ensure that the transformed bounding boxes still enclose the corresponding individual cell targets.
6. The cell identification and counting method based on the YOLO algorithm according to claim 1, characterized in that, The step of building and training the YOLO single-cell detection model is S5; the step of using the trained YOLO model for single-cell inference is S6; after S6, the following steps are also included: S7: Filter, remove duplicates, and count candidate detection boxes; S8: Save the recognition results and output them to the host computer or client.
7. The cell identification and counting method based on the YOLO algorithm according to claim 6, characterized in that, In step S7, the candidate boxes output by the YOLO single-cell detection model are filtered by confidence threshold and processed by non-maximum suppression. For multiple overlapping candidate boxes generated by the same cell, the candidate box with the highest confidence is retained, and the other candidate boxes with an overlap exceeding the threshold are deleted. The final set of retained detection boxes is the set of identified cells, and the number of elements in the set is the cell count result. Predicted boxes are filtered using a confidence threshold to obtain a preliminary candidate set. : , in, This represents the set of candidate boxes after being filtered by confidence level. Indicates the first One candidate box, Indicates the first The confidence level of each candidate box. Indicates the confidence threshold; To eliminate redundant detections, the following rejection logic is executed for candidate boxes in the set: If and , then delete ;in The preset overlap threshold; The final number of recognitions is obtained by counting the number of elements in the retained bounding box set after all processing: , in, This represents the final set of individual cell detection boxes retained after nonmaximum suppression. This indicates the number of elements in the set, i.e., the total number of cells identified; In step S8, for each identified cell, the system outputs the coordinates of the top left corner of the bounding box (x, y), width, height, confidence, and class name. The system further records the image name, recognition timestamp, processing time, cell list (cells), and total number of cells (cell_count), and saves them as a JSON file with the same name as the input image. The file is stored in the results directory and handed over to the system for further processing.
8. A method for identifying and detecting single-cell droplets, characterized in that, Includes the following steps: Step 1: Identify specific single-cell droplets; identify single-cell droplets using the method described in any one of claims 1-7; Step 2: Automatically plan the detection path for the non-cellular regions of single-cell droplets; Step 3: Autofocus the image; Step 4: Perform surface-enhanced Raman spectroscopy detection of single-cell metabolites according to the detection path.
9. The method for identifying and detecting single-cell droplets according to claim 8, characterized in that, Step two includes the following steps: Step 1: Obtain the complete outline of the droplet and the set of position coordinates of internal cells; Step 2: Calculate the indentation distance : Traverse each cell Calculate the shortest distance from it to the edge of the droplet profile. Indentation distance for Half of it, to obtain the inward shrinkage area ; Step 3: Obtain the cell region for single-cell recognition, based on distance. Obtaining expanded areas ; Step 4: Calculate the final effective safe area ; Step 5: In the safe area The system generates a planned path according to the set step size and number of detection points. If there are not enough points, the step size is automatically reduced until enough detection points are generated. If there are too many points, the distance from the test points to the edge is calculated, sorted from smallest to largest, test points close to the edge are deleted, and the center point is retained to minimize the interference of the droplet boundary. Finally, a reliable path is returned.
10. The method for identifying and detecting single-cell droplets according to claim 8, characterized in that, Step three, image autofocus, includes the following steps: Step 1: Obtain the current Z-axis voltage Set voltage spacing ,by Five equally spaced voltage groups are generated around the center. The calculation formula is as follows: , Step 2: Cyclicly control the Z-axis movement to each voltage group Acquire microscopic images at the corresponding locations. ; Step 3: Image effective region extraction: Based on the previous droplet recognition results, extract the effective region from the image. The droplet is divided into two complete regions. Eliminate background and interference areas; Step 4: Sharpness score calculation: The Laplace variance algorithm is used to calculate the droplet region. Clarity score A higher score indicates a clearer image, as shown in the formula below: , Step 5: Lock in the optimal initial voltage: Iterate through 5 sets of sharpness scores Record the voltage with the highest score ; Step 6: Set the voltage search range for high-precision focusing ,by Expand the search scope by focusing on the central point: Set precision threshold That is, target control precision, golden ratio ; Step 7: Calculate the initial search point and , ; Step 8: Collect voltage and Corresponding image and Calculate the sharpness score using the method in step 4. and ; Step 9: Iteratively optimize the search interval: If This indicates that the optimal voltage is within the range Internal update Recalculate ; like This indicates that the optimal voltage is within the range. Internal update Recalculate ;like :renew Recalculate and ; Step 10: Termination condition determination: When the length of the search interval... When the iteration terminates, the midpoint of the interval is taken as the optimal focusing voltage. , The Z-axis is moved according to the optimal focusing voltage to focus on the final detection position, and the surface-enhanced Raman spectroscopy detection of single-cell metabolites in the droplet begins through the aforementioned planned path.