Microfluidic liquid drop detection method and system based on improved SAM model

Through the improved SAM model and lightweight mask decoder processing of microfluidic droplet images, the inaccurate counting problems caused by low image resolution and high noise in the prior art are solved, and efficient and accurate droplet counting is achieved and image processing.

CN119478933APending Publication Date: 2025-02-18SHANDONG FIRST MEDICAL UNIV & SHANDONG ACADEMY OF MEDICAL SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411478162.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When processing microfluidic droplet images, the resolution is low, the noise is high, and the droplet boundaries are blurred, making it difficult to accurately count image processing tools such as ImageJ under low resolution and noise interference, affecting the accuracy of experimental results. and reliability.

Method used

Using an improved SAM model, combined with a lightweight mask decoder and self-attention calculation, the microfluidic droplet image is processed through point-by-point product calculation and position encoding, improving the accuracy of image segmentation, and through batch processing modules and multiple GPU parallel processing improves processing efficiency.

Benefits of technology

Effective segmentation of low-resolution microfluidic droplet images is achieved, counting errors caused by noise interference and boundary blur, improve counting accuracy and reliability, and greatly shorten processing time and improve work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478933A_ABST
    Figure CN119478933A_ABST
Patent Text Reader

Abstract

The invention discloses a microfluidic liquid drop detection method and system based on an improved SAM model, and belongs to the technical field of microfluidics. Comprising the following steps: acquiring a microfluidic droplet image; processing the micro-fluidic liquid drop image through a trained improved SAM model to obtain a micro-fluidic liquid drop counting image; processing the micro-fluidic droplet counting image through image processing software to obtain the number of micro-fluidic droplets; wherein the improved SAM model performs point-by-point product calculation on the input image embedding through a lightweight mask decoder by using a token updated through self-attention calculation and cross attention calculation, and adds a position code for the image embedding in the calculation process. The accuracy and the reliability of counting the micro-fluidic liquid drops can be improved, and the problems of misrecognition and counting errors caused by noise interference, fuzzy boundary of the liquid drops in an image and lower contrast ratio of the liquid drops to the background in the existing micro-fluidic liquid drop detection are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of microfluidic technology, and in particular to a microfluidic droplet detection method and system based on an improved SAM model. Background Art

[0002] The statements in this section merely mention background art related to the present invention and do not necessarily constitute prior art.

[0003] Microfluidic technology uses micron-scale channels to control liquid flow. Its characteristic is that it can achieve efficient reaction and separation in a small volume. It has been widely used in fields such as biological analysis, drug screening and environmental monitoring.

[0004] In the application of microfluidic technology, real-time segmentation and accurate counting of microfluidic droplets are crucial. However, in actual operation, it is not easy to obtain clear images of microfluidic droplets and perform accurate analysis. Due to the limitations of technology and equipment, the obtained microfluidic droplet images often have low resolution, blurred boundaries of microfluidic droplets in the image, low contrast with the background, and a large number of noise points. Existing image processing tools (such as ImageJ) often lead to incorrect counting when faced with low-resolution, noisy and complex background images. For example: when performing image counting, noise is often mistakenly identified as an actual object, resulting in inaccurate counting, affecting the accuracy and reliability of subsequent experimental results, and also making further analysis and conclusions based on these data lose scientific basis.

[0005] At the same time, when using ImageJ software alone to process microfluidic droplet images, the processing speed is relatively slow due to the need to manually process the edge of the droplets, and it cannot meet the needs of large-scale data processing. When a large number of microfluidic droplet images need to be processed, it often takes a lot of time and manpower, which seriously affects the efficiency of research and application.

[0006] The SAM model is used to segment each image one by one, which takes a long time when processing a large number of microfluidic droplet images. In addition, when dealing with complex backgrounds, existing segmentation algorithms often fail to effectively separate target objects, and the appearance of the segmented target objects will affect the accuracy of subsequent counting. Summary of the invention

