Blood card quality identification method and device, electronic equipment and storage medium

By using target detection models and image enhancement techniques, the problem of blood card quality recognition methods being dependent on image quality has been solved, enabling effective recognition of complex image morphologies and improving the accuracy and generalization of blood card quality recognition.

CN122067281APending Publication Date: 2026-05-19AIKANG MEDTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
AIKANG MEDTECH CO LTD
Filing Date
2026-01-13
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing blood card quality identification methods are easily affected by image quality, struggle to handle complex image shapes, have fixed interpretation rules, and poor generalization, resulting in low accuracy of quality identification results.

Method used

A target detection model is used to preprocess the blood card images. Through the feature learning mechanism of deep learning, the category and coordinate information of the gel micropillars are identified to generate blood card quality results. Image enhancement technology is combined to process images when barcode decoding fails, thereby improving the decoding success rate.

Benefits of technology

It effectively handles complex image shapes, improves the accuracy and generalization of blood card quality identification, and reduces the probability of invalid blood cards entering the detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122067281A_ABST
    Figure CN122067281A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a blood card quality identification method and device, electronic equipment and a storage medium. The method comprises the steps that a blood card image of a to-be-detected blood card is obtained, original pixel data of the blood card image are read, and the to-be-detected blood card comprises a plurality of gel microcolumns; preprocessing the original pixel data to obtain an image tensor; inputting the image tensor into a target detection model, calculating the image tensor by the target detection model, and outputting category information and coordinate information of each gel microcolumn; and generating a blood card quality result based on the category information and the coordinate information. The method can improve the accuracy of quality identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a blood card quality identification method, device, electronic device, and storage medium. Background Technology

[0002] Blood cards are mainly based on the principle of antigen-antibody reaction. Taking microcolumn gel cards as an example, known antibodies, such as anti-A, anti-B, and anti-D monoclonal antibodies, are added to the gel microcolumn. Then, the blood to be tested is added to the gel microcolumn, and the blood to be tested can be identified based on the reaction results.

[0003] Blood card quality identification involves analyzing the differences between the image of the blood card to be tested and the image of a normal blood card through image processing to determine the product quality of the blood card and ensure the validity of the blood card reaction.

[0004] However, current blood card quality identification methods are easily affected by image quality (such as image brightness and background, which have a significant impact on the interpretation results), have difficulty dealing with complex image shapes, have fixed interpretation rules, and have poor generalization ability, resulting in low accuracy of quality identification results. Summary of the Invention

[0005] The main objective of this application is to propose a blood card quality identification method, device, electronic device, and storage medium to improve the accuracy of blood card quality identification.

[0006] To achieve the above objectives, this application proposes a blood card quality identification method, comprising: Acquire the image of the blood card to be tested, and read the raw pixel data of the blood card image. The blood card to be tested includes multiple gel micropillars. The original pixel data is preprocessed to obtain the image tensor; The image tensor is input into the target detection model, which calculates the image tensor and outputs the category and coordinate information of each gel micropillar. Blood card quality results are generated based on category and coordinate information.

[0007] Optionally, in one embodiment, after reading the raw pixel data of the blood card image, the method further includes: Identify barcode image regions in raw pixel data; Decode the barcode image area; When decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered. When decoding fails, the system outputs a result indicating that the blood card is of abnormal quality.

[0008] Optionally, in one implementation, when decoding fails, the output of the identification result of abnormal blood card quality includes: When decoding fails, image enhancement is performed on the barcode image area to obtain an enhanced image, and the barcode information in the enhanced image is decoded a second time. When the second decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered; If the second decoding fails, the image enhancement image is subjected to extreme sharpening and extreme contrast adjustment to obtain an extreme enhancement image, and then the extreme enhancement image is decoded a third time. When the third decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered; If the third decoding fails, the system will output a result indicating that the blood card is of abnormal quality.

[0009] Optionally, in one embodiment, decoding the barcode image region includes: Binarize the barcode image region to obtain a binarized image; Decode the binarized image.

[0010] Optionally, in one implementation, the training process of the object detection model includes: Obtain the sample blood card image and the corresponding annotation box label; The sample blood card images are preprocessed to obtain the sample image tensor; Input the sample image tensor into the object detection model, the object detection model calculates the sample image tensor, and outputs the sample recognition result; The parameters of the target detection model are updated based on the difference between the sample recognition results and the bounding box labels.

[0011] Optionally, in one embodiment, the sample blood card image is preprocessed to obtain a sample image tensor, including: Data augmentation was performed on the sample blood card images to obtain multiple augmented sample blood card images; Each enhanced blood karyotype image is preprocessed to obtain the sample image tensor corresponding to each enhanced blood karyotype image.

