Search

CN-121982092-A - Droplet size determination method, terminal device and computer program product

CN121982092ACN 121982092 ACN121982092 ACN 121982092ACN-121982092-A

Abstract

The application is suitable for the technical field of computers, and provides a method for determining the particle size of liquid drops, terminal equipment and a computer program product, wherein the method comprises the steps of inputting an acquired liquid drop image into a trained particle size detection model for detection to obtain the particle size of each liquid drop in the liquid drop image; the particle size detection model is obtained by training a pre-constructed target detection model based on a preset sample set, each piece of sample data in the preset sample set comprises a sample image and a corresponding sample detection result, the sample image comprises a sample gradient image obtained by marking a sample droplet image and a sample enhancement image obtained by enhancing the sample droplet image, the sample detection result comprises the predicted particle size of each sample droplet in the sample enhancement image, the particle size detection model comprises a gradient head and a particle size detection head, and the output of the gradient head is used for calculating a loss function corresponding to the particle size detection head. The application improves the detection precision of various droplet sizes through gradient images and data enhancement.

Inventors

  • CHEN YUCHAO
  • ZHANG FENG

Assignees

  • 利德健康科技(广州)有限公司

Dates

Publication Date
20260505
Application Date
20251225

Claims (10)

  1. 1. A droplet size determination method, comprising: Acquiring a droplet image to be detected; The method comprises the steps of inputting a liquid drop image into a trained particle size detection model to detect the particle size of each liquid drop in the liquid drop image, wherein the particle size detection model is obtained by training a pre-built target detection model based on a preset sample set, each piece of sample data in the preset sample set comprises a sample image and a sample detection result corresponding to the sample image, the sample image comprises a sample gradient image obtained by labeling the sample liquid drop image and a sample enhancement image obtained by data enhancement processing of the sample liquid drop image, the sample detection result comprises the predicted particle size of each sample liquid drop in the sample enhancement image, the target detection model comprises a gradient head and a particle size detection head, and the output of the gradient head is used for calculating a loss function corresponding to the particle size detection head.
  2. 2. The method of determining the particle size of droplets according to claim 1, further comprising, before the inputting the droplet image into a trained particle size detection model for detection, obtaining the particle size of each droplet in the droplet image: Labeling each sample liquid drop image to obtain the sample gradient image corresponding to each sample liquid drop image; Recording the outline of each sample droplet in each sample droplet image in the labeling process of each sample droplet image, and calculating sample droplet information of each sample droplet based on the outline of each sample droplet, wherein the sample droplet information comprises sample coordinates, sample size, sample area and sample particle size; Performing data enhancement processing on each sample liquid drop image to obtain a sample enhancement image corresponding to each sample liquid drop image; and carrying out optimization training on the target detection model based on each sample gradient image, each sample enhancement image and each droplet information to obtain the particle size detection model.
  3. 3. The droplet size determination method according to any one of claims 1 or 2, wherein each of the sample gradient images includes an edge gradient map of each of the sample droplets in the sample gradient image, the edge gradient map of each of the sample droplets being obtained according to: Determining the outline of the sample liquid drop in the labeling process; Obtaining an initial mask corresponding to the sample liquid drop based on the outer contour, and obtaining an initial gradient map with the same size as the initial mask, wherein all pixel values in the outer contour in the initial mask are 255, and the rest pixel values are 0, and all pixel values in the initial gradient map are 0; setting the pixel value corresponding to the outer contour in the initial mask to 0 to obtain an intermediate mask, and determining the outer contour corresponding to the intermediate mask; performing 1 adding operation on pixel values of the outer contour in the initial gradient map to obtain an intermediate gradient map; And continuously executing the step of setting the pixel value corresponding to the outer contour in the initial mask to 0 based on the intermediate mask and the intermediate gradient map to obtain the intermediate mask, determining the outer contour corresponding to the intermediate mask and the subsequent steps until all the pixel values in the latest intermediate mask are 0, and determining the latest intermediate gradient map as the edge gradient map, wherein the 1 adding operation of the intermediate gradient map for each time further comprises the step of executing the 1 adding operation of a non-zero region of the intermediate gradient, wherein the non-zero region refers to a region with the pixel value not being 0.
  4. 4. The droplet size determination method according to any one of claims 1 or 2, wherein the sample enhanced image is obtained according to: when the data enhancement processing mode is a general processing mode, carrying out data enhancement processing on the sample liquid drop image based on a geometric transformation mode and/or a color transformation mode to obtain the sample enhancement image; And/or the number of the groups of groups, When the data enhancement mode is a data synthesis mode, the brightness of the sample liquid drop image is adjusted based on a linear transformation mode, and/or the sample liquid drop image is subjected to data enhancement processing based on a local high-light reflection mode, and/or the sample liquid drop image is subjected to data enhancement processing based on a shadow shielding method, so that the sample enhancement image is obtained, the linear transformation mode is used for superposing linear brightness gradient on the sample liquid drop image, the local high-light reflection mode is used for randomly superposing Gaussian spot areas and brightness gains on the sample liquid drop image, the shadow shielding mode is used for reducing the brightness in random areas of the sample liquid drop image, and semitransparent gray matters are added.
  5. 5. The method of determining a particle diameter of a droplet according to claim 2, wherein the optimizing training of the object detection model based on each of the sample gradient images, each of the sample enhanced images, and each of the droplet information to obtain the particle diameter detection model includes: Based on the data enhancement processing mode corresponding to each sample liquid drop image, adjusting each sample liquid drop information and each sample gradient image corresponding to each sample liquid drop image to obtain each target liquid drop information and each target gradient image; Inputting each sample enhanced image into the target detection model for processing to obtain a sample detection result of each sample droplet corresponding to each sample droplet image; and carrying out optimization training on the target detection model based on each sample detection result, each target liquid drop information and each target gradient image to obtain the particle size detection model.
  6. 6. The method of determining a droplet size according to claim 5, wherein the sample detection result further includes a predicted droplet area of the sample droplet calculated from a predicted gradient image corresponding to the sample droplet image outputted from the gradient head, wherein the performing optimization training on the target detection model based on the sample detection result, the target droplet information, and the target gradient image to obtain the droplet size detection model includes: calculating a loss function corresponding to the particle size detection head based on the predicted particle size of each sample droplet, the sample particle size and the predicted droplet area; Calculating a loss function corresponding to the gradient head based on the predicted gradient image of the sample liquid drop image and the target gradient image; and carrying out optimization training on the target detection model based on the loss function corresponding to the particle size detection head and the loss function corresponding to the gradient head to obtain the particle size detection model.
  7. 7. The method of determining a droplet size according to claim 6, wherein the calculating a loss function corresponding to the droplet size detection head based on the predicted particle size of each of the sample droplets, the sample particle size, and the predicted droplet area includes: calculating a true value loss function corresponding to the particle size detection head based on the predicted particle size of each sample droplet and the sample particle size; calculating to obtain a physical consistency constraint loss function corresponding to the particle size detection head based on the predicted particle size of each sample liquid drop and the predicted liquid drop area; And summing the true value loss function and the physical consistency constraint loss function to obtain a loss function corresponding to the particle size detection head.
  8. 8. The droplet size determination method according to any one of claims 6 or 7, wherein the sample detection result further includes a predicted detection frame, and the predicted droplet area of each of the sample droplets is determined according to: Cutting the prediction gradient image corresponding to the sample liquid drop based on the predicted detection frame to obtain a prediction edge map corresponding to the sample liquid drop; Conducting derivative operation on the predicted edge map to obtain a gradient amplitude corresponding to the predicted edge map; performing image processing on the gradient amplitude to obtain a droplet contour corresponding to the sample droplet; and calculating the predicted liquid drop area based on the liquid drop contour.
  9. 9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the droplet size determination method according to any one of claims 1 to 8 when executing the computer program.
  10. 10. A computer program product comprising a computer program which, when run, implements the droplet size determination method according to any one of claims 1 to 8.