[0007] In order to address the deficiencies in the prior art, the present invention provides a microfluidic droplet detection method, system, electronic device, computer-readable storage medium and computer program product based on an improved SAM model, which combines the respective advantages of the improved SAM model and ImageJ software to improve the accuracy and reliability of counting in microfluidic droplet detection.

[0008] In a first aspect, the present invention provides a microfluidic droplet detection method based on an improved SAM model;

[0009] A microfluidic droplet detection method based on an improved SAM model, comprising:

[0010] Acquire images of microfluidic droplets;

[0011] The microfluidic droplet image is processed by using the trained improved SAM model to obtain a microfluidic droplet counting image;

[0012] Processing the microfluidic droplet counting image by image processing software to obtain the number of microfluidic droplets;

[0013] The improved SAM model uses a lightweight mask decoder to perform point-by-point product calculations on the input image embedding using tokens updated through self-attention calculations and cross-attention operations, and adds position encoding to the image embedding during the calculation process.

[0014] In some embodiments, when training the improved SAM model, the hyperparameters in the improved SAM model and the color mask of the microfluidic droplets in the microfluidic droplet image are optimized with the goal of maximizing the detection accuracy of the image processing software.

[0015] In some embodiments, the improved SAM model processes the microfluidic droplet images in batches through a preset input path and an output path, and distributes processing tasks to multiple threads.

[0016] In some embodiments, the improved SAM model includes an image encoder, a hint encoder, and a lightweight mask decoder connected in sequence;

[0017] The image encoder is used to perform convolution processing on the microfluidic droplet image and output an image embedding; the prompt encoder is used to generate a mask prompt based on the image embedding, and add the mask prompt to the image embedding at the element level to update the image embedding; the lightweight mask decoder is used to use the updated image embedding as a query vector, calculate the point-by-point product with a preset token and update the image embedding to generate a microfluidic droplet counting image.

[0018] In some embodiments, updating the token using self-attention calculation and cross-attention operation specifically includes:

[0019] Insert the learned output token embedding into the set of prompt embeddings generated by the prompt encoder to generate tokens;

[0020] Perform self-attention calculation on the token to obtain the self-attention weight; use the token as the query vector and calculate the cross-attention weight between it and the input image embedding;

[0021] A pointwise MLP update is performed for each token according to the self-attention weights and the cross-attention weights.

[0022] In some embodiments, the image processing software is ImageJ software.

[0023] In a second aspect, the present invention provides a microfluidic droplet detection system based on an improved SAM model;

[0024] A microfluidic droplet detection system based on an improved SAM model, comprising:

[0025] An acquisition module is configured to: acquire a microfluidic droplet image;

[0026] The segmentation module is configured to: process the microfluidic droplet image through the trained improved SAM model to obtain a microfluidic droplet counting image;

[0027] The microfluidic droplet detection module is configured to: process the microfluidic droplet counting image by image processing software to obtain the number of microfluidic droplets;

[0028] The improved SAM model uses a lightweight mask decoder to perform point-by-point product calculations on the input image embedding using tokens updated through self-attention calculations and cross-attention operations, and adds position encoding to the image embedding during the calculation process.

[0029] In a third aspect, the present invention provides an electronic device;

[0030] An electronic device comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-mentioned microfluidic droplet detection method based on the improved SAM model.

[0031] In a fourth aspect, the present invention provides a computer-readable storage medium;

[0032] A computer-readable storage medium stores a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned microfluidic droplet detection method based on the improved SAM model.

[0033] In a fifth aspect, the present invention provides a computer program product;

[0034] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned microfluidic droplet detection method based on the improved SAM model.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] 1. The technical solution provided by the present invention adopts an improved SAM model to segment the collected low-resolution microfluidic droplet images, thereby achieving effective segmentation of microfluidic droplets; and solves the problems of object misidentification and counting errors caused by noise interference, blurred droplet boundaries in the image, and low contrast between droplets and background when processing low-resolution images.

[0037] 2. The technical solution provided by the present invention introduces a batch processing module, which greatly shortens the time for processing a large number of microfluidic images and reduces the processing time required for replacing a single image. At the same time, the use of multiple GPUs greatly improves the running time, greatly improves work efficiency, and accelerates the progress of research and application.