[0012] Optionally, in one implementation, generating blood card quality results based on category information and coordinate information includes: The number of gel micropillars in the blood card to be tested is obtained, and the spacing between adjacent gel micropillars in the blood card image is determined based on the number of gel micropillars and the width of the blood card image. The gel micropillar number was determined based on the spacing and coordinate information; The category of gel micropillars is determined based on the category information; The quality identification result of each gel micropillar in the blood sac to be tested is determined based on the serial number and category of each gel micropillar.

[0013] This application also provides a blood card quality identification device, comprising: The acquisition unit is used to acquire the blood card image of the blood card to be tested and read the raw pixel data of the blood card image. The blood card to be tested includes multiple gel micropillars. The preprocessing unit is used to preprocess the raw pixel data to obtain the image tensor; The recognition unit is used to input the image tensor into the target detection model, which calculates the image tensor and outputs the category information and coordinate information of each gel micropillar. The generation unit is used to generate blood card quality results based on category information and coordinate information.

[0014] Another aspect of this application provides an electronic device, comprising: Memory, transceiver, processor, and bus system; The memory is used to store programs; The processor is used to execute programs in memory, including methods for performing the aspects mentioned above; Bus systems are used to connect memory and processor to enable communication between them.

[0015] Another aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described above.

[0016] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: This method uses an object detection model to identify the quality of preprocessed blood card images. Based on the feature learning mechanism of deep learning in the object detection model, it breaks through the limitations of traditional methods that rely on image quality and have rigid rules. It can effectively deal with complex image shapes and significantly improve the generalization of quality identification results, thereby improving the accuracy of blood card quality identification. Attached Figure Description

[0017] Figure 1 This is a system architecture diagram of the blood card quality identification method provided in the embodiments of this application; Figure 2 This is a flowchart illustrating the blood card quality identification method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the label box provided in the embodiments of this application; Figure 4 This is another flowchart illustrating the blood card quality identification method provided in this application embodiment; Figure 5 This is a schematic diagram of the blood card quality identification device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0019] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0020] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0021] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0022] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.

[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0024] System architecture and scenario description used in the embodiments of this application: Figure 1This is a system architecture diagram of the blood card quality identification method according to an embodiment of this application. It includes a terminal 140, an Internet 130, a gateway 120, a server 110, etc.

[0025] Terminal 140 includes various forms of devices with display screens, such as desktop computers, laptops, PDAs (personal digital assistants), mobile phones, in-vehicle terminals, home theater terminals, dedicated terminals, intelligent voice interaction devices, smart home appliances, or aircraft. Furthermore, it can be a single device or a collection of multiple devices. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data.

[0026] Server 110 refers to a computer system that can provide certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines).

[0027] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120.

[0028] The blood card quality identification method provided in this application embodiment can be implemented separately in terminal 140, separately in server 110, or partially in terminal 140 and partially in server 110.

[0029] When the blood card quality identification method provided in this application embodiment is implemented alone in terminal 140, terminal 140 acquires the blood card image corresponding to the blood card to be detected, the blood card to be detected includes a gel micropillar containing blood gel; terminal 140 decodes the barcode information in the blood card image; when decoding fails, terminal 140 performs image enhancement on the blood card image to obtain an enhanced image, and decodes the barcode information in the enhanced image; when decoding is successful, terminal 140 performs quality identification on the enhanced image based on the target detection model to obtain the quality identification result.

[0030] First, let's analyze some of the terms used in this application: Microcolumn gel chromatography is a detection method combining antigen-antibody specific reactions, gel molecular sieve filtration, and centrifugation techniques, primarily used for erythrocyte antigen-antibody detection. A microcolumn gel card typically consists of a plastic casing and multiple internal gel microcolumns. Each microcolumn is divided into a sample application chamber at the top and a gel separation column at the bottom. The gel separation column is composed of porous gel particles (such as dextran gel) and antibodies. When the antigen on the surface of erythrocytes binds to the corresponding antibody in the gel, the erythrocytes agglutinate; if there is no corresponding antigen on the surface of the erythrocytes, the antibody will not bind, and the erythrocytes remain in a free state. The principle utilizes the molecular sieve properties of the gel medium. Under centrifugal force, free erythrocytes can freely pass through the gel gaps, while agglutinated erythrocytes, due to their increased size, cannot pass through the gel gaps and are thus retained in the upper layer of the gel or dispersed within the gel. By observing the distribution of erythrocytes in the gel, it is possible to determine whether an antigen-antibody reaction has occurred.

[0031] Blood card quality recognition determines the quality of a blood card by analyzing the differences between the image of the blood card to be tested and that of a normal blood card, thus ensuring the validity of the blood card's detection. Existing blood card quality recognition algorithms use grayscale to locate bubbles, stains, or dried adhesive residue, or pre-defined areas, and calculate the differences between the image of that area and a normal image to determine if there are any quality issues. However, these algorithms struggle with image brightness and background variations, have limited ability to handle complex image shapes, rely on fixed interpretation rules, have poor generalization capabilities, and do not address the problem of damaged blood card barcodes.

[0032] In response, this application provides a blood card quality identification method, which can solve the above-mentioned problems.

