Disclosure of Invention
The invention provides an immunochromatography detection method and system for clinical laboratory, which are used for solving the existing problems.
The immunochromatography detection method and system for the clinical laboratory adopt the following technical scheme:
One embodiment of the invention provides an immunochromatographic assay for clinical laboratory, comprising the steps of:
Acquiring an observation area of a patient sample in a detection test paper image after immunochromatography detection and an imaging total area of a designed color development area of a detection line and a quality control line on an actual detection test paper in the detection test paper image;
The observation area is divided into a plurality of connected areas, the confidence that each connected area is a color development area is determined according to the difference between the gray values of the pixel points in the connected areas, and two color development areas are screened out according to the confidence that each connected area is a color development area;
Determining the color development degree of each color development area according to the difference between gray values of pixel points in each color development area and the confidence coefficient of the color development area, and determining the chromatographic result coefficient of the detection test paper according to the color development degree difference and the area difference between the color development areas and combining the imaging total area of the designed color development areas of the detection line and the quality control line on the actual detection test paper in the detection test paper image;
and according to the size of the chromatographic result coefficient of the detection test paper, combining the color development degree of each color development area to obtain the chromatographic result quantification value of the detection test paper.
Further, the determining the confidence that each connected domain is a color development region includes the following specific steps:
Calculating the average value of the gray values of all pixel points in each connected domain, and taking the average value as the gray average value of each connected domain;
calculate except for the first Gray average value and the first gray average value of each connected domain except the connected domainsThe ratio of the gray average values of the connected domains will be in addition to the firstGray average value and the first of all connected domains except the connected domainsTaking the sum value of the ratio of the gray average values of the connected domains as a first sum value;
For the first The main component analysis is carried out on each connected domain, and the first is calculatedA plurality of principal component vectors of the connected domains;
For the first A connected domain for calculating the cosine similarity between the maximum principal component vector and each principal component vector except the maximum principal component vector, and taking the sum of the cosine similarity between the maximum principal component vector and all principal component vectors except the maximum principal component vector as a second sum;
determining a first sum value based on the first sum value and the second sum value The individual connected domains are the confidence of the color development region.
Further, the first sum value and the second sum value are determinedThe confidence that each connected domain is a color development region comprises the following specific steps:
taking the normalized value of the product of the first sum and the second sum as a first sum The individual connected domains are the confidence of the color development region.
Further, the step of screening out two color development areas according to the confidence level that each connected area is a color development area includes the following specific steps:
The first two connected domains with the highest confidence of the color development region are marked as the color development region.
Further, the determining the color development degree of each color development area comprises the following specific steps:
In the first place Calculating the absolute value of the difference value of the gray values of any two pixel points in the color development area, and recording the sum value of the absolute value of the difference value of the gray values of all any two pixel points as a third sum value;
Will be the first The ratio of the confidence level of each color development area to the maximum value in the confidence level of each connected area as the color development area is recorded as a first ratio;
determining a first value based on the first ratio and the third sum Degree of color development of each color development region.
Further, the first ratio and the third sum are determinedThe color development degree of each color development area comprises the following specific steps:
The ratio of the first ratio to the third sum is recorded as the first ratio Degree of color development of each color development region.
Further, the determination of the chromatographic result coefficient of the test paper comprises the following specific steps:
calculating the absolute value of the difference of the color development degrees of the two color development areas as a first difference;
Calculating the ratio of the area of each color development area to the imaging total area of the designed color development area of the detection line and the quality control line on the actual detection test paper in the detection test paper image, and taking the ratio as a second ratio of each color development area;
taking the absolute value of the difference value of the second ratio of the two color development areas as a second difference;
and determining the chromatographic result coefficient of the detection test paper according to the first difference and the second difference.
Further, the determining the chromatographic result coefficient of the test paper according to the first difference and the second difference comprises the following specific steps:
And taking a normalized value of the product of the first difference and the second difference as a chromatographic result coefficient of the detection test paper.
Further, the method for obtaining the chromatographic result quantification value of the detection test paper comprises the following specific steps:
when the chromatographic result coefficient of the detection test paper is smaller than a preset positive threshold, enabling the chromatographic result quantized value of the detection test paper to be a preset second constant, wherein the preset second constant is larger than or equal to a positive integer 1;
when the chromatographic result coefficient of the detection test paper is larger than or equal to a preset positive threshold value, marking a color development area with the smallest color development degree as a target color development area, calculating the average value of brightness values of all pixel points in each channel in the target color development area in RGB three channels to be used as each channel value of the target color development area, calculating the average value of RGB three channel values of the target color development area to be used as a first average value, and taking the normalized value of the product of the color development degree of the target color development area and the first average value as the chromatographic result quantification value of the detection test paper.
The invention also provides an immunochromatography detection system for the clinical laboratory, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program stored in the memory so as to realize the steps of the immunochromatography detection method for the clinical laboratory.
The technical scheme of the invention has the beneficial effects that:
In the embodiment of the invention, an observation area of a patient sample in a detection test paper image after immunochromatography detection is obtained, the observation area is divided into a plurality of connected areas, two color development areas are screened, so that a chromatographic result coefficient of the detection test paper is determined, a chromatographic result quantification value of the detection test paper is obtained, a target color development area is screened through analyzing image characteristics of the chromatographic test paper, a chromatographic result is determined according to color development degree differences of different color development areas for qualitative analysis, and finally quantitative analysis is carried out based on color development characteristics of the test paper, so that color development intensity of the color development area is accurately measured in a numerical form, manual subjective error is reduced, higher precision and consistency are provided, and finally relevant preventive and therapeutic measures can be taken for patients according to the chromatographic result of the test paper, so that disease prevention and control efficiency is improved.
Detailed Description
In order to further describe the technical means and effects adopted by the invention to achieve the preset aim, the following detailed description refers to specific implementation, structure, characteristics and effects of an immunochromatography detection method and system for clinical laboratory according to the present invention by referring to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, 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 invention belongs.
The invention provides a immunochromatography detection method and a system for clinical laboratory, which are specifically described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of steps of an immunochromatography detection method for clinical laboratory according to an embodiment of the present invention is shown, and the method includes the following steps:
And S001, acquiring an observation area of a patient sample in a detection test paper image after immunochromatography detection and an imaging total area of a designed color development area of a detection line and a quality control line on the actual detection test paper in the detection test paper image.
And fixing a high-resolution camera above the observation platform, and using the high-resolution camera to overlook and collect detection test paper images of patient samples in the observation platform after immunochromatography detection.
In the technical specification of the detection test paper provided by the manufacturer, the designed color development areas of the detection line and the quality control line on the actual detection test paper are obtained, so that the imaging total area of the designed color development areas of the detection line and the quality control line on the actual detection test paper in the detection test paper image is obtained.
In this embodiment, the test paper image is an RGB image, each pixel point in the test paper image corresponds to a brightness value in RGB three channels, the test paper image is subjected to gray-scale processing to obtain a gray-scale value of each pixel point in the test paper image, the test paper image is denoised by using wavelet transformation so as to ensure that the image is clear and a color line can be accurately identified, and a perspective projection principle is used to obtain the imaging total area of the designed color area of a detection line and a quality control line on the actual test paper in the test paper image according to each basic parameter of the high-resolution camera (acquired from the specification of the high-resolution camera) and the distance from the high-resolution camera to the test paper (the position of the high-resolution camera above an observation platform is fixed). The image graying process, wavelet transformation and perspective projection principle are all known techniques, and specific methods are not described herein.
It should be further noted that, the immunochromatography detection method is a rapid detection technology based on antigen-antibody reaction, generally, a sample is first collected from a patient and then added to a corresponding test paper, and the test paper is schematically shown in fig. 2. The test paper in fig. 2 comprises a sample pad, a bottom plate, a fluorescent pad, a shielding wire, a detection wire, a quality control wire, a nitrocellulose membrane and a water absorption pad, wherein the chromatography direction is the direction from the sample pad to the water absorption pad. The sample pad is used for absorbing a sample and filtering large-particle impurities, the fluorescent pad (also called a combination pad) contains a dry labeled antibody, usually colloidal gold or fluorescent dye, a detection line and a quality control line are fixed with specific antibodies or antigens, the specific antibodies or antigens are used for capturing target molecules (antigens or antibodies) in the sample, and the water absorption pad is used for absorbing excessive liquid to ensure that the sample smoothly passes through the whole test paper. After the sample is added to the sample pad, it diffuses into the fluorescent pad by capillary action, and the labeled antibody on the fluorescent pad binds to the target antigen (or antibody) in the sample to form a complex. And then continues to move forward, passes through the detection zone (the corresponding region of the nitrocellulose membrane), and if the complex contains target molecules, they are captured by the immobilized antibodies of the detection zone and display a color development result. If the detection line and the quality control line are both colored, the presence of target molecules in the sample is indicated, and the result is positive. If only the quality control line develops color, the detection line does not develop color, which means that the sample does not contain target molecules, and the result is negative. If the quality control line does not develop, whether or not the detection line develops, indicating that the detection is invalid, it may be insufficient sample or improperly operated.
From this, it can be known that the detection area corresponding to the nitrocellulose membrane of the test strip in fig. 2 is an observation area, and the embodiment of the present invention uses the split neural network to identify the observation area in the image of the split test strip.
The relevant content of the segmented neural network is as follows:
The segmentation neural network used in the embodiment is a Mask R-CNN neural network, and the data set used is an enhanced image data set. Wherein Mask R-CNN is a known technology, and the specific method is not described herein. The Chinese language of Mask R-CNN is called Mask area convolutional neural network, and the English language is called Mask Region-based Convolutional Neural Network.
The pixel points to be segmented are divided into 2 types, namely, the corresponding label labeling process of the training set is that the single-channel semantic label is labeled, the label of the pixel point at the corresponding position belonging to the background area is 0, and the label of the pixel point belonging to the observation area is 1.
The task of the network is classification, so the loss function used is a cross entropy loss function.
The observation area in the test paper image is obtained by dividing the neural network, and the process is a known technology, and the specific method is not described here.
Step S002, dividing the observation area into a plurality of connected areas, determining the confidence coefficient of each connected area as a color development area according to the difference between the gray values of the pixel points in the connected areas, and screening out two color development areas according to the confidence coefficient of each connected area as the color development area.
The test paper has the advantages that the color development degree of the test paper corresponding to some patient samples is shallow, and the patient properties of the test paper cannot be determined only by naked eyes, so that the qualitative analysis is required to be performed on the chromatographic results based on the color development characteristics of the test paper images to determine the patient properties of different test papers corresponding to the patients, and meanwhile, the quantitative analysis is performed on the chromatographic results by combining the color saturation of the color development areas, so that the color development intensity of the color development areas is accurately measured in a numerical form, the error of manual identification is reduced, and a theoretical basis is provided for the evaluation of the patient conditions.
In general, the color development area of the test paper is a detection line and quality control line area, while other areas of the test paper cannot develop color, and the color development area generally presents a thin strip shape and has deeper gray scale relative to other areas under the condition of developing color, so that all connected areas in a photographed test paper image can be screened based on the characteristics, and possible color development areas are obtained.
Preferably, in one embodiment of the present invention, the method for acquiring a color development area includes:
and dividing the observed region in the detection test paper image by using a region growing algorithm to obtain a plurality of connected regions.
To observe the first of the areasFor the first connected domain as an examplePrincipal component analysis (PCA, PRINCIPAL COMPONENT ANALYSIS) of each connected domain is performed to calculate the firstAnd a plurality of principal component vectors of the connected domains.
The area growing algorithm and the principal component analysis are known techniques, and the specific method is not described here, but in this embodiment, the gray value of the pixel point is used as the basic value of the area growing and the principal component analysis.
And calculating the average value of the gray values of all the pixel points in each connected domain, and taking the average value as the gray average value of each connected domain.
Calculate except for the firstGray average value and the first gray average value of each connected domain except the connected domainsThe ratio of the gray average values of the connected domains will be in addition to the firstGray average value and the first of all connected domains except the connected domainsThe sum of the ratios of the gray average values of the connected domains is taken as a first sum.
For the firstAnd a connected domain for calculating the cosine similarity between the maximum principal component vector and each principal component vector except the maximum principal component vector, and taking the sum of the cosine similarity between the maximum principal component vector and all principal component vectors except the maximum principal component vector as a second sum.
Taking the normalized value of the product of the first sum and the second sum as the first sumThe individual connected domains are the confidence of the color development region.
It should be noted that the normalized value of the product of the first sum and the second sum is used in this embodimentA linear normalization function for normalizing the product of the first sum and the second sum toWithin the interval. Since the test paper color-developing region will appear darker after meeting the relevant conditions, ifThe average gray level of each connected domain is smaller than the other connected domains, i.e. the larger the first sum value, the secondThe more likely that each connected domain is a color development region. The cosine similarity of the two vectors is calculated in a known way, and the larger the cosine similarity is, the closer the directions of the two vectors are, and the color-developing area is a detection line and a quality control line are long strips, so that the PCA can be used for the first vectorThe principal component decomposition is carried out on each connected domain, and as the largest principal component vector represents the overall extending trend of the connected domain, if the directions of other principal component vectors and the largest principal component vector are more similar, namely the second sum value is larger, the extending trend is more obvious, the possibility of the connected domain being a strip-shaped region is higher, and the corresponding first one is thatThe greater the confidence that each connected domain is a colored region.
In the observation region, the first two connected regions with the highest confidence of the color development region are designated as color development regions.
The preset color development threshold value is 0.85, and the preset first constant is 0, which is described as an example. If the confidence coefficient of the two color development areas is smaller than 0.85, the fact that the corresponding color development areas are not found in the detection test paper image is indicated, and the chromatographic result of the detection test paper is determined to be invalid. If only one confidence coefficient of the two color development areas is greater than or equal to 0.85, the fact that only one real color development area exists in the image of the detection test paper is indicated, namely the detection result is negative, the sample does not contain target molecules, and therefore the chromatographic result quantification value of the detection test paper is a preset first constant 0. If the confidence that the two color development areas are the color development areas is greater than or equal to 0.85, the two real color development areas exist in the detection test paper image, and in general, if the two color development areas exist in the detection test paper image, the chromatographic result is considered positive, and at this time, further quantitative analysis on the positive result is needed.
And step S003, determining the color development degree of each color development area according to the difference between gray values of pixel points in each color development area and the confidence coefficient of the color development area, and determining the chromatographic result coefficient of the detection test paper according to the color development degree difference and the area difference between the color development areas and combining the imaging total area of the designed color development areas of the detection line and the quality control line on the actual detection test paper in the detection test paper image.
It should be noted that the actual chromatographic result may be that the developed area is not as obvious and thick as the positive reaction due to the lower antigen concentration of the patient sample, i.e. the developed color of the detection line is visible, but may be blurred, unclear or light in edge, and a weak positive result appears, so that misjudgment is easy to occur when the evaluation is carried out with naked eyes. Then in order to evaluate the chromatographic result more accurately, the corresponding degree of coloration needs to be determined for all the coloration areas, and then the chromatographic result is determined by comparing the difference of the degrees of coloration of the different coloration areas.
Because the weak positive and the positive have two color development areas, the color depth of the positive color development area is deeper and uniform, and the color depth of the weak positive color development area is shallower and uneven, the pixel gray uniformity of different color development areas can be analyzed to measure, and meanwhile, the confidence level comprises the overall color depth condition of the areas, so that the corresponding color development degree can be calculated for the color development area corresponding to the detection test paper image based on the factors.
Preferably, in one embodiment of the present invention, the method for obtaining the chromatographic result coefficient of the test paper includes:
to observe the first of the areas For example, in the first color development regionAnd in each color development area, calculating the absolute value of the difference value of the gray values of any two pixel points, and recording the sum value of the absolute values of the difference values of all any two pixel points as a third sum value.
Will be the firstThe ratio of the confidence level that each color development region is a color development region to the maximum value in the confidence levels that all connected regions are color development regions is recorded as a first ratio. The ratio of the first ratio to the third sum is recorded as the first ratioDegree of color development of each color development region.
It is to be noted that the smaller the third sum value, the description of the third sum valueThe more uniform the gray level of the pixel points in the color development areas, the larger the corresponding color development degree, and the larger the first ratio, the description of the firstThe deeper the color depth of the individual colored regions, the greater the corresponding degree of color development.
Thus, corresponding color development degrees are obtained for all color development areas in the detection test paper image. Since the chromatographic result may have positive, negative and weak positive, and the weak positive and the positive have differences in the color development degree of the detection line, qualitative analysis of the chromatographic result based on the color development degrees of different color development areas in the detection test paper image is required next.
The positive and negative of the chromatographic result can be directly distinguished by the number of the color development areas, and the positive and the weak positive have differences in the degree of color development, but no accurate distinguishing method exists, so that the two results need to be qualitatively analyzed next. The general positive chromatographic result shows that the color developing effect of the detection line and the quality control line is clear and deep, and meanwhile, the detection line and the quality control line can occupy the whole designed color developing area. The weak positive detection line has light color and cannot occupy the whole designed color development area, but the quality control line still develops color clearly. And thus can be distinguished based on the degree of color development of the different color development regions.
In the observation region, the absolute value of the difference in the degree of color development of the two color development regions is calculated as the first difference. Calculating the ratio of the area of each color development area to the imaging total area of the designed color development area of the detection line and the quality control line on the actual detection test paper in the detection test paper image, taking the ratio as the second ratio of each color development area, taking the absolute value of the difference value of the second ratio of the two color development areas as the second difference, and taking the normalized value of the product of the first difference and the second difference as the chromatographic result coefficient of the detection test paper.
It should be noted that the normalized value of the product of the first difference and the second difference is used in this embodimentA linear normalization function for normalizing the product of the first difference and the second difference toWithin the interval. The greater the first difference, the greater the likelihood that the test paper is weakly positive, and vice versa, due to the small degree of color development of the weakly positive detection line relative to the quality control line. Since the weak positive detection line cannot occupy the whole design color development area, the larger the value of the second difference corresponding to the weak positive is, and the smaller the value of the second difference corresponding to the positive result is. Thus the larger the chromatographic result coefficient, the more likely it is to be weakly positive.
And S004, according to the size of the chromatographic result coefficient of the detection test paper, combining the color development degree of each color development area to obtain the chromatographic result quantized value of the detection test paper.
The positive threshold is preset to 0.75 and the second constant is preset to 1, as described by way of example.
When the chromatographic result coefficient of the detection test paper is smaller than a preset positive threshold, the immunochromatography detection is judged to be positive, and the chromatographic result quantized value of the detection test paper is made to be a preset second constant 1.
And when the chromatographic result coefficient of the detection test paper is greater than or equal to a preset positive threshold, judging that the immunochromatography detection is weak positive.
The qualitative analysis of the positive and weak positive of the chromatographic result is described, but the weak positive only indicates that the color development degree of the detection line is relatively shallow, but the degree of the weak positive is still not measured, so that the observation results of different people have a certain subjectivity, and therefore, the chromatographic result needs to be quantitatively analyzed through specific numerical values, thereby assisting related personnel in evaluating the illness state.
Since the positive and weak positive can be distinguished by the chromatographic result coefficient, for different weak positive chromatographic results, the color development degree is different, and the color development region with lower color development degree can be set as the target color development region, namely the color development region of the detection line, and quantitative analysis can be performed according to the occupation ratio condition of the color channels.
In the observation region, a color development region having the smallest color development degree is referred to as a target color development region.
In the RGB three channels, calculating the average value of the brightness values of all pixel points in the target color development area in each channel, and taking the average value as the value of each channel of the target color development area.
And calculating the average value of RGB three-channel values of the target color development area, taking the average value as a first average value, and taking a normalized value of the product of the color development degree of the target color development area and the first average value as a chromatographic result quantized value of the detection test paper.
It should be noted that the normalized value of the product of the color development degree of the target color development region and the first average value is used in this embodimentA linear normalization function for normalizing the product of the color development degree of the target color development area and the first average value toWithin the interval. The size of the first average value reflects the color deep saturation of the target color development area, and the larger the color channel value of the target color development area is, the larger the corresponding color saturation is, so that the better the color development effect of the target color development area is, namely, the larger the quantized value of weak positive is. Meanwhile, the color development degree of the target color development area is combined, namely, the greater the color development degree and the color saturation is, the better the color development effect of the target color development area is, and the greater the quantized value of weak positive of the detection test paper is.
Therefore, the qualitative analysis is carried out on the chromatographic results of different test papers in the mode, different types of chromatographic results are distinguished by means of machine vision, the chromatographic results are specifically quantified in a numerical mode, and the artificial subjectivity error is reduced. Then the staff associated therewith can assist in diagnosing and controlling the patient's condition based on the quantified results.
In this embodiment, if the denominator of the ratio is 0 in calculating the ratio, the denominator is 1, and the ratio is ensured to be established, which is described as an example.
The invention also provides an immunochromatography detection system for the clinical laboratory, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program stored in the memory so as to realize the steps of the immunochromatography detection method for the clinical laboratory.
The present invention has been completed.
To sum up, in the embodiment of the invention, an observation area of a patient sample in a test paper image after immunochromatography detection is obtained, the observation area is divided into a plurality of connected domains, the confidence level that each connected domain is a color development area is determined, the two color development areas are screened out, the color development degree of each color development area is obtained, and the chromatographic result coefficient of the test paper is determined according to the color development degree difference and the area difference between the color development areas, so that the chromatographic result quantification value of the test paper is obtained. The invention performs qualitative and quantitative analysis on the chromatographic result by analyzing the existence of different color development areas and the difference of color development degrees on the chromatographic test paper, thereby adopting corresponding precautionary treatment measures and improving the detection accuracy of the chromatographic result and the disease control efficiency.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the invention, but any modifications, equivalent substitutions, improvements, etc. within the principles of the present invention should be included in the scope of the present invention.