[0038] 3. The technical solution provided by the present invention introduces a statistical and analysis module for Excel data, which reduces human resources on the one hand and reduces human errors while improving work efficiency on the other hand. It further presents the data obtained from the experiment through more intuitive results, which is conducive to subsequent research. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0040] Figure 1 A schematic diagram of a process flow provided by an embodiment of the present invention;

[0041] Figure 2 A schematic diagram of a low-resolution microfluidic droplet image provided by an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of the process of improving the SAM model provided by an embodiment of the present invention;

[0043] Figure 4 A technical schematic diagram of a low-resolution original image provided by an embodiment of the present invention;

[0044] Figure 5 A schematic diagram of counting after segmentation processing by the improved SAM model provided in an embodiment of the present invention;

[0045] Figure 6 A schematic diagram of the implementation flow of batch processing provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0047] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0048] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0049] Embodiment 1

[0050] When processing low-resolution microfluidic droplet images, the existing traditional SAM model and ImageJ software have unsatisfactory image processing effects and high error rates due to noise interference, blurred droplet boundaries in the image, and low contrast between the droplet and the background. Therefore, the present invention provides a microfluidic droplet detection method based on an improved SAM model.

[0051] Next, combine Figure 1-Figure 6 , a microfluidic droplet detection method based on an improved SAM model disclosed in this embodiment is described in detail.

[0052] The microfluidic droplet detection method based on the improved SAM model comprises the following steps:

[0053] S1. Acquire microfluidic droplet images.

[0054] In practical applications, the entire process of the microfluidic experiment under a microscope is captured by a camera, and the obtained video images are frame-processed to obtain multiple microfluidic droplet images.

[0055] S2. Process the microfluidic droplet image through the trained improved SAM model to obtain the microfluidic droplet counting image.

[0056] Since the resolution of microfluidic droplet images is low and the droplets at the edge of the image are small, it is difficult to distinguish them with the naked eye, and the traditional SAM model or ImageJ software cannot efficiently and effectively segment the droplets. Therefore, in this embodiment, the SAM model is improved, and the mask (mask) of the mask decoder and the visual segmentation object and its corresponding area are changed to obtain a more accurate segmentation image.

[0057] In this embodiment, improving the mask decoder refers to changing the content of the hyper parameters in the mask decoder, and the hyper parameters include points_per_side, pred_iou_thresh, and stability_score_thresh.

[0058] Considering that the original background of the droplet image has white and green areas, the white is the device for holding liquid, and the green background is the liquid that the droplet falls on, which is called the "continuous phase" or "external phase"; the show_anns function will also identify the continuous phase. The mask of the visual segmented object refers to setting the visual color of the continuous phase unchanged. Usually the continuous phase will be divided into a largest droplet, and the color of the remaining identified droplets is the best to use the color closest to the original droplet, which is convenient for subsequent identification and counting using Imagj software, maximizing the detection accuracy of Imagj software.

[0059] The improved SAM model includes an image encoder, a hint encoder and a lightweight mask decoder connected in sequence. As an implementation method, S2 specifically includes:

[0060] S201, inputting the microfluidic droplet image into the image encoder for processing to obtain image embedding.

[0061] Specifically, the MAE pre-trained ViT-H / 16 is used as the image encoder to process the input image and output a 16× downsampled image embedding.

[0062] Exemplarily, first, the input microfluidic droplet image is scaled and padded on the short sides to obtain an image with a resolution of 1024×1024; then the number of channels of the image is changed to 256 using 1×1 convolution, and then further processed by 3×3 convolution (256 channels) to obtain an image embedding with a dimension of 64×64×256.

[0063] S202, embedding the image into the prompt encoder, generating a dense mask feature map according to the image embedding, and performing element-wise addition of the dense mask feature map and the image embedding to update the image embedding.