[0033] The blood card quality identification method provided in the embodiments of this application will be described below with reference to the accompanying drawings. The execution subject of the blood card quality identification method described below is a terminal device, which can be implemented by the terminal device by running the various computer programs mentioned above. Of course, based on the understanding of the following text, it is not difficult to see that the blood card quality identification method provided in the embodiments of this application can also be implemented by the terminal device and the server in collaboration.

[0034] Please see Figure 2 ,like Figure 2 The diagram shown is a flowchart of a blood card quality identification method provided in this embodiment. The method includes: Step 201: Obtain the blood card image of the blood card to be tested, and read the original pixel data of the blood card image. The blood card to be tested includes multiple gel micropillars.

[0035] The blood test card can be a standardized carrier specifically designed for blood-related tests such as blood typing, antibody screening, and crossmatching. It includes gel microcolumns containing gel. Depending on the testing requirements or the number of subjects being tested, the number of gel microcolumns in the blood test card is typically designed to be 6-12. The microcolumns are pre-filled with specific gels such as dextran gel. After the blood sample is added, it agglutinates based on the antigen-antibody reaction principle. After centrifugation, different morphologies such as a precipitate layer and a separation layer are formed within the gel microcolumn. These states directly determine the test results. The presence of impurities in the gel distribution within the microcolumn, and other aspects of product quality, directly affect the antigen-antibody reaction and the distribution of red blood cells after centrifugation, ultimately influencing the interpretation of the results.

[0036] A blood card image is a visualized digital image generated after the blood card to be tested is captured by an image acquisition device, and the content presented covers all the gel micropillars on the blood card.

[0037] Raw pixel data can be extracted from the acquired blood card image as unprocessed pixel matrix information, i.e., two-dimensional matrix data with pixels as the basic unit. For grayscale images, each element in this matrix corresponds to the grayscale value of a pixel in the image (usually an integer from 0 to 255, where 0 represents pure black and 255 represents pure white); for color images, it is stored in RGB three-channel format, with each pixel containing the brightness values ​​of the red, green, and blue channels, which together represent the color information of the blood card surface.

[0038] In one embodiment, after reading the raw pixel data of the blood card image, the method further includes: Identify barcode image regions in raw pixel data; Decode the barcode image area; When decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered. When decoding fails, the system outputs a result indicating that the blood card is of abnormal quality.

[0039] In this embodiment, the barcode image area refers to a specific pixel matrix area from the original pixel data used to carry the blood card identification barcode. Specifically, it is the original pixel data within a fixed coordinate range pre-defined according to the standardized design specifications of the blood card. The barcode image area can include a one-dimensional barcode (such as Code128, EAN-13) or a two-dimensional barcode (such as QR Code), serving as the identification of the blood card to be tested. It can be associated with basic patient information (such as name, gender, and age), details of testing items (such as ABO blood typing, RhD blood typing screening, irregular antibody testing, etc.), blood card production batch, expiration date, and testing institution code.

[0040] Decoding refers to extracting and parsing the barcode information from a barcode image area using specialized algorithms or tools. Depending on the barcode type (1D or 2D), a suitable decoding algorithm is selected to parse the raw encoded data extracted from the barcode image area, converting it into human-readable and system-recognizable structured information. The success rate of decoding is affected by multiple factors. For example, if the barcode has problems such as blurry printing, wear, tear, or stains, it will directly lead to physical loss of encoded information, making decoding impossible. When decoding fails, the blood card to be tested can be directly determined to have abnormal quality, and an identification result indicating abnormal blood card quality can be output, without needing to perform quality identification on the gel micropillars. Only when decoding is successful are the various steps of quality identification for the gel micropillars executed.

[0041] By attempting decoding before performing quality identification on the gel micropillars, the problem of passing quality identification of the gel micropillars in the blood card but failing to identify the blood card information, thus preventing the instrument from performing fully automated testing, can be avoided, thereby improving the accuracy of quality identification.

[0042] In one implementation, when decoding fails, the output of the blood card quality abnormality identification result includes: When decoding fails, image enhancement is performed on the barcode image area to obtain an enhanced image, and the barcode information in the enhanced image is decoded a second time. When the second decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered; If the second decoding fails, the image enhancement image is subjected to extreme sharpening and extreme contrast adjustment to obtain an extreme enhancement image, and then the extreme enhancement image is decoded a third time. When the third decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered; If the third decoding fails, the system will output a result indicating that the blood card is of abnormal quality.

[0043] In this implementation, image enhancement refers to the process of optimizing image quality and highlighting target features through a series of digital processing techniques to address defects in the blood card image that affect barcode recognition (such as uneven lighting, blurring, noise, distortion, etc.), thereby improving the success rate of subsequent decoding. This can repair image interference and enhance the recognizability of the barcode without destroying the original valid information. Here, image enhancement is performed on the blood card image when decoding fails; the enhanced blood card image can be called the image-enhanced image.

