A blood collection tube aluminum foil cap state recognition method, device, equipment and medium
By combining traditional machine vision with a lightweight deep learning classification network model, the problem of low accuracy in recognizing the state of aluminum foil caps on blood collection tubes has been solved, achieving efficient and fast aluminum foil cap state recognition, which is suitable for embedded edge devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AUTOBIO DIAGNOSTICS CO LTD
- Filing Date
- 2023-02-27
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies have low accuracy in identifying the condition of the aluminum foil cap on blood collection tubes, and cannot effectively distinguish between samples with incomplete membrane removal and samples with liquid residue on the tube wall, posing a safety hazard.
By combining traditional machine vision algorithms with a lightweight deep learning classification network model, the system monitors the location of blood collection tubes, collects raw images, preprocesses and normalizes them, and then inputs them into the lightweight deep learning classification network model for recognition. The learning rate is dynamically adjusted to improve the recognition accuracy.
It achieves high accuracy in identifying the condition of aluminum foil caps on different types of blood collection tubes, is compatible with samples with incomplete membrane removal and fluid residue on the tube wall, has low hardware resource requirements, fast recognition speed, and is suitable for use in embedded edge devices.
Smart Images

Figure CN115995061B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method, apparatus, equipment and medium for recognizing the status of aluminum foil caps on blood collection tubes. Background Technology
[0002] In the operation of medical testing automated lines, some blood samples from blood collection tubes require multiple biochemical, immunological, and hematological analyses at different time intervals, while other blood samples need to be retained for subsequent retesting. Typically, medical testing automated lines are equipped with refrigerators to store blood samples at low temperatures. Before the next test after the blood collection tube samples are removed from the refrigerator, the aluminum foil caps on the tubes need to be removed. A decapping device is located next to the refrigerator to perform this decapping operation. Incomplete decapping of the aluminum foil caps after removing the blood collection tubes from the refrigerator can cause needle collisions in subsequent testing equipment, seriously affecting the operational safety of the testing equipment and the biosafety of the personnel. Therefore, the decapping device needs to accurately identify the decapping status of the blood collection tubes. Aluminum foil cap status identification has a very important application in medical testing automated lines.
[0003] Currently, there are two main methods for detecting the state of aluminum foil caps on blood collection tubes. One is based on ultrasonic detection, which uses the principle of ultrasonic wave detection to identify the state of the aluminum foil cap. However, this method can only make a simple judgment on the state of the aluminum foil cap, relying solely on whether the ultrasonic waves are blocked at the tube opening. It cannot accurately identify the state of the aluminum foil cap in blood collection tube samples where the foil has not been completely removed, resulting in a low accuracy rate. The other method is based on traditional machine vision, which uses template matching to detect the state of the aluminum foil cap. However, template matching can only identify the state of aluminum foil caps of specific models. Due to the complexity of the aluminum foil cap's condition, the presence of incomplete removal of the foil, and interference from the fluid residue on the tube wall, the accuracy rate remains low.
[0004] In summary, improving the accuracy of identifying the status of the aluminum foil cap on blood collection tubes is a problem that needs to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for identifying the state of the aluminum foil cap of blood collection tubes, which can improve the accuracy of identifying the state of the aluminum foil cap of blood collection tubes. The specific solution is as follows:
[0006] In a first aspect, this application discloses a method for identifying the state of the aluminum foil cap of a blood collection tube, including:
[0007] The position of the blood collection tube is monitored, and when the position of the blood collection tube reaches the target detection position, the original image of the blood collection tube is acquired;
[0008] The original image is processed using a preset machine vision algorithm to obtain an image of the aluminum foil cap at the first opening of the blood collection tube;
[0009] The image of the aluminum foil cap at the first tube opening is normalized, and then the normalized image of the aluminum foil cap at the first tube opening is input into a pre-built lightweight deep learning classification network model so as to determine the state of the aluminum foil cap of the blood collection tube by using the recognition results output by the lightweight deep learning classification network model.
[0010] Optionally, before monitoring the position of the blood collection tube and acquiring the original image of the blood collection tube when its position reaches the target detection position, the method further includes:
[0011] Load the model file of the lightweight deep learning classification network model.
[0012] Optionally, obtaining the model file includes:
[0013] Obtain several samples of aluminum foil caps containing different models of blood collection tubes; wherein, the aluminum foil cap samples include aluminum foil caps without film removal, aluminum foil caps with failed film removal, and aluminum foil caps with successful film removal;
[0014] An industrial camera is used to acquire sample images of the aluminum foil cap sample, and the sample images are processed using the preset machine vision algorithm to determine the second tube opening aluminum foil cap image corresponding to the aluminum foil cap sample, so as to obtain the model training set.
[0015] The lightweight deep learning classification network model is trained using the model training set, and the learning rate of the lightweight deep learning classification network model is dynamically adjusted during the training process. After a preset number of iterations, the current optimal model parameters of the lightweight deep learning classification network model are determined using the current learning rate. Then, the model file of the lightweight deep learning classification network model is determined based on the optimal model parameters.
[0016] Optionally, the step of processing the original image using a preset machine vision algorithm to obtain an image of the aluminum foil cap at the first opening of the blood collection tube includes:
[0017] The original image is color-converted to convert the corresponding RGB color image into a grayscale image;
[0018] The grayscale image is subjected to spatial domain Gaussian filtering and / or median filtering, and then the filtered image is subjected to a first preset processing to obtain the first region of interest image of the blood collection tube;
[0019] Based on the first region of interest image, the filtered image is cropped according to the preset height of the aluminum foil cap to obtain the aluminum foil cap region image of the blood collection tube opening;
[0020] The image of the aluminum foil cap region is subjected to a second preset processing to obtain a second region of interest image of the aluminum foil cap;
[0021] Based on the second region of interest image, the aluminum foil cap region image is cropped to obtain the first tube opening aluminum foil cap image of the blood collection tube.
[0022] Optionally, the first preset processing of the filtered image to obtain the first region of interest image of the blood collection tube includes:
[0023] The filtered image is processed using a first edge detection algorithm based on a preset low threshold to obtain a binarized image of the blood collection tube's edge.
[0024] The binarized image of the blood collection tube's edge is processed using a first contour extraction algorithm to obtain a first outer contour point set corresponding to the binarized image of the blood collection tube's edge.
[0025] The minimum bounding rectangle of the first outer contour point set is determined to obtain the first region of interest image of the blood collection tube.
[0026] Optionally, the second preset processing of the image of the aluminum foil cap region to obtain a second region of interest image of the aluminum foil cap includes:
[0027] The image of the aluminum foil cap region is processed using a second edge detection algorithm based on a preset high threshold to obtain a binarized image of the edge of the aluminum foil cap.
[0028] The edge binarized image of the aluminum foil cap is processed using a second contour extraction algorithm to obtain a second outer contour point set corresponding to the edge binarized image of the aluminum foil cap.
[0029] Determine the minimum bounding rectangle of the second outer contour point set to obtain the second region of interest image of the aluminum foil cap.
[0030] Optionally, the step of inputting the normalized image of the first tube opening aluminum foil cap into a pre-constructed lightweight deep learning classification network model, so as to determine the state of the aluminum foil cap of the blood collection tube using the recognition results output by the lightweight deep learning classification network model, includes:
[0031] The normalized image of the first tube opening aluminum foil cap is input into a pre-constructed lightweight deep learning classification network model to determine the recognition result output by the lightweight deep learning classification network model.
[0032] If the score of the identification result is not less than the first preset threshold, then the first classification type corresponding to the current identification result is determined as the aluminum foil cap state of the blood collection tube.
[0033] If the score of the recognition result is less than the first preset threshold, and the number of recognitions of the lightweight deep learning classification network model is equal to the second preset threshold, then the corresponding second classification type is determined according to the recognition result corresponding to the highest score, and then the second classification type is determined as the aluminum foil cap state of the blood collection tube.
[0034] If the score of the recognition result is less than the first preset threshold, and the number of recognitions by the lightweight deep learning classification network model is less than the second preset threshold, then the step of processing the original image using a preset machine vision algorithm to obtain the image of the first tube opening aluminum foil cap of the blood collection tube is re-executed.
[0035] Optionally, constructing the lightweight deep learning classification network model includes:
[0036] The lightweight deep learning classification network model is constructed using the following network structure: The network structure includes an input part, a main branch part, a side branch part, and a classifier. The input part includes sequentially connected convolutional layers and max-pooling layers. The convolutional layers are processed by a preset activation function before being passed to the max-pooling layer. The main branch part is the backbone of the network structure, including a first group of convolutional layers, a second group of convolutional layers, and a third group of convolutional layers. These three groups are connected by the preset activation function. Each of the first, second, and third groups of convolutional layers contains several interconnected trunk convolutional layers and branch convolutional layers. The side branch part is a branch path extending from the input part and the main branch part of the network structure. The classifier includes a sequentially connected global pooling layer, a linear transformation layer, and a softmax layer.
[0037] The basic parameters of each part of the network structure are set to obtain the lightweight deep learning classification network model.
[0038] Secondly, this application discloses a blood collection tube aluminum foil cap status recognition device, comprising:
[0039] The blood collection tube position monitoring module is used to monitor the position of the blood collection tube and to acquire the original image of the blood collection tube when the position of the blood collection tube reaches the target detection position.
[0040] The machine vision algorithm processing module is used to process the original image using a preset machine vision algorithm to obtain an image of the aluminum foil cap at the first opening of the blood collection tube.
[0041] The model processing module is used to normalize the image of the first tube opening aluminum foil cap, and then input the normalized image of the first tube opening aluminum foil cap into a pre-constructed lightweight deep learning classification network model, so as to determine the state of the aluminum foil cap of the blood collection tube by using the recognition results output by the lightweight deep learning classification network model.
[0042] Thirdly, this application discloses an electronic device, which includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the blood collection tube aluminum foil cap status recognition method as described above.
[0043] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the blood collection tube aluminum foil cap status recognition method as described above.
[0044] This application provides a method for identifying the state of the aluminum foil cap on blood collection tubes. The method monitors the position of the blood collection tube and acquires its original image when the tube reaches a target detection position. The original image is processed using a preset machine vision algorithm to obtain an image of the first aluminum foil cap at the tube opening. This first aluminum foil cap image is then normalized and input into a pre-constructed lightweight deep learning classification network model. The recognition result output by the lightweight deep learning classification network model is used to determine the state of the aluminum foil cap on the blood collection tube. Therefore, this invention uses a combination of traditional machine vision and a lightweight deep learning classification network model to accurately identify the state of the aluminum foil cap on blood collection tubes. The model is very lightweight, requiring minimal hardware resources and computing power, and has a fast recognition speed. This technology is compatible with different models of aluminum foil caps on blood collection tubes and has a high recognition accuracy for samples with incomplete removal of the aluminum foil cap or fluid clinging to the tube wall.
[0045] Furthermore, the blood collection tube aluminum foil cap status recognition device, equipment, and storage medium provided in this application correspond to the above-mentioned blood collection tube aluminum foil cap status recognition method and have the same effect. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0047] Figure 1 This application discloses a flowchart of a method for identifying the status of the aluminum foil cap of a blood collection tube.
[0048] Figure 2 The original image of a portion of the blood collection tubes disclosed in this application;
[0049] Figure 3 This is a schematic diagram of a method for identifying the state of the aluminum foil cap of a blood collection tube using a YOLO deep learning object detection network model disclosed in this application;
[0050] Figure 4 This is a schematic diagram of the network structure of a lightweight deep learning classification model disclosed in this application.
[0051] Figure 5 This is a schematic diagram of the 3D network structure of a lightweight deep learning classification model disclosed in this application.
[0052] Figure 6 These are images of some of the test samples disclosed in this application;
[0053] Figure 7 This application discloses a flowchart of a specific method for identifying the status of the aluminum foil cap of a blood collection tube.
[0054] Figure 8 Images of the openings of blood collection tubes from which the membrane has been successfully removed, as disclosed in this application.
[0055] Figure 9 Images of aluminum foil caps from partially disassembled blood collection tubes disclosed in this application;
[0056] Figure 10 This application discloses images of the aluminum foil caps of blood collection tubes without the membrane removed.
[0057] Figure 11 This application discloses a flowchart of a specific method for identifying the status of the aluminum foil cap of a blood collection tube.
[0058] Figure 12 This application discloses a flowchart of a specific method for identifying the status of the aluminum foil cap of a blood collection tube.
[0059] Figure 13 This is a schematic diagram of the first outer contour point set corresponding to the binarized image of the blood collection tube edge disclosed in this application;
[0060] Figure 14 This application discloses a flowchart of a specific method for identifying the status of the aluminum foil cap of a blood collection tube.
[0061] Figure 15 This is a schematic diagram of the second outer contour point set corresponding to the binarized image of the edge of the aluminum foil cap disclosed in this application;
[0062] Figure 16 This is a flowchart illustrating the implementation of a blood collection tube aluminum foil cap status recognition technology disclosed in this application;
[0063] Figure 17 This is a schematic diagram of the structure of a blood collection tube aluminum foil cap status recognition device disclosed in this application;
[0064] Figure 18 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. 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.
[0066] Currently, traditional machine vision and ultrasonic detection technologies have significant limitations in accurately identifying the complex state of the aluminum foil caps on blood collection tubes, resulting in relatively low accuracy.
[0067] Therefore, this application provides a solution for identifying the status of the aluminum foil cap of blood collection tubes, which systematically solves the problem of identifying the status of the aluminum foil cap of blood collection tubes and can improve the accuracy of identifying the status of the aluminum foil cap of blood collection tubes.
[0068] This invention discloses a method for recognizing the status of the aluminum foil cap on blood collection tubes. See [link to relevant documentation]. Figure 1 As shown, the method includes:
[0069] Step S11: Monitor the position of the blood collection tube, and when the position of the blood collection tube reaches the target detection position, acquire the original image of the blood collection tube.
[0070] The execution subject of the blood collection tube aluminum foil cap status recognition method provided in this embodiment of the invention can be the corresponding blood collection tube aluminum foil cap status recognition device. It should be noted that when monitoring the position of the blood collection tube, if the blood collection tube reaches the detection position, the industrial camera is controlled to acquire an image of the blood collection tube. For example... Figure 2 The image shown is a partial original image of the blood collection tubes. From left to right, the images show the states of successful foil cap removal, failed foil removal, and no foil removal.
[0071] Step S12: Process the original image using a preset machine vision algorithm to obtain an image of the aluminum foil cap at the first opening of the blood collection tube.
[0072] In this embodiment, after obtaining the original image of the blood collection tube, the original image of the blood collection tube is first processed using a traditional machine vision algorithm. The main process is to further obtain the image of the aluminum foil cap of the blood collection tube from the image of the blood collection tube, and then obtain the ROI region (region of interest) of the aluminum foil cap at the opening of the blood collection tube. The image of the first aluminum foil cap at the opening of the blood collection tube is obtained by cropping based on the ROI region of the aluminum foil cap at the opening of the blood collection tube.
[0073] Step S13: Normalize the image of the first tube opening aluminum foil cap, and then input the normalized image of the first tube opening aluminum foil cap into a pre-constructed lightweight deep learning classification network model, so as to use the recognition results output by the lightweight deep learning classification network model to determine the state of the aluminum foil cap of the blood collection tube.
[0074] In this embodiment, after obtaining the image of the aluminum foil cap at the first opening of the blood collection tube, it is normalized. Then, the normalized image of the aluminum foil cap at the first opening is fed into a pre-constructed lightweight deep learning classification network model for inference. Based on the recognition result output by the model inference, the state of the aluminum foil cap of the blood collection tube is identified. The recognition result includes the classification type and score of the aluminum foil cap of the blood collection tube.
[0075] Specifically, the image normalization operation includes resizing the image to 128x128, changing the image data format to float type, mapping the image pixel values to floating-point values of 0 to 1, and finally obtaining the normalized image.
[0076] In this embodiment, the process of determining the aluminum foil cap state of the blood collection tube using the recognition result output by a lightweight deep learning classification network model specifically includes: if the score value of the recognition result is not less than a first preset threshold, then the first classification type corresponding to the current recognition result is determined as the aluminum foil cap state of the blood collection tube; if the score value of the recognition result is less than the first preset threshold, and the recognition count of the lightweight deep learning classification network model is equal to a second preset threshold, then the corresponding second classification type is determined based on the recognition result corresponding to the highest score value, and then the second classification type is determined as the aluminum foil cap state of the blood collection tube; if the score value of the recognition result is less than the first preset threshold, and the recognition count of the lightweight deep learning classification network model is less than the second preset threshold, then the step of processing the original image using a preset machine vision algorithm to obtain the first tube opening aluminum foil cap image of the blood collection tube is re-executed.
[0077] In other words, in the first specific implementation, if the score of the recognition result is greater than or equal to the set first preset threshold, then the classification type value of the recognition result is the final recognition result status type value, and the recognition ends. It should also be noted that when initially recognizing the status of the blood collection tube aluminum foil cap, the recognition count is set to 0; after each recognition result is output, the recognition count is incremented by 1. Therefore, in the second specific implementation, if the score of the recognition result is less than the set first preset threshold, and the recognition count is equal to the second preset threshold (for example, setting the maximum number of recognitions to three), that is, when the recognition count is three, the classification type value of the recognition result with the highest score among the three recognition results is taken as the final recognition result status type value, and the recognition ends. In the third specific implementation, if the calculated score is less than the set threshold, and the recognition count is less than the second preset threshold (that is, less than three recognitions), then the machine vision algorithm is used again to acquire images for recognition.
[0078] This application provides a method for identifying the state of the aluminum foil cap on blood collection tubes. The method monitors the position of the blood collection tube and acquires its original image when the tube reaches a target detection position. The original image is processed using a preset machine vision algorithm to obtain an image of the first aluminum foil cap at the tube opening. This first aluminum foil cap image is then normalized and input into a pre-constructed lightweight deep learning classification network model. The recognition result output by the lightweight deep learning classification network model is used to determine the state of the aluminum foil cap on the blood collection tube. Therefore, this invention uses a combination of traditional machine vision and a lightweight deep learning classification network model to accurately identify the state of the aluminum foil cap on blood collection tubes. The model is very lightweight, requiring minimal hardware resources and computing power, and has a fast recognition speed. This technology is compatible with different models of aluminum foil caps on blood collection tubes and has a high recognition accuracy for samples with incomplete removal of the aluminum foil cap or fluid clinging to the tube wall.
[0079] Specifically, the process of constructing a lightweight deep learning classification network model may include: building the network structure of the lightweight deep learning classification network model; and then setting the basic parameters of each part of the network structure to obtain the lightweight deep learning classification network model.
[0080] In one specific implementation, a technique for detecting and recognizing the state of the aluminum foil cap on blood collection tubes can be used, such as the YOLO deep learning object detection network model. Figure 3The diagram illustrates the specific implementation process of using the YOLO deep learning object detection network model. First, the system loads the model file of the YOLO deep learning object detection network model and waits for the blood collection tube to reach the detection position. While waiting for the blood collection tube to reach the detection position, the number of recognition attempts is set to 0. Then, an industrial camera is used to capture an image of the aluminum foil cap of the blood collection tube. The image of the aluminum foil cap is normalized to obtain a normalized image. This normalized image is then fed into the YOLO deep learning object detection network model. After inference, the model obtains a calculation result, and the number of recognition attempts is incremented by 1. If the score of the calculation result is greater than or equal to a set threshold, the classification type value of the calculation result is the final recognition result state type value, and recognition ends. If the score of the calculation result is less than the set threshold, and the number of recognition attempts is less than 3, the machine algorithm recognition steps are repeated, and the image is re-captured for recognition. If the score of the calculation result is less than the set threshold, and the number of recognition attempts is equal to 3, the classification type value of the calculation result with the highest score among the three calculation results is used as the final recognition result state type value, and recognition ends. However, when using the YOLO deep learning object detection network model, it was found that training the model often requires a large training set, necessitating the collection of numerous blood collection tube foil cap sample images. Furthermore, creating the training set is complex, requiring manual annotation of the ROI (Region of Interest) for each blood collection tube foil cap sample image. Moreover, the trained YOLO deep learning object detection network model file is easily affected by background lighting when applied to a production environment, leading to errors in recognition results and sometimes a decrease in accuracy. Additionally, it suffers from slow recognition speed, requires significant hardware resources and computing power, and may experience memory exhaustion and insufficient computing power on some less powerful mobile devices.
[0081] Therefore, further, in another implementation, such as Figure 4 The diagram shown is a schematic representation of the pre-built lightweight deep learning classification network model in an embodiment of this application. Figure 5 The diagram shows a 3D structural representation of a lightweight deep learning classification network model. This lightweight deep learning classification network model takes a 3x128x128 RGB color blood collection tube foil cap image as input and outputs the classification result. The model mainly consists of four parts: input, main branch, side branches, and classifier. The following is a illustrative description of each component.
[0082] 1. Input, consisting of a two-layer network structure: a convolutional layer and a max-pooling layer connected in sequence:
[0083] (1) The first layer is a Conv layer with a Kernel of 5x5, Pad of 2, Stride of 2, input Channel of 3, and output Channel of 64;
[0084] (2) The second layer is the MaxPool layer with a Kernel of 3x3, Pad of 1, and Stride of 2;
[0085] The first Conv layer is passed to the second MaxPool layer after being processed by the preset activation function GELU.
[0086] 2. Main branch: This is the main trunk and pathway in the overall network structure, which generally includes three major layers.
[0087] (1) The first group of convolutional layers: divided into two branches: main line convolutional layers and branch line convolutional layers;
[0088] i) The branch network structure of the trunk convolutional layer in the first group of convolutional layers is as follows:
[0089] The first sublayer is a Conv layer with a Kernel of 1x1, Pad of 0, Stride of 1, input Channel of 64, and output Channel of 64.
[0090] The second sublayer is a Conv layer with a Kernel of 3x3, Pad of 1, Stride of 1, input Channel of 64, and output Channel of 64.
[0091] The third sublayer is a Conv layer with a Kernel of 1x1, Pad of 0, Stride of 1, input Channel of 64, and output Channel of 128;
[0092] The first group of three convolutional layers are sequentially connected using the GELU operation.
[0093] ii) The branch network structure of the branch convolutional layers in the first group of convolutional layers is as follows:
[0094] A Conv layer with a Kernel of 1x1, Pad of 0, Stride of 1, input Channel of 64, and output Channel of 128;
[0095] The trunk convolutional layers and branch convolutional layers in the first group of convolutional layers are merged and summarized into a single branch using the Add operation, and then the GELU operation is performed.
[0096] (2) The second set of convolutional layers: divided into two branches: the main convolutional layer and the branch convolutional layer.
[0097] i) The branch network structure of the trunk convolutional layer in the second group of convolutional layers is as follows:
[0098] The first sublayer is a Conv layer with a Kernel of 1x1, Pad of 0, Stride of 1, input Channel of 128, and output Channel of 128.
[0099] The second sub-layer is a Conv layer with a Kernel of 3x3, a Pad of 1, a Stride of 2, an input Channel of 128, and an output Channel of 128.
[0100] The third sublayer is a Conv layer with a Kernel of 1x1, Pad of 0, Stride of 1, input Channel of 128, and output Channel of 256;
[0101] The second set of three convolutional layers are sequentially connected using the GELU operation.
[0102] ii) The branch network structure of the branch convolutional layers in the second group of convolutional layers is as follows:
[0103] A Conv layer with a Kernel of 1x1, Pad of 0, Stride of 2, input Channel of 128, and output Channel of 256;
[0104] The trunk convolutional layers and branch convolutional layers in the second group of convolutional layers are merged and summarized into a single branch using the Add operation, and then the GELU operation is performed.
[0105] (3) The third group of convolutional layers: divided into two branches: mainline convolutional layers and branch convolutional layers.
[0106] i) The branch network structure of the trunk convolutional layer in the third group of convolutional layers is as follows:
[0107] The first sublayer is a Conv layer with a Kernel of 1x1, Pad of 0, Stride of 1, input Channel of 256, and output Channel of 256.
[0108] The second sublayer is a Conv layer with a Kernel of 3x3, a Pad of 1, a Stride of 2, an input Channel of 256, and an output Channel of 256.
[0109] The third sublayer is a Conv layer with a Kernel of 1x1, Pad of 0, Stride of 1, input Channel of 256, and output Channel of 512.
[0110] The three sub-layers of the third convolutional layer are sequentially connected using the GELU operation.
[0111] ii) The branch network structure of the branch convolutional layers in the third group of convolutional layers is as follows:
[0112] A Conv layer with a Kernel of 1x1, Pad of 0, Stride of 2, input Channel of 256, and output Channel of 512;
[0113] The trunk convolutional layers and branch convolutional layers in the third group of convolutional layers are merged and summarized into one branch using the Add operation, and then the GELU operation is performed.
[0114] The three main layers are connected sequentially.
[0115] 3. Lateral branches, including three lateral branches.
[0116] (1) The first side branch is a branch that branches off after the input ends. The network structure of this side branch is as follows:
[0117] A Conv layer with a Kernel of 1x1, Pad of 0, Stride of 4, input Channel of 64, and output Channel of 512;
[0118] A GELU operation follows the Conv layer.
[0119] (2) The second lateral branch is a branch that is separated from the first group of convolutional layers of the main branch. The network structure of this lateral branch is as follows:
[0120] A Conv layer with a Kernel of 1x1, Pad of 0, Stride of 4, input Channel of 128, and output Channel of 512;
[0121] A GELU operation follows the Conv layer.
[0122] (3) The third lateral branch is a branch that is separated from the second group of convolutional layers of the main branch. The network structure of this lateral branch is as follows:
[0123] A Conv layer with a Kernel of 1x1, Pad of 0, Stride of 2, input Channel of 256, and output Channel of 512;
[0124] A GELU operation follows the Conv layer.
[0125] The outputs of the three side branches and the output of the main branch are combined into one branch by performing an Add operation.
[0126] 4. Classifier
[0127] The classifier consists of a three-layer network structure.
[0128] (1) The first layer is the GlobalAveragePool layer, which performs pooling operations and then becomes a feature vector of length 512.
[0129] (2) The second layer is the linear transformation layer, which transforms the feature vector of length 512 into a feature vector of length 2.
[0130] (3) The third layer is the Softmax layer, which calculates the probability score for each category.
[0131] In the embodiments of this application, experiments were conducted using a preset lightweight classification model and a traditional ResNet network model, as shown in Table 1.
[0132] Table 1
[0133] Model type Recognition accuracy Params(M) Flops (GFlops) Speed (ms) (Jetson Nano) This lightweight classification model 100% 1.445 0.238 4.45 Resnet50 99.9% 25.557 4.12 54.77 Resnet18 96.2% 11.69 1.82 20.03
[0134] As can be seen, this invention combines traditional machine vision with a lightweight deep learning classification network model. The model is very lightweight, requiring minimal hardware resources and computing power, and boasts fast recognition speed. Experimental testing using an image dataset of opened aluminum foil caps showed a 100% recognition accuracy, surpassing the accuracy of the ResNet network. On a Jetson Nano mobile edge device, the recognition speed for a single sample is less than 5ms, achieving a very fast recognition speed. Furthermore, the network in this embodiment has fewer layers, only 11 in the vertical direction. The network parameters and floating-point computation are far less than those of the traditional ResNet network, making the model very lightweight. This results in faster training and inference speeds, making it highly suitable for use in embedded edge devices. Simultaneously, the network incorporates side branches and utilizes the image pyramid concept to extract image features at multiple scales. For finer features, feature extraction is more effective, leading to better recognition accuracy. Figure 6 The images shown are test sample images that the lightweight deep learning classification model in this embodiment can accurately identify, but ResNet cannot accurately identify, after the same training set and the same number of training iterations.
[0135] In one specific embodiment of the blood collection tube aluminum foil cap status recognition method provided by the present invention, see [link to relevant documentation]. Figure 7 As shown, before processing the original image using a preset machine vision algorithm to obtain the image of the first aluminum foil cap at the opening of the blood collection tube, the process may further include:
[0136] Step S21: Load the model file of the lightweight deep learning classification network model.
[0137] In this embodiment, before the blood collection tube reaches the detection position, the system loads the model file of a lightweight deep learning classification network model. Specifically, the process of obtaining the model file includes: acquiring several samples of aluminum foil caps containing different models of blood collection tubes; wherein, the aluminum foil cap samples include samples of aluminum foil caps without film removal, samples of aluminum foil caps with failed film removal, and samples of aluminum foil caps with successful film removal; acquiring sample images of the aluminum foil cap samples using an industrial camera, and processing the sample images using the preset machine vision algorithm to determine the second tube opening aluminum foil cap image corresponding to the aluminum foil cap sample, so as to obtain a model training set; training the lightweight deep learning classification network model using the model training set, and dynamically adjusting the learning rate of the lightweight deep learning classification network model during the training process, so that after a preset number of iterations of training, the current optimal model parameters of the lightweight deep learning classification network model are determined using the current learning rate, and then the model file of the lightweight deep learning classification network model is determined based on the optimal model parameters.
[0138] For example, 10,000 samples of various types of blood collection tube foil caps were collected, including samples with the foil caps still attached, such as... Figure 8 As shown; samples that failed to remove the membrane, such as Figure 9 As shown; successfully demeabilized samples (including fluid clinging to the blood collection tube wall), such as Figure 10 As shown, all sample images are acquired using an industrial camera, and processed using a preset machine vision algorithm to determine the second tube opening aluminum foil cap image corresponding to the aluminum foil cap sample. This second tube opening aluminum foil cap image is used to create a model training set for recognizing the state of the blood collection tube aluminum foil cap. Further, the model training set is fed into the lightweight deep learning classification network model used in this invention. During training, a method of dynamically setting the training learning rate is employed. The initial learning rate is set to 1e-5, and real-time accuracy and loss are dynamically monitored, storing the highest current accuracy and the corresponding lowest loss. If the accuracy does not improve further and the loss does not decrease further after 100 consecutive training epochs, the learning rate is reduced to half of its original value, achieving dynamic adjustment of the model training learning rate, refining the training process, and learning to obtain the optimal model parameters. After 1000 epochs of training, the model file of the deep learning network model is obtained. One epoch represents all data fed into the network, completing one forward computation and backpropagation process.
[0139] Step S22: Monitor the position of the blood collection tube, and when the position of the blood collection tube reaches the target detection position, acquire the original image of the blood collection tube.
[0140] Step S23: Process the original image using a preset machine vision algorithm to obtain an image of the aluminum foil cap at the first opening of the blood collection tube.
[0141] Step S24: Normalize the image of the first tube opening aluminum foil cap, and then input the normalized image of the first tube opening aluminum foil cap into a pre-constructed lightweight deep learning classification network model, so as to use the recognition results output by the lightweight deep learning classification network model to determine the state of the aluminum foil cap of the blood collection tube.
[0142] For more detailed processing procedures regarding steps S22, S23, and S24, please refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0143] As can be seen, in this embodiment, a large number of blood collection tube aluminum foil cap sample images were collected. Image preprocessing was used to create a model training set. This training set was then fed to a lightweight deep learning classification network model for thorough training to obtain the model file. Finally, the model file was applied to the recognition of blood collection tube aluminum foil cap states, achieving a very high recognition accuracy. It is compatible with different models of blood collection tube aluminum foil caps, and even samples with incomplete foil removal and fluid buildup on the blood collection tube walls can achieve high recognition accuracy. Testing showed that the overall recognition accuracy can reach 100%. It should be noted that when creating the training dataset, it is only necessary to place images of blood collection tube aluminum foil caps of different classification types into different folders. The training data creation is relatively simple, and the training convergence speed is relatively fast.
[0144] In one specific embodiment of the blood collection tube aluminum foil cap status recognition method provided by the present invention, see [link to relevant documentation]. Figure 11 As shown, the process of processing the original image using a preset machine vision algorithm to obtain the image of the aluminum foil cap at the first opening of the blood collection tube specifically includes:
[0145] Step S31: Perform color conversion on the original image to convert the RGB color image corresponding to the original image into a grayscale image.
[0146] Step S32: Perform spatial domain Gaussian filtering and / or median filtering on the grayscale image, and then perform a first preset processing on the filtered image to obtain the first region of interest image of the blood collection tube.
[0147] In this embodiment, the original image of the blood collection tube is an RGB color image. The RGB color image is converted into a Grayscale image. The Grayscale image is then subjected to spatial domain Gaussian filtering and / or median filtering to eliminate the interference of random electronic noise during the camera image acquisition process, thereby obtaining the filtered image. The filtered image is then subjected to a first preset processing to obtain the first ROI region image of the blood collection tube.
[0148] Specifically, such as Figure 12 The following is a detailed description of the first preset processing procedure, which mainly includes:
[0149] Step S321: Process the filtered image using a first edge detection algorithm based on a preset low threshold to obtain a binarized image of the blood collection tube's edge;
[0150] Step S322: Process the binarized image of the blood collection tube edge using the first contour extraction algorithm to obtain the first outer contour point set corresponding to the binarized image of the blood collection tube edge;
[0151] Step S323: Determine the minimum bounding rectangle of the first outer contour point set to obtain the first region of interest image of the blood collection tube.
[0152] Typical edge detection algorithms use a threshold to filter out small gradient values caused by noise or color changes, while retaining large gradient values. The Canny algorithm uses a dual threshold, namely a high threshold and a low threshold, to distinguish edge pixels. If the gradient value of an edge pixel is greater than the high threshold, it is considered a strong edge point. In this embodiment, the filtered image is processed using the low-threshold Canny algorithm to obtain a binarized image of obvious edges in the image; then, the binarized image of obvious edges in the image is processed using a first contour extraction algorithm, such as the FindContours algorithm, to obtain a binarized image of the first outer contour point set of the blood collection tube including the aluminum foil cap, which has a relatively coarse appearance. The binarized image of the first outer contour point set of the blood collection tube including the aluminum foil cap is shown below. Figure 13 As shown. Finally, the minimum bounding rectangle of the first outer contour point set of the blood collection tube including the aluminum foil cap in the image is calculated to obtain the first ROI region of the blood collection tube including the aluminum foil cap in the image.
[0153] Step S33: Based on the first region of interest image, crop the filtered image according to the preset height of the aluminum foil cap to obtain the aluminum foil cap region image of the blood collection tube opening.
[0154] In this embodiment of the application, the first ROI region of the blood collection tube including the aluminum foil cap in the image obtained in step S32 is used. According to the preset height of the aluminum foil cap, the filtered image obtained in step S32 is cropped to obtain the image of the aluminum foil cap region of the blood collection tube opening.
[0155] Step S34: Perform a second preset processing on the image of the aluminum foil cap area to obtain a second region of interest image of the aluminum foil cap.
[0156] Furthermore, a second preprocessing step is performed on the image of the aluminum foil cap region to obtain a second region of interest image of the aluminum foil cap. The second preprocessing process is as follows: Figure 14As shown, it specifically includes:
[0157] Step S341: Process the image of the aluminum foil cap region using a second edge detection algorithm based on a preset high threshold to obtain a binarized image of the edge of the aluminum foil cap;
[0158] Step S342: Process the edge binarized image of the aluminum foil cap using the second contour extraction algorithm to obtain the second outer contour point set corresponding to the edge binarized image of the aluminum foil cap;
[0159] Step S343: Determine the minimum bounding rectangle of the second outer contour point set to obtain the second region of interest image of the aluminum foil cap.
[0160] In this embodiment, the image of the aluminum foil cap region at the blood collection tube opening is processed using the Canny algorithm with a high threshold to obtain a binarized image of the fine edges in the image. Then, similarly, the binarized image of the fine edges of the aluminum foil cap in the image is processed using the FindContours algorithm to obtain a binarized image of the second outer contour point set of the aluminum foil cap, which has a more refined representation. The binarized image of the second outer contour point set of the aluminum foil cap at the blood collection tube opening is shown below. Figure 15 As shown. Finally, the minimum bounding rectangle of the second outer contour point set in the image is calculated to obtain the second ROI region of the aluminum foil cap of the blood collection tube opening in the image.
[0161] Step S35: Based on the second region of interest image, crop the aluminum foil cap region image to obtain the first tube opening aluminum foil cap image of the blood collection tube.
[0162] In this embodiment, the second ROI region of the aluminum foil cap in the image is used to crop the image of the aluminum foil cap region obtained in step S33 to obtain the image of the aluminum foil cap at the first opening of the blood collection tube. Then, a normalization operation is performed on the image of the aluminum foil cap at the first opening of the blood collection tube. The image normalization operation includes resizing the image size to 128x128, changing the image data format to float type, and mapping the pixel values of the image to floating-point values of 0 to 1, finally obtaining the normalized image.
[0163] like Figure 16 The diagram shows the overall flowchart of the process for identifying the state of the aluminum foil cap on blood collection tubes by combining a preset machine vision algorithm with a pre-built lightweight deep learning classification network model. As can be seen, this invention uses a combination of traditional machine vision and a lightweight deep learning classification network model to accurately identify the state of the aluminum foil cap on blood collection tubes. The model is very lightweight, requiring minimal hardware resources and computing power, and has a fast recognition speed. This technology is compatible with different models of aluminum foil caps on blood collection tubes and has a high recognition accuracy for samples with incompletely removed aluminum foil caps and samples with fluid clinging to the tube walls.
[0164] Accordingly, this application also discloses a blood collection tube aluminum foil cap status recognition device, see [link to relevant documentation]. Figure 17 As shown, the device includes:
[0165] The blood collection tube position monitoring module 11 is used to monitor the position of the blood collection tube and to acquire the original image of the blood collection tube when the position of the blood collection tube reaches the target detection position.
[0166] The machine vision algorithm processing module 12 is used to process the original image using a preset machine vision algorithm to obtain the image of the aluminum foil cap at the first opening of the blood collection tube.
[0167] The model processing module 13 is used to normalize the image of the first tube opening aluminum foil cap, and then input the normalized image of the first tube opening aluminum foil cap into a pre-constructed lightweight deep learning classification network model, so as to determine the state of the aluminum foil cap of the blood collection tube by using the recognition results output by the lightweight deep learning classification network model.
[0168] For more detailed information on the working process of each of the above modules, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.
[0169] Therefore, the above-described scheme in this embodiment monitors the position of the blood collection tube and acquires its original image when the tube reaches the target detection position. A preset machine vision algorithm is used to process the original image, obtaining an image of the first aluminum foil cap at the tube opening. This image is then normalized and input into a pre-constructed lightweight deep learning classification network model. The recognition result output by the lightweight deep learning classification network model is used to determine the state of the aluminum foil cap on the blood collection tube. Thus, this invention uses a combination of traditional machine vision and a lightweight deep learning classification network model to accurately identify the state of the aluminum foil cap on the blood collection tube. The model is very lightweight, requiring minimal hardware resources and computing power, and has a fast recognition speed. This technology is compatible with different models of aluminum foil caps on blood collection tubes and has a high recognition accuracy for samples with incomplete removal of the aluminum foil cap or fluid clinging to the tube wall.
[0170] Furthermore, embodiments of this application also disclose an electronic device, Figure 18 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0171] Figure 18This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the blood collection tube aluminum foil cap status identification method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be a computer.
[0172] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0173] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it can include an operating system 221, computer programs 222, and data 223, etc. The data 223 can include various types of data. The storage method can be temporary storage or permanent storage.
[0174] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the blood collection tube aluminum foil cap status identification method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0175] Furthermore, this application also discloses a computer-readable storage medium, which includes random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, magnetic disks, optical disks, or any other form of storage medium known in the art. When the computer program is executed by a processor, it implements the aforementioned method for identifying the status of the aluminum foil cap on blood collection tubes. The specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0176] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0177] The steps of the blood collection tube aluminum foil cap status recognition or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0178] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0179] The above provides a detailed description of the method, apparatus, equipment, and medium for identifying the status of the aluminum foil cap of a blood collection tube provided by the present invention. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for identifying the status of the aluminum foil cap on a blood collection tube, characterized in that, include: The position of the blood collection tube is monitored, and when the position of the blood collection tube reaches the target detection position, the original image of the blood collection tube is acquired; The original image is processed using a preset machine vision algorithm to obtain an image of the aluminum foil cap at the first opening of the blood collection tube; The preset machine vision algorithm includes: performing color conversion and filtering on the original image, then sequentially using a first preset processing method to obtain a first region of interest (ROI) image of the blood collection tube, cropping the aluminum foil cap region image of the blood collection tube opening according to a preset aluminum foil cap height, then using a second preset processing method to obtain a second ROI image of the aluminum foil cap, and cropping the aluminum foil cap region image according to the second ROI image to obtain the first tube opening aluminum foil cap image; wherein, the first preset processing method sequentially includes: edge detection based on a preset low threshold, contour extraction, and determination of the minimum bounding rectangle; the second preset processing method sequentially includes: edge detection based on a preset high threshold, contour extraction, and determination of the minimum bounding rectangle; The image of the aluminum foil cap at the first tube opening is normalized, and then the normalized image of the aluminum foil cap at the first tube opening is input into a pre-built lightweight deep learning classification network model so as to determine the state of the aluminum foil cap of the blood collection tube by using the recognition results output by the lightweight deep learning classification network model.
2. The method for identifying the status of the aluminum foil cap of a blood collection tube according to claim 1, characterized in that, Before monitoring the position of the blood collection tube and acquiring the original image of the blood collection tube when its position reaches the target detection position, the method further includes: Load the model file of the lightweight deep learning classification network model.
3. The method for identifying the status of the aluminum foil cap of a blood collection tube according to claim 2, characterized in that, Obtaining the model file includes: Obtain several samples of aluminum foil caps containing different models of blood collection tubes; wherein, the aluminum foil cap samples include aluminum foil caps without film removal, aluminum foil caps with failed film removal, and aluminum foil caps with successful film removal; An industrial camera is used to acquire sample images of the aluminum foil cap sample, and the sample images are processed using the preset machine vision algorithm to determine the second tube opening aluminum foil cap image corresponding to the aluminum foil cap sample, so as to obtain the model training set. The lightweight deep learning classification network model is trained using the model training set, and the learning rate of the lightweight deep learning classification network model is dynamically adjusted during the training process. After a preset number of iterations, the current optimal model parameters of the lightweight deep learning classification network model are determined using the current learning rate. Then, the model file of the lightweight deep learning classification network model is determined based on the optimal model parameters.
4. The method for identifying the status of the aluminum foil cap of a blood collection tube according to claim 1, characterized in that, The step of processing the original image using a preset machine vision algorithm to obtain the image of the aluminum foil cap at the first opening of the blood collection tube includes: The original image is color-converted to convert the corresponding RGB color image into a grayscale image; The grayscale image is subjected to spatial domain Gaussian filtering and / or median filtering, and then the filtered image is subjected to a first preset processing to obtain the first region of interest image of the blood collection tube; Based on the first region of interest image, the filtered image is cropped according to the preset height of the aluminum foil cap to obtain the aluminum foil cap region image of the blood collection tube opening; The image of the aluminum foil cap region is subjected to a second preset processing to obtain a second region of interest image of the aluminum foil cap; Based on the second region of interest image, the aluminum foil cap region image is cropped to obtain the first tube opening aluminum foil cap image of the blood collection tube.
5. The method for identifying the status of the aluminum foil cap of a blood collection tube according to claim 4, characterized in that, The first preset processing of the filtered image to obtain the first region of interest image of the blood collection tube includes: The filtered image is processed using a first edge detection algorithm based on a preset low threshold to obtain a binarized image of the blood collection tube's edge. The binarized image of the blood collection tube's edge is processed using a first contour extraction algorithm to obtain a first outer contour point set corresponding to the binarized image of the blood collection tube's edge. The minimum bounding rectangle of the first outer contour point set is determined to obtain the first region of interest image of the blood collection tube.
6. The method for identifying the status of the aluminum foil cap of a blood collection tube according to claim 4, characterized in that, The second preset processing of the image of the aluminum foil cap region to obtain the second region of interest image of the aluminum foil cap includes: The image of the aluminum foil cap region is processed using a second edge detection algorithm based on a preset high threshold to obtain a binarized image of the edge of the aluminum foil cap. The edge binarized image of the aluminum foil cap is processed using a second contour extraction algorithm to obtain a second outer contour point set corresponding to the edge binarized image of the aluminum foil cap. Determine the minimum bounding rectangle of the second outer contour point set to obtain the second region of interest image of the aluminum foil cap.
7. The method for identifying the status of the aluminum foil cap of a blood collection tube according to claim 1, characterized in that, The step of inputting the normalized image of the first tube opening aluminum foil cap into a pre-constructed lightweight deep learning classification network model, so as to determine the state of the aluminum foil cap of the blood collection tube using the recognition results output by the lightweight deep learning classification network model, includes: The normalized image of the first tube opening aluminum foil cap is input into a pre-constructed lightweight deep learning classification network model to determine the recognition result output by the lightweight deep learning classification network model. If the score of the recognition result is not less than the first preset threshold, then the first classification type corresponding to the current recognition result is determined as the aluminum foil cap state of the blood collection tube. If the score of the recognition result is less than the first preset threshold, and the number of recognitions of the lightweight deep learning classification network model is equal to the second preset threshold, then the corresponding second classification type is determined according to the recognition result corresponding to the highest score, and then the second classification type is determined as the aluminum foil cap state of the blood collection tube. If the score of the recognition result is less than the first preset threshold, and the number of recognitions by the lightweight deep learning classification network model is less than the second preset threshold, then the step of processing the original image using a preset machine vision algorithm to obtain the image of the first tube opening aluminum foil cap of the blood collection tube is re-executed.
8. The method for identifying the status of the aluminum foil cap of a blood collection tube according to any one of claims 1 to 7, characterized in that, Constructing the lightweight deep learning classification network model includes: The lightweight deep learning classification network model is constructed using the following network structure: The network structure includes an input part, a main branch part, a side branch part, and a classifier. The input part includes sequentially connected convolutional layers and max-pooling layers. The convolutional layers are processed by a preset activation function before being passed to the max-pooling layer. The main branch part is the backbone of the network structure, including a first group of convolutional layers, a second group of convolutional layers, and a third group of convolutional layers. These three groups are connected by the preset activation function. Each of the first, second, and third groups of convolutional layers contains several interconnected trunk convolutional layers and branch convolutional layers. The side branch part is a branch path extending from the input part and the main branch part of the network structure. The classifier includes a sequentially connected global pooling layer, a linear transformation layer, and a softmax layer. The basic parameters of each part of the network structure are set to obtain the lightweight deep learning classification network model.
9. A device for recognizing the status of the aluminum foil cap on a blood collection tube, characterized in that, include: The blood collection tube position monitoring module is used to monitor the position of the blood collection tube and to acquire the original image of the blood collection tube when the position of the blood collection tube reaches the target detection position. The machine vision algorithm processing module is used to process the original image using a preset machine vision algorithm to obtain an image of the aluminum foil cap at the first opening of the blood collection tube. The preset machine vision algorithm includes: performing color conversion and filtering on the original image, then sequentially using a first preset processing method to obtain a first region of interest (ROI) image of the blood collection tube, cropping the aluminum foil cap region image of the blood collection tube opening according to a preset aluminum foil cap height, then using a second preset processing method to obtain a second ROI image of the aluminum foil cap, and cropping the aluminum foil cap region image according to the second ROI image to obtain the first tube opening aluminum foil cap image; wherein, the first preset processing method sequentially includes: edge detection based on a preset low threshold, contour extraction, and determination of the minimum bounding rectangle; the second preset processing method sequentially includes: edge detection based on a preset high threshold, contour extraction, and determination of the minimum bounding rectangle; The model processing module is used to normalize the image of the first tube opening aluminum foil cap, and then input the normalized image of the first tube opening aluminum foil cap into a pre-constructed lightweight deep learning classification network model, so as to determine the state of the aluminum foil cap of the blood collection tube by using the recognition results output by the lightweight deep learning classification network model.
10. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the method for identifying the status of the aluminum foil cap of the blood collection tube as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein the computer program, when executed by a processor, implements the method for recognizing the status of the aluminum foil cap of a blood collection tube as described in any one of claims 1 to 8.