[0064] Specifically, the resolution of the image embedding is reduced to 1 / 4 of the original image resolution as the input mask, and then the input mask is downsampled by 4×. Through two 2×2 convolutions with a stride of 2, the output channels are 4 and 16 respectively. Finally, the channel dimension is mapped to 256 through a 1×1 convolution. Each layer is separated by a GELU activation function and layer normalization to obtain a dense mask feature map of size 64×64×256. The dense mask feature map and the image embedding are added element-wise. If there is no mask hint, the learned embedding representing "no mask" is added to each image embedding position.

[0065] Exemplarily, the specific process of generating a dense mask feature map is as follows:

[0066] First convolution: The resolution of the input mask is 1 / 4 of the input image, and then the first convolution is performed, the output channel is 4, the formula is Conv1=Conv2D(Mask,kernel_size=2,stride=2,output_channels=4).

[0067] Second convolution: Then the second convolution is performed, the output channel is 16, the formula is Conv2 = Conv2D (Conv1, kernel_size = 2, stride = 2, output_channels = 16).

[0068] Final convolution: Finally, the channel dimension is mapped to 256 through 1×1 convolution, the formula is FinalConv=Conv2D(Conv2,kernel_size=1,stride=1,output_channels=256).

[0069] S203, input the updated image embedding into the lightweight mask decoder for processing, use the updated image embedding as the query vector, calculate the point-by-point product with the preset token and update the image embedding to generate a microfluidic droplet counting image.

[0070] After running the lightweight mask decoder, the updated image embedding is upsampled 4× (relative to the input image downsampled 4×) through two transposed convolutions (2×2, stride 2, output channel dimensions of 64 and 32, with GELU activation and layer normalization in between). Then, the tokens are again focused on the upsampled image embedding, and the updated output token embedding is passed through a small 3-layer MLP with the output dimension matching the channel dimension of the upsampled image embedding; finally, the mask is predicted by the point-by-point product of the upsampled image embedding and the MLP output. Finally, the predicted mask is assigned a color and the mask data is output through the show_anns function.

[0071] In summary, the lightweight mask decoder efficiently predicts the segmentation mask by processing the image embedding and hint embedding.

[0072] As an implementation method, before the updated image is embedded into the input lightweight mask decoder for processing, it also includes: updating the token by using self-attention calculation and cross-attention operation.

[0073] During the computation of criss-cross attention, the image embedding is treated as a 64×64 256-dimensional vector. Each self-attention / criss-cross attention and MLP has residual connections, layer normalization, and dropout of 0.1 (during training). The next decoder layer receives the update token and the updated image embedding from the previous layer.

[0074] To ensure that the mask decoder has access to critical geometric information, positional encodings are added when the image embedding participates in the attention layer. Additionally, in the attention layer, the entire original hint token (including its positional encoding) is re-added to the updated token query and key to enforce the dependency on the hint token’s geometric position and type.

[0075] The token is updated using self-attention calculation and cross-attention operation, including:

[0076] (1) Insert the learned output token embedding into the set of prompt embeddings generated by the prompt encoder to generate a token.

[0077] (2) Perform self-attention calculation on the token to obtain the self-attention weight; use the token as the query vector and calculate the cross-attention weight between it and the input image embedding.

[0078] Among them, the parameters of the self-attention mechanism are expressed as:

[0079] Q=XW Q ,K=XWK,V=XWV;

[0080] The cross attention weight is expressed as:

[0081]

[0082] Q=XWQ, K=IWK, V=IWV;

[0083] Where X is the embedding of the token and I is the embedding of the image (which can be viewed as a key and value), Wq, Wk, W v Represents the learned parameter matrix, which is used for linear transformation of query, key and value respectively. The parameter matrix is ​​randomly generated.

[0084] (3) Perform a pointwise MLP update on each token based on the self-attention weight and cross-attention weight.

[0085] Updated_Token = MLP(O);

[0086] Where O represents the output of the self-attention mechanism or the output of the cross-attention mechanism, and MLP is a multi-layer perceptron applied to the output of O to obtain the updated token representation.

[0087] As an implementation method, when training the improved SAM model, the hyperparameters in the improved SAM model and the color mask of the microfluidic droplets in the microfluidic droplet image are optimized with the goal of maximizing the detection accuracy of the image processing software.

