Coronavirus antigen detection result discrimination method and device, equipment, storage medium
By acquiring and verifying image quality on the user interface, cropping the antigen card area, performing affine transformation and window detection, and using the YOLO network for classification, the problems of interpretation errors and low efficiency in COVID-19 antigen detection are solved, and rapid and accurate interpretation of test results is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU WONDFO BIOTECH
- Filing Date
- 2022-10-28
- Publication Date
- 2026-06-30
AI Technical Summary
Existing COVID-19 antigen testing methods suffer from problems such as interpretation errors, low efficiency of manual statistical analysis, large data volume leading to missed detections, and the risk of infection among personnel. Furthermore, different shooting habits of test subjects result in unstable image quality, affecting the accuracy of interpretation.
By acquiring detection images through the user interface, verifying image quality, cropping antigen card regions, performing affine transformation and window detection, and using the YOLO network for classification, the accuracy of interpretation is improved by combining deep learning and traditional algorithms.
It enables rapid and accurate interpretation of test results, reduces false positives and false negatives, improves testing efficiency, reduces the risk of infection, and supports large-scale screening of at-risk populations.
Smart Images

Figure CN115620067B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, specifically relating to a method, device, equipment, and storage medium for judging the results of COVID-19 antigen detection. Background Technology
[0002] Compared to the cumbersome nucleic acid testing method, antigen testing significantly shortens the turnaround time, providing results in just a few minutes. It also eliminates the need for laboratory facilities, allowing for direct distribution to at-risk individuals and enabling self-testing anytime, anywhere. Antigen testing is more flexible and practical in addressing large-scale screening of at-risk populations and reducing strain on healthcare systems.
[0003] The typical procedure for antigen testing is as follows: epidemic prevention and control personnel distribute antigen cards to at-risk individuals, and report the test results after testing. However, this procedure has several problems: 1. Different test takers may interpret the results differently, leading to misinterpretations; 2. Manually collecting and summarizing results is time-consuming and increases the risk of infection from contact with infected individuals; 3. The large volume of data makes it easy to miss tests, and manual statistical analysis is inefficient.
[0004] Existing technologies propose solutions that rely on IoT technology and artificial intelligence (AI) algorithms to interpret antigen detection results and upload them. These solutions can improve the statistical efficiency of antigen detection results, reduce the statistical time cycle, and complete the statistical work quickly.
[0005] However, in practice, it has been found that due to the different shooting habits of the test subjects, the image quality cannot be guaranteed. It may be affected by various factors such as ambient lighting, shooting angle and the pixel of the acquisition device, which may cause the uploaded images to be blurry, noisy, geometrically distorted and other distortions. Therefore, the accuracy of interpretation is still relatively low. Summary of the Invention
[0006] The purpose of this invention is to provide a method, device, equipment, and storage medium for judging the results of COVID-19 antigen tests, which can quickly interpret the test results and improve the accuracy of the interpretation.
[0007] The first aspect of this invention discloses a method for judging the results of COVID-19 antigen testing, comprising:
[0008] Based on the shooting command input by the user on the user operation interface, the camera device is invoked to acquire the detection image;
[0009] When the detected image passes the verification, the position and angle information of the antigen card are determined from the detected image;
[0010] Based on the location information and the angle information, the antigen card area is cropped from the detection image;
[0011] Based on the location information and the angle information, an affine transformation is performed on the antigen card region to obtain a corrected scaled image;
[0012] The YOLO network is used to perform window detection on the corrected scaled image to obtain the window region;
[0013] The YOLO network is used to classify the view area and obtain a classification score;
[0014] If the classification score is greater than the first threshold, the first classification category corresponding to the classification score is determined as the discrimination result.
[0015] The discrimination result is mapped to an interval to obtain the final classification result of the detected image, wherein the final classification result includes positive or negative.
[0016] A second aspect of this invention discloses a COVID-19 antigen detection result discrimination device, comprising:
[0017] The shooting unit is used to call the camera device to acquire detection images according to the shooting command input by the user on the user operation interface;
[0018] The first detection unit is used to determine the position and angle information of the antigen card from the detection image when the detection image passes the verification.
[0019] The cropping unit is used to crop the antigen card region from the detection image based on the position information and the angle information;
[0020] The correction unit is used to perform affine transformation processing on the antigen card area according to the position information and the angle information to obtain a corrected scaled image;
[0021] The second detection unit is used to perform window detection on the corrected scaled image using a YOLO network to obtain a window region; and to classify the window region to obtain a classification score.
[0022] The first classification unit is used to determine the first classification category corresponding to the classification score as the discrimination result when the classification score is greater than the first threshold.
[0023] A mapping unit is used to perform interval mapping on the discrimination result to obtain the final classification result of the detected image, wherein the final classification result includes positive or negative.
[0024] A third aspect of the present invention discloses an electronic device, including a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the COVID-19 antigen detection result discrimination method disclosed in the first aspect.
[0025] The fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the COVID-19 antigen detection result discrimination method disclosed in the first aspect.
[0026] The beneficial effects of this invention are that the provided method, apparatus, device, and storage medium for judging COVID-19 antigen test results, by calling the camera device to acquire test images and perform image recognition to complete the antigen test result acquisition according to the shooting command input by the user on the user operation interface, can quickly interpret the test results. At the same time, by performing a qualification verification on the test image, the antigen card area is further detected only after the verification is qualified, and a corrected scaled image is obtained after performing an affine transformation on the antigen card area before window detection is performed. Finally, the detected window areas are classified, which can avoid the impact of capturing unqualified images on subsequent recognition results, reduce the probability of false detection, realize a detection process from coarse to fine, and improve the accuracy of interpretation. Attached Figure Description
[0027] The accompanying drawings illustrate specific examples of the technical solutions described in this invention and, together with the detailed embodiments, form part of the specification, serving to explain the technical solutions, principles, and effects of this invention.
[0028] Unless otherwise specified or defined, the same reference numerals in different figures represent the same or similar technical features, and different reference numerals may be used to represent the same or similar technical features.
[0029] Figure 1 This is a flowchart of a method for judging the results of COVID-19 antigen detection disclosed in this invention;
[0030] Figure 2 This is a schematic diagram of a prediction frame for an antigen card detection process disclosed in this invention;
[0031] Figure 3 This is a schematic diagram of the structure of a COVID-19 antigen detection result discrimination device disclosed in this invention;
[0032] Figure 4 This is a schematic diagram of the structure of an electronic device disclosed in this invention.
[0033] Explanation of reference numerals in the attached figures:
[0034] 301. Imaging unit; 302. First detection unit; 303. Cropping unit; 304. Correction unit; 305. Second detection unit; 306. First classification unit; 307. Mapping unit; 308. Second classification unit; 309. Third classification unit; 401. Memory; 402. Processor. Detailed Implementation
[0035] To facilitate understanding of the present invention, specific embodiments of the present invention will be described in more detail below with reference to the accompanying drawings.
[0036] Unless otherwise specified or defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. When combined with the technical solutions of the invention in a real-world scenario, all technical and scientific terms used herein may also have meanings corresponding to the purpose of achieving the technical solutions of the invention. The terms "first," "second," etc., used herein are merely for distinguishing names and do not represent a specific number or order. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0037] Unless otherwise specified or defined, the terms “described” or “the” as used herein refer to the technical features or technical content mentioned or described above, which may be the same as or similar to the technical features or technical content mentioned above.
[0038] Undoubtedly, any technical content or feature that is contrary to or clearly contradicts the purpose of this invention should be excluded.
[0039] like Figure 1 As shown, this invention discloses a method for judging the results of COVID-19 antigen tests, which can be implemented by computer programming. The executing entity of this method can be an electronic device such as a smartwatch, smartphone, tablet computer, computer, or laptop computer, or a COVID-19 antigen test result judging device (hereinafter referred to as the judging device) embedded in an electronic device; this invention does not limit this. In this embodiment, an electronic device is used as an example for illustration. The method includes the following steps S10 to S90:
[0040] S10. The electronic device calls the camera to acquire the detection image based on the shooting command input by the user on the user operation interface.
[0041] In this embodiment of the invention, before performing steps S10 to S90 to determine the antigen detection results of unknown test samples, a dedicated application name and corresponding QR code for antigen detection result determination can be pre-set on the antigen detection kit (i.e., antigen reagent kit). The application can be a downloadable and installable application (APP), or it can be another application that does not require downloading and installation, such as a mini-program used on other apps (e.g., WeChat, Alipay, etc.).
[0042] Based on this, before executing step S10, the electronic device may also execute the following steps S01 to S02:
[0043] S01. The electronic device calls the camera device to scan the identification code on the antigen reagent kit to obtain identification information according to the scanning command input by the user.
[0044] For example, when a user clicks the virtual scan button on an electronic device to input a scan command, the electronic device can then activate its built-in camera to start a camera mode. In this camera mode, the user can point the camera at the QR code on the antigen test kit and scan it to obtain the corresponding identification information.
[0045] After scanning and obtaining the identification information, the electronic device can determine the corresponding application. If it is an app that needs to be downloaded and installed, a prompt will be displayed to guide the user to download the app and register / log in. If it is a mini-program (such as a WeChat mini-program), the user's WeChat information will be automatically retrieved for login. After the user completes login, the electronic device can configure a unique identifier (ID) for that user and associate and store the user's personal identity information (at least including ID card number, name, and mobile phone number) with this ID. Furthermore, the same user can also be linked to the user identity information of other people; that is, this ID can be associated with and store multiple user identity information.
[0046] S02. The electronic device acquires and identifies the corresponding application, and displays the user interface of the application.
[0047] After the user logs in, the electronic device displays the application's user interface on the screen. The user interface then prompts the user to complete the self-test sampling according to the instructions on the antigen test kit, and to take a photo according to the prescribed photographic guidelines when the colorimetric result appears on the reagent card (generally, text prompts indicate that taking a horizontal photo is more accurate for interpretation, but this is not mandatory). The user can input photographic commands at any time via clicks or voice commands to control the electronic device to take the photo.
[0048] For example, the user can open the downloaded app or WeChat mini-program to call the camera device of the electronic device, generally a mobile phone. It is usually recommended to take a picture of an antigen test card. The electronic device then calls the camera device to obtain a detection image according to the shooting instruction input by the user on the user operation interface, that is, step S10 is executed.
[0049] After the electronic device executes step S10 to obtain the detection image, it is necessary to further perform a pass check on the detection image. Specifically, it includes time check, blur judgment, etc. Among them,
[0050] Time check: Only allow taking pictures at the current time, and do not allow calling historical images of the device;
[0051] Blur judgment: Use the Laplacian operator to make a blur judgment. That is, convert the image into a grayscale image, and then perform a convolution operation with the Laplacian convolution kernel to obtain a response map. Calculate the variance of this response map, and compare this variance with the set threshold to judge the image quality. If it is greater than the threshold, the blur judgment is qualified.
[0052] Based on this, the specific implementation can be: Identify whether the detection image is a new image taken at the current time or a pre-stored historical image retrieved from the picture library; if the detection image is a new image taken at the current time, determine that the detection image passes the check; if the detection image is a pre-stored historical image retrieved from the picture library, determine that the detection image fails the check.
[0053] Or further, the detection image can be converted into a grayscale image, and then the Laplacian convolution kernel is used to perform a convolution operation on this grayscale image to obtain a response map, calculate the variance vt of the response map. Thus, when it is recognized that the detection image is a new image taken at the current time and the above variance vt is greater than or equal to the set blur threshold, it is determined that the detection image passes the check; otherwise, it is determined that the detection image fails the check, and information prompting the user to retake the picture is output. Among them, the Laplacian convolution kernel is:
[0054]
[0055] Among them, the calculation of the blur threshold can be to manually screen a set of pictures with visually judged qualified blur, and then obtain the corresponding variance set Var through the above calculation method, and take the minimum value in the variance set Var as the blur threshold.
[0056] In summary, the embodiment of the present invention will perform a pass check on the taken pictures. Specifically, after taking pictures, only allow uploading the taken pictures, and do not allow reading device pictures; for the pictures after taking, the blur degree will be judged by comparing the threshold with the Laplacian operator; therefore, the quality of the image can be greatly improved and the misjudgment rate can be reduced.
[0057] S20. When the detection image passes the verification, the electronic device determines the position and angle information of the antigen card from the detection image.
[0058] The goal of this step is to detect antigen cards (antigen sampling reagent cards) from the calibrated test images. Its objective is to determine whether an antigen card is present in the test image, and if so, to pinpoint the location of the antigen card, defined as (x, y, w, h, θ).
[0059] like Figure 2 As shown, (x, y, w, h, θ) represent the center coordinates (x, y), width w, height h, and angle θ of the predicted bounding box, respectively. This step achieves object detection by training a detection network, such as a detection network based on the EAST framework, with 5 predicted values (x, y, w, h, θ, p), where p represents the probability of an object being present in the predicted bounding box. Preferably, the loss function used in the training of this detection network includes: a positional loss function L. loc , Angle loss function L θ Probability loss function L p They are defined as follows:
[0060]
[0061]
[0062]
[0063] Where R,θ,p are the label values of the training samples. β represents the predicted value for the training samples, and β is the hyperparameter used to adjust the positive and negative samples.
[0064] S30: The electronic device cuts out the antigen card area from the detection image based on the position and angle information of the antigen card.
[0065] The electronic device can crop out the area where the antigen card is located from the detection image based on the position and angle information (x, y, w, h, θ) of the antigen card.
[0066] S40. The electronic device performs affine transformation processing on the antigen card area based on the position and angle information to obtain a corrected scaled image.
[0067] In this step, firstly, based on the detected position and angle information of the antigen card, an affine transformation is performed on the cropped antigen card region. The goal of the affine transformation is to correct it to a fixed scale and angle. Here, the width w and height h of the prediction box are corrected to (w, h) = (640, 640), and the angle θ is corrected to 0. During the affine transformation, the aspect ratio of the antigen card itself remains unchanged, and the pixel values at other positions are filled with 0 after the transformation. The affine transformation matrix for the center coordinates (x, y) of the prediction box is:
[0068]
[0069] Where (x, y) represents the two-dimensional coordinates before the transformation, and (x′, y′) represents the two-dimensional coordinates after the transformation.
[0070] S50: The electronic device uses the YOLO network to perform window detection on the corrected zoom-in image to obtain the window region, and classifies the window region to obtain a classification score.
[0071] In this embodiment of the invention, the viewing area is mainly composed of the color development area after the control line (C) and the test line (T) react chemically with the test sample. Since the color intensity of the test line T is related to the concentration of the test sample, the higher the concentration, the deeper the color, indicating stronger viral virulence; conversely, the lower the concentration, the lighter the color, indicating weaker viral virulence. Therefore, this invention categorizes samples based on the color gradient of the test line T, from high to low as C1 to C9. Furthermore, when the control line C is colored but the test line T is not, it is classified as B; when the test line T is colored but the control line C is not, it is classified as invalid, resulting in a total of 11 classification categories.
[0072] A multi-task network can be pre-trained for window detection and classification. The objective of this multi-task network is similar to that of the network used for detecting antigen cards, but it predicts less angular information. This is because step S40 has already corrected the antigen card region to an appropriate angle and size; therefore, this step only performs detection and classification, i.e., ((x1, y1, x2, y2, s). It should be noted that the network used for detecting antigen cards and this multi-task network can also be designed and implemented within the same network, but this approach often yields poorer results.
[0073] Preferably, in this embodiment of the invention, the multi-task network is set as a YOLO network with YOLO as the detection framework to detect the view area, achieve the task objective, and output ((x1,y1,x2,y2,s), where (x1,y1,x2,y2) are the coordinates of the top left and bottom right vertices of the predicted view area, and s is the classification score.
[0074] The YOLO network uses two loss functions during training: a localization loss function and a classification loss function. The localization loss function is the IOU loss function, which is the intersection / union of the predicted bounding boxes and the ground truth label boxes in the training samples.
[0075]
[0076] Where A represents the predicted bounding box of the training sample, and B represents the true label bounding box of the training sample.
[0077] The classification loss function uses the cross-entropy loss function:
[0078]
[0079] Where y represents the label classification score of the training sample. The predicted classification score represents the training sample.
[0080] In this embodiment of the invention, for the classification score obtained in step S50, setting different boundary thresholds can divide the samples (including training samples and test samples) into three cases, each requiring different processing. For example, setting the first threshold to 0.7 and the second threshold to 0.3 can divide the samples into: classification discrimination (score>0.7), metric learning (0.3<=score<=0.7), and dose alignment (score<0.3). Steps S60, S70, and S80 are executed respectively, and then the process proceeds to step S90.
[0081] S60. If the classification score is greater than the first threshold, the electronic device determines the first classification category corresponding to the classification score as the discrimination result.
[0082] For sample 1 (score>0.7), it can be considered that this type of sample has a high score, that is, the confidence of the classification is high. The first classification category cls1 corresponding to this classification score can be directly used as the discrimination result of the sample.
[0083] S70. If the classification score is greater than or equal to the second threshold and less than or equal to the first threshold, the electronic device uses a metric learning network to classify the window region and obtain the second classification category as the discrimination result.
[0084] For sample 2 (0.3 <= score <= 0.7), this type of sample can be considered a difficult sample to classify, and a metric learning network is further used to distinguish it. The metric learning network is trained using training samples to classify test samples, and the second classification category cls2 of the metric learning network is used as the discrimination result.
[0085] It should be noted that the second threshold is lower than the first threshold, and the first and second classification categories can be the same or different; both can be any of the 11 classification categories mentioned above. Since the task of metric learning is to reduce intra-class distances and increase inter-class distances, the second classification category cls2 derived by the metric learning network is more accurate than the first classification category cls1.
[0086] Specifically, during the training of a metric learning network, the ResNet framework can be used to extract features, and an appropriate loss function can be selected to enhance discriminative ability. Preferably, the loss function is:
[0087]
[0088] Meanwhile, to balance the impact of class imbalance, the value of m is:
[0089]
[0090] a and b control the upper and lower bounds of the margin, n is the number of samples in each category, j represents the sample number from 1 to n, λ controls the shape of this function, λ and s are hyperparameters, θ represents the angle between the feature vectors, N represents the number of pairs, and i represents the group number from 1 to N.
[0091] S80. If the classification score is less than the second threshold, the electronic device calculates the first gray-scale mean of the area where the quality control line is located and the second gray-scale mean of the area where the detection line is located in the window area, and calculates the ratio of the second gray-scale mean to the first gray-scale mean. When the ratio is greater than or equal to the preset category threshold of the first classification category corresponding to the classification score, the first classification category corresponding to the classification score is determined as the discrimination result.
[0092] The quality control line area refers to the area corresponding to the position coordinates of the quality control line (C line) in the height direction, while the test line area refers to the area corresponding to the position coordinates of the test line (T line) in the height direction.
[0093] For sample 3 (score < 0.3), samples with low scores are often considered to be discarded. However, due to the black-box nature of deep networks, there is also the possibility of ignoring correct samples. Therefore, this step involves dose comparison for inverse complementation. That is, by calculating the ratio r of the gray values of the C and T lines and comparing it with the set category threshold thred, it is determined whether the sample should be recalled.
[0094] For example, for test sample a, the first category corresponding to the classification score obtained in step S50 is cls1, and its corresponding threshold is thred1. If the ratio r of the gray values of the C and T lines of the sample is greater than or equal to thred1, then the sample is recalled and classified as cls1; otherwise, it is discarded.
[0095] Specifically, the calculation of the category threshold thred can be implemented as follows:
[0096] For each training sample classified into categories C1 to C9, a fixed-width and fixed-height region is taken at the center of the viewport box. The grayscale projection of this region along the height direction is calculated, resulting in a one-dimensional array H.
[0097]
[0098] Where i, j, h, and w represent the width and height positions of the pixel value and the width and height values of the region, respectively. Gray[i][j] represents the grayscale projection of the region containing the pixel value.
[0099] Median filtering is applied to the array H to eliminate the influence of outliers. Further rising and falling edge detection is performed on the smoothed one-dimensional array to obtain the position coordinates of lines C and T in the height direction, thereby detecting the corresponding location regions of lines C and T.
[0100] Then, for all training samples, the mean grayscale value Vc is taken for the region where the C line is located, and the mean grayscale value Vt is taken for the region where the T line is located. Typically, the mean grayscale value Vc for the C line is greater than or equal to the mean grayscale value Vt for the T line. The ratio r = Vt / Vc is calculated. For training samples C1-C9, the values r1-r9 are calculated respectively, and their mean values are taken to obtain the preset category thresholds thred1-thred9. The preset category thresholds thred1-thred9 correspond one-to-one with the classification categories C1-C9.
[0101] S90. The electronic device performs interval mapping on the discrimination results to obtain the final classification result of the detected image, wherein the final classification result includes positive or negative.
[0102] This step uses medical standards to set business logic to determine the positivity or negativity of the sample, obtaining the final classification result as the antigen detection result. For example, assuming categories C1-C6 are positive and other categories are negative, then the discrimination results calculated in steps S60, S70, and S80 are mapped to a result interval. That is, if the discrimination result of the test sample belongs to C1-C6, the antigen detection result of the test sample is positive; otherwise, the antigen detection result of the test sample is negative.
[0103] As an optional implementation, after obtaining the final classification result of the detected image as the antigen detection result, the electronic device may also perform the following steps S91 to S93:
[0104] S91. Receive the identity selection command entered by the user on the user operation interface.
[0105] S92. Determine the target user identity information corresponding to the identity selection instruction from multiple user identity information stored in association with the user identification code.
[0106] For example, if multiple user identity information stored with an ID corresponds to the user and user's family member 1 and user's family member 2 respectively, the user can select a certain user identity information from them to clarify whose antigen test result it is, thus avoiding the inability of some users to understand or have the equipment support to achieve automatic identification and uploading of antigen test results.
[0107] S93. The final classification result is associated with the target user's identity information, stored, and uploaded to the backend server.
[0108] Finally, after determining the identity information of the target user selected by the user, the electronic device uploads the final classification result as the antigen test result of the target user corresponding to that target user identity information.
[0109] As can be seen, by implementing the embodiments of the present invention and designing a qualification verification step for images, the collected images can be verified to be qualified, and interference from unqualified samples can be filtered out. A multi-stage processing procedure based on deep learning is designed, which is a coarse-to-fine process, greatly improving the accuracy of sample identification. In the multi-stage processing logic, different frameworks are selected based on the tasks of different stages to achieve the objectives, such as antigen card detection based on the EAST framework and window detection based on the YOLO framework. During the processing, classification discrimination, metric learning, and dose comparison are used to process the samples differently. Traditional image processing algorithms are also combined; for example, dose comparison uses the grayscale value ratio and threshold comparison to compensate for low-scoring samples. That is, by combining deep learning algorithms with traditional algorithms, the effectiveness of this method is improved.
[0110] In summary, the COVID-19 antigen detection result discrimination method provided by this invention can accurately and quickly interpret the test results, reduce the probability of missed or false detections, and simultaneously upload the results, thereby improving the efficiency and accuracy of testing, enhancing the efficiency of infection screening during the epidemic, reducing the risk of infection, and contributing to the better implementation of epidemic prevention and control work.
[0111] like Figure 3As shown, this embodiment of the invention discloses a COVID-19 antigen detection result discrimination device, including an imaging unit 301, a first detection unit 302, a cropping unit 303, a correction unit 304, a second detection unit 305, a first classification unit 306, a mapping unit 307, a second classification unit 308, and a third classification unit 309, wherein...
[0112] The shooting unit 301 is used to call the camera device to acquire the detection image according to the shooting command input by the user on the user operation interface;
[0113] The first detection unit 302 is used to determine the position and angle information of the antigen card from the detection image when the detection image verification is qualified;
[0114] The cropping unit 303 is used to crop out the antigen card area from the detection image based on the position information and angle information;
[0115] The correction unit 304 is used to perform affine transformation processing on the antigen card area based on the position information and angle information to obtain a corrected scaled image.
[0116] The second detection unit 305 is used to perform window detection on the corrected scaled image using the YOLO network to obtain the window region; and to classify the window region to obtain a classification score.
[0117] The first classification unit 306 is used to determine the first classification category corresponding to the classification score as the discrimination result when the classification score is greater than the first threshold.
[0118] The mapping unit 307 is used to perform interval mapping on the discrimination result to obtain the final classification result of the detected image, wherein the final classification result includes positive or negative.
[0119] Preferred, such as Figure 3 The COVID-19 antigen test result discrimination device shown may further include a second classification unit 308, which is used to classify the window area using a metric learning network when the classification score is greater than or equal to a second threshold and less than or equal to a first threshold, and obtain a second classification category as the discrimination result; wherein the second threshold is less than the first threshold.
[0120] Preferred, such as Figure 3 The COVID-19 antigen test result discrimination device shown may further include a third classification unit 309, used to calculate the first gray-scale mean of the area where the quality control line is located and the second gray-scale mean of the area where the test line is located in the window area when the classification score is less than the second threshold; and to calculate the ratio of the second gray-scale mean to the first gray-scale mean; and to determine the first classification category corresponding to the classification score as the discrimination result when the ratio is greater than or equal to the preset category threshold of the first classification category corresponding to the classification score.
[0121] like Figure 4 As shown, an embodiment of the present invention discloses an electronic device, including a memory 401 storing executable program code and a processor 402 coupled to the memory 401;
[0122] The processor 402 calls the executable program code stored in the memory 401 to execute the COVID-19 antigen detection result discrimination method described in the above embodiments.
[0123] This invention also discloses a computer-readable storage medium storing a computer program that causes a computer to execute the COVID-19 antigen detection result discrimination method described in the above embodiments.
[0124] The purpose of the above embodiments is to reproduce and derive the technical solution of the present invention by way of example, and to fully describe the technical solution, purpose and effect of the present invention. The purpose is to enable the public to have a more thorough and comprehensive understanding of the disclosure of the present invention, and not to limit the scope of protection of the present invention.
[0125] The above embodiments are not an exhaustive list based on the present invention, and there may be many other embodiments not listed. Any substitutions and improvements made without departing from the concept of the present invention are within the protection scope of the present invention.
Claims
1. A method for discriminating a result of detection of a COVID-19 antigen, characterized by, include: Based on the shooting command input by the user on the user operation interface, the camera device is invoked to acquire the detection image; When the detected image passes the verification, the position and angle information of the antigen card are determined from the detected image; Based on the location information and the angle information, the antigen card area is cropped from the detection image; Based on the location information and the angle information, an affine transformation is performed on the antigen card region to obtain a corrected scaled image; The YOLO network is used to perform window detection on the corrected scaled image to obtain the window region; The YOLO network is used to classify the view area and obtain a classification score; If the classification score is greater than the first threshold, the first classification category corresponding to the classification score is determined as the discrimination result. If the classification score is greater than or equal to the second threshold and less than or equal to the first threshold, a metric learning network is used to classify the viewport region to obtain a second classification category as the discrimination result; wherein, the second threshold is less than the first threshold; If the classification score is less than the second threshold, calculate the first gray mean of the area where the quality control line is located and the second gray mean of the area where the detection line is located in the window region. Calculate the ratio of the second grayscale mean to the first grayscale mean; When the ratio is greater than or equal to a preset category threshold for the first category corresponding to the classification score, the first category corresponding to the classification score is determined as the discrimination result; The discrimination result is mapped to an interval to obtain the final classification result of the detected image, wherein the final classification result includes positive or negative; Determining the preset category thresholds includes: for training samples classified into categories C1 to C9, taking a fixed-width and fixed-height region at the center of the window, calculating the grayscale projection of this region in the height direction to obtain a one-dimensional array, performing median filtering and rising and falling edge detection on the one-dimensional array to obtain the regions where the C-line and T-line are located, calculating the grayscale mean Vc of the region where the C-line is located and the grayscale mean Vt of the region where the T-line is located, calculating the ratio of Vt / Vc to obtain the training samples, and statistically analyzing the ratio of all training samples under each category to obtain the preset category threshold corresponding to each category.
2. The method for judging the results of COVID-19 antigen detection as described in claim 1, characterized in that, Before invoking the camera device to acquire the detection image according to the shooting command input by the user on the user operation interface, the method further includes: Based on the scanning command input by the user, the camera device is invoked to scan the identification code on the antigen reagent kit to obtain identification information; Obtain the application corresponding to the identification information and display the user interface of the application.
3. The method for judging the results of COVID-19 antigen detection as described in claim 2, characterized in that, After performing interval mapping on the discrimination results to obtain the final classification result of the detected image, the method further includes: Receive the identity selection command input by the user on the user operation interface; The target user identity information corresponding to the identity selection instruction is determined from multiple user identity information stored in association with the user identification code; The final classification result is associated with the target user's identity information, stored, and uploaded to the backend server.
4. A COVID-19 antigen test result discrimination device, characterized in that, include: The shooting unit is used to call the camera device to acquire the detection image according to the shooting command input by the user on the user operation interface; The first detection unit is used to determine the position and angle information of the antigen card from the detection image when the detection image passes the verification. The cropping unit is used to crop the antigen card region from the detection image based on the position information and the angle information; The correction unit is used to perform affine transformation processing on the antigen card area according to the position information and the angle information to obtain a corrected scaled image; The second detection unit is used to perform window detection on the corrected scaled image using a YOLO network to obtain a window region; and to classify the window region to obtain a classification score. The first classification unit is used to determine the first classification category corresponding to the classification score as the discrimination result when the classification score is greater than the first threshold. A mapping unit is used to perform interval mapping on the discrimination result to obtain the final classification result of the detected image, wherein the final classification result includes positive or negative; It also includes a second classification unit, used to classify the window region using a metric learning network when the classification score is greater than or equal to a second threshold and less than or equal to the first threshold, and obtain a second classification category as the discrimination result; wherein the second threshold is less than the first threshold; It also includes a third classification unit, used to calculate the first gray-scale mean of the area where the quality control line is located and the second gray-scale mean of the area where the detection line is located in the window region when the classification score is less than the second threshold; and to calculate the ratio of the second gray-scale mean to the first gray-scale mean; and to determine the first classification category corresponding to the classification score as the discrimination result when the ratio is greater than or equal to a preset category threshold of the first classification category corresponding to the classification score. Determining the preset category thresholds includes: for training samples classified into categories C1 to C9, taking a fixed-width and fixed-height region at the center of the window, calculating the grayscale projection of this region in the height direction to obtain a one-dimensional array, performing median filtering and rising and falling edge detection on the one-dimensional array to obtain the regions where the C-line and T-line are located, calculating the grayscale mean Vc of the region where the C-line is located and the grayscale mean Vt of the region where the T-line is located, calculating the ratio of Vt / Vc to obtain the training samples, and statistically analyzing the ratio of all training samples under each category to obtain the preset category threshold corresponding to each category.
5. An electronic device, characterized in that, It includes a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the COVID-19 antigen detection result discrimination method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program causes a computer to perform the COVID-19 antigen detection result discrimination method according to any one of claims 1 to 3.