[0044] When the initial decoding of the barcode image area fails, the system does not directly output a result indicating abnormal blood card quality. Instead, it performs multiple rounds of image optimization and decoding attempts to salvage barcode failures caused by minor interference such as barcode damage or uneven lighting, ensuring accurate screening of invalid blood cards. Specifically, after the initial decoding failure, the system first performs targeted image enhancement operations on the original barcode image area. This improves the contrast and clarity of the barcode bar and space areas, uses an adaptive histogram equalization algorithm to optimize the brightness distribution of the barcode area, eliminates the effects of local over-brightness or under-brightness, and simultaneously applies mild Gaussian sharpening to enhance the edge features of the barcode bar and space. After processing, an enhanced image is obtained. The barcode decoding algorithm is then called to perform a second decoding of the barcode information in the enhanced image. If the second decoding is successful, it is determined that the minor interference of the barcode has been eliminated, and the system automatically triggers subsequent preprocessing steps. If the second decoding still fails, it can be assumed that the interference in the barcode area is severe. In this case, extreme enhancement processing is performed on the enhanced image, such as extreme sharpening and extreme contrast adjustment. The process involves several steps: extreme sharpening enhances the edge differences between barcode bars and spaces by increasing the weight parameters of the sharpening convolution kernel; extreme contrast adjustment maximizes the grayscale difference between barcode bars and spaces by stretching the dynamic range of pixel values, resulting in an extremely enhanced image. This enhanced image is then subjected to a third decoding step. If the third decoding succeeds, the system triggers a preprocessing step. Only when the third decoding fails does the system ultimately determine that the blood card's barcode has an unrepairable quality defect, at which point it outputs the blood card quality anomaly identification result. This identification result clearly records the conclusion that the barcode failed to decode three times, and simultaneously marks the coordinates of the barcode image area and the reason for each decoding failure, forming a complete anomaly determination report.

[0045] The tiered retry mechanism avoids misjudgments caused by minor interference, and the progressive enhancement strategy ensures the rigor of barcode verification, reducing the probability of invalid blood cards entering subsequent testing processes.

[0046] In one example, image enhancement can include feature enhancement and / or visual enhancement. Feature enhancement can strengthen the identifiable features of the barcode (such as bar / grid edges, contrast, and integrity) through technical means, while suppressing interference information such as noise and dirt, providing a clearer and more easily identifiable feature basis for the barcode decoding algorithm and directly improving the decoding success rate. For example, for the case of blurry barcodes, sharpening processes such as Laplacian operators and Sobel operators can be used to enhance the clarity of edge contours and make the encoded structure sharper and more distinguishable; for the problem of insufficient contrast between the barcode and the background, histogram equalization or adaptive contrast enhancement algorithms can be used to stretch the pixel brightness range, making the difference in brightness between black bars (or black grids) and white bars (or white grids) more significant; if there is noise, dirt, or other interference in the image, denoising operations such as median filtering and Gaussian filtering can be used to filter out irrelevant pixel interference, while threshold segmentation technology can be used to separate the barcode body from the background, highlighting the integrity of the encoded area and preventing interfering pixels from obscuring barcode details.

[0047] Visual enhancement can improve the overall visual effect of blood card images, such as adjusting contrast, brightness, and sharpness, and using filter enhancements to optimize image quality, making barcodes or QR codes clearer and more legible. For example, if a blood card image has local shadows or reflections due to uneven lighting during shooting, or if there is redundant interference from a colored background, the image can be converted to grayscale to remove irrelevant color information; then the overall brightness can be adjusted to balance the brightness difference between the barcode area and the background, avoiding the barcode being too dark in shadows and too bright in reflective areas; and the global contrast can be enhanced to make the boundary between the barcode and the background clearer, reducing the interference of lighting and color on recognition at the source.

[0048] Feature enhancement and visual enhancement are two image enhancement methods that can be used individually or in combination. In essence, if one enhancement method succeeds, only that method can be used; if decoding fails, both methods can be combined before attempting decoding again. This eliminates the need for preset fixed enhancement modes; the enhancement can be dynamically adjusted based on image defects, improving the overall decoding process's adaptability to different acquisition conditions and defect types. This ensures high decoding success rates while maintaining efficiency and reducing distortion risks.

[0049] In one embodiment, decoding a barcode image region includes: Binarize the barcode image region to obtain a binarized image; Decode the binarized image.

[0050] In this implementation, binarization can transform the original color or grayscale barcode image area into an image containing only black and white pixels. By enhancing the contrast between the barcode and the background, interference from lighting, color, and noise is eliminated, providing a clear and identifiable target image, which can be called a binarized image. If the blood card image has uniform overall lighting and a significant difference in brightness between the barcode and the background, global threshold binarization can be used, i.e., a fixed threshold is directly set to quickly complete the image conversion. Binarization provides a clear and interference-free image foundation for decoding. Decoding based on the binarized image can significantly reduce the difficulty of barcode detail recognition in the decoding algorithm and improve the accuracy of barcode information extraction.