[0088] The optimization process is as follows: in the training process using the training set, the mask weights and the boundary clarity and contrast of the segmented droplets are continuously optimized, which can be understood as the continuous adjustment of the six hyperparameters of the mask, and the color mask of the segmented object is adjusted at the same time. Find a balance point, keep the smaller droplets in the image from being segmented within a certain range, and the larger droplets can be segmented with precise contours. The segmented image is then added to the image processing software, and the software is used to detect the droplets in the image. The objects segmented by the improved SAM segmentation model have clear contours, which can solve the error of identifying a large number of image noise points as small droplets when using image processing software alone. The combination of the two ensures the accurate detection of droplets in microfluidic images.

[0089] Here, the balance point is determined manually. Since the droplets at the boundary are more obvious before and after segmentation, the images before and after segmentation are compared, that is, the droplets with the smallest size in the outermost circular area are ensured not to be identified and segmented (because the segmentation will cause the droplet segmentation boundary overlap problem), and the droplets at the edge of the image will not have unclear boundary segmentation after segmentation.

[0090] The specific process is as follows: the points_per_side parameter specifies the number of points on each side, starting from 80 and gradually increasing. If the object details are insufficient, consider increasing it further. The pred_iou_thresh parameter refers to the predicted IOU threshold, which controls the accuracy of the prediction. It starts at 0.75 and gradually increases to observe the recognition of the droplets. The stability_score_thresh parameter refers to the stability score threshold, starting from 0.90, and then fine-tuned according to the recognition of the droplets. The crop_n_layers parameter refers to the number of cropped layers. This invention has always set this parameter to 1. The crop_n_points_downscale_factor parameter refers to the downsampling factor of the points during cropping, which affects the cropping accuracy. From 2, it is found that the fineness of the droplets is insufficient, and it is gradually reduced (increasing the number of points). The min mask region area parameter refers to the minimum area of ​​the mask region, which affects the size and complexity of the mask, and decreases from 100.

[0091] The color mask adjustment process is performed in the code part that receives the image segmentation annotations and is adjusted during the continuous training process. In the color mask part, the same color as the background is selected, and the transparency is continuously adjusted to obtain the transparency that is most convenient for the image processing software to detect the droplets.

[0092] In order to meet the multi-task environment in practical applications, as an implementation method, the SAM model is modified and improved so that it can be processed in batches. The specific process is as follows:

[0093] First, merge the library imports. Second, modify the show_anns function: In the show_anns function, pass the image into the function to support the display of different images. Define a fixed color and keep the transparency. Adjust the color as needed.

[0094] Then, set the input_folder and output_folder paths to read and save the images; use os.makedirs() to ensure that the output folder exists. Iterate through all image files in input_folder (filter by extension) and call process_image() to process each file.

[0095] In some embodiments, multiple GPUs may be run in parallel to achieve parallel processing of batches of images.

[0096] S3. Process the microfluidic droplet counting image through image processing software to obtain the number of microfluidic droplets.

[0097] Specifically, the microfluidic droplet counting image is input into the ImageJ software to obtain a counting image processed by the ImageJ software, and the counting image reflects the number of microfluidic droplets.

[0098] Furthermore, statistical analysis is performed on the data obtained through the image processing software, including extracting and analyzing the data in Excel and counting the number of droplets of different sizes. After the above statistical work is completed, it is output in the form of Excel, and the final result is obtained in the form of a histogram.

[0099] In practical applications, Python code can be used to implement the above processing.

[0100] Embodiment 2

[0101] This embodiment discloses a microfluidic droplet detection system based on an improved SAM model, comprising:

[0102] An acquisition module is configured to: acquire a microfluidic droplet image;

[0103] The segmentation module is configured to: process the microfluidic droplet image through the trained improved SAM model to obtain a microfluidic droplet counting image;

[0104] The microfluidic droplet detection module is configured to: process the microfluidic droplet counting image by image processing software to obtain the number of microfluidic droplets;

