Cervical fluorescence image processing and analysis method, system and storage medium
By combining the color ratio matrix of cervical fluorescence images with a preset recognition model, the low sensitivity and invasiveness problems of cervical image processing and analysis in existing technologies are solved, and accurate and efficient recognition of cervical precancerous lesions is achieved.
Patent Information
- Application Number
- CN202411340284.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The existing cervical image processing and analysis methods have low sensitivity, making it difficult to accurately identify precancerous lesions. They are also invasive to patients and increase diagnosis time.
By extracting the three primary color values of the cervical fluorescence image to generate a color proportion matrix, a preliminary analysis is made as to whether there are abnormal areas. The abnormal areas are further identified using the preset recognition model, and detailed detection is performed in combination with the preset recognition model formed by convolutional neural network training.
It achieves accurate and efficient analysis of cervical images, improves the accuracy of identifying precancerous lesions, reduces invasiveness to patients, and shortens diagnosis time.
Smart Images

Figure CN119228762B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a cervical fluorescence image processing and analysis method, system and storage medium. Background Art
[0002] Cervical cancer is one of the most common malignant tumors of the female genital tract, primarily squamous cell carcinoma (SCC), with others including cervical adenocarcinoma and small cell carcinoma. Long-term or recurrent infection with the human papillomavirus (HPV) has been shown to be the primary cause of cervical cancer. The development of HPV infection into cervical cancer requires a precancerous stage. According to the WHO classification of female reproductive tract tumors, the precursor lesion to SCC is designated as cervical squamous intraepithelial lesion (SIL), which is categorized into low-grade SIL (LSIL) and high-grade SIL (HSIL). LSIL includes CIN1, p16-negative CIN2, and HPV-induced condylomata. HSIL includes p16-positive CIN2 and CIN3 lesions.
[0003] Accurate and effective detection of precancerous lesions is an important means of cervical cancer screening, significantly reducing the incidence of cervical cancer. Commonly used examination methods include visual inspection, glacial acetic acid coating, conventional colposcopy combined with acetic acid and Lugol's iodine test, Papanicolaou (Pap) smear, and liquid-based cytology. However, these methods have a high false-negative rate, poor sensitivity, and cannot accurately determine the characteristics of the lesion. Furthermore, they require contact coating of the patient's cervix, which can cause discomfort to the patient and may introduce other pathogens during the contact process.
[0004] With the advancement and innovation of medical imaging and image processing technologies, capturing and analyzing cervical images has become a mainstream screening method for cervical cancer. However, current cervical image processing and analysis is often relatively simplistic. For example, the image is analyzed for clarity, and if not, clarity is adjusted, followed by a doctor's diagnosis and further examination. This requires a high level of physician experience and increases patient diagnostic time. Therefore, accurate and efficient analysis and processing of cervical images is a pressing technical challenge. Summary of the Invention
[0005] The main purpose of the present invention is to provide a cervical fluorescence image processing and analysis method, system and storage medium, aiming to solve the technical problem of how to accurately and efficiently analyze and process cervical images in the prior art.
[0006] To achieve the above objectives, the present invention provides a method for processing and analyzing cervical fluorescence images, wherein the method comprises:
[0007] After acquiring a cervical fluorescence image based on the preset excitation light, extracting the three primary color values of each pixel in the cervical fluorescence image, and generating multiple color proportion matrices of the cervical fluorescence image based on the three primary color values of each pixel;
[0008] performing a preliminary analysis on the cervical fluorescence image according to each of the color proportion matrices to determine whether there is an abnormal area in the cervical fluorescence image;
[0009] If an abnormal area exists in the cervical fluorescence image, extracting an abnormal area image from the cervical fluorescence image, and converting the abnormal area image into a cervical grayscale image based on the three primary color values of each pixel in the abnormal area image;
[0010] The cervical grayscale image is recognized based on a preset recognition model to obtain a final recognition result.
[0011] Preferably, the step of identifying the cervical grayscale image based on a preset recognition model to obtain a final recognition result includes:
[0012] Performing feature extraction on the cervical grayscale image based on a feature extraction module in a preset recognition model to obtain a feature vector of the cervical grayscale image;
[0013] The feature vector is classified and calculated based on the classifier in the preset recognition model to obtain a calculation result. The calculation formula is:
[0014]
[0015] Where n represents the number of abnormal categories, ai and bi are the weight and bias values of the i-th abnormality in the classifier, H is the feature vector, pi represents the calculation result of the i-th abnormality probability value, j represents the previous j calculations, and wi represents the sum of the classifier errors of the i-th abnormality calculation result in the previous j calculations;
[0016] According to the calculation result, the abnormality type corresponding to the abnormal area in the cervical fluorescence image is determined, and the area size of the abnormal area is identified, and the abnormality type and the area size are generated as the final identification result.
[0017] Preferably, before the step of identifying the cervical grayscale image based on a preset recognition model to obtain a final recognition result, the step includes:
[0018] Acquire cervical image samples, and divide the cervical image samples into training image samples and test image samples;
[0019] The training image samples are transferred to the preset initial model, the preset initial model is trained, and when the number of training times reaches the preset number, the loss function value of the preset initial model is calculated, and the calculation formula is:
[0020]
[0021] Among them, L represents the loss function value, M represents the number of samples in the training image samples that are identified as abnormal after training, N represents the number of samples in the training image samples that are not identified as abnormal after training, and P k1 represents the abnormal category identified by the training of the k1th training image sample, S k1 represents the abnormal category identified by the training of the k1th training image sample, S k1 represents the reference abnormal region corresponding to the k1th training image sample, S k1 ' represents the abnormal area identified by training of the k1th training image sample, P k2 represents the reference category corresponding to the k2th training image sample, P k2 ′ represents the category of the k2th training image sample after training, S k2 P represents the k2th training image sample k2 'with P k2 On the contrary, the reference abnormal area corresponding to the k2th training image sample;
[0022] Determine whether the loss function value is less than or equal to a preset threshold; if so, test the preset initial model based on the test sample image to obtain a test result;
[0023] A test error is generated according to the test result, and the preset recognition model is generated according to the magnitude relationship between the test error and a preset threshold.
[0024] Preferably, the step of generating the preset recognition model according to the magnitude relationship between the test error and a preset threshold comprises:
[0025] If the size relationship is that the test error is less than a preset threshold, generating the preset initial model as a preset recognition model;
[0026] If the test error is greater than or equal to the preset threshold, the calculation formula of the loss function value is updated, and the preset initial model is iteratively trained based on the updated calculation formula until the test error is less than the preset threshold. The formula for updating the calculation formula is:
[0027]
[0028] Among them, L′ represents the calculation formula after the update, L represents the calculation formula before the update, μ1 and μ2 represent the preset update parameters, and W t Represents the weight matrix between the input layer and the convolution layer in the preset initial model, m represents the number of elements in the weight matrix, Used to calculate the cumulative value of the absolute value of each element in the weight matrix. represents the transpose of the weight matrix.
[0029] Preferably, the step of performing a preliminary analysis on the cervical fluorescence image according to each of the color proportion matrices to determine whether there is an abnormal area in the cervical fluorescence image includes:
[0030] Based on a preset comparison formula, the pixel color proportion values in each color proportion matrix are compared with a preset proportion threshold value to generate multiple proportion conversion matrices, wherein the preset comparison formula is:
[0031]
[0032] k=1, 2, 3, x=1, 2, 3...X, y=1, 2, 3...Y;
[0033] Among them, k represents the red, green and blue of the three primary colors, X represents the number of rows in the color ratio matrix, Y represents the number of columns in the color ratio matrix, F represents the preset ratio threshold, and f' k (x, y) represents the proportion conversion matrix, f k (x, y) represents the color ratio matrix;
[0034] Performing a sum operation on each of the proportion conversion matrices to obtain a sum matrix, and performing a sum operation on the values of each element in the sum matrix to obtain a matrix value of the sum matrix;
[0035] It is determined whether the matrix value is greater than a preset matrix threshold value. If the matrix value is greater than the preset matrix threshold value, it is determined that an abnormal area exists in the cervical fluorescence image.
[0036] Preferably, if there is an abnormal area in the cervical fluorescence image, the step of extracting the abnormal area image from the cervical fluorescence image includes:
[0037] If there is an abnormal area in the cervical fluorescence image, searching for a target element in the sum matrix whose values are all zero;
[0038] Target pixel points corresponding to the target elements are searched in the cervical fluorescence image, and the target pixel points are removed from the fluorescence image to form the abnormal area image.
[0039] Preferably, the step of extracting the three primary color values of each pixel in the cervical fluorescence image includes:
[0040] Determining whether the cervical fluorescence image includes a complete cervical surface and whether the clarity of the cervical fluorescence image reaches a preset clarity threshold;
[0041] If the cervical fluorescence image includes the complete surface of the cervix and the clarity reaches a preset clarity threshold, the cervical fluorescence image is determined to be a valid image, and the step of extracting the three primary color values of each pixel in the cervical fluorescence image is performed;
[0042] If the cervical fluorescence image does not include the complete cervical surface and / or the clarity does not reach a preset clarity threshold, the cervical fluorescence image is determined to be an invalid image, and a prompt message for re-collecting the cervical fluorescence image is output.
[0043] Preferably, the step of extracting the three primary color values of each pixel in the cervical fluorescence image includes:
[0044] Generating a grayscale value of each pixel point according to the three primary color values of each pixel point, determining a maximum value and a minimum value among the grayscale values, and performing an average operation on the maximum value and the minimum value to obtain an operation result as an initial threshold value;
[0045] Comparing the grayscale value of each pixel with the initial threshold, determining a first set of grayscale values greater than the initial threshold, and a second set of grayscale values less than the initial threshold;
[0046] generating a first average grayscale value and a second average grayscale value based on the first grayscale value set and the second grayscale value set, respectively;
[0047] updating the initial threshold according to the first average grayscale value and the second average grayscale value, and determining whether the updated initial threshold is the same as the initial threshold before the update;
[0048] If they are the same, removing each pixel corresponding to the second grayscale value set from the cervical fluorescence image to form a new cervical fluorescence image;
[0049] If they are not the same, then based on the updated initial threshold, the step of comparing the grayscale value of each pixel with the initial threshold is performed until the updated initial threshold is the same as the initial threshold before the update.
[0050] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a cervical fluorescence image processing and analysis system, which includes a memory, a processor, a communication bus, and a control program stored in the memory:
[0051] The communication bus is used to realize the connection and communication between the processor and the storage;
[0052] The processor is used to execute the control program to implement the steps of the cervical fluorescence image processing and analysis method described above.
[0053] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a control program is stored. When the control program is executed by a processor, the steps of the cervical fluorescence image processing and analysis method described above are implemented.
[0054] The present invention provides a cervical fluorescence image processing and analysis method, system, and storage medium. After acquiring a cervical fluorescence image using a preset excitation light source, the method extracts the three primary color values of each pixel in the image and generates multiple color ratio matrices for the cervical fluorescence image based on the three primary color values of each pixel. The method then performs a preliminary analysis of the cervical fluorescence image based on the color ratio matrices to determine whether an abnormal region exists in the image. If an abnormal region exists, the abnormal region image is segmented from the cervical fluorescence image and converted into a cervical grayscale image based on the three primary color values of each pixel in the abnormal region image. The method then identifies the converted cervical grayscale image using a preset recognition model to obtain a final recognition result. Thus, a two-stage detection and recognition mechanism is established. The front stage performs preliminary detection by generating a color ratio matrix from the acquired cervical fluorescence image based on the differences in the three primary color values of the pixels between normal and abnormal cervical fluorescence images. The back stage then performs a re-detection of cervical fluorescence images detected as abnormal by the front stage using a preset recognition model pre-trained with a large number of abnormal image samples. Furthermore, the pre-test criteria for normality are quite strict. Only when the images fully meet the normal criteria can they be considered normal. Furthermore, any area suspected of abnormality is considered abnormal, leading to post-testing. This allows for rapid screening of normal cervical fluorescence images. Furthermore, for initially abnormal cervical fluorescence images, a pre-set recognition model trained using a convolutional neural network performs more detailed and comprehensive image recognition, achieving higher recognition accuracy and enabling precise and efficient analysis and processing of cervical fluorescence images. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 This is a flow chart of a first embodiment of a method for processing and analyzing cervical fluorescence images according to the present invention;
[0056] Figure 2 This is a flow chart of a second embodiment of the cervical fluorescence image processing and analysis method of the present invention;
[0057] Figure 3This is a flow chart of a third embodiment of the cervical fluorescence image processing and analysis method of the present invention;
[0058] Figure 4 This is a schematic diagram of the structure of the hardware operating environment involved in an embodiment of the cervical fluorescence image processing and analysis system of the present invention.
[0059] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0060] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0061] The present invention provides a cervical fluorescence image processing and analysis method, please refer to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for processing and analyzing cervical fluorescence images of the present invention.
[0062] The present invention provides an embodiment of a method for processing and analyzing cervical fluorescence images. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order. Specifically, the method for processing and analyzing cervical fluorescence images in this embodiment includes:
[0063] Step S10 , after acquiring a cervical fluorescence image based on a preset excitation light, extracting the three primary color values of each pixel in the cervical fluorescence image, and generating multiple color proportion matrices of the cervical fluorescence image based on the three primary color values of each pixel.
[0064] The cervical fluorescence image processing and analysis method of this embodiment is applied to a server. The server processes and analyzes collected cervical fluorescence images to determine whether they reflect characteristics of cervical cancer and precancerous lesions. This embodiment utilizes the autofluorescence properties of human tissue to capture cervical fluorescence images. When irradiated with short-wavelength light, such as ultraviolet, violet, or blue light, human tissue can induce fluorescent groups or substances within the tissue, such as collagen, protein, porphyrin, and tryptophan, to produce intrinsic fluorescence, known as autofluorescence. The short-wavelength light used for irradiation is the excitation light. Specifically, a device for capturing cervical fluorescence images is provided. This device can use a preset laser light with a short wavelength that is effective for inducing fluorescence based on the properties of fluorescent substances in the cervix. The device also includes a camera assembly, such as a high-sensitivity CCD (Charge Coupled Device) camera. The preset excitation light illuminates the cervical surface at a specific wavelength, stimulating the cervical tissue to produce autofluorescence. The camera assembly then captures a fluorescence image of the cervical surface and transmits it to the server. The server then acquires the cervical fluorescence image based on the preset excitation light.
[0065] Furthermore, the server is equipped with an extraction tool for extracting the three primary color values. This extraction tool can be used to extract the three primary color values of each pixel in the cervical fluorescence image. The three basic colors that cannot be further decomposed are the three primary colors, including red (R), green (G), and blue (B). The three primary color values of a pixel are the R value, G value, and B value of that pixel. After extracting the three primary color values of each pixel in the cervical fluorescence image, the three primary color values of each pixel can be arranged according to color to form multiple color proportion matrices of the cervical fluorescence image. Since there are three colors in the three primary color values, the color proportion matrices formed are preferably three, namely, a red color proportion matrix, a green color proportion matrix, and a blue color proportion matrix. The specific formation method is that for each pixel point, the R value, G value and B value of the three primary color values are added to obtain the calculation result, and then the R value, G value and B value are respectively ratioed with the calculation result to obtain the R value ratio, G value ratio and B value ratio of each pixel point, and then the R value ratio of each pixel point is arranged according to the position of each pixel point in the cervical fluorescence image to form a red color ratio matrix, the G value ratio of each pixel point is arranged according to the position of each pixel point in the fluorescent cervical image to form a green color ratio matrix, and the B value ratio of each pixel point is arranged according to the position of each pixel point in the fluorescent cervical image to form a blue color ratio matrix.
[0066] It should be noted that when collecting cervical fluorescence images based on preset excitation light, the collected images may be unclear or may not include the complete cervical surface. The three primary colors extracted from the pixels of such images cannot serve as the basis for subsequent analysis and processing. Therefore, before extracting the three primary colors of the pixels, it is necessary to determine the validity of the obtained cervical fluorescence image. Specifically, the step of extracting the three primary color values of each pixel in the cervical fluorescence image includes:
[0067] Step a1, determining whether the cervical fluorescence image contains the complete cervical surface, and whether the clarity of the cervical fluorescence image reaches a preset clarity threshold;
[0068] Step a2: If the cervical fluorescence image includes the complete surface of the cervix and the clarity reaches a preset clarity threshold, the cervical fluorescence image is determined to be a valid image, and the step of extracting the three primary color values of each pixel in the cervical fluorescence image is performed;
[0069] Step a3: If the cervical fluorescence image does not include the complete cervical surface and / or the clarity does not reach the preset clarity threshold, the cervical fluorescence image is determined to be an invalid image, and a prompt message for re-collecting the cervical fluorescence image is output.
[0070] Furthermore, the server is equipped with a recognition module capable of identifying the surface contour of the cervix. This recognition module identifies the cervical fluorescence image and determines whether the image contains the complete cervical surface by determining whether the image contains the corresponding surface contour of the cervix. The server is also equipped with a detection module for detecting image clarity and a preset clarity threshold for determining clarity. The detection module detects the clarity of the cervical fluorescence image and compares the detected clarity with the preset clarity threshold. By determining whether the detected clarity exceeds the preset clarity threshold, the server determines whether the clarity of the cervical fluorescence image meets the preset clarity threshold.
[0071] Furthermore, if the cervical fluorescence image is identified as containing a surface contour corresponding to the cervix, the cervical fluorescence image can be determined to contain a complete cervical surface. Furthermore, if the comparison determines that the detected clarity is greater than a preset clarity threshold, the clarity of the cervical fluorescence image can be determined to have met the preset clarity threshold. The cervical fluorescence image is then determined to be a valid image, and the three primary color values of each pixel can be extracted therefrom. Conversely, if the cervical fluorescence image does not contain a complete cervical surface, or its clarity does not meet the preset clarity threshold, or if the cervical fluorescence image neither contains the cervical surface nor meets the preset clarity threshold, the cervical fluorescence image is considered invalid. In this case, a prompt message can be output in the form of text or audio to recapture the cervical fluorescence image, so that a valid cervical fluorescence image can be recaptured for analysis and processing based on the prompt message.
[0072] It is understandable that the collected cervical fluorescence images not only include images of the cervical surface, but also images of the surrounding tissues. This type of tissue is not useful for the analysis of cervical cancer and precancerous lesions, but instead increases the amount of data required for image processing, affecting processing efficiency. Therefore, after extracting the three primary color values of each pixel, the cervical fluorescence image can be background-removed based on the differences between the pixels, so as to retain the area containing the cervical image for analysis and processing. Specifically, after extracting the three primary color values of each pixel in the cervical fluorescence image, the following steps are performed:
[0073] Step b1, generating a grayscale value for each pixel according to the three primary color values of each pixel, determining a maximum value and a minimum value among the grayscale values, and performing a mean operation on the maximum value and the minimum value to obtain a mean value as an initial threshold value;
[0074] Step b2: comparing the grayscale value of each pixel with the initial threshold, determining a first set of grayscale values greater than the initial threshold, and a second set of grayscale values less than the initial threshold among the grayscale values;
[0075] Step b3, generating a first average grayscale value and a second average grayscale value based on the first grayscale value set and the second grayscale value set respectively;
[0076] Step b4, updating the initial threshold value according to the first average grayscale value and the second average grayscale value, and determining whether the updated initial threshold value is the same as the initial threshold value before the update;
[0077] Step b5: if they are the same, removing each pixel corresponding to the second grayscale value set from the cervical fluorescence image to form a new cervical fluorescence image;
[0078] Step b6: If they are not the same, then based on the updated initial threshold, the step of comparing the grayscale value of each pixel with the initial threshold is performed until the updated initial threshold is the same as the initial threshold before the update.
[0079] Furthermore, a grayscale conversion formula is pre-set. The three primary color values of each pixel are added to the grayscale conversion formula for calculation. The calculated result is the grayscale value of each pixel. After the three primary color values of all pixels are calculated, the grayscale values of all pixels are obtained. The grayscale values are then compared to determine the maximum and minimum values. The maximum and minimum values are then averaged, and the calculated result forms the initial threshold.
[0080] Furthermore, two arrays are established, namely a first array and a second array. The grayscale value of each pixel is compared with the initial threshold value to determine the size relationship between each grayscale value and the initial threshold value. Grayscale values that are determined to be greater than the initial threshold value after comparison are placed in the first array, and grayscale values that are determined to be less than the initial threshold value after comparison are placed in the second array. After all grayscale values are compared, the first array forms a first grayscale value set, and the second array forms a second grayscale value set. Then, a mean operation is performed on each grayscale value in the first grayscale value set to obtain the operation result as the first average grayscale value, and a mean operation is performed on each grayscale value in the second grayscale value set to obtain the operation result as the second average grayscale value.
[0081] Furthermore, the first average grayscale value and the second average grayscale value are averaged, and the result is used to replace and update the original initial threshold. A determination is then made as to whether the updated initial threshold is the same as the initial threshold before the update. If they are the same, this indicates that the pixels corresponding to the first grayscale value set are all pixels imaging the cervical surface, and the pixels corresponding to the second grayscale value set are all pixels imaging the surrounding tissue of the cervix. Therefore, the pixels corresponding to the second grayscale value set can be removed from the cervical fluorescence image. The new cervical fluorescence image formed by the remaining pixels after removal is an image of the cervical surface.
[0082] Conversely, if the updated initial threshold is determined to be different from the initial threshold before the update, this indicates that the pixels corresponding to the first grayscale value set and the pixels corresponding to the second grayscale value set both include pixels from the cervical surface image and pixels from the surrounding tissue image. In this case, the grayscale value of each pixel is compared with the updated initial threshold to determine the magnitude relationship between each grayscale value and the updated initial threshold. The first and second grayscale value sets are then re-divided, and the first and second average grayscale values are calculated to form a new initial threshold for judgment. This is repeated until the updated initial threshold is equal to the initial threshold before the update, generating a new cervical fluorescence image.
[0083] Step S20: performing a preliminary analysis on the cervical fluorescence image according to each of the color proportion matrices to determine whether there is an abnormal area in the cervical fluorescence image.
[0084] Understandably, the composition and content of substances differ between normal and abnormal cervical tissue, resulting in different cervical fluorescence images. A large number of cervical fluorescence images obtained from normal cervical tissue are preliminarily analyzed to determine the color ratio characteristics of each of the three primary color values, which serve as a reference for analyzing the generated color ratio matrices. Based on the analysis of the color ratio matrices, a preliminary analysis of the reference cervical fluorescence images is then performed to determine whether abnormal areas exist in the cervical fluorescence images. Abnormal areas include at least cancerous areas and precancerous lesions.
[0085] It should be noted that to avoid missing abnormal areas in cervical fluorescence images, strict criteria are used to form a normal reference, and strict criteria are also used to analyze each color ratio matrix based on the normal reference. Only strictly normal cervical tissue is used to form a normal reference, and only when each color ratio matrix strictly matches the normal reference is the cervical fluorescence image determined to have no abnormal areas. All other areas are determined to have abnormal areas, thus ensuring the accuracy of cervical abnormality screening.
[0086] Step S30: If an abnormal area exists in the cervical fluorescence image, an abnormal area image is extracted from the cervical fluorescence image, and the abnormal area image is converted into a cervical grayscale image based on the three primary color values of each pixel in the abnormal area image.
[0087] Furthermore, if an abnormal region is determined to exist in the cervical fluorescence image, the cervical fluorescence image can be segmented based on the boundaries of the abnormal region, and the abnormal region can be extracted as an abnormal region image. Furthermore, based on the grayscale values converted from the three primary color values of each pixel in the abnormal region image, the abnormal region image is converted into a cervical grayscale image for subsequent analysis and processing.
[0088] Step S40: Recognize the cervical grayscale image based on a preset recognition model to obtain a final recognition result.
[0089] Furthermore, the server is pre-installed with a preset recognition model. This model is trained based on a convolutional neural network and includes convolutional layers, pooling layers, and fully connected layers. Because normal cervical tissue has been excluded by the color ratio matrix, the cervical fluorescence images that have been initially analyzed to show abnormal areas require further processing. Therefore, to save training time and subsequent processing time for the preset recognition model, various abnormal images formed by various types of abnormal cervical tissue can be collected as training samples to form a preset recognition model. This model is then capable of identifying abnormal types of cervical tissue. Of course, to avoid errors in cervical fluorescence images that do not contain abnormal areas excluded by the color ratio matrix, and thus misclassify normal cervical fluorescence images as those with abnormal areas, the training samples can include a large number of normal image samples formed by normal cervical tissue and various abnormal image samples formed by various types of abnormal cervical tissue. The preset recognition model is trained using these training samples, enabling the preset recognition model to distinguish between normal and abnormal fluorescence images in addition to differentiating between various types of abnormalities. The trained preset recognition model is then used to perform recognition processing on the converted cervical grayscale image to obtain the final recognition result. The final recognition result at least includes information such as whether there is an abnormal area in the cervical fluorescence image, if there is an abnormal area, the size of the abnormal area, and the corresponding abnormal type.
[0090] The present invention provides a cervical fluorescence image processing and analysis method. After acquiring a cervical fluorescence image using a preset excitation light source, the three primary color values of each pixel in the cervical fluorescence image are extracted. Multiple color ratio matrices of the cervical fluorescence image are generated based on the three primary color values of each pixel. The cervical fluorescence image is then initially analyzed based on each color ratio matrix to determine whether an abnormal region exists within the cervical fluorescence image. If an abnormal region exists, the abnormal region image is segmented from the cervical fluorescence image and converted into a cervical grayscale image based on the three primary color values of each pixel within the abnormal region image. The converted cervical grayscale image is then recognized using a preset recognition model to obtain a final recognition result. Thus, a two-stage detection and recognition mechanism is established. The front stage performs preliminary detection by generating a color ratio matrix from the acquired cervical fluorescence image based on the differences in the three primary color values of the pixels between normal and abnormal cervical fluorescence images. The back stage then performs a re-detection of cervical fluorescence images detected as abnormal by the front stage using a preset recognition model pre-trained on a large number of abnormal image samples. Furthermore, the pre-test criteria for normality are quite strict. Only when the images fully meet the normal criteria can they be considered normal. Furthermore, any area suspected of abnormality is considered abnormal, leading to post-testing. This allows for rapid screening of normal cervical fluorescence images. Furthermore, for initially abnormal cervical fluorescence images, a pre-set recognition model trained using a convolutional neural network performs more detailed and comprehensive image recognition, achieving higher recognition accuracy and enabling precise and efficient analysis and processing of cervical fluorescence images.
[0091] Further, please refer to Figure 2 Based on the first embodiment of the cervical fluorescence image processing and analysis method of the present invention, a second embodiment of the cervical fluorescence image processing and analysis method of the present invention is proposed.
[0092] The difference between the second embodiment of the cervical fluorescence image processing and analysis method and the first embodiment of the cervical fluorescence image processing and analysis method is that the step of identifying the cervical grayscale image based on a preset recognition model to obtain a final recognition result includes:
[0093] Step S41, performing feature extraction on the cervical grayscale image based on a feature extraction module in a preset recognition model to obtain a feature vector of the cervical grayscale image;
[0094] Step S42, performing classification calculation on the feature vector based on the classifier in the preset recognition model to obtain a calculation result;
[0095] Step S43: determining the abnormality type corresponding to the abnormal area in the cervical fluorescence image according to the calculation result, identifying the area size of the abnormal area, and generating the abnormality type and the area size as the final recognition result.
[0096] Furthermore, the cervical grayscale image can be processed directly using a preset recognition model, or it can be divided into multiple sub-grayscale images and processed separately using the preset recognition model. Alternatively, based on the size of the cervical sub-grayscale image, if it exceeds a certain size, it can be divided into multiple sub-grayscale images for processing, while if it does not exceed the specified size, it can be directly processed. Regardless of whether the sub-grayscale image is divided or not, the processing flow is the same, with only differences in processing efficiency. This embodiment uses an undivided cervical grayscale image for illustration.
[0097] Specifically, the preset recognition model is divided into a feature extraction module, which includes multiple convolution layers and multiple pooling layers, for example, at least three convolution layers and three pooling layers. The convolution layer is used to extract features from the image, and the pooling layer is used to select the features extracted by the convolution layer. Therefore, it can be set to connect a pooling layer after a convolution layer. In addition, it can also be set so that the number of convolution layers is greater than the number of pooling layers, for example, twice, so that two convolution layers correspond to one pooling layer. The cervical grayscale image is subjected to feature extraction by this type of feature extraction module in the preset recognition model to obtain multiple feature matrices, and then the feature matrices are connected by the fully connected layer in the preset recognition module to form a feature vector of the cervical grayscale image.
[0098] Furthermore, the preset recognition model also includes a classifier, which classifies and calculates each feature vector to obtain a calculation result representing the probability value of the feature vector in each category of abnormality. The category of abnormality includes at least no abnormality, CIN1 abnormality, negative CIN2 abnormality, condyloma abnormality, positive CIN2 abnormality, positive CIN3 abnormality, cancer abnormality, etc. The calculation formula can be specifically referred to as the following formula (1).
[0099]
[0100] Where n represents the number of abnormal categories, ai and bi are the weight and bias values of the i-th abnormality in the classifier, H is the feature vector, pi represents the calculation result of the i-th abnormality probability value, j represents the previous j calculations, and wi represents the sum of the classifier errors of the i-th abnormality calculation result in the previous j calculations.
[0101] In order to ensure the accuracy of probability value calculation in each category of anomalies, this embodiment is provided with a mechanism for correcting the classifier errors that occurred in the previous calculation process for each category of anomalies. The specific number of times can be determined by testing. For example, if the correction effect of the first 5 times is better after testing, it is set to the first 5 times. Among them, the classifier error is the calculation error introduced due to its weight value and bias value. After each preset recognition model is completed, the calculation error will be evaluated to obtain the corresponding classifier error. By averaging the classifier errors of the previous times and using them to correct the current classification calculation, the current calculation result is more accurate.
[0102] Furthermore, after obtaining the probability values for each category of abnormality represented by the calculation results, the probability values represented by the calculation results are compared to determine the probability value with the largest value. The abnormality type corresponding to the largest probability value is then searched for; this abnormality type is the abnormality type corresponding to the abnormal region image. Furthermore, the abnormal region boundary in the abnormal region image is identified, and the abnormal range of the abnormal region is determined based on the region boundary, thereby obtaining the region size corresponding to the abnormal region. Furthermore, for the abnormal region image formed by segmenting the abnormal region boundary, the region size corresponding to the abnormal region can be directly determined based on the boundary of the abnormal region image. The abnormality type and abnormal region size are then combined to form the final recognition result.
[0103] It is understandable that the preset recognition model needs to be pre-trained. Specifically, the step of recognizing the cervical grayscale image based on the preset recognition model and obtaining the final recognition result includes:
[0104] Step c1, obtaining cervical image samples, and dividing the cervical image samples into training image samples and test image samples;
[0105] Step c2, transferring the training image sample to a preset initial model, training the preset initial model, and calculating the loss function value of the preset initial model when the number of training times reaches a preset number;
[0106] Step c3, determining whether the loss function value is less than or equal to a preset threshold; if so, testing the preset initial model based on the test sample image to obtain a test result;
[0107] Step c4: generating a test error according to the test result, and generating the preset recognition model according to the size relationship between the test error and a preset threshold.
[0108] Furthermore, a large number of cervical image samples are collected and screened, and those that are unclear are removed. The remaining images are labeled with abnormal types and areas before being transmitted to the server. After receiving these cervical image samples, the server divides them into training and test image samples according to a pre-set ratio, such as an 8:2 ratio or a 7:3 ratio. The training image samples are then transmitted to a preset initial model built based on a convolutional neural network for deep learning training.
[0109] Furthermore, a preset number of training runs and a loss function value calculation formula are pre-set for the preset initial model. The loss function value is used to evaluate the difference between the model output of the trained preset initial model and the identified target output. The smaller the difference, the closer the model output of the preset initial model is to the target output, and the better the model training effect. When the number of training runs reaches the preset number, the loss function value is calculated. The specific calculation formula can be referred to as the following formula (2).
[0110]
[0111] Among them, L represents the loss function value, M represents the number of samples in the training image samples that are identified as abnormal after training, N represents the number of samples in the training image samples that are not identified as abnormal after training, and P k1 represents the abnormal category identified by the training of the k1th training image sample, S k1 represents the abnormal category identified by the training of the k1th training image sample, S k1 represents the reference abnormal region corresponding to the k1th training image sample, S k1 ' represents the abnormal area identified by training of the k1th training image sample, P k2 represents the reference category corresponding to the k2th training image sample, P k2 ' represents the category of the k2th training image sample after training, S k2 P represents the k2th training image sample k2 'with P k2 On the contrary, the reference abnormal area corresponding to the k2th training image sample.
[0112] It should be noted that the cervical image samples in this embodiment include both normal image samples formed by normal cervical tissue and various abnormal image samples formed by various abnormal cervical tissues. When calculating the loss function value, the error loss of normal image samples and abnormal image samples should be considered. In the above formula (2), the reference abnormal category and the reference abnormal area are the identified abnormal category and abnormal area, respectively, and the reference category is the category identified as non-abnormal. For a certain training image sample, if it is an abnormal category, but is identified as a non-abnormal category, that is, the P of the above training image sample k2 'with P k2 On the contrary, in this case, the corresponding abnormal area is not identified, and the abnormal area identified by the training image samples of this abnormal type constitutes its error. By considering the errors caused by various factors, the calculated loss function value is made more accurate.
[0113] Furthermore, a preset threshold representing the error size is pre-set, and the calculated loss function value is compared with the preset threshold to determine whether the loss function value is less than or equal to the preset threshold. If it is less than or equal to, it means that the loss function value is smaller, and the closer the model output of the trained preset initial model is to the target output. At this time, in order to ensure the accuracy of the preset initial model, the preset initial model is tested with a test sample image, and the test sample image is processed by the preset initial model to obtain a test result, and a test error is generated based on the test result. The method for generating the test error can be the same as the method for generating the loss function value, or it can be different, and there is no limitation here.
[0114] Furthermore, the test error is compared with a preset threshold to generate a magnitude relationship between the two, and then a preset recognition model is generated based on the magnitude relationship between the two. Specifically, the step of generating the preset recognition model based on the magnitude relationship between the test error and the preset threshold includes:
[0115] Step c41: if the size relationship is that the test error is less than a preset threshold, generating the preset initial model as a preset recognition model;
[0116] Step c42: If the test error is greater than or equal to the preset threshold, the calculation formula of the loss function value is updated, and the preset initial model is iteratively trained based on the updated calculation formula until the test error is less than the preset threshold.
[0117] Furthermore, if the relationship between the test error and the preset threshold is that the prediction error is less than the preset threshold, it means that the trained preset initial model can accurately process the test image sample, and the preset initial model has a better image processing effect after training, thereby generating the preset initial model into a preset recognition model.
[0118] If the relationship between the test error and the preset threshold is such that the prediction error is greater than or equal to the preset threshold, this indicates that the trained preset initial model performs poorly on the test image samples but performs well on the training image samples, indicating that the preset initial model overfits the training image samples. In this case, the loss function calculation formula is adjusted by adding a penalty term to limit overfitting to update the formula. The preset initial model is then iteratively trained based on the updated formula. The loss function value is recalculated and, when it is less than or equal to the preset threshold, it is retested using the test samples until the test error is also less than the preset threshold, at which point the preset initial model is converted into the preset recognition model.
[0119] The formula for updating the calculation formula of the loss function value is specifically shown in the following formula (3).
[0120]
[0121] Among them, L′ represents the calculation formula after the update, L represents the calculation formula before the update, μ1 and μ2 represent the preset update parameters, and W t Represents the weight matrix between the input layer and the convolution layer in the preset initial model, m represents the number of elements in the weight matrix, Used to calculate the cumulative value of the absolute value of each element in the weight matrix. represents the transpose of the weight matrix.
[0122] This embodiment pre-trains a preset recognition model for identifying cervical grayscale images. During the training process, various factors that may cause model recognition errors are fully considered. Overfitting of the preset recognition model to training image samples is prevented by updating the loss function calculation formula. This ensures the accuracy of the preset recognition model, thereby making it more accurate in identifying cervical grayscale images. Furthermore, a classifier error assessment and correction mechanism is implemented for the classifier in the preset recognition model, further improving the accuracy of identifying abnormal categories in cervical grayscale images.
[0123] Further, please refer to Figure 3 Based on the first and second embodiments of the cervical fluorescence image processing and analysis method of the present invention, a third embodiment of the cervical fluorescence image processing and analysis method of the present invention is proposed.
[0124] The third embodiment of the cervical fluorescence image processing and analysis method differs from the first and second embodiments of the cervical fluorescence image processing and analysis method in that the step of performing a preliminary analysis on the cervical fluorescence image based on each color proportion matrix to determine whether there is an abnormal area in the cervical fluorescence image includes:
[0125] Step S21, based on a preset comparison formula, comparing the pixel color proportion values in each of the color proportion matrices with a preset proportion threshold value to generate a plurality of proportion conversion matrices;
[0126] Step S22, performing a sum operation on each of the proportion conversion matrices to obtain a sum matrix, and performing a sum operation on the values of each element in the sum matrix to obtain a matrix value of the sum matrix;
[0127] Step S23 , determining whether the matrix value is greater than a preset matrix threshold value; if so, determining that an abnormal area exists in the cervical fluorescence image.
[0128] Furthermore, the server is pre-set with a preset comparison formula and a preset ratio threshold for performing a comparison process on the color ratio matrix. The preset ratio threshold is generated based on the pixel color ratio in the normal cervical fluorescence image formed by normal cervical tissue, and is used to determine whether the pixel in the cervical fluorescence image matches the pixel in the normal cervical fluorescence image. Moreover, for three different color ratio matrices, the preset ratio threshold can be set to different values based on the characteristics of the pixel in the normal cervical fluorescence image, or it can be set to the same value. Specifically, the elements in the color ratio matrix are used as pixel color ratio values, and each color ratio value is compared with the preset ratio threshold using the preset comparison formula to determine whether the color ratio value is greater than or equal to the preset ratio threshold. If it is greater than or equal to the preset ratio threshold, the element corresponding to the color ratio value in the color ratio matrix is generated as a value of 1, indicating that the pixel corresponding to the color ratio value may be abnormal. Conversely, if it is determined to be less than the preset ratio threshold, the element corresponding to the color ratio value in the color ratio matrix is generated as a value of 0, indicating that the pixel corresponding to the color ratio value is normal. The specific preset comparison formula can be seen in the following formula (4).
[0129]
[0130] k=1, 2, 3, x=1, 2, 3...X, y=1, 2, 3...Y; (4);
[0131] Among them, k represents the red, green and blue of the three primary colors, X represents the number of rows in the color ratio matrix, Y represents the number of columns in the color ratio matrix, F represents the preset ratio threshold, and f' k (x, y) represents the proportion conversion matrix, f k (x, y) represents the color proportion matrix.
[0132] Furthermore, after comparing the color proportion values of all pixels in each color proportion matrix, the resulting matrix is used as a proportion conversion matrix, and a summation operation is performed on each proportion conversion matrix. Specifically, each element in the red color proportion matrix, the green color proportion matrix, and the blue color proportion matrix is summed according to its respective position to form a summation matrix. For example, the elements in the first row and first column of the three color proportion matrices are summed, the elements in the first row and second column are summed, the elements in the first row and third row are summed, and so on, to obtain the elements in the first row, first column, second column, third column, etc. of the summation matrix, respectively. The values of each element in the summation matrix are then summed again, for example, the values of the elements in the first row, first column, second column, third column, etc., are summed to obtain the matrix value of the summation matrix.
[0133] Furthermore, a preset matrix threshold is pre-set based on a normal cervical fluorescence image. A normal cervical fluorescence image is formed by a normal cervix component. The preset matrix threshold is used to determine whether the currently acquired cervical fluorescence image is abnormal. Specifically, the matrix value obtained by the calculation is compared with the preset matrix threshold to determine whether the matrix value is greater than the preset matrix threshold. If it is greater than the preset matrix threshold, it indicates that the pixel color ratio values in the color ratio matrix have a relatively large number of pixel color ratio values greater than the preset ratio threshold, and the cervix corresponding to the cervical fluorescence image derived from the color ratio matrix is likely to be abnormal. Therefore, it is determined that an abnormal area exists in the cervical fluorescence image. Otherwise, it is determined that no abnormal area exists in the cervical fluorescence image.
[0134] Furthermore, for cervical fluorescence images containing abnormal areas, the cervical fluorescence image can be segmented by identifying the boundaries of the abnormal areas, and the abnormal areas can be extracted from the images for abnormality type identification, thereby avoiding identification of the entire cervical fluorescence image and improving identification efficiency. Specifically, if an abnormal area exists in the cervical fluorescence image, the step of extracting an image of the abnormal area from the cervical fluorescence image includes:
[0135] Step S31, if there is an abnormal area in the cervical fluorescence image, searching for a target element in the sum matrix whose values are all zero;
[0136] Step S32 , searching for target pixel points corresponding to the target elements in the cervical fluorescence image, and removing the target pixel points from the fluorescence image to form the abnormal area image.
[0137] Furthermore, for cervical fluorescence images determined to have abnormal areas, the pixel points corresponding to the elements in the color proportion matrix whose color proportion values are greater than the preset proportion threshold may be abnormal, and the value of the element after summing up in the sum matrix is 1, 2 or 3. Therefore, the abnormal area in the cervical fluorescence image can be determined by searching for all elements in the sum matrix whose element values are zero.
[0138] Specifically, the numerical values of the elements in the sum matrix are identified, and all elements with a zero value are identified as target elements. The target position of each target element in the sum matrix is then determined, and the pixel corresponding to each target position in the cervical fluorescence image is identified as the target pixel corresponding to each target element in the cervical fluorescence image. The target pixel is a point in the non-abnormal area of the cervical fluorescence image. All identified target pixels are removed from the cervical fluorescence image, and the area formed by the remaining pixels is the abnormal area in the cervical fluorescence image.
[0139] In this embodiment, each color proportion matrix is converted into a proportion conversion matrix. For the same pixel point, as long as the pixel color proportion value of the pixel point in any color proportion matrix is abnormal, the pixel point is generated as an abnormal element in the proportion conversion matrix, and the cervical fluorescence image is segmented based on this type of abnormal element and other normal matrices in the proportion conversion matrix, and the abnormal area image is extracted therefrom, so that the determination of whether there is an abnormal area in the cervical fluorescence image and the extraction of the abnormal area image are more accurate.
[0140] In addition, the embodiment of the present invention also provides a cervical fluorescence image processing and analysis system. Figure 4 , Figure 4 This is a schematic diagram of the structure of the equipment hardware operating environment involved in the embodiment of the cervical fluorescence image processing and analysis system of the present invention.
[0141] like Figure 4 As shown, the cervical fluorescence image processing and analysis system may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a storage device 1005. The communication bus 1002 is used to implement connection and communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface). The storage device 1005 may be a high-speed RAM storage device or a stable storage device (non-volatile memory), such as a disk storage device. The storage device 1005 may also be a storage device independent of the aforementioned processor 1001.
[0142] Those skilled in the art will understand that Figure 4 The hardware structure of the cervical fluorescence image processing and analysis system shown in the figure does not constitute a limitation to the cervical fluorescence image processing and analysis system, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0143] like Figure 4 As shown, the storage medium 1005 may include an operating system, a network communication module, a user interface module, and a control program. The operating system is a program that manages and controls the cervical fluorescence image processing and analysis system and software resources, supporting the operation of the network communication module, the user interface module, the control program, and other programs or software. The network communication module is used to manage and control the network interface 1004; and the user interface module is used to manage and control the user interface 1003.
[0144] exist Figure 4 In the hardware structure of the cervical fluorescence image processing and analysis system shown in FIG, the network interface 1004 is mainly used to connect to other system servers and communicate data with them; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; the processor 1001 can call the control program stored in the memory 1005 and perform the following operations:
[0145] After acquiring a cervical fluorescence image based on the preset excitation light, extracting the three primary color values of each pixel in the cervical fluorescence image, and generating multiple color proportion matrices of the cervical fluorescence image based on the three primary color values of each pixel;
[0146] performing a preliminary analysis on the cervical fluorescence image according to each of the color proportion matrices to determine whether there is an abnormal area in the cervical fluorescence image;
[0147] If an abnormal area exists in the cervical fluorescence image, extracting an abnormal area image from the cervical fluorescence image, and converting the abnormal area image into a cervical grayscale image based on the three primary color values of each pixel in the abnormal area image;
[0148] The cervical grayscale image is recognized based on a preset recognition model to obtain a final recognition result.
[0149] Furthermore, the step of identifying the cervical grayscale image based on a preset recognition model to obtain a final recognition result includes:
[0150] Performing feature extraction on the cervical grayscale image based on a feature extraction module in a preset recognition model to obtain a feature vector of the cervical grayscale image;
[0151] The feature vector is classified and calculated based on the classifier in the preset recognition model to obtain a calculation result. The calculation formula is:
[0152]
[0153] Where n represents the number of abnormal categories, ai and bi are the weight and bias values of the i-th abnormality in the classifier, H is the feature vector, pi represents the calculation result of the i-th abnormality probability value, j represents the previous j calculations, and wi represents the sum of the classifier errors of the i-th abnormality calculation result in the previous j calculations;
[0154] According to the calculation result, the abnormality type corresponding to the abnormal area in the cervical fluorescence image is determined, and the area size of the abnormal area is identified, and the abnormality type and the area size are generated as the final identification result.
[0155] Furthermore, before the step of identifying the cervical grayscale image based on the preset recognition model and obtaining the final recognition result, the processor 1001 may call the control program stored in the storage 1005 and perform the following operations:
[0156] Acquire cervical image samples, and divide the cervical image samples into training image samples and test image samples;
[0157] The training image samples are transferred to the preset initial model, the preset initial model is trained, and when the number of training times reaches the preset number, the loss function value of the preset initial model is calculated, and the calculation formula is:
[0158]
[0159] Among them, L represents the loss function value, M represents the number of samples in the training image samples that are identified as abnormal after training, N represents the number of samples in the training image samples that are not identified as abnormal after training, and P k1 represents the abnormal category identified by the training of the k1th training image sample, S k1 represents the abnormal category identified by the training of the k1th training image sample, S k1 represents the reference abnormal region corresponding to the k1th training image sample, S k1 ' represents the abnormal area identified by training of the k1th training image sample, P k2 represents the reference category corresponding to the k2th training image sample, P k2 ' represents the category of the k2th training image sample after training, S k2 P represents the k2th training image sample k2 'with P k2 On the contrary, the reference abnormal area corresponding to the k2th training image sample;
[0160] Determine whether the loss function value is less than or equal to a preset threshold; if so, test the preset initial model based on the test sample image to obtain a test result;
[0161] A test error is generated according to the test result, and the preset recognition model is generated according to the magnitude relationship between the test error and a preset threshold.
[0162] Furthermore, the step of generating the preset recognition model according to the magnitude relationship between the test error and a preset threshold value includes:
[0163] If the size relationship is that the test error is less than a preset threshold, generating the preset initial model as a preset recognition model;
[0164] If the test error is greater than or equal to the preset threshold, the calculation formula of the loss function value is updated, and the preset initial model is iteratively trained based on the updated calculation formula until the test error is less than the preset threshold. The formula for updating the calculation formula is:
[0165]
[0166] Among them, L′ represents the calculation formula after the update, L represents the calculation formula before the update, μ1 and μ2 represent the preset update parameters, and W t Represents the weight matrix between the input layer and the convolution layer in the preset initial model, m represents the number of elements in the weight matrix, Used to calculate the cumulative value of the absolute value of each element in the weight matrix. represents the transpose of the weight matrix.
[0167] Furthermore, the step of performing a preliminary analysis on the cervical fluorescence image according to each of the color proportion matrices to determine whether there is an abnormal area in the cervical fluorescence image includes:
[0168] Based on a preset comparison formula, the pixel color proportion values in each color proportion matrix are compared with a preset proportion threshold value to generate multiple proportion conversion matrices, wherein the preset comparison formula is:
[0169]
[0170] k=1, 2, 3, x=1, 2, 3...X, y=1, 2, 3...Y;
[0171] Among them, k represents the red, green and blue of the three primary colors, X represents the number of rows in the color ratio matrix, Y represents the number of columns in the color ratio matrix, F represents the preset ratio threshold, and f'k (x, y) represents the proportion conversion matrix, f k (x, y) represents the color ratio matrix;
[0172] Performing a sum operation on each of the proportion conversion matrices to obtain a sum matrix, and performing a sum operation on the values of each element in the sum matrix to obtain a matrix value of the sum matrix;
[0173] It is determined whether the matrix value is greater than a preset matrix threshold value. If the matrix value is greater than the preset matrix threshold value, it is determined that an abnormal area exists in the cervical fluorescence image.
[0174] Furthermore, if there is an abnormal area in the cervical fluorescence image, the step of extracting the abnormal area image from the cervical fluorescence image includes:
[0175] If there is an abnormal area in the cervical fluorescence image, searching for a target element in the sum matrix whose values are all zero;
[0176] Target pixel points corresponding to the target elements are searched in the cervical fluorescence image, and the target pixel points are removed from the fluorescence image to form the abnormal area image.
[0177] Furthermore, before the step of extracting the three primary color values of each pixel in the cervical fluorescence image, the processor 1001 may call the control program stored in the memory 1005 and perform the following operations:
[0178] Determining whether the cervical fluorescence image includes a complete cervical surface and whether the clarity of the cervical fluorescence image reaches a preset clarity threshold;
[0179] If the cervical fluorescence image includes the complete surface of the cervix and the clarity reaches a preset clarity threshold, the cervical fluorescence image is determined to be a valid image, and the step of extracting the three primary color values of each pixel in the cervical fluorescence image is performed;
[0180] If the cervical fluorescence image does not include the complete cervical surface and / or the clarity does not reach a preset clarity threshold, the cervical fluorescence image is determined to be an invalid image, and a prompt message for re-collecting the cervical fluorescence image is output.
[0181] Furthermore, after the step of extracting the three primary color values of each pixel in the cervical fluorescence image, the processor 1001 may call the control program stored in the memory 1005 and perform the following operations:
[0182] Generating a grayscale value of each pixel point according to the three primary color values of each pixel point, determining a maximum value and a minimum value among the grayscale values, and performing an average operation on the maximum value and the minimum value to obtain an operation result as an initial threshold value;
[0183] Comparing the grayscale value of each pixel with the initial threshold, determining a first set of grayscale values greater than the initial threshold, and a second set of grayscale values less than the initial threshold;
[0184] generating a first average grayscale value and a second average grayscale value based on the first grayscale value set and the second grayscale value set, respectively;
[0185] updating the initial threshold according to the first average grayscale value and the second average grayscale value, and determining whether the updated initial threshold is the same as the initial threshold before the update;
[0186] If they are the same, removing each pixel corresponding to the second grayscale value set from the cervical fluorescence image to form a new cervical fluorescence image;
[0187] If they are not the same, then based on the updated initial threshold, the step of comparing the grayscale value of each pixel with the initial threshold is performed until the updated initial threshold is the same as the initial threshold before the update.
[0188] The specific implementation of the cervical fluorescence image processing and analysis system of the present invention is basically the same as the embodiments of the above-mentioned cervical fluorescence image processing and analysis method, and will not be repeated here.
[0189] The embodiment of the present invention further provides a storage medium having a control program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned cervical fluorescence image processing and analysis method.
[0190] The storage medium of the present invention may be a computer-readable storage medium, and its implementation is substantially the same as that of the above-mentioned cervical fluorescence image processing and analysis method embodiments, and will not be described in detail here.
[0191] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of the present invention, or directly or indirectly used in other related technical fields, all fall within the protection of the present invention.
Claims
1. A cervical fluorescence image processing and analysis method, characterized in that: The cervical fluorescence image processing and analysis method comprises: After acquiring a cervical fluorescence image based on the preset excitation light, extracting the three primary color values of each pixel in the cervical fluorescence image, and performing background removal on the cervical fluorescence image according to the three primary color values of each pixel to update the cervical fluorescence image; generating a plurality of color proportion matrices of the cervical fluorescence image based on the updated three primary color values of each pixel point in the cervical fluorescence image; performing a preliminary analysis on the cervical fluorescence image according to each of the color proportion matrices to determine whether there is an abnormal area in the cervical fluorescence image; If an abnormal area exists in the cervical fluorescence image, extracting an abnormal area image from the cervical fluorescence image, and converting the abnormal area image into a cervical grayscale image based on the three primary color values of each pixel in the abnormal area image; Identify the cervical grayscale image based on a preset recognition model to obtain a final recognition result, wherein the final recognition result includes the size of the abnormal area and the abnormality type corresponding to the abnormal area; The step of performing a preliminary analysis on the cervical fluorescence image according to each color proportion matrix to determine whether there is an abnormal area in the cervical fluorescence image includes: Based on a preset comparison formula, the pixel color proportion values in each color proportion matrix are compared with a preset proportion threshold value to generate multiple proportion conversion matrices, wherein the preset comparison formula is: ; Among them, the value of k represents red, green and blue in the three primary colors respectively, X represents the number of rows in the color proportion matrix, Y represents the number of columns in the color proportion matrix, and F represents the preset proportion threshold. represents the proportion conversion matrix, Represents the color proportion matrix; Performing a sum operation on each of the proportion conversion matrices to obtain a sum matrix, and performing a sum operation on the values of each element in the sum matrix to obtain a matrix value of the sum matrix; determining whether the matrix value is greater than a preset matrix threshold, and if so, determining that an abnormal area exists in the cervical fluorescence image; Wherein, if there is an abnormal area in the cervical fluorescence image, the step of extracting the abnormal area image from the cervical fluorescence image includes: If there is an abnormal area in the cervical fluorescence image, searching for a target element in the sum matrix whose values are all zero; Target pixel points corresponding to the target elements are searched in the cervical fluorescence image, and the target pixel points are removed from the fluorescence image to form the abnormal area image.
2. The cervical fluorescence image processing and analysis method according to claim 1, wherein: The step of identifying the cervical grayscale image based on a preset recognition model to obtain a final recognition result includes: Performing feature extraction on the cervical grayscale image based on a feature extraction module in a preset recognition model to obtain a feature vector of the cervical grayscale image; The feature vector is classified and calculated based on the classifier in the preset recognition model to obtain a calculation result. The calculation formula is: ; Where n represents the number of abnormal categories, ai and bi are the weight and bias values of the i-th abnormality in the classifier, H is the feature vector, pi represents the calculation result of the i-th abnormality probability value, j represents the previous j calculations, and wi represents the sum of the classifier errors of the i-th abnormality calculation result in the previous j calculations; According to the calculation result, the abnormality type corresponding to the abnormal area in the cervical fluorescence image is determined, and the area size of the abnormal area is identified, and the abnormality type and the area size are generated as a final identification result.
3. The cervical fluorescence image processing and analysis method according to claim 1, wherein: The step of identifying the cervical grayscale image based on a preset recognition model to obtain a final recognition result includes: Acquire cervical image samples, and divide the cervical image samples into training image samples and test image samples; The training image samples are transferred to the preset initial model, the preset initial model is trained, and when the number of training times reaches the preset number, the loss function value of the preset initial model is calculated, and the calculation formula is: ; Where L represents the loss function value, M represents the number of samples in the training image samples that are identified as abnormal after training, and N represents the number of samples in the training image samples that are identified as not abnormal after training. represents the reference abnormality category corresponding to the k1th training image sample, represents the abnormal category identified by the training of the k1th training image sample, represents the reference abnormal area corresponding to the k1th training image sample, represents the abnormal area identified by training for the k1th training image sample, represents the reference category corresponding to the k2th training image sample, represents the category of the k2th training image sample after training recognition, Represents the k2th training image sample and On the contrary, the reference abnormal area corresponding to the k2th training image sample; Determine whether the loss function value is less than or equal to a preset threshold; if so, test the preset initial model based on the test sample image to obtain a test result; A test error is generated according to the test result, and the preset recognition model is generated according to the magnitude relationship between the test error and a preset threshold.
4. The cervical fluorescence image processing and analysis method according to claim 3, characterized in that: The step of generating the preset recognition model according to the magnitude relationship between the test error and the preset threshold comprises: If the size relationship is that the test error is less than a preset threshold, generating the preset initial model as a preset recognition model; If the test error is greater than or equal to the preset threshold, the calculation formula of the loss function value is updated, and the preset initial model is iteratively trained based on the updated calculation formula until the test error is less than the preset threshold. The formula for updating the calculation formula is: ; in, represents the calculation formula after the update, and L represents the calculation formula before the update. 、 Indicates the preset update parameters, Represents the weight matrix between the input layer and the convolution layer in the preset initial model, m represents the number of elements in the weight matrix, Used to calculate the cumulative value of the absolute value of each element in the weight matrix. represents the transpose of the weight matrix.
5. The cervical fluorescence image processing and analysis method according to any one of claims 1 to 4, characterized in that: The step of extracting the three primary color values of each pixel in the cervical fluorescence image includes: Determining whether the cervical fluorescence image includes a complete cervical surface and whether the clarity of the cervical fluorescence image reaches a preset clarity threshold; If the cervical fluorescence image includes the complete surface of the cervix and the clarity reaches a preset clarity threshold, the cervical fluorescence image is determined to be a valid image, and the step of extracting the three primary color values of each pixel in the cervical fluorescence image is performed; If the cervical fluorescence image does not include the complete cervical surface and / or the clarity does not reach a preset clarity threshold, the cervical fluorescence image is determined to be an invalid image, and a prompt message for re-collecting the cervical fluorescence image is output.
6. The cervical fluorescence image processing and analysis method according to any one of claims 1 to 4, characterized in that: After the step of extracting the three primary color values of each pixel in the cervical fluorescence image, the following steps are performed: Generating a grayscale value of each pixel point according to the three primary color values of each pixel point, determining a maximum value and a minimum value among the grayscale values, and performing an average operation on the maximum value and the minimum value to obtain an operation result as an initial threshold value; Comparing the grayscale value of each pixel with the initial threshold, determining a first set of grayscale values greater than the initial threshold, and a second set of grayscale values less than the initial threshold; generating a first average grayscale value and a second average grayscale value based on the first grayscale value set and the second grayscale value set, respectively; updating the initial threshold according to the first average grayscale value and the second average grayscale value, and determining whether the updated initial threshold is the same as the initial threshold before the update; If they are the same, removing each pixel corresponding to the second grayscale value set from the cervical fluorescence image to form a new cervical fluorescence image; If they are not the same, then based on the updated initial threshold, the step of comparing the grayscale value of each pixel with the initial threshold is performed until the updated initial threshold is the same as the initial threshold before the update.
7. A cervical fluorescence image processing and analysis system, characterized in that: The cervical fluorescence image processing and analysis system includes a memory, a processor, a communication bus, and a control program stored in the memory: The communication bus is used to realize the connection and communication between the processor and the storage; The processor is used to execute the control program to implement the steps of the cervical fluorescence image processing and analysis method according to any one of claims 1 to 6.
8. A storage medium, characterized in that: The storage medium stores a control program, and when the control program is executed by the processor, the steps of the cervical fluorescence image processing and analysis method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Medical image processing method, system and device and readable storage medium
CN113450305A
Image processing method and device, equipment and storage medium
CN114092576A
Inherent fluorescence cervical image abnormity identification method and system
CN118229647A