[0051] Step 202: Preprocess the original pixel data to obtain the image tensor.

[0052] Raw pixel data, as an unprocessed two-dimensional or three-dimensional numerical matrix, carries key feature information such as the position, shape, and grayscale distribution of gel micropillars. On the other hand, it is also mixed with interference information such as uneven illumination, equipment noise, bubble artifacts, and background noise introduced during image acquisition. Moreover, its data format and size specifications are often inconsistent, making it impossible to directly input into the target detection model for calculation. Therefore, it is necessary to optimize and standardize the data through systematic preprocessing operations.

[0053] Preprocessing can include resizing, format conversion, and normalization. The preprocessed raw pixel data can be converted into image tensors in the form of data matrices. Resizing scales all raw pixel data from blood stencil images to the preset input size of the target detection model. Format conversion converts the integer values ​​of the raw pixel data (usually 8-bit grayscale values ​​or RGB three-channel values ​​from 0-255) into floating-point data to avoid integer overflow during subsequent numerical calculations. Normalization maps pixel values ​​to the numerical range adapted to the model, thereby eliminating lighting differences under different acquisition scenarios and ensuring consistency in data distribution between the training and inference phases. Preprocessing can also include tensor transformation and batch dimension addition. Tensor transformation adjusts the data dimension order according to the target detection model used, that is, matching the raw pixel data to the tensor input format of the model. Batch dimension addition adds batch dimensions by expanding the dimensions, such as converting the tensor dimension to a four-dimensional format of "1-number of channels-height-width," ensuring that the data can be directly input into the target detection model for calculation.

[0054] Step 203: Input the image tensor into the target detection model. The target detection model calculates the image tensor and outputs the category information and coordinate information of each gel micropillar.

[0055] Object detection models can extract deep features from images to identify objects that meet predefined target definitions. They can determine the target category and output the target's location information within the image. They can focus on key targets of interest, directly capturing the target's core features and spatial location, and ultimately output detection results containing the target region and its corresponding category. In this example, the object detection model performs convolution operations on the image tensor to capture basic visual features such as the edges, texture, and color distribution of the gel micropillars. Then, it fuses and reduces the dimensionality of the shallow features to generate high-dimensional semantic features that characterize the essential properties of the gel micropillars.

[0056] Based on prior knowledge of the size and shape of the gel micropillars learned during training, the model outputs the coordinate information of each gel micropillar in the image tensor to mark the specific location of the micropillar in the blood stenography image. The category determination is based on high-dimensional semantic features and classifies each located gel micropillar into categories through a classification algorithm, outputting the corresponding category information. This category information can be set to different category labels such as "qualified / unqualified" and "normal / bubble / dry glue" according to actual detection needs.

[0057] In one implementation, the training process of the object detection model includes: Obtain the sample blood card image and the corresponding annotation box label; The sample blood card images are preprocessed to obtain the sample image tensor; Input the sample image tensor into the object detection model, the object detection model calculates the sample image tensor, and outputs the sample recognition result; The parameters of the target detection model are updated based on the difference between the sample recognition results and the bounding box labels.

[0058] In this embodiment, the sample blood card images can be blood card images covering diverse shooting scenarios, including images of different types of blood cards (blood typing cards, antibody screening cards, etc.), different quality states (normal, air bubbles, dry glue, foreign matter, low liquid, etc.), and different acquisition conditions (different lighting, different shooting angles, and different equipment acquisition), to ensure the diversity and representativeness of the samples and avoid model overfitting.

[0059] The annotation boxes can be manually annotated or manually reviewed. The rectangular annotation boxes clearly define the coordinate boundaries of each gel micropillar in the image, ensuring that the model can accurately locate the target area. For each gel micropillar within the annotation box, its corresponding quality category is labeled, forming structured annotation data that combines position coordinates with quality labels.

[0060] Preprocessed blood sac images can be converted into sample image tensors in the form of data matrices. Quality identification of the sample image tensors in the training set is then performed based on a selected target detection model. This involves first extracting features from the input sample image tensors, then capturing shallow and deep features of the image layer by layer using a convolutional neural network. Candidate regions for the gel micropillars in the image are generated and their locations predicted. The coordinate boxes of each candidate region are output, and a classification head is used to determine the quality status of each candidate region, resulting in sample identification results containing predicted gel micropillar locations and quality labels.

[0061] Based on the difference between the sample recognition result and the bounding box label, a loss value can be calculated. The loss function can include positional loss and classification loss. The positional loss measures the deviation between the model's predicted coordinates of the gel micropillars and the labeled coordinates, while the classification loss measures the difference between the model's predicted quality label and the true label, directly reflecting the model's current recognition error. Subsequently, the loss value can be backpropagated from the model's output layer to the input layer layer by layer using the backpropagation algorithm. Based on the gradient direction of the loss value, the weights, biases, and other parameters of each layer of the network are adjusted to reduce the model's prediction error.