Description

Droplet size determination method, terminal device and computer program product Technical Field The application belongs to the technical field of computers, and particularly relates to a droplet size determining method, terminal equipment and a computer program product. Background In practical application, droplets generated by microfluidic are usually monodisperse (high in uniformity of particle size), concentrated in size range (submicron to hundreds of microns), and are generated/transmitted in closed microchannels, and have extremely high requirements on real-time performance, non-invasiveness and spatial resolution of measurement. Currently, in the scenes of microfluidic and the like, the existing droplet size determination method is mainly based on an image method, an electrical method and an optical scattering method. Among them, the image method is the mainstream because of its non-contact, visual and real-time detection feature. However, the deep learning method in the conventional image method has a problem that consideration is not comprehensive enough and it is difficult to satisfy actual demands. Disclosure of Invention The embodiment of the application provides a liquid drop particle size determining method, terminal equipment and a computer program product, which are used for solving the problems that consideration of the prior art is not comprehensive enough and actual requirements are difficult to meet. In a first aspect, an embodiment of the present application provides a method for determining a droplet size, including: Acquiring a droplet image to be detected; The method comprises the steps of inputting a liquid drop image into a trained particle size detection model to detect the particle size of each liquid drop in the liquid drop image, wherein the particle size detection model is obtained by training a pre-built target detection model based on a preset sample set, each piece of sample data in the preset sample set comprises a sample image and a sample detection result corresponding to the sample image, the sample image comprises a sample gradient image obtained by labeling the sample liquid drop image and a sample enhancement image obtained by data enhancement processing of the sample liquid drop image, the sample detection result comprises the predicted particle size of each sample liquid drop in the sample enhancement image, the target detection model comprises a gradient head and a particle size detection head, and the output of the gradient head is used for calculating a loss function corresponding to the particle size detection head. Optionally, before the inputting the droplet image into the trained particle size detection model for detection, obtaining the particle size of each droplet in the droplet image, the method further includes: Labeling each sample liquid drop image to obtain the sample gradient image corresponding to each sample liquid drop image; Recording the outline of each sample droplet in each sample droplet image in the labeling process of each sample droplet image, and calculating sample droplet information of each sample droplet based on the outline of each sample droplet, wherein the sample droplet information comprises sample coordinates, sample size, sample area and sample particle size; Performing data enhancement processing on each sample liquid drop image to obtain a sample enhancement image corresponding to each sample liquid drop image; and carrying out optimization training on the target detection model based on each sample gradient image, each sample enhancement image and each droplet information to obtain the particle size detection model. Optionally, each sample gradient image includes an edge gradient map of each sample droplet in the sample gradient image, and the edge gradient map of each sample droplet is obtained according to the following manner: Determining the outline of the sample liquid drop in the labeling process; Obtaining an initial mask corresponding to the sample liquid drop based on the outer contour, and obtaining an initial gradient map with the same size as the initial mask, wherein all pixel values in the outer contour in the initial mask are 255, and the rest pixel values are 0, and all pixel values in the initial gradient map are 0; setting the pixel value corresponding to the outer contour in the initial mask to 0 to obtain an intermediate mask, and determining the outer contour corresponding to the intermediate mask; performing 1 adding operation on pixel values of the outer contour in the initial gradient map to obtain an intermediate gradient map; And continuously executing the step of setting the pixel value corresponding to the outer contour in the initial mask to 0 based on the intermediate mask and the intermediate gradient map to obtain the intermediate mask, determining the outer contour corresponding to the intermediate mask and the subsequent steps until all the pixel values in the latest intermediate mask are 0,