[0105] The improved SAM model uses a lightweight mask decoder to perform point-by-point product calculations on the input image embedding using tokens updated through self-attention calculations and cross-attention operations, and adds position encoding to the image embedding during the calculation process.

[0106] It should be noted that the acquisition module, segmentation module and microfluidic droplet detection module correspond to the steps in Embodiment 1, and the examples and application scenarios implemented by the modules are the same as those of the corresponding steps, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the modules as part of the system can be executed in a computer system such as a set of computer executable instructions.

[0107] Embodiment 3

[0108] Embodiment 3 of the present invention provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of the above-mentioned microfluidic droplet detection method based on the improved SAM model are completed.

[0109] Embodiment 4

[0110] Embodiment 4 of the present invention provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps of the above-mentioned microfluidic droplet detection method based on the improved SAM model are completed.

[0111] Embodiment 5

[0112] Embodiment 5 of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned microfluidic droplet detection method based on the improved SAM model.

[0113] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device, and a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0116] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0117] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A microfluidic droplet detection method based on an improved SAM model, characterized in that: include: Acquire images of microfluidic droplets; The microfluidic droplet image is processed by using the trained improved SAM model to obtain a microfluidic droplet counting image; Processing the microfluidic droplet counting image by image processing software to obtain the number of microfluidic droplets; The improved SAM model uses a lightweight mask decoder to perform point-by-point product calculations on the input image embedding using tokens updated through self-attention calculations and cross-attention operations, and adds position encoding to the image embedding during the calculation process.

2. The microfluidic droplet detection method based on the improved SAM model as claimed in claim 1, characterized in that: When training the improved SAM model, the hyperparameters in the improved SAM model and the color mask of the microfluidic droplets in the microfluidic droplet image are optimized with the goal of maximizing the detection accuracy of the image processing software.

3. The microfluidic droplet detection method based on the improved SAM model as claimed in claim 1, characterized in that: The improved SAM model processes the microfluidic droplet images in batches through a preset input path and an output path, and distributes the processing tasks to multiple threads.

4. The microfluidic droplet detection method based on the improved SAM model as claimed in claim 1, characterized in that: The improved SAM model includes an image encoder, a prompt encoder and a lightweight mask decoder connected in sequence; The image encoder is used to perform convolution processing on the microfluidic droplet image and output an image embedding; the prompt encoder is used to generate a mask prompt according to the image embedding, and perform element-wise addition of the mask prompt and the image embedding to update the image embedding; The lightweight mask decoder is used to use the updated image embedding as a query vector, calculate the point-by-point product with the preset token and update the image embedding to generate a microfluidic droplet counting image.

5. The microfluidic droplet detection method based on the improved SAM model as claimed in claim 1, characterized in that: The token is updated using self-attention calculation and cross-attention operation, including: Insert the learned output token embedding into the set of prompt embeddings generated by the prompt encoder to generate tokens; Perform self-attention calculation on the token to obtain the self-attention weight; use the token as the query vector and calculate the cross-attention weight between it and the input image embedding; A pointwise MLP update is performed for each token according to the self-attention weights and the cross-attention weights.

6. The microfluidic droplet detection method based on the improved SAM model as claimed in claim 1, characterized in that: The image processing software is ImageJ software.

7. A microfluidic droplet detection system based on an improved SAM model, characterized in that: include: An acquisition module is configured to: acquire a microfluidic droplet image; The segmentation module is configured to: process the microfluidic droplet image through the trained improved SAM model to obtain a microfluidic droplet counting image; The microfluidic droplet detection module is configured to: process the microfluidic droplet counting image by image processing software to obtain the number of microfluidic droplets; The improved SAM model uses a lightweight mask decoder to perform point-by-point product calculations on the input image embedding using tokens updated through self-attention calculations and cross-attention operations, and adds position encoding to the image embedding during the calculation process.

8. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the microfluidic droplet detection method based on the improved SAM model according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the microfluidic droplet detection method based on the improved SAM model described in any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the microfluidic droplet detection method based on the improved SAM model described in any one of claims 1 to 6 are implemented.