Intelligent recognition and analysis method of colloidal gold test strip results based on machine learning
By obtaining the color rendering images of the test strips at different time points and building a time dynamic feature model, the problem of failure to capture the time dynamic laws of the color rendering process in the prior art is solved, and higher detection accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202510154021.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-02-12
AI Technical Summary
The prior art has failed to fully capture the time dynamic rules of the color rendering process of colloidal gold test strips, resulting in the limitation of the accuracy of the detection results.
By obtaining the color-producing images of the test strips at different time points, extracting local and global features, dynamically adjusting the feature weights, constructing a time-dynamic feature model of the color-producing reaction, analyzing the time-dynamic laws of the color-producing process, and evaluating the stability and entropy value changes of the color-producing region through morphological filtering and Shannon entropy calculation.
The comprehensive capture of the color rendering process of the test strip is achieved, the accuracy and robustness of the detection results are improved, and the intelligent detection level under complex reaction conditions is ensured.
Smart Images

Figure CN119624958B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image detection technology, and more specifically, to a method for intelligently identifying and analyzing colloidal gold test strip results based on machine learning. Background Art
[0002] As a rapid detection tool, colloidal gold test strips are widely used in medical diagnosis, food safety testing, environmental monitoring and other fields. The test results of the test strips are presented in the strip area through a color reaction, and its color intensity and distribution characteristics reflect the concentration or state of the detection target; the color reaction is a complex dynamic process, which is affected by many factors such as chemical components, reaction conditions, and test strip structure. The reaction speed and characteristics of different chemical components vary significantly. This dynamic characteristic determines that the color development process is not just the state at a certain point in time, but a comprehensive reflection of the entire color development reaction process.
[0003] However, existing technologies usually only focus on a single time point image of the color development reaction of the test strip, fail to fully capture the temporal dynamic laws of the color development process, lack in-depth analysis of the temporal dynamic effects during the color development reaction, and are unable to fully extract the color development characteristics, resulting in the accuracy of colloidal gold test strip detection results being limited under complex reaction conditions. Summary of the invention
[0004] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a method for intelligent identification and analysis of colloidal gold test strip results based on machine learning to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] The method for intelligent recognition and analysis of colloidal gold test strip results based on machine learning includes the following steps:
[0007] S1: Obtaining color images of the test strip at different time points, the color images containing color change information of each area of the test strip;
[0008] S2: Extract local and global features of the color image;
[0009] S3: Based on the relative importance of local features and global features, the weight of each feature is dynamically adjusted to perform adaptive weighted fusion to form a color change feature vector;
[0010] S4: Based on the color change feature vector, a temporal dynamic characteristic model of the color development reaction is constructed to analyze the temporal dynamic law of the color development process of the test strip;
[0011] S5: Analyze the boundary morphology change of the color display area through morphological filtering and active contour model to determine whether the morphology change of the color display area is stable; analyze the entropy value change of the color display signal through Shannon entropy calculation to determine whether the entropy value change of the color display signal conforms to the normal color display trend;
[0012] S6: When the morphological changes of the color development area are stable and the entropy value changes of the color development signal are consistent with the normal color development trend, the color development result is predicted based on the time dynamic feature model and the test result of the test strip is output.
[0013] In a preferred embodiment, a color image of the test strip at different time points is obtained, and the color image contains color change information of each area of the test strip, specifically including:
[0014] S101: collecting color images of the test strip within a predetermined time interval, and recording color change information of each area of the test strip at each time point;
[0015] S102: preprocessing the acquired color image to remove background noise and enhance the recognizability of the color development area of the test strip;
[0016] S103: Sort the color-developed images in chronological order according to the time sequence to form a time sequence of color-developed areas.
[0017] In a preferred embodiment, extracting local features and global features of the color image specifically includes:
[0018] S201: performing region segmentation on the color image to divide it into a local region and a global region;
[0019] S202: applying color histogram and edge detection in the local area to extract color change features, and using color difference analysis in the global area to extract overall color change features;
[0020] S203: Synthesize the extracted local features with the global features to form a complete feature vector.
[0021] In a preferred embodiment, based on the relative importance of local features and global features, the weights of the features are dynamically adjusted to perform adaptive weighted fusion to form a color change feature vector, specifically including:
[0022] S301: Based on the feature distribution of the local area and the global area in the color image, initial weights of the local features and the global features are calculated respectively;
[0023] S302: analyzing the effects of local features and global features on color change, and evaluating the dynamic contribution of the two features;
[0024] S303: recalculating the weighting factor based on the dynamic contribution, and generating local weighted features and global weighted features;
[0025] Among them, the weights are readjusted according to the dynamic contribution of local features and global features to calculate the weighting factor, which is the product of the initial weight and the dynamic contribution of the corresponding feature;
[0026] S304: weightedly merging the local weighted features with the global weighted features to generate a color change feature vector.
[0027] In a preferred embodiment, a temporal dynamic characteristic model of the color development reaction is constructed based on the color change characteristic vector, and the temporal dynamic law of the color development process of the test strip is analyzed, specifically including:
[0028] S401: grouping the color change feature vectors according to time sequence, and constructing a continuous time series data set for color dynamic law analysis;
[0029] S402: Convert the continuous time series data set into an input matrix, where the rows of the matrix represent feature vectors and the columns of the matrix represent time points;
[0030] S403: Based on the input matrix, a time dynamic modeling algorithm is selected to train a time dynamic characteristic model of the color development reaction;
[0031] S404: By optimizing the model parameters, the temporal dynamic characteristic model of the color development reaction is adjusted to adapt to the color development process data.
[0032] In a preferred embodiment, the boundary morphological changes of the color display area are analyzed by morphological filtering and active contour model to determine whether the morphological changes of the color display area are stable, which specifically includes:
[0033] Perform morphological filtering on the image of the color-developed area to remove noise and highlight the boundary features of the color-developed area;
[0034] The active contour model is used to segment the boundary of the color-developing area and extract the boundary shape of the color-developing area;
[0035] The change rate of the color development area boundary and the morphological stability index are calculated based on the boundary value analysis method;
[0036] The change rate of the color region boundary and the morphological stability index are compared with the corresponding preset thresholds to determine whether the morphological change of the color region is stable.
[0037] In a preferred embodiment, the change rate of the color development area boundary and the morphological stability index are calculated based on the boundary value analysis method, specifically:
[0038] Extracting data of the fitted boundary curve of the color development area at multiple time points, including the length, area and shape parameters of the boundary;
[0039] Calculate the rate of change of the boundary: ;in, Indicates time point The boundary change rate, Indicates time point The boundary length of the fitted boundary curve, Indicates time point The boundary length of the fitted boundary curve;
[0040] Calculate the morphological stability index: ;in, An indicator of the morphological stability of the color-developing region boundary, represents the first The coordinates of the points, represents the average position of the fitted boundary curve, represents the number of points on the fitted boundary curve, Indicates the index of the point on the fitted boundary curve.
[0041] In a preferred embodiment, the entropy value change of the color development signal is analyzed by Shannon entropy calculation to determine whether the entropy value change of the color development signal conforms to the normal color development trend, specifically including:
[0042] Extract the pixel intensity value of the color display area, and count the occurrence frequency of each pixel intensity value in the color display area to generate a probability distribution of pixel intensity;
[0043] The Shannon entropy value of the color-developing area at a certain time point is calculated based on the probability distribution of pixel intensity;
[0044] Arrange the Shannon entropy values in chronological order to construct the Shannon entropy value time series of the color-displaying area;
[0045] Based on the Shannon entropy time series, the entropy change index is generated by calculating the entropy change rate between adjacent time points;
[0046] The entropy value change index is compared with the preset threshold to determine whether the entropy value change of the color rendering signal conforms to the normal color rendering trend.
[0047] In a preferred embodiment, based on the Shannon entropy time series, the entropy change index is generated by calculating the entropy change rate between adjacent time points, specifically:
[0048] The Shannon entropy time series is processed into segments, each of which contains consecutive time points;
[0049] Calculate the cumulative rate of change of entropy value in each period of time, and the expression is: ;in, Indicates time period The cumulative rate of change of entropy value in Indicates the time period, Indicates the time point index within the time period. Indicates the total number of time points in the time period. Indicates time point The Shannon entropy value of the color rendering area, Indicates time point The Shannon entropy value of the color rendering area.
[0050] In a preferred embodiment, when the morphological change of the color development area is stable and the change of the entropy value of the color development signal conforms to the normal color development trend, the color development result is predicted based on the time dynamic feature model, and the test result of the test strip is output, which specifically includes:
[0051] S601: inputting the time series data of the color development area into the time dynamic feature model to extract the key feature vectors related to the color development process;
[0052] S602: performing inference calculation on key feature vectors based on a time dynamic feature model to generate a predicted value of a color rendering result;
[0053] S603: Compare the predicted value of the color development result with the preset judgment standard of the test strip to determine whether it meets the judgment requirement;
[0054] S604: Classify and mark the color development results to generate the test results of the test strip.
[0055] The technical effects and advantages of the intelligent identification and analysis method of colloidal gold test strip results based on machine learning of the present invention are as follows:
[0056] 1. The intelligent recognition and analysis method of colloidal gold test strip results based on machine learning proposed in the present invention can effectively solve the deficiency of the prior art in failing to fully capture the temporal dynamic laws of the color development process. By obtaining the color development images of the test strips at different time points and extracting and fusing the local features and global features of the color development images, the present invention comprehensively captures the spatial and temporal dynamic features of the color development process. This feature extraction method combines the local details and overall trends of the color development area, provides high-quality data input for subsequent dynamic feature modeling, avoids the problem of insufficient feature expression caused by single time point image analysis, and thus significantly improves the accuracy and robustness of the test strip detection results.
[0057] 2. By constructing a temporal dynamic characteristic model of the color development reaction, analyzing the dynamic laws of the color development process, and combining morphological filtering, active contour model and Shannon entropy calculation, the morphological changes of the color development area and the entropy changes of the color development signal are comprehensively evaluated. This multi-level and multi-dimensional analysis method can not only accurately judge the stability of the color development area, but also effectively identify the dynamic trend of the color development signal, laying the foundation for the accurate prediction of the color development results; when the morphological changes of the color development area are stable and the entropy changes of the color development signal are in line with the normal color development trend, the color development results are intelligently predicted based on the temporal dynamic characteristic model to ensure the reliability and consistency of the test results. This method realizes the full-link coverage of the test strip color development process from dynamic analysis to intelligent judgment, which greatly improves the intelligence level of test strip detection under complex reaction conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a schematic diagram of the intelligent identification and analysis method of colloidal gold test strip results based on machine learning of the present invention. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] Example: Figure 1 The present invention provides a method for intelligent recognition and analysis of colloidal gold test strip results based on machine learning, which comprises the following steps:
[0061] S1: Obtaining color images of the test strip at different time points, where the color images contain color change information of each area of the test strip.
[0062] S2: Extract local and global features of the color image.
[0063] S3: Based on the relative importance of local features and global features, the weight of each feature is dynamically adjusted to perform adaptive weighted fusion to form a color change feature vector.
[0064] S4: Based on the color change characteristic vector, a temporal dynamic characteristic model of the color development reaction is constructed to analyze the temporal dynamic law of the color development process of the test strip.
[0065] S5: Analyze the boundary morphology changes of the color display area through morphological filtering and active contour model to determine whether the morphology changes of the color display area are stable; analyze the entropy value changes of the color display signal through Shannon entropy calculation to determine whether the entropy value changes of the color display signal conform to the normal color display trend.
[0066] S6: When the morphological changes of the color development area are stable and the entropy value changes of the color development signal are consistent with the normal color development trend, the color development result is predicted based on the time dynamic feature model and the test result of the test strip is output.
[0067] Obtain the color images of the test strip at different time points. The color images contain the color change information of each area of the test strip, including:
[0068] S101: Collecting the color image of the test strip within a predetermined time interval, and recording the color change information of each area of the test strip at each time point:
[0069] Use an image acquisition device (such as a high-resolution camera) to take timed photos at predetermined time intervals (for example, 1 second, 5 seconds or 10 seconds, etc.); the color image of the test strip will be automatically recorded after each shot; these images should ensure that multiple areas of the test strip are captured, including the reaction area, the control area and its boundary area; the resolution of the image acquisition device should be high enough to accurately capture subtle changes in the color area in subsequent processing; the acquired images must have sufficient lighting conditions to ensure that the color change information of the test strip is clearly visible; the time interval for image acquisition is adjusted according to the experimental requirements and the color development reaction speed of the test strip; ensure that during the color development reaction of the test strip, the color development status at each time point is accurately recorded.
[0070] S102: Preprocess the acquired color image to remove background noise and enhance the recognizability of the color development area of the test strip:
[0071] Use image filtering technology (such as median filtering or Gaussian filtering) to smooth the original color image and remove noise caused by uneven lighting or performance differences of image acquisition equipment. This can effectively reduce interference factors in the image and improve image quality.
[0072] Image enhancement algorithms (such as histogram equalization or adaptive contrast enhancement) are used to enhance the image and highlight the color-developing area of the test strip. Through enhancement, the color change of the color-developing area is more obvious, which is helpful for subsequent feature extraction.
[0073] In order to further highlight the edge of the test strip, the border in the image is extracted using techniques such as Canny edge detection. This helps to accurately identify the various areas of the test strip and provide a reliable data basis for feature extraction in subsequent steps.
[0074] S103: Sort the color images in chronological order according to the time sequence to form a time sequence of color development areas:
[0075] Each acquired color image is marked with a timestamp, which should be automatically recorded according to the system clock to ensure that the time sequence of the acquired images is accurate. The timestamp format can be UNIX timestamp or standard date and time format.
[0076] Sort all acquired color images by timestamp. This sorting can be done programmatically, using a sorting algorithm (such as quick sort or merge sort) to ensure that the images are in chronological order, avoiding time confusion caused by image acquisition delays or other factors.
[0077] Extract local and global features of the color image, including:
[0078] S201: Segment the color image into local areas and global areas:
[0079] Convert the color image to grayscale image to reduce color interference and improve segmentation accuracy.
[0080] Adaptive threshold segmentation algorithm is used to automatically divide the color area and background area according to the change of brightness in the image. The color area on the test strip is usually lower in brightness, while the background area is higher in brightness.
[0081] The color development area is marked by connected domain analysis and further divided into local area and global area. The local area includes the reaction area and the control area, and the global area is the color development area of the entire test strip.
[0082] Verify the accuracy of the segmentation results manually or through algorithms to ensure that the segmented local and global areas meet the color characteristics of the test strip.
[0083] S202: Apply color histogram and edge detection in the local area to extract color change features, and use color difference analysis in the global area to extract overall color change features:
[0084] Calculate the distribution of the color histogram in the local area, extract the color intensity distribution characteristics, and record the changes in the pixel values in the color display area; use the Canny edge detection algorithm to identify the boundary shape of the local color display area and extract the boundary change characteristics. The boundary of the color display area may gradually expand or shrink as the color intensity changes.
[0085] The pixel values in the global area are counted, the color mean and variance are calculated, and the uniformity of the overall color change is analyzed; through Lab color space conversion, the color difference between the color display area and the background is calculated to evaluate the overall color change of the color display area.
[0086] Local features (such as color histogram and boundary features) and global features (such as color mean and color difference value) are stored as feature vectors respectively for subsequent feature synthesis.
[0087] S203: Synthesize the extracted local features with the global features to form a complete feature vector:
[0088] The data formats of local features and global features are uniformly converted. For example, color histogram features, edge features, etc. are converted into fixed-length feature arrays for subsequent processing; feature normalization methods (such as maximum and minimum normalization) are used to normalize all feature values to the [0,1] interval to eliminate the influence of different feature dimensions on the synthesis results.
[0089] Integrate local features and global features according to predetermined rules. For example, use feature concatenation to combine local features and global features item by item according to dimensions; process the integrated feature vectors through feature mapping functions to ensure complementarity between features and avoid information redundancy.
[0090] Based on the relative importance of local features and global features, the weights of each feature are dynamically adjusted to perform adaptive weighted fusion to form a color change feature vector, including:
[0091] S301: Based on the feature distribution of the local region and the global region in the color image, the initial weights of the local features and the global features are calculated respectively:
[0092] The local and global regional feature distributions of the color image are preliminarily statistically analyzed, and the numerical range and frequency distribution of the local features and global features are statistically analyzed respectively.
[0093] The initial weight of a local feature is calculated as the sum of all feature values in the local area divided by the number of features; the initial weight of a global feature is calculated in a similar way, that is, the sum of all feature values in the global area divided by the number of global features.
[0094] S302: By analyzing the effects of local features and global features on color change, the dynamic contribution of the two is evaluated:
[0095] The dynamic contribution of local features is calculated by dividing the value change of a feature in the local area at a certain point in time by the sum of the changes of all features in the local area.
[0096] The dynamic contribution of the global feature is calculated by dividing the value change of a feature in the global region at a certain point in time by the sum of the changes of all features in the global region.
[0097] Normalization processes the dynamic contribution of local features and the dynamic contribution of global features, and limits the dynamic contribution of local features and global features to a fixed numerical range to ensure that the contributions of different features are comparable.
[0098] S303: Recalculate the weighting factor based on the dynamic contribution, and generate local weighted features and global weighted features:
[0099] The weights are readjusted according to the dynamic contributions of local features and global features to calculate a weighting factor, which is the product of the initial weight and the dynamic contribution of the corresponding feature.
[0100] Based on the adjusted weights, the values of the local weighted features are calculated by multiplying the value of a feature in the local area by the adjusted local weights. The value of the global weighted features is calculated in a similar way, that is, multiplying the value of a feature in the global area by the adjusted global weights.
[0101] S304: Perform weighted merging of the local weighted features and the global weighted features to generate a color change feature vector:
[0102] The local weighted features and the global weighted features are merged according to a predetermined rule, and the final weights of the local features and the global features are multiplied respectively during the merging.
[0103] The final weight distribution satisfies that the sum of the two is a fixed value, such as one or one hundred percent, to ensure that the weight distribution is reasonable.
[0104] After the local weighted features are multiplied by the final weight, they are added to the result of multiplying the global weighted features by the final weight to obtain a complete color change feature vector.
[0105] Based on the color change characteristic vector, a temporal dynamic characteristic model of the color development reaction is constructed to analyze the temporal dynamic law of the color development process of the test strip, including:
[0106] S401: Group the color change feature vectors in chronological order and construct a continuous time series data set for color dynamic law analysis:
[0107] The color change feature vectors are extracted. Each color change feature vector corresponds to a time point. The time points are arranged in the order of shooting or sampling of the color development process. These color change feature vectors are grouped in sequence according to the order of time points to form a continuous time series data set.
[0108] In the time series data set, the color change feature vector at each time point contains information such as the color change and distribution characteristics of the color development area. This information can fully reflect the color development status of the test strip at that time point.
[0109] S402: Convert the continuous time series data set into an input matrix, where the rows of the matrix represent feature vectors and the columns of the matrix represent time points:
[0110] Arrange each feature vector in the time series dataset into an input matrix by time point: ;in, represents the input matrix, Indicates Features at time point The numerical value of represents the dimension of the feature vector (i.e. the number of features at each time point), Indicates the number of time points, The number of the feature. The number indicating the time point.
[0111] Each row in the input matrix represents the change of a color change feature over time, and each column represents all feature values at a certain time point.
[0112] S403: Based on the input matrix, a time dynamic modeling algorithm is selected to train a time dynamic characteristic model of the color development reaction:
[0113] Select an algorithm based on time series modeling (such as a long short-term memory neural network LSTM), and the input matrix is used as training data.
[0114] The expression of the time dynamic characteristic model is defined as: ;in, To indicate a point in time The predicted feature vector of A model for representing the temporal dynamic characteristics of color development reactions. A set of parameters (including weight matrices and bias terms) that represent the temporal dynamic characteristics of the color reaction.
[0115] During training, the model is optimized using the following loss function: ;in, is the loss value, which indicates the error between the predicted value and the actual value; Indicates time point The actual eigenvector of .
[0116] The model iterates the parameter set of the temporal dynamic characteristic model of the color development reaction multiple times to minimize the loss value.
[0117] S404: By optimizing the model parameters, the temporal dynamic characteristic model of the color development reaction is adjusted to adapt to the color development process data:
[0118] Optimize the parameter set of the temporal dynamic characteristic model of the color response, including adjusting the learning rate to accelerate the model convergence, adding regularization terms to avoid model overfitting, and adjusting the number of neurons in the hidden layer to adapt to the complexity of the color data.
[0119] The expression of the model after optimization is: ;in, It is the parameter set of the optimized temporal dynamic characteristic model of the color development reaction.
[0120] After the optimization is completed, the model can accurately capture the temporal dynamics of the color change characteristics and output the optimized prediction feature vector.
[0121] The boundary morphology changes of the color display area are analyzed by morphological filtering and active contour model to determine whether the morphology changes of the color display area are stable, including:
[0122] Perform morphological filtering on the image in the color area to remove noise and highlight the boundary features of the color area:
[0123] Convert the color area image into a grayscale image to reduce the interference of color information.
[0124] The morphological filtering technology is applied to process the grayscale image. The specific operations include: using the dilation operation to highlight the boundary of the colored area, and enhancing the outline of the colored area by extending the pixels with lower brightness to the surrounding pixels; using the erosion operation to remove the noise pixels around the colored area and retain the real boundary of the area.
[0125] The processing result of morphological filtering is expressed as the filtered image matrix , where each pixel value is updated after dilation and erosion: ;in, Represents the first Line The pixel value of the column, Indicates the original image Line The pixel value of the column, In pixels The neighborhood pixel set centered at and Represent the filter image matrix The row and column labels (indicating the pixel position currently being processed), and Respectively represent the row and column labels in the neighborhood pixel set.
[0126] The active contour model is used to segment the boundary of the color area and extract the boundary shape of the color area:
[0127] The filtered image matrix Apply the active contour model and initialize the boundary curve as the rough boundary of the color-rendering area.
[0128] The boundary curve refers to the outline of the color region segmented in the image, indicating the boundary shape of the color region. It is a two-dimensional curve that can be represented by a mathematical function or a point set to describe the geometric characteristics of the color region.
[0129] The active contour model adjusts the boundary curve by minimizing the energy function and finally fits the real boundary of the color rendering area; the energy function is defined as: ;in, Represents the total energy value of the boundary curve, which is used to evaluate the degree of fit between the curve and the boundary of the color-developing area; Indicates that the boundary curve is in the parameter The coordinates of the point below; Indicates that the boundary curve is in the parameter The first-order derivative under is used to measure the smoothness of the curve; Indicates that the boundary curve is in the parameter The second derivative under , which is used to measure the rigidity of the curve; Represents the filtered image matrix The pixel intensity values on the boundary curve; , and They represent the smoothness coefficient, rigidity coefficient and image intensity coefficient, respectively, and are used to control the smoothness, rigidity and boundary fitting accuracy of the curve; The parameterized variable representing the boundary curve represents the parameter value of each point on the boundary curve; Indicates the total length of the boundary curve; Represents tiny arc-length elements along a boundary curve and is used to integrate the energy distribution of the curve.
[0130] Among them, the smoothing coefficient, the rigidity coefficient and the image intensity coefficient can be obtained through experimental adjustment, optimization algorithm or reference empirical values, and can be dynamically set according to the image characteristics of the color display area.
[0131] After multiple iterations, the active contour model finally outputs the fitted boundary curve. , which represents the true boundary shape of the color-developed area.
[0132] The change rate of the color development area boundary and the morphological stability index are calculated based on the boundary value analysis method:
[0133] Extract the fitted boundary curve of the color-developed area Data at multiple points in time, including the length, area, and shape parameters of the boundary.
[0134] Calculate the boundary change rate, which is defined as the rate of change of the boundary length at adjacent time points: ;in, Indicates time point The boundary change rate, Indicates time point The fitted boundary curve The length of the boundary, Indicates time point The fitted boundary curve The length of the boundary.
[0135] Calculate the morphological stability index, taking into account the smoothness and symmetry of the border: ;in, An indicator of the morphological stability of the color-developing region boundary, Represents the fitted boundary curve On The coordinates of the points, Represents the fitted boundary curve The average position of Represents the fitted boundary curve The number of points on Represents the fitted boundary curve The index of the previous point.
[0136] Compare the change rate of the color region boundary and the morphological stability index with the corresponding preset thresholds to determine whether the morphological change of the color region is stable:
[0137] Set a preset threshold for the rate of change of the boundary and preset thresholds for the morphological stability indicator .
[0138] when ,and When , the morphological change of the color display area is determined to be stable (at this time, the boundary change rate and morphological stability index of the color display area meet the preset requirements, and the morphological change is determined to meet the stability requirements); otherwise, the morphological change of the color display area is determined to be unstable.
[0139] in, It is the upper limit of the rate of change of the color-developing area boundary, which is used to judge whether the dynamic change of the boundary is too drastic. This value is determined according to the experimental settings, such as the allowable change range of the boundary length, by analyzing the normal change range of the color-developing area; It is the tolerance range of the fluctuation of the boundary shape of the color-developing area. It is used to measure whether the smoothness and symmetry of the boundary shape are within a reasonable range. By analyzing the deviation and uniformity of the boundary points, this value is set to distinguish between stable and unstable color-developing area shapes.
[0140] The entropy value change of the color development signal is analyzed by Shannon entropy calculation to determine whether the entropy value change of the color development signal conforms to the normal color development trend, including:
[0141] Extract the pixel intensity value of the color-developed area, and count the frequency of occurrence of each pixel intensity value in the color-developed area to generate the probability distribution of pixel intensity:
[0142] All pixel intensity values are extracted from the color-developed area image to generate a grayscale matrix, in which each pixel intensity value represents its grayscale intensity.
[0143] All pixel intensity values in the grayscale image are counted to determine the range of pixel intensity values (eg, from 0 to 255).
[0144] The occurrence frequency of each pixel intensity value is calculated, and the frequency of each pixel intensity value is divided by the total number of pixels to obtain its probability value in the color display area.
[0145] The probabilities of all pixel intensity values are combined to form a probability distribution for subsequent Shannon entropy calculation. The probability distribution is described as follows:
[0146] The probability of each pixel intensity value is calculated by dividing the number of pixels with that pixel intensity value by the total number of pixels in the image. That is, each probability value in the probability distribution is the ratio of the number of pixels with that pixel intensity value to the total number of pixels, and the sum of all probability values is equal to 1.
[0147] The Shannon entropy value of the colored area at a certain time point is calculated based on the probability distribution of pixel intensity:
[0148] Based on the generated pixel intensity probability distribution, the Shannon entropy value of the color display area at a certain time point is calculated. The Shannon entropy value is defined as the negative value of the sum of the products of all pixel intensity probability values and their logarithms, and its expression is: ;in, The Shannon entropy value of the color rendering area, Indicates The probability value of the pixel intensity value, Represents the total number of grayscale values (i.e. the number of possible pixel intensity values), An index representing the pixel intensity value.
[0149] By calculating the probability product terms of each pixel intensity value in turn and summing them up, the Shannon entropy value corresponding to the time point is finally obtained.
[0150] Arrange the Shannon entropy values in chronological order to construct the Shannon entropy value time series of the color-displaying area:
[0151] The Shannon entropy values of the image of the color-developed area are calculated at multiple time points, and the Shannon entropy values of each time point are arranged in chronological order to generate a Shannon entropy value time series.
[0152] Based on the Shannon entropy time series, the entropy change index is generated by calculating the entropy change rate between adjacent time points:
[0153] The Shannon entropy value time series is processed in segments, each segment contains continuous time points, for example, every 5 time points is a segment.
[0154] Calculate the cumulative rate of change of entropy value in each period of time, and the expression is: ;in, Indicates time period The cumulative rate of change of entropy value in Indicates the time period (indicates the number of time points included in this period), Indicates the time point index within the time period. Indicates the total number of time points in the time period. Indicates time point The Shannon entropy value of the color rendering area, Indicates time point The Shannon entropy value of the color rendering area.
[0155] The greater the cumulative rate of entropy change, the more unstable the entropy change of the color rendering signal is, which may deviate from the normal color rendering trend, indicating that the randomness and distribution fluctuation of the color rendering area are beyond the expected range.
[0156] Compare the entropy change index with the preset threshold to determine whether the entropy change of the color rendering signal conforms to the normal color rendering trend:
[0157] The preset threshold corresponding to the cumulative rate of entropy change is set as the standard for judging the color development signal trend, wherein the preset threshold corresponding to the cumulative rate of entropy change is a value set according to experimental data, which is used to limit the random fluctuation range of the color development signal. By analyzing the cumulative rate of entropy change in the normal color development process, its upper limit is extracted as the preset threshold, and if it exceeds this value, it is judged as not meeting the normal color development trend.
[0158] When the cumulative rate of entropy value change is greater than the corresponding preset threshold, it is determined that the entropy value change of the color display signal does not conform to the normal color display trend. This means that the random fluctuation of the color display signal exceeds the normal range, the distribution or dynamic characteristics of the color display area are abnormal, and the color display signal change does not conform to the normal color display trend.
[0159] When the cumulative rate of entropy value change is less than or equal to the corresponding preset threshold, it is judged that the entropy value change of the color display signal conforms to the normal color display trend. At this time, it means that the random fluctuation of the color display signal is within an acceptable range, the distribution and dynamic characteristics of the color display area are stable, and the color display signal change conforms to the normal color display trend.
[0160] When the morphological changes of the coloring area are stable and the changes in the entropy value of the coloring signal conform to the normal coloring trend, the dynamic characteristics of the coloring process can be considered to be within a reasonable physical and chemical range, and the data quality is high. This means that the coloring results of the test strip have good continuity and predictability. If the morphological changes of the coloring area are unstable, there may be problems such as blurred regional boundaries and abnormal coloring diffusion, which will lead to inaccurate dynamic feature extraction and affect the input quality of the time dynamic feature model. Similarly, if the entropy value changes of the coloring signal do not conform to the normal coloring trend, it may be said that the randomness of the coloring process is too large, resulting in high data noise or abnormal coloring reaction, and the model cannot effectively capture the coloring law. Therefore, only when the morphological and entropy changes of the coloring area meet the stability conditions, can the time dynamic feature model accurately predict the coloring results based on reliable data and output the test results of the test strip.
[0161] When the morphological changes of the color development area are stable and the entropy value changes of the color development signal conform to the normal color development trend, the color development result is predicted based on the time dynamic feature model, and the test results of the test strip are output, including:
[0162] S601: Input the time series data of the color development area into the time dynamic feature model to extract the key feature vectors related to the color development process:
[0163] The time series data of the color development area are received as input, which include the color development characteristics at each time point, such as the color intensity distribution and morphological changes of the area.
[0164] The time-dynamic feature model processes the time series data step by step and converts it into a feature representation within the model.
[0165] Through the feature extraction of the model, key features are extracted from the time series data. These features are represented in vector form and cover the core information of color dynamics, such as the speed of color change and the morphological characteristics of regional diffusion.
[0166] S602: Perform inference calculation on the key feature vector based on the time dynamic feature model to generate a predicted value of the color rendering result:
[0167] The key feature vector extracted in S601 is input into the inference module of the time dynamic feature model.
[0168] The temporal dynamic feature model processes the input features hierarchically according to a preset model structure (such as a recurrent neural network or a temporal convolutional network) to simulate the dynamic changes in the color development process. The model calculates the possibility of each color development state through an inference module and represents the color development result as a set of predicted values, each of which represents a possible state of the test strip, such as the probability that the reagent reaction reaches a specific concentration.
[0169] Among them, the inference results are used in the subsequent judgment steps, and the predicted value set is directly compared with the test strip detection standard.
[0170] S603: Compare the predicted value of the color development result with the preset judgment standard of the test strip to determine whether it meets the judgment requirements:
[0171] The predicted values generated in S602 are compared one by one with the preset judgment criteria of the test strip.
[0172] The judgment criteria include the numerical range of the color development results under different conditions, such as the upper and lower limits of the color development intensity corresponding to a specific concentration.
[0173] Verify whether each predicted value falls within the numerical range of the judgment standard: if all predicted values are within the standard range, the color development result is judged to meet the requirements; if any predicted value exceeds the standard range, the color development result is judged to not meet the requirements.
[0174] S604: Classify and mark the color development results to generate the test results of the test strip:
[0175] The color development result is classified according to the determination result of S603: if the color development result meets the determination criteria, it is marked as "passed"; if the color development result does not meet the determination criteria, it is marked as "failed".
[0176] Generate test results of the test strip, including the following:
[0177] Test number: unique identification of the test strip;
[0178] Detection time: the time of collecting color data;
[0179] Detection status: classification mark of color development results;
[0180] Judgment basis: preset standard range corresponding to the test result.
[0181] The test results are stored in the database and output to the user for viewing and analysis.
[0182] It is worth noting that the test strips mentioned in the description of this embodiment are used to represent colloidal gold test strips.
[0183] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0184] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or may be transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium may be a solid-state hard disk.
[0185] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0186] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0187] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0188] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, and may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0189] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0190] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0191] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0192] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for intelligent identification and analysis of colloidal gold test strip results based on machine learning, characterized in that: The steps include: S1: Obtaining color images of the test strip at different time points, the color images containing color change information of each area of the test strip; S2: Extract local and global features of the color image; S3: Based on the relative importance of local features and global features, the weight of each feature is dynamically adjusted to perform adaptive weighted fusion to form a color change feature vector; S4: Based on the color change feature vector, a temporal dynamic characteristic model of the color development reaction is constructed to analyze the temporal dynamic law of the color development process of the test strip; S5: Analyze the boundary morphology change of the color display area through morphological filtering and active contour model to determine whether the morphology change of the color display area is stable; analyze the entropy value change of the color display signal through Shannon entropy calculation to determine whether the entropy value change of the color display signal conforms to the normal color display trend; S6: When the morphological changes of the color development area are stable and the entropy value changes of the color development signal are consistent with the normal color development trend, the color development result is predicted based on the time dynamic feature model and the test result of the test strip is output.
2. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 1, characterized in that: Obtain the color images of the test strip at different time points. The color images contain the color change information of each area of the test strip, including: S101: collecting color images of the test strip within a predetermined time interval, and recording color change information of each area of the test strip at each time point; S102: preprocessing the acquired color image to remove background noise and enhance the recognizability of the color development area of the test strip; S103: Sort the color-developed images in chronological order according to the time sequence to form a time sequence of color-developed areas.
3. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 2, characterized in that: Extract local and global features of the color image, including: S201: performing region segmentation on the color image to divide it into a local region and a global region; S202: applying color histogram and edge detection in the local area to extract color change features, and using color difference analysis in the global area to extract overall color change features; S203: Synthesize the extracted local features with the global features to form a complete feature vector.
4. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 3, characterized in that: Based on the relative importance of local features and global features, the weights of each feature are dynamically adjusted to perform adaptive weighted fusion to form a color change feature vector, including: S301: Based on the feature distribution of the local area and the global area in the color image, initial weights of the local features and the global features are calculated respectively; S302: analyzing the effects of local features and global features on color change, and evaluating the dynamic contribution of the two features; S303: recalculating the weighting factor based on the dynamic contribution, and generating local weighted features and global weighted features; Among them, the weights are readjusted according to the dynamic contribution of local features and global features to calculate the weighting factor, which is the product of the initial weight and the dynamic contribution of the corresponding feature; S304: weightedly merging the local weighted features with the global weighted features to generate a color change feature vector.
5. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 4, characterized in that: Based on the color change characteristic vector, a temporal dynamic characteristic model of the color development reaction is constructed to analyze the temporal dynamic law of the color development process of the test strip, including: S401: grouping the color change feature vectors according to time sequence, and constructing a continuous time series data set for color dynamic law analysis; S402: Convert the continuous time series data set into an input matrix, where the rows of the matrix represent feature vectors and the columns of the matrix represent time points; S403: Based on the input matrix, a time dynamic modeling algorithm is selected to train a time dynamic characteristic model of the color development reaction; S404: By optimizing the model parameters, the temporal dynamic characteristic model of the color development reaction is adjusted to adapt to the color development process data.
6. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 5, characterized in that: The boundary morphology changes of the color display area are analyzed by morphological filtering and active contour model to determine whether the morphology changes of the color display area are stable, including: Perform morphological filtering on the image of the color-developed area to remove noise and highlight the boundary features of the color-developed area; The active contour model is used to segment the boundary of the color-developing area and extract the boundary shape of the color-developing area; The change rate of the color development area boundary and the morphological stability index are calculated based on the boundary value analysis method; The change rate of the color region boundary and the morphological stability index are compared with the corresponding preset thresholds to determine whether the morphological change of the color region is stable.
7. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 6, characterized in that: The change rate of the color development area boundary and the morphological stability index are calculated based on the boundary value analysis method, specifically: Extracting data of the fitted boundary curve of the color development area at multiple time points, including the length, area and shape parameters of the boundary; Calculate the rate of change of the boundary: ;in, Indicates time point The boundary change rate, Indicates time point The boundary length of the fitted boundary curve, Indicates time point The boundary length of the fitted boundary curve; Calculate the morphological stability index: ;in, An index of morphological stability representing the boundaries of the color-developing region, represents the first The coordinate values of the points, represents the average position of the fitted boundary curve, represents the number of points on the fitted boundary curve, Indicates the index of the point on the fitted boundary curve.
8. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 7, characterized in that: The entropy value change of the color development signal is analyzed by Shannon entropy calculation to determine whether the entropy value change of the color development signal conforms to the normal color development trend, including: Extract the pixel intensity value of the color display area, and count the occurrence frequency of each pixel intensity value in the color display area to generate a probability distribution of pixel intensity; The Shannon entropy value of the color-developing area at a certain time point is calculated based on the probability distribution of pixel intensity; Arrange the Shannon entropy values in chronological order to construct the Shannon entropy value time series of the color-displaying area; Based on the Shannon entropy time series, the entropy change index is generated by calculating the entropy change rate between adjacent time points; The entropy value change index is compared with the preset threshold to determine whether the entropy value change of the color rendering signal conforms to the normal color rendering trend.
9. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 8, characterized in that: Based on the Shannon entropy time series, the entropy change index is generated by calculating the entropy change rate between adjacent time points, specifically: The Shannon entropy time series is processed into segments, each of which contains consecutive time points; Calculate the cumulative rate of change of entropy value in each period of time, and the expression is: ;in, Indicates time period The cumulative rate of change of entropy value in Indicates the time period, Indicates the time point index within the time period. Indicates the total number of time points in the time period. Indicates time point The Shannon entropy value of the color rendering area, Indicates time point The Shannon entropy value of the color rendering area.
10. The method for intelligent identification and analysis of colloidal gold test strip results based on machine learning according to claim 9, characterized in that: When the morphological changes of the color development area are stable and the entropy value changes of the color development signal conform to the normal color development trend, the color development result is predicted based on the time dynamic feature model, and the test results of the test strip are output, including: S601: inputting the time series data of the color development area into the time dynamic feature model to extract the key feature vectors related to the color development process; S602: performing inference calculation on key feature vectors based on a time dynamic feature model to generate a predicted value of a color rendering result; S603: Compare the predicted value of the color development result with the preset judgment standard of the test strip to determine whether it meets the judgment requirement; S604: Classify and mark the color development results to generate the test results of the test strip.
Citation Information
Patent Citations
Testing method for colloidal gold card reader and colloidal gold card reader
CN105259342A
Ovulation predicting method and device and terminal
CN107714097A