Test tube image segmentation method and system based on deep learning, and training method
Through the deep learning-based test tube image segmentation method, using the Unet architecture and post-processing steps, the problems of low image segmentation efficiency and insufficient accuracy in the prior art are solved, and efficient and accurate pixel-level image segmentation is achieved.
Patent Information
- Application Number
- CN202311666666.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art is inefficient in test tube image segmentation, making it difficult to achieve accurate pixel-level segmentation.
The deep learning-based test tube image segmentation method is used to perform image segmentation using a model of the Unet architecture, and combined with post-processing steps such as removing small noise areas and filling holes to improve the accuracy of segmentation.
It improves the efficiency and accuracy of image segmentation, and can realize end-to-end pixel-level image segmentation to meet the needs of test tube image segmentation.
Smart Images

Figure CN120107273A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition, and in particular to a test tube image segmentation method and system based on deep learning, and a training method. Background Art
[0002] In vitro diagnosis, or IVD (In Vitro Diagnosis), refers to a diagnostic method that obtains clinical diagnostic information by testing samples such as human body fluids, cells and tissues in vitro, and then determines the disease or body function. It plays an important role in disease prevention, diagnosis, and treatment. Currently, more than 80% of clinical disease diagnosis can be completed by IVD. It includes sample pre-treatment, multi-row rapid sample injection, multi-turn turntable sample barcode high-speed reading, etc., which are applied to automated test lines, test tube sorting, blood bag management, coagulation, immunity, urine, biochemistry, luminescence platforms, etc.
[0003] The IVD vision industry plays an important role in the field of medical diagnosis. Currently, the detection field mainly focuses on test tube and blood bag detection. The premise of such detection is to extract the perceptual area, namely the ROI area, which includes the test tube body and the blood bag body. The area is equipped with information carriers such as barcodes and characters. Summary of the invention
[0004] The purpose of the present invention is to provide a test tube image segmentation method and system based on deep learning, and a training method to achieve end-to-end pixel-level image segmentation.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] The test tube image segmentation method based on deep learning includes the following steps:
[0007] S1: Load the test tube image segmentation model and parameters;
[0008] S2: Acquire an image to be detected and preprocess the image;
[0009] S3: inputting the preprocessed image into the test tube image segmentation model to obtain a segmented test tube image;
[0010] S4: Post-processing the segmented test tube image and outputting the image.
[0011] In step S1, the test tube image segmentation model is a Unet architecture, including an encoder and a decoder, wherein the encoder extracts image features and the decoder segments the feature image.
[0012] In step S4, the post-processing method includes removing small noise areas, filling holes, morphological operations, etc.
[0013] A test tube image segmentation system based on deep learning includes an image acquisition device, a processor and a memory, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0014] The test tube image segmentation model training method comprises the following steps:
[0015] A1: Collect sample images;
[0016] A2: Label and classify different types of nodes in the sample image;
[0017] A3: Build the original model;
[0018] A4: Input the sample image into the original detection model, compare the detection result with the annotation of the sample image, calculate the loss function, adjust the parameters of the original detection model and continue the cyclic training until the training is completed to obtain the test tube image segmentation model.
[0019] In step A2, the sample image contains accurate annotations of the test tube body, including pixel-level labels.
[0020] In step A3, the original model is a Unet architecture, including an encoder and a decoder, wherein the encoder extracts image features and the decoder segments the feature image.
[0021] In step A3, the Unet architecture uses a skip connection to connect the feature map of the encoder with the feature map of the decoder and save the feature information.
[0022] In step A4: a pixel-level cross entropy loss function is used by minimizing the difference between the predicted segmented image and the true label.
[0023] In step A4: the training is optimized using a back-propagation algorithm and the network weights are updated.
[0024] Compared with the prior art, the present invention has the beneficial effect that the image segmentation model based on deep learning is used to segment the image, and the segmentation efficiency is higher. The model adopts the Unet architecture, which can retain more low-level and high-level feature information and improve the segmentation performance. Post-processing is used for the segmented image to further improve the accuracy of segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A test tube image segmentation flow chart of the present invention;
[0026] Figure 2 A model architecture diagram of an embodiment of the present invention;
[0027] Figure 3 An image to be detected according to an embodiment of the present invention;
[0028] Figure 4 This is an output segmented image according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] Example 1
[0031] like Figure 1 As shown, the test tube image segmentation method based on deep learning includes the following steps:
[0032] S1: Load the test tube image segmentation model and parameters;
[0033] S2: Acquire the image to be detected and preprocess the image, such as Figure 2 As shown;
[0034] S3: inputting the preprocessed image into the test tube image segmentation model to obtain a segmented test tube image;
[0035] S4: Post-process the segmented test tube image and output the image, such as Figure 3 shown.
[0036] In step S1, the test tube image segmentation model is a Unet architecture, including an encoder and a decoder, wherein the encoder extracts image features and the decoder segments the feature image.
[0037] In step S4, the post-processing method includes removing small noise areas, filling holes, morphological operations, etc.
[0038] Example 2
[0039] A test tube image segmentation system based on deep learning includes an image acquisition device, a processor and a memory, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0040] S1: Load the test tube image segmentation model and parameters;
[0041] S2: Acquire an image to be detected and preprocess the image;
[0042] S3: inputting the preprocessed image into the test tube image segmentation model to obtain a segmented test tube image;
[0043] S4: Post-processing the segmented test tube image and outputting the image.
[0044] In step S1, the test tube image segmentation model is a Unet architecture, including an encoder and a decoder, wherein the encoder extracts image features and the decoder segments the feature image.
[0045] In step S4, the post-processing method includes removing small noise areas, filling holes, morphological operations, etc.
[0046] Example 3
[0047] The test tube image segmentation model training method is characterized by comprising the following steps:
[0048] A1: Collect sample images;
[0049] A2: Label and classify different types of nodes in the sample image;
[0050] A3: Build the original model;
[0051] A4: Input the sample image into the original detection model, compare the detection result with the annotation of the sample image, calculate the loss function, adjust the parameters of the original detection model and continue the cyclic training until the training is completed to obtain the test tube image segmentation model.
[0052] In step A2, the sample image contains accurate annotations of the test tube body, including pixel-level labels.
[0053] In step A3, the original model is a Unet architecture, including an encoder and a decoder, wherein the encoder extracts image features and the decoder segments the feature image, such as Figure 2 shown.
[0054] In step A3, the Unet architecture uses a skip connection to connect the feature map of the encoder with the feature map of the decoder and save the feature information.
[0055] In step A4: a pixel-level cross entropy loss function is used by minimizing the difference between the predicted segmented image and the true label.
[0056] In step A4: the training is optimized using a back-propagation algorithm and the network weights are updated.
[0057] Example 4
[0058] Unet architecture: Unet is a semantic segmentation architecture based on convolutional neural networks. It has an encoder-decoder structure, where the encoder is used to extract image features and the decoder is used to generate segmentation results from feature maps. Unet uses skip connections to connect the feature map of the encoder with the feature map of the decoder, helping to retain more low-level and high-level feature information, thereby improving segmentation performance.
[0059] Data preparation: Before performing semantic segmentation of test tube bodies, we first need to prepare a dataset of annotated test tubes. The images in these datasets should contain accurate annotations of the test tube bodies (pixel-level labels) as the training targets of the network.
[0060] Train the network: Use the prepared dataset to train the Unet network. During training, the goal of the network is to minimize the difference between the predicted segmented image and the true label, usually using a pixel-level cross entropy loss function. Training can be optimized using a back-propagation algorithm to update the network weights so that it can accurately segment the test tube body.
[0061] Inference process: After the network training is completed, the trained Unet model can be used for inference, that is, to perform semantic segmentation of the test tube body on the new image. The inference process is to input the image into the network and then obtain the predicted segmentation result.
[0062] Post-processing: Segmentation results usually require some post-processing steps, such as removing small noisy areas, filling holes, or performing morphological operations to further improve the accuracy of segmentation.
[0063] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention in the form of a ring-shaped light source. Therefore, the embodiments should be considered exemplary and non-restrictive in every sense, and the scope of the invention is defined by the appended claims rather than the above description, and it is intended that all changes within the meaning and range of equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0064] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. Test tube image segmentation method based on deep learning, It is characterized in that The following steps are involved: S1: Load the test tube image segmentation model and parameters; S2: Acquire an image to be detected and preprocess the image; S3: inputting the preprocessed image into the test tube image segmentation model to obtain a segmented test tube image; S4: Post-processing the segmented test tube image and outputting the image.
2. The test tube image segmentation method based on deep learning according to claim 1, It is characterized in that In step S1, the test tube image segmentation model is a Unet architecture, including an encoder and a decoder, wherein the encoder extracts image features and the decoder segments the feature image.
3. The test tube image segmentation method based on deep learning according to claim 2, It is characterized in that In step S4, the post-processing method includes removing small noise areas, filling holes, morphological operations, etc.
4. A test tube image segmentation system based on deep learning, including an image acquisition device, a processor and a memory, It is characterized in that The memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 3 when executing the computer program.
5. Test tube image segmentation model training method, It is characterized in that The following steps are involved: A1: Collect sample images; A2: Label and classify different types of nodes in the sample image; A3: Build the original model; A4: Input the sample image into the original detection model, compare the detection result with the annotation of the sample image, calculate the loss function, adjust the parameters of the original detection model and continue the cyclic training until the training is completed to obtain the test tube image segmentation model.
6. The test tube image segmentation model training method according to claim 5, It is characterized in that In step A2, the sample image contains accurate annotations of the test tube body, including pixel-level labels.
7. The test tube image segmentation model training method according to claim 5, Features: In step A3, the original model is a Unet architecture, including an encoder and a decoder, wherein the encoder extracts image features and the decoder segments the feature image.
8. The test tube image segmentation model training method according to claim 6, Features: In step A3, the Unet architecture uses a skip connection to connect the feature map of the encoder with the feature map of the decoder and save the feature information.
9. The test tube image segmentation model training method according to claim 6, It is characterized in that In step A4: a pixel-level cross entropy loss function is used by minimizing the difference between the predicted segmented image and the true label.
10. The test tube image segmentation model training method according to claim 6, It is characterized in that In step A4: the training is optimized using a back-propagation algorithm and the network weights are updated.