[0062] Through repeated iterations with a large number of diverse samples, the model gradually masters the localization and quality identification of gel micropillars, thereby improving the accuracy of quality identification.

[0063] In one example, the blood sac image should show the entire reaction area, avoiding glare, blurring, and severe occlusion, and should contain various anomalous information, including air bubbles, dried glue, foreign matter, and low fluid levels. Various imaging devices and lighting conditions can be used during the collection process. The corresponding label box for this blood sac image can be found in [reference needed]. Figure 3 As shown, for each gel micropillar region in the blood card, a rectangle can be used to enclose the target feature region. The label corresponding to the rectangle can be the label of the data using labelme. The label categories can include normal (0) and abnormal (1).

[0064] In one embodiment, the sample blood card image is preprocessed to obtain a sample image tensor, including: Data augmentation was performed on the sample blood card images to obtain multiple augmented sample blood card images; Each enhanced blood karyotype image is preprocessed to obtain the sample image tensor corresponding to each enhanced blood karyotype image.

[0065] In this implementation, data augmentation is used to expand sample diversity, and standardized preprocessing is combined to generate tensor data suitable for model training, thereby improving the model's generalization ability to complex blood karn image scenarios.

[0066] Specifically, before performing routine preprocessing on the sample blood card images, data augmentation is first applied to the original images. By simulating various interference scenarios that may occur during actual blood card image acquisition, multiple augmented sample blood card images with differentiated features are generated. A single original sample blood card image can generate multiple augmented sample blood card images, significantly expanding the quantity and diversity of training samples. This allows the model to learn more robust micro-pillar features during training, effectively resisting interference from factors such as lighting, angle, and noise in actual detection scenarios. After data augmentation, the system can perform a standardized preprocessing procedure on each generated augmented sample blood card image, identical to that used in the inference stage. The augmented sample blood card images constitute the model training dataset, ensuring that the model is exposed to rich image feature scenarios during training, thereby achieving accurate recognition of blood card images in different states during the subsequent inference stage.

[0067] Step 204: Generate blood card quality results based on category information and coordinate information.

[0068] The system individually classifies the category information of each gel micropillar output by the target detection model into two main categories: "normal" and "abnormal." The abnormal category can be further refined according to detection needs into specific types such as air bubble interference, uneven gel distribution, dry gel, impurity contamination, and micropillar damage. The classification results are then used to determine the category of all micropillars. Furthermore, a pre-set quality rule library can be used to perform an overall quality rating of the blood sac. It is understandable that when an abnormal gel micropillar is identified in the blood sac to be tested, the blood sac quality results can also indicate the corresponding abnormal gel micropillar based on coordinate information.

[0069] In one implementation, generating blood card quality results based on category information and coordinate information includes: The number of gel micropillars in the blood card to be tested is obtained, and the spacing between adjacent gel micropillars in the blood card image is determined based on the number of gel micropillars and the width of the blood card image. The gel micropillar number was determined based on the spacing and coordinate information; The category of gel micropillars is determined based on the category information; The quality identification result of each gel micropillar in the blood sac to be tested is determined based on the serial number and category of each gel micropillar.

[0070] In this embodiment, the number of gel micropillars can refer to the total number of independent slots on the blood sac used to carry the blood sac detection reaction. The spacing between adjacent gel micropillars in the blood sac can then be determined based on the width of the blood sac image and the number of gel micropillars. For example, dividing the total pixel width of the blood sac image (denoted as W) by the number of gel micropillars (denoted as N) yields the spacing between the center positions of adjacent gel micropillars (denoted as N). In this blood test card, the gel micropiles are ordered, with different numbered micropiles corresponding to different category labels. Each category label corresponds to a pre-defined test item. The test items on the same blood test card can be different or the same. When the test items are the same, different samples are added to different micropiles. The number can be a numerical indication of the category label or a direct category label. For example, in the ABO blood typing and Rh blood typing test card, the 8 micropiles correspond to different test items, and the category labels are A, B, Ctl, D, N (self), Ac, Bc, and N (oc). In the anti-human globulin antigen test card (8-micropile blood test card), the 8 micropiles correspond to the same test item. During the experiment, different samples are added, and the category labels can be recorded as anti-human 1, anti-human 2, anti-human 3, anti-human 4, anti-human 5, anti-human 6, anti-human 7, and anti-human 8. Based on the relationship between the coordinate position and the spacing output by the image processing model, the index corresponding to that coordinate position can be calculated. For example, if the coordinate position is X and the spacing is w, then the index corresponding to that coordinate position is the rounded-up number. This method is used to obtain the gel microcolumn serial number corresponding to the category information at the coordinate position.

[0071] The model outputs category information that can be purely numerical computer codes, with each code corresponding to a gel microcolumn category. For example, the category information could be "0, 1, 2," and the corresponding gel microcolumn categories could be "normal," "dry gel," or "bubble." The system calls a pre-defined category coding mapping table to convert the numerical category information output by the model into gel microcolumn categories with clear physical meanings. For example, "0" corresponds to "normal," "1" to "dry gel," and "2" to "bubble." Subsequently, the system can output the instruction recognition result for the blood card to be tested. For example, it can generate a quality status list for each microcolumn according to its serial number, presenting the quality status of each microcolumn, such as "1st microcolumn normal; 2nd microcolumn dry gel; 3rd microcolumn bubble," etc. Alternatively, it can first traverse all gel categories, and if at least one abnormal state is identified in the category information, it can directly generate a quality abnormality judgment conclusion and label the serial number and specific problem type of all abnormal microcolumns, such as "abnormality is dry gel in column X; bubble in column Y," etc.

[0072] Each gel micropillar can be quickly identified and divided using a preset algorithm, eliminating the need for manual selection of gel micropillars in each image. This enables continuous and uninterrupted image segmentation, shortening the overall detection process time.

[0073] In one example, a flowchart illustrating another method for blood card quality identification can be found here. Figure 4 As shown, step 401, acquiring the blood card image of the blood card to be tested, can be done by using a high-definition industrial camera in a standard environment with uniform lighting and vertical orientation to obtain a clear original image of an unused blood card. Step 402: Detect whether the barcode in the blood card image has been successfully decoded, i.e., to identify the identity information of the blood card to be detected. Preprocessing can be done on the image, such as grayscale conversion and brightness adjustment, to highlight the barcode features, and then the decoding library is called to parse the encoded data. Visual enhancement and feature enhancement can be performed on the blood card image to optimize image quality before decoding. If decoding is successful, proceed to step 403; if decoding fails (e.g., damaged barcode, invalid data), proceed to step 406. Step 403: Input the blood card image into the target detection model to obtain the recognition result corresponding to each gel micropillar region; Step 404: Determine if there are any abnormalities in the identification results of each microcolumn gel column; otherwise, proceed to step 405; otherwise, proceed to step 406. Step 405: Confirm that the blood card to be tested is of normal quality; Step 406: Determine if the blood card to be tested is of abnormal quality.

[0074] The method provided in this application includes: acquiring a blood card image of a blood card to be tested; reading the original pixel data of the blood card image; the blood card to be tested includes multiple gel micropillars; preprocessing the original pixel data to obtain an image tensor; inputting the image tensor into a target detection model; the target detection model calculates the image tensor and outputs the category information and coordinate information of each gel micropillar; and generating a blood card quality result based on the category information and coordinate information.

[0075] This method uses an object detection model to identify the quality of preprocessed blood card images. Based on the feature learning mechanism of deep learning in the object detection model, it breaks through the limitations of traditional methods that rely on image quality and have rigid rules. It can effectively deal with complex image shapes and significantly improve the generalization of quality identification results, thereby improving the accuracy of blood card quality identification.

[0076] The above describes the blood card quality identification method; the following describes the device that performs this method.

[0077] Please see Figure 5 ,like Figure 5 The diagram shown is a structural schematic of a blood card quality identification device proposed in this application. The device 500 includes: The acquisition unit 501 is used to acquire the blood card image of the blood card to be tested and read the original pixel data of the blood card image. The blood card to be tested includes multiple gel micropillars. Preprocessing unit 502 is used to preprocess the original pixel data to obtain an image tensor; The recognition unit 503 is used to input the image tensor into the target detection model, and the target detection model calculates the image tensor and outputs the category information and coordinate information of each gel micropillar. The generation unit 504 is used to generate blood card quality results based on category information and coordinate information.

[0078] Optionally, in one embodiment, the acquisition unit 501 is further configured to: Identify barcode image regions in raw pixel data; Decode the barcode image area; When decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered. When decoding fails, the system outputs a result indicating that the blood card is of abnormal quality.

[0079] Optionally, in one embodiment, the acquisition unit 501 is specifically used for: When decoding fails, image enhancement is performed on the barcode image area to obtain an enhanced image, and the barcode information in the enhanced image is decoded a second time. When the second decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered; If the second decoding fails, the image enhancement image is subjected to extreme sharpening and extreme contrast adjustment to obtain an extreme enhancement image, and then the extreme enhancement image is decoded a third time. When the third decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered; If the third decoding fails, the system will output a result indicating that the blood card is of abnormal quality.

[0080] Optionally, in one embodiment, the acquisition unit 501 is specifically used for: Binarize the barcode image region to obtain a binarized image; Decode the binarized image.

[0081] Optionally, in one embodiment, the identification unit 503 is further configured to: Obtain the sample blood card image and the corresponding annotation box label; The sample blood card images are preprocessed to obtain the sample image tensor; Input the sample image tensor into the object detection model, the object detection model calculates the sample image tensor, and outputs the sample recognition result; The parameters of the target detection model are updated based on the difference between the sample recognition results and the bounding box labels.

[0082] Optionally, in one embodiment, the identification unit 503 is further configured to: Data augmentation was performed on the sample blood card images to obtain multiple augmented sample blood card images; Each enhanced blood karyotype image is preprocessed to obtain the sample image tensor corresponding to each enhanced blood karyotype image.

[0083] Optionally, in one embodiment, the generation unit 504 is specifically used for: The number of gel micropillars in the blood card to be tested is obtained, and the spacing between adjacent gel micropillars in the blood card image is determined based on the number of gel micropillars and the width of the blood card image. The gel micropillar number was determined based on the spacing and coordinate information; The category of gel micropillars is determined based on the category information; The quality identification result of each gel micropillar in the blood sac to be tested is determined based on the serial number and category of each gel micropillar.

[0084] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described blood card quality identification method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0085] Please see Figure 6 , Figure 6 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 601 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 602 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 602 and is called and executed by the processor 601 using the blood card quality identification method of the embodiments of this application. The input / output interface 603 is used to implement information input and output; The communication interface 604 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 605 transmits information between various components of the device (e.g., processor 601, memory 602, input / output interface 603, and communication interface 604); The processor 601, memory 602, input / output interface 603, and communication interface 604 are connected to each other within the device via bus 605.

[0086] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described blood card quality identification method.

[0087] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0088] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0089] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0090] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0091] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0092] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0093] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0095] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0097] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0098] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for identifying blood card quality, characterized in that, include: Acquire an image of the blood card to be tested, and read the raw pixel data of the blood card image. The blood card to be tested includes multiple gel micropillars. The original pixel data is preprocessed to obtain the image tensor; The image tensor is input into the target detection model, which calculates the image tensor and outputs the category information and coordinate information of each gel micropillar. Blood card quality results are generated based on the category information and the coordinate information.

2. The method according to claim 1, characterized in that, After reading the raw pixel data of the blood card image, the process further includes: Identify the barcode image region in the raw pixel data; Decode the barcode image area; When decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered. When decoding fails, the system outputs a result indicating that the blood card is of abnormal quality.

3. The method according to claim 2, characterized in that, When decoding fails, the output of the blood card quality abnormality identification result includes: When decoding fails, image enhancement is performed on the barcode image area to obtain an enhanced image, and the scan code information in the enhanced image is decoded a second time. When the second decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered; If the second decoding fails, the image enhancement image is subjected to extreme sharpening and extreme contrast adjustment to obtain an extreme enhancement image, and then the extreme enhancement image is decoded a third time. When the third decoding is successful, the step of preprocessing the original pixel data to obtain the image tensor is triggered. If the third decoding fails, the system will output a result indicating that the blood card is of abnormal quality.

4. The method according to claim 2, characterized in that, Decoding the barcode image region includes: The barcode image region is binarized to obtain a binarized image; The binarized image is decoded.

5. The method according to claim 1, characterized in that, The training process of the target detection model includes: Obtain the sample blood card image and the corresponding annotation box label; The sample blood card image is preprocessed to obtain the sample image tensor; The sample image tensor is input into the target detection model, the target detection model calculates the sample image tensor, and outputs the sample recognition result; The parameters of the target detection model are updated based on the difference between the sample recognition result and the bounding box label.

6. The method according to claim 5, wherein preprocessing the sample blood card image to obtain a sample image tensor includes: Data augmentation is performed on the sample blood card images to obtain multiple augmented sample blood card images; Each of the enhanced sample blood card images is preprocessed to obtain the sample image tensor corresponding to each enhanced sample blood card image.

7. The method according to claim 1, characterized in that, The process of generating blood card quality results based on the category information and the coordinate information includes: The number of gel micropillars in the blood card to be tested is obtained, and the spacing between adjacent gel micropillars in the blood card image is determined based on the number of gel micropillars and the width of the blood card image. The sequence number of the gel micropillar is determined based on the spacing and the coordinate information; The category of gel micropillars is determined based on the category information; The quality identification result of each gel micropillar in the blood sac to be tested is determined based on the serial number and category of each gel micropillar.

8. A blood card quality identification device, characterized in that, include: The acquisition unit is used to acquire the blood card image of the blood card to be tested and read the original pixel data of the blood card image. The blood card to be tested includes multiple gel micropillars. The preprocessing unit is used to preprocess the original pixel data to obtain an image tensor; The recognition unit is used to input the image tensor into the target detection model, the target detection model calculates the image tensor, and outputs the category information and coordinate information of each gel micropillar; The generation unit is used to generate blood card quality results based on the category information and the coordinate information.

9. An electronic device, characterized in that, include: Memory, transceiver, processor, and bus system; The memory is used to store programs; The processor is configured to execute a program in the memory, including performing the method as described in any one of claims 1 to 7; The bus system is used to connect the memory and the processor to enable communication between the memory and the processor.

10. A computer-readable storage medium, characterized in that, Includes instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1 to 7.