Lightweight yolov8-based endometrial inflammation classification and identification method and system
Through the weight pruning and multimodal feature fusion technology of the lightweight YOLOv8 model, the problems of high computing resources and insufficient feature extraction were solved, and real-time, efficient and accurate recognition and diagnosis of endometrial inflammation were achieved.
Patent Information
- Application Number
- CN202510659444.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-21
- Publication Date
- 2025-10-10
AI Technical Summary
The existing yolov8 model has high computational resource requirements in the classification and identification of endometrial inflammation, and it is difficult to effectively extract key feature information, resulting in low real-time diagnosis efficiency and insufficient accuracy.
A lightweight yolov8 model is used to lightweight the model through weight importance pruning, quantization and knowledge distillation technology, and the attention mechanism is combined to fuse multimodal features and extract key feature information.
It significantly reduces the amount of computation and memory usage, improves the model's real-time recognition capabilities in environments with limited computing resources, enhances classification accuracy and reliability, and provides real-time diagnostic results to assist doctors in decision-making.
Smart Images

Figure CN120765981A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image analysis, and in particular to a method and system for classifying and identifying endometrial inflammation based on lightweight Yolov8. Background Art
[0002] With the development of digital medical imaging technology, preliminary screening and diagnosis of endometrial inflammation based on hysteroscopic images has become one of the most important means of diagnosing endometritis. Currently, traditional diagnostic methods rely mainly on the doctor's visual observation and empirical judgment, which is not only time-consuming and labor-intensive, but also subject to certain degrees of subjectivity and misdiagnosis. However, with the development of computer vision technology, especially the widespread application of deep learning algorithms in the field of image processing, it is possible to use these advanced technologies to automatically classify and analyze hysteroscopic images, and to assist in diagnosis through intelligent algorithms, thereby greatly improving the efficiency and accuracy of diagnosis, and having great auxiliary significance for the diagnosis and treatment work of gynecologists.
[0003] At present, relevant personnel have applied yolov8 to the classification and recognition of endometrial inflammation. However, although yolov8 has demonstrated strong performance in the field of target detection, it still faces some challenges when it is actually applied to the classification and recognition of endometrial inflammation. For example, the processing of high-resolution hysteroscopic images requires high computing resources, and the computing environment of medical institutions is often limited, which may lead to slower model inference speed and is not conducive to real-time diagnosis. In addition, although yolov8 can detect target areas related to the endometrium, how to extract the most critical feature information for the classification task from these areas and improve the classification accuracy is still an urgent problem to be solved. Therefore, it is necessary to further optimize the yolov8 model so that it can adapt to the real-time recognition needs of endometrial inflammation classification while further enhancing the classification accuracy through multimodal feature fusion. Summary of the Invention
[0004] In order to meet the real-time identification requirements of endometrial inflammation classification while further enhancing the classification accuracy through multimodal feature fusion, the present invention aims to provide a method and system for endometrial inflammation classification and identification based on lightweight yolov8. The technical solutions adopted are as follows:
[0005] In a first aspect, the present application discloses a method for classifying and identifying endometrial inflammation based on lightweight Yolov8, the method comprising:
[0006] S1. Determine classified target historical hysteroscopic image data, wherein the classification labels include a normal classification group indicating a normal endometrium and a pathological classification group indicating the presence of endometritis;
[0007] S2, divide the target historical hysteroscopy image data according to a preset distribution ratio to obtain training data and verification data;
[0008] S3, input the training data and the verification data into a yolov8 classification model, in the training process, perform model lightweight processing based on weight importance pruning, and quantization and knowledge distillation technology, and perform feature weighting and selection based on an attention mechanism on target region features related to endometrium detected by the yolov8 and pre-acquired auxiliary modal features to extract the most critical feature information for the classification task;
[0009] S4, input real-time hysteroscopy image data into the trained yolov8 classification model to obtain an endometritis classification result for assisting in diagnosis.
[0010] Further, in step S1, the determining of the classified target historical hysteroscopy image data comprises:
[0011] S11, obtain initial historical hysteroscopy image data and endometrial histopathological result data, the endometrial histopathological result data including CD138 immunohistochemical detection results;
[0012] S12, pre-process the initial historical hysteroscopy image data based on an adaptive histogram equalization algorithm to obtain standardized image data, wherein the algorithm parameters are adaptively adjusted according to the gray scale distribution characteristics of the image to enhance the local contrast of the image and improve the overall visualization effect of the image;
[0013] S13, classify and label the standardized image data according to the endometrial histopathological result data to obtain the classified target historical hysteroscopy image data.
[0014] Further, in step S2, the target historical hysteroscopy image data is divided according to an allocation ratio of 8:2 to obtain training data and verification data.
[0015] Further, in step S3, in the training process, the model lightweight processing is performed based on weight importance pruning, and quantization and knowledge distillation technology, comprising:
[0016] S31, for each weight in the model, respectively evaluate the influence of the weight on the loss function by comprehensively considering the gradient size and the consistency of the gradient direction and the weight update direction, and convert the corresponding influence degree into weight importance;
[0017] S32, according to a preset score threshold, set the weights with a weight importance score lower than the score threshold to 0 to realize the sparsification of the model structure;
[0018] S33. According to a uniform quantization strategy based on sensitivity analysis, the weights retained after pruning are converted from high-precision floating-point numbers to low-precision integers to reduce the model storage space while speeding up the inference speed.
[0019] S34. Obtain the output of the high-precision teacher model and guide the quantized student model to perform accuracy recovery training based on knowledge distillation technology to ensure that the quantized and pruned model can approach the performance level of the teacher model while maintaining a small size and fast inference.
[0020] Furthermore, in step S31, the influence of the weight on the loss function is evaluated by comprehensively considering the gradient size, the direction of the gradient, and the consistency of the weight update direction, and the corresponding influence degree is converted into the weight importance, including:
[0021] S311. Calculate the gradient size and gradient direction of the weight based on the partial derivative of the loss function with respect to the weight;
[0022] S312, determining directional consistency between the gradient direction and the weight update direction based on the cosine similarity between the gradient direction and the weight update direction;
[0023] S313: constructing an adjustment coefficient based on the directional consistency through a preset mapping function;
[0024] S314: Multiply the gradient of the weight by the adjustment coefficient to obtain a comprehensive score reflecting the importance of the weight.
[0025] Furthermore, in step S3, during the training process, the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are weighted and selected based on the attention mechanism to extract the most critical feature information for the classification task, including:
[0026] S315. Based on the feature dimension alignment method, the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are dimensionally aligned to obtain a fused feature set;
[0027] S316, performing weighted processing on each feature in the fusion feature set by calculating the attention weight based on the attention mechanism to obtain a weighted feature set;
[0028] S317: Based on the weighted feature set, the most critical feature information for the classification task is screened out through a principal component analysis algorithm.
[0029] In a second aspect, the present application discloses a classification and identification system for endometrial inflammation based on lightweight Yolov8, the system comprising a historical data acquisition module, a data partitioning module, a classification model training module, and a diagnosis assistance module, wherein:
[0030] The historical data acquisition module is used to determine the classified target historical hysteroscopic image data, wherein the classification labels include a normal classification group indicating normal endometrium and a pathological classification group indicating the presence of endometritis;
[0031] The data division module is used to divide the target historical hysteroscopic image data according to a preset distribution ratio to obtain training data and verification data;
[0032] The classification model training module is used to input the training data and the verification data into the yolov8 classification model. During the training process, the model is lightweighted based on weight importance pruning, quantization and knowledge distillation technology, and the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are weighted and selected based on the attention mechanism to extract the feature information most critical to the classification task;
[0033] The diagnosis auxiliary module is used to input real-time hysteroscopic image data into the trained yolov8 classification model to obtain the classification results of endometrial inflammation for auxiliary diagnosis.
[0034] In a third aspect, the present application discloses a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements any of the aforementioned methods for classifying and identifying endometrial inflammation based on lightweight yolov8.
[0035] In a fourth aspect, the present application discloses a lightweight yolov8-based endometrial inflammation classification and identification control device, comprising a communication interface, a memory, a communication bus, and a processor, wherein the processor, communication interface, and memory communicate with each other via the communication bus:
[0036] The memory is used to store computer programs;
[0037] The processor is used to implement the steps of any of the aforementioned methods for classifying and identifying endometrial inflammation based on lightweight yolov8 when executing the program stored in the memory.
[0038] The present invention has the following beneficial effects:
[0039] (1) Based on weight importance pruning, quantization and knowledge distillation technologies, the computational complexity and memory usage of the model can be significantly reduced, enabling the model to run efficiently in a medical environment with limited computing resources, further meeting the real-time recognition requirements of endometrial inflammation classification;
[0040] (2) Fusion of the target region features detected by yolov8 with the pre-acquired auxiliary modality features can make full use of information from multiple sources and improve the reliability and stability of diagnosis by capturing more comprehensive disease features;
[0041] (3) Based on the trained YOLOv8 classification model, doctors can be provided with real-time classification results of endometrial inflammation, which can be used as a reference for clinical decision-making. This helps doctors make diagnoses more quickly and accurately, thereby formulating more effective treatment plans and improving patient treatment outcomes and satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 A flowchart of a method for classifying and identifying endometrial inflammation based on lightweight yolov8 provided in one embodiment of the present invention;
[0044] Figure 2 A system structure diagram of a lightweight yolov8-based endometrial inflammation classification and identification system provided by one embodiment of the present invention;
[0045] Figure 3 A schematic structural diagram of a computer-readable storage medium provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to further illustrate the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features and effects of a method and system for classifying and identifying endometrial inflammation based on a lightweight Yolov8 proposed by the present invention. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics of one or more embodiments may be combined in any suitable form.
[0047] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0048] The following describes in detail a method and system for classifying and identifying endometrial inflammation based on lightweight yolov8 provided by the present invention in conjunction with the accompanying drawings.
[0049] See also Figure 1 , which shows a method flow chart of a method for classifying and identifying endometrial inflammation based on lightweight yolov8 provided by one embodiment of the present invention, the method comprising:
[0050] Step S1 : determining classified target historical hysteroscopic image data, wherein the classification labels include a normal classification group indicating normal endometrium and a pathological classification group indicating the presence of endometritis.
[0051] Step S2: dividing the target historical hysteroscopic image data according to a preset distribution ratio to obtain training data and verification data.
[0052] Step S3: input the training data and the verification data into the yolov8 classification model. During the training process, the model is lightweighted based on weight importance pruning, quantization and knowledge distillation technology, and the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are weighted and selected based on the attention mechanism to extract the feature information that is most critical to the classification task.
[0053] Step S4: input the real-time hysteroscopic image data into the trained yolov8 classification model to obtain the classification results of endometrial inflammation for auxiliary diagnosis.
[0054] As can be seen from the above, the present application discloses a method for classifying and identifying endometrial inflammation based on lightweight yolov8, which can significantly reduce the computational complexity and memory usage of the model based on technologies such as weight importance pruning, quantization, and knowledge distillation, so that the model can run efficiently in a medical environment with limited computing resources, further meeting the real-time recognition requirements of endometrial inflammation classification; fusing the target area features detected by yolov8 with the pre-acquired auxiliary modality features can make full use of information from multiple sources, and improve the reliability and stability of diagnosis by capturing more comprehensive disease characteristics; based on the trained yolov8 classification model, it can provide doctors with real-time endometrial inflammation classification results, and use them as a reference for clinical decision-making. This helps doctors make diagnoses more quickly and accurately, thereby formulating more effective treatment plans and improving patient treatment effects and satisfaction.
[0055] In one embodiment, in step S1, determining the classified target historical hysteroscopic image data includes:
[0056] Step S11 , obtaining initial historical hysteroscopy image data and endometrial tissue pathology result data, wherein the endometrial tissue pathology result data includes CD138 immunohistochemistry detection results.
[0057] Specifically, this application pre-collects historical hysteroscopic image data from the medical record system. These image data cover the endometrial status of different age groups, different disease severity and different treatment stages, ensuring the diversity and representativeness of the data. At the same time, this application will also conduct quality checks on the collected historical hysteroscopic image data, including image clarity assessment (such as calculating the spatial frequency and / or gradient distribution of the image based on the blur detection algorithm, and comparing these indicators with the preset clarity standards to determine the image clarity), image integrity detection (such as detecting image texture features and comparing them with preset feature templates to determine whether the image is missing or damaged), in order to eliminate blurry and incomplete images and ensure the accuracy and reliability of subsequent analysis and processing.
[0058] Step S12, preprocessing the initial historical hysteroscopic image data based on an adaptive histogram equalization algorithm to obtain standardized image data, wherein the algorithm parameters are adaptively adjusted according to the grayscale distribution characteristics of the image to enhance the local contrast of the image and improve the overall visualization effect of the image.
[0059] Specifically, during the adaptive histogram equalization process, the present application calculates the image's grayscale histogram and analyzes its grayscale distribution characteristics. Based on the analyzed grayscale distribution characteristics, the algorithm parameters, including the contrast limit threshold, are then adaptively adjusted based on dynamic evaluation. Specifically, for a first local image region whose grayscale distribution is less than a preset grayscale distribution uniformity threshold, this indicates low image contrast within that region. To enhance the local contrast of this region, the present application gradually lowers the contrast limit threshold for the first local image region according to a preset step size. After each adjustment, the present application re-evaluates the grayscale distribution uniformity of that region. This process continues until the current local image grayscale distribution meets the distribution uniformity requirement. Conversely, for a second local image region whose grayscale distribution is greater than the preset grayscale distribution uniformity threshold, this indicates high image contrast within that region. To avoid image distortion caused by over-enhancement, the present application gradually increases the contrast limit threshold for the second local image region according to a preset step size. The grayscale distribution uniformity of that region is also re-evaluated after each adjustment. This process will also continue until the current local image grayscale distribution meets the distribution uniformity requirement.
[0060] Step S13: classify and label the standardized image data according to the endometrial tissue pathology result data to obtain classified target historical hysteroscopy image data.
[0061] Specifically, this application uses relevant image standardization tools (such as LabelImg software) to standardize the standardized image data. Images corresponding to normal endometrium are labeled as the "normal classification group," while images corresponding to endometritis are labeled as the "lesion classification group." Furthermore, after completing the data labeling, this application also categorizes and verifies all images to ensure that each image is correctly classified into the corresponding group and that no omissions or labeling errors occur.
[0062] In one embodiment, in step S2, the target historical hysteroscopic image data is divided according to a distribution ratio of 8:2 to obtain training data and verification data.
[0063] Specifically, this application first randomly shuffles the target historical hysteroscopic image data to ensure the uniformity and randomness of the data distribution. Afterwards, 80% of the shuffled data is used as training data in a ratio of 8:2 (it should be noted that the division ratio is not fixed and can be adjusted according to the upper limit of computing resources in other application scenarios). This data is mainly used for model training to learn image features and optimize model parameters; the remaining 20% of the shuffled data is used as validation data. This data is mainly used to evaluate the model's performance indicators, such as accuracy and recall, before the end of each round of training, and to adjust the model parameters accordingly, so that the model can gradually converge to the optimal solution and improve the accuracy and robustness of predictions for unseen data.
[0064] In one embodiment, in step S3, during the training process, model lightweight processing is performed based on weight importance pruning, quantization, and knowledge distillation techniques, including:
[0065] In step S31, for each weight in the model, the influence of the weight on the loss function is evaluated by comprehensively considering the gradient size and the consistency between the gradient direction and the weight update direction, and the corresponding influence degree is converted into weight importance.
[0066] Specifically, this application first calculates the gradient size and gradient direction of the weight based on the partial derivative of the loss function with respect to the weight. Then, the directional consistency is determined by calculating the cosine similarity between the gradient direction and the weight update direction. Finally, based on the metric value of the directional consistency, the sigmoid function is used to map the metric value to the corresponding adjustment coefficient, and finally the gradient size of the weight is multiplied by this adjustment coefficient to obtain a comprehensive score reflecting the importance of the weight in model training.
[0067] Step S32: according to a preset score threshold, the weights in the model whose weight importance scores are lower than the score threshold are reset to 0, so as to achieve sparseness of the model structure.
[0068] Specifically, the present application will set an initial score threshold based on the complexity of the model and the pruning target, and after performing a simulated pruning operation according to the initial score threshold, evaluate the performance of the pruned model, including accuracy, recall, etc. The adjustment ratio and adjustment direction are set based on the performance evaluation index, and the preset step size is updated based on the adjustment ratio and adjustment direction. Afterwards, the initial score threshold is adjusted according to the updated step size. This iterative adjustment process will continue until the performance of the pruned model is stable within the corresponding range and meets the pruning target, and the target score threshold is obtained. Furthermore, the present application will further traverse the importance scores of all weights in the model, and reset the weights whose importance scores are lower than the target score threshold to 0. It should be noted that this operation can reduce the number of effective connections in the model, thereby reducing computational complexity while achieving sparse model structure.
[0069] In one embodiment, the adjustment ratio and adjustment direction are set based on the performance evaluation index, including: calculating the deviation between the performance index of the model after pruning and the preset performance threshold. On the one hand, according to the size of the deviation, when it is determined that the deviation is positive, it is considered that the model performance is excessive, and the adjustment direction is set to reduce the score threshold to perform more pruning operations; when it is determined that the deviation is negative, it is considered that the model performance is damaged and needs to be improved, and the adjustment direction is set to increase the score threshold to reduce pruning operations and ensure the balance between pruning effect and model performance. On the other hand, the present application will also be based on the size of the deviation, according to the preset deviation range interval, such as when it is determined that the deviation size is in interval A, set the adjustment ratio corresponding to interval A. It should be noted that the division of interval A and the setting of the corresponding adjustment ratio are based on the sensitivity to changes in model performance. In actual applications, these parameters will be fine-tuned according to specific scenarios and model characteristics to achieve the best pruning effect.
[0070] In step S33, according to the uniform quantization strategy based on sensitivity analysis, the weights retained after pruning are converted from high-precision floating-point numbers to low-precision integers, so as to reduce the model storage space while speeding up the inference speed.
[0071] Specifically, this application performs a sensitivity analysis on the weights retained after pruning to identify which weights have a greater impact on model performance and which have a smaller impact. Based on the results of the sensitivity analysis, the weights are then classified into different sensitivity levels. For each sensitivity level, a corresponding quantization step size is set using a preset quantization precision mapping table. Specifically, this quantization precision mapping table can be understood as a pre-established correspondence between sensitivity levels and quantization step sizes. In this table, weights with higher sensitivity levels are assigned smaller quantization step sizes to minimize precision loss during the quantization process for these critical weights. Weights with lower sensitivity levels are assigned larger quantization step sizes to reduce model storage space and accelerate inference while maintaining model performance. It should be noted that this correspondence is pre-determined based on expert experience. Finally, a uniform quantization strategy is applied to convert each weight from a high-precision floating-point number to a low-precision integer based on the quantization step size. Specifically, the weight value is mapped to the nearest integer multiple of the quantization step size corresponding to each weight, thereby achieving a low-precision representation of the weight.
[0072] In step S34, the output of the high-precision teacher model is obtained, and the quantized student model is guided to perform precision recovery training based on the knowledge distillation technology to ensure that the quantized and pruned model can approach the performance level of the teacher model while maintaining a small size and fast inference.
[0073] Specifically, the output of the high-precision teacher model includes the probability prediction distribution of the model, and in the process of knowledge distillation, this application will construct the corresponding distillation loss based on the student model output and the teacher model output, and construct the classification loss based on the difference between the student model output and the true label. Afterwards, the distillation loss and the classification loss are weightedly combined to obtain the overall training loss function. It should be noted that this application will perform backpropagation based on the overall training loss function to optimize the student model parameters. Through continuous iteration, the quantized pruned model will eventually be able to approach the performance level of the teacher model while maintaining a small size and fast inference.
[0074] In one embodiment, in step S31, the comprehensive gradient size, the consistency between the gradient direction and the weight update direction are used to evaluate the influence of the weight on the loss function, and the corresponding influence degree is converted into the weight importance, including:
[0075] Step S311, based on the partial derivative of the loss function with respect to the weight, calculate the gradient size and gradient direction of the weight.
[0076] Specifically, during backpropagation, this application calculates the partial derivative of the loss function with respect to the current weight. This partial derivative includes both the magnitude and direction of the gradient. The magnitude of the gradient reflects the sensitivity of the weight to changes in the loss function, while the direction of the gradient indicates the fastest path to minimize the loss function.
[0077] Step S312: determining the directional consistency between the gradient direction and the weight update direction based on the cosine similarity between the gradient direction and the weight update direction.
[0078] Specifically, this application first obtains the unit vectors of the weight update direction and the gradient direction, calculates the dot product between the two unit vectors, and divides it by the product of their modulos to obtain the cosine similarity between the two. Finally, the cosine similarity is used as a measure of directional consistency. It should be noted that this metric reflects the extent to which the gradient direction is consistent with the weight update direction.
[0079] Step S313: constructing an adjustment coefficient through a preset mapping function based on the directional consistency.
[0080] Step S314: multiply the gradient of the weight by the adjustment coefficient to obtain a comprehensive score reflecting the importance of the weight.
[0081] Specifically, based on step S313 to step S314, it should be noted that, considering that the sigmoid function has a smooth transition and can nonlinearly map the input value to the (0, 1) interval, and its output is sensitive to changes in the input value, it is very suitable as a mapping function to process the metric value of directional consistency to accurately reflect the consistency between the gradient direction and the weight update direction. This application selects the sigmoid function as the mapping function, and maps the metric value of directional consistency to the corresponding value domain based on the mapping function. It should be noted that when the metric value of directional consistency is close to 1, the adjustment coefficient obtained by mapping will also be close to 1, which means that the gradient direction and the weight update direction are highly consistent. It can be considered that the current weight has a high importance in model training, and it can be considered to give priority to retaining the weight to ensure that pruning does not affect model performance; when the metric value of directional consistency is close to -1, the adjustment coefficient obtained by mapping will be close to 0, which means that the gradient direction and the weight update direction are almost completely opposite. It can be considered that the current weight is not important in model training, and the weight can be considered as a pruning removal object to improve the pruning effect.
[0082] In one embodiment, in step S3, during the training process, the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are weighted and selected based on the attention mechanism to extract the feature information most critical to the classification task, including:
[0083] In step S315, based on the feature dimension alignment method, the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are dimensionally aligned to obtain a fused feature set.
[0084] Specifically, this application first converts the target region features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features into the same dimension or feature space based on the feature dimension alignment method. Afterwards, the converted auxiliary modality features are spliced with the target region features to integrate feature information from different sources into a fused feature set, enriching the data input.
[0085] Step S316: Based on the attention mechanism, each feature in the fusion feature set is weighted by calculating the attention weight to obtain a weighted feature set.
[0086] Specifically, taking into account the complex relationship and interdependence between features, this application will use a multi-head self-attention calculation mechanism to calculate the attention weight of each feature in the fusion feature set, where these weights reflect the contribution of the feature to the classification task and represent the relative influence of the feature in the classification decision. Afterwards, after obtaining the attention weights, this application will perform element-by-element multiplication operations on these weights and the corresponding features to achieve weighted processing of the features and obtain a weighted feature set. It should be noted that the weighted feature set not only contains the information of the original features, but also adjusts the importance of each feature through the attention mechanism, providing more accurate and valuable input for subsequent classification tasks.
[0087] Step S317 : Based on the weighted feature set, the most critical feature information for the classification task is screened out through a principal component analysis algorithm.
[0088] Specifically, the screening of key feature information based on the principal component analysis algorithm falls within the scope of the prior art and is not limited in this application. It should be noted that the key feature information obtained from the screening will serve as input for subsequent classifier training. These key features not only contain important information in the original data, but also, through weighting and dimensionality reduction processing, further improve the performance and generalization ability of the classifier.
[0089] It should be noted that the specific criteria for judging endometrial inflammation under hysteroscopy include:
[0090] (1) Congestion area: Divide the uterine cavity into six equal parts, that is, divide the uterine cavity into two parts along the coronal plane of the uterus using the line connecting the openings of the two fallopian tubes; starting from the midpoint of the line and ending at the internal cervical os, radially divide the two parts of the uterine cavity into three equal parts along the uterine wall, for a total of six parts. Regardless of whether it is punctate congestion, patchy congestion, or mixed congestion, one-sixth of the uterine cavity area is used as a reference to calculate the proportion of the total congestion area to the uterine cavity area. A congestion area equal to 0 is grade 0, 0 to <1 / 6 is grade 1, 1 / 6 to <1 / 3 is grade 2, 1 / 3 to <1 / 2 is grade 3, and ≥1 / 2 is grade 4. ② Micropolyps: less than 1 mm in diameter with a distinct vascular axis.
[0091] (2) Endometrial polyps are cone-shaped or finger-shaped growths. Under the microscope, pathological examination shows endometrial stroma, glands and thick blood vessels.
[0092] (3) Endometrial polypoid hyperplasia, which is a morphological change of local protrusions of the endometrium. The difference from polyps under the microscope lies in the presence or absence of focal fibrosis and thick-walled blood vessels.
[0093] (4) Interstitial edema, i.e. the endometrium becomes pale and thick (proliferative stage).
[0094] This application sets the diagnosis of CE as the presence of 5 or more plasma cells (≥5 / HPF) in the specimen section and immunohistochemistry indicating CD138 positivity; others are diagnosed as non-CE. Specifically, when using AI analysis of hysteroscopic endometrial images to distinguish whether they belong to the CE group, the endometrial images obtained under hysteroscopy are first pre-processed, including image enhancement and denoising, to improve image quality. The processed images are then input into a pre-trained AI model. This model is trained based on a large amount of labeled CE and non-CE endometrial image data. It can automatically extract features from the image, such as the morphology and distribution of plasma cells, and classify and judge based on these features, ultimately outputting the group to which the image belongs (CE group or non-CE group).
[0095] Please refer to Figure 2 A classification and identification system for endometrial inflammation based on lightweight yolov8 is characterized in that the system includes a historical data acquisition module, a data partitioning module, a classification model training module, and a diagnosis auxiliary module, wherein:
[0096] The historical data acquisition module is used to determine the classified target historical hysteroscopic image data, wherein the classification labels include a normal classification group indicating normal endometrium and a pathological classification group indicating the presence of endometritis.
[0097] The data partitioning module is used to partition the target historical hysteroscopic image data according to a preset distribution ratio to obtain training data and verification data.
[0098] The classification model training module is used to input the training data and the verification data into the yolov8 classification model. During the training process, the model is lightweighted based on weight importance pruning, quantization and knowledge distillation technology, and the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are weighted and selected based on the attention mechanism to extract the feature information that is most critical to the classification task.
[0099] The diagnosis auxiliary module is used to input real-time hysteroscopic image data into the trained yolov8 classification model to obtain the classification results of endometrial inflammation for auxiliary diagnosis.
[0100] In one embodiment, the above modules are also used to implement a method for classifying and identifying endometrial inflammation based on lightweight yolov8 as described in any one of the above method embodiments, which is not limited in this application.
[0101] As can be seen from the above, the present application discloses a lightweight yolov8-based endometrial inflammation classification and identification system, which can significantly reduce the model's computational complexity and memory usage based on weight importance pruning, quantization, and knowledge distillation technologies, enabling the model to run efficiently in a medical environment with limited computing resources, further meeting the real-time identification requirements of endometrial inflammation classification; fusing the target area features detected by yolov8 with the pre-acquired auxiliary modality features can make full use of information from multiple sources, and improve the reliability and stability of diagnosis by capturing more comprehensive disease characteristics; based on the trained yolov8 classification model, it can provide doctors with real-time endometrial inflammation classification results, and use them as a reference for clinical decision-making. This helps doctors make diagnoses more quickly and accurately, thereby formulating more effective treatment plans and improving patient treatment outcomes and satisfaction.
[0102] Please refer to Figure 3 The present application discloses a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the above-mentioned method for classifying and identifying endometrial inflammation based on lightweight yolov8.
[0103] As can be seen from the above, the computer-readable storage medium disclosed in this application, based on technologies such as weight importance pruning, quantization, and knowledge distillation, can significantly reduce the computational complexity and memory usage of the model, enabling the model to operate efficiently in a medical environment with limited computing resources, further meeting the real-time identification requirements for endometrial inflammation classification; fusing the target area features detected by yolov8 with the pre-acquired auxiliary modality features can make full use of information from multiple sources, and improve the reliability and stability of diagnosis by capturing more comprehensive disease characteristics; based on the trained yolov8 classification model, it can provide doctors with real-time endometrial inflammation classification results, and use them as a reference for clinical decision-making. This helps doctors make diagnoses more quickly and accurately, thereby formulating more effective treatment plans and improving patient treatment outcomes and satisfaction.
[0104] The present application discloses a device for classifying and identifying endometrial inflammation based on lightweight YOLOv8, which includes a communication interface, a memory, a communication bus and a processor, wherein the processor, the communication interface and the memory communicate with each other through the communication bus: the memory is used to store computer programs; the processor is used to implement the steps of the aforementioned method for classifying and identifying endometrial inflammation based on lightweight YOLOv8 when executing the program stored in the memory.
[0105] As can be seen from the above, the present application discloses a lightweight yolov8-based endometrial inflammation classification and identification control device, which can significantly reduce the model's computational complexity and memory usage based on weight importance pruning, quantization, and knowledge distillation technologies, so that the model can run efficiently in a medical environment with limited computing resources, further meeting the real-time identification requirements of endometrial inflammation classification; fusing the target area features detected by yolov8 with the pre-acquired auxiliary modality features can make full use of information from multiple sources, and improve the reliability and stability of diagnosis by capturing more comprehensive disease characteristics; based on the trained yolov8 classification model, it can provide doctors with real-time endometrial inflammation classification results, and use them as a reference for clinical decision-making. This helps doctors make diagnoses more quickly and accurately, thereby formulating more effective treatment plans and improving patient treatment effects and satisfaction.
[0106] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0107] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
Claims
1. A classification and identification method for endometrial inflammation based on lightweight yolov8, characterized in that: The method comprises: S1. Determine classified target historical hysteroscopic image data, wherein the classification labels include a normal classification group indicating normal endometrium and a pathological classification group indicating the presence of endometritis; S2. Dividing the target historical hysteroscopic image data according to a preset distribution ratio to obtain training data and verification data; S3. Input the training data and the verification data into the yolov8 classification model. During the training process, the model is lightweighted based on weight importance pruning, quantization and knowledge distillation technology, and the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are weighted and selected based on the attention mechanism to extract the feature information that is most critical to the classification task; S4. Input the real-time hysteroscopic image data into the trained yolov8 classification model to obtain the classification results of endometrial inflammation for auxiliary diagnosis.
2. The method according to claim 1, characterized in that In step S1, determining the classified target historical hysteroscopic image data includes: S11, obtaining initial historical hysteroscopic image data and endometrial tissue pathology result data, wherein the endometrial tissue pathology result data includes CD138 immunohistochemistry test results; S12, preprocessing the initial historical hysteroscopic image data based on an adaptive histogram equalization algorithm to obtain standardized image data, wherein the algorithm parameters are adaptively adjusted according to the grayscale distribution characteristics of the image to enhance the local contrast of the image and improve the overall visualization effect of the image; S13. Classify and label the standardized image data according to the endometrial tissue pathology result data to obtain classified target historical hysteroscopy image data.
3. The method according to claim 1, characterized in that In step S2, the target historical hysteroscopic image data is divided according to a distribution ratio of 8:2 to obtain training data and verification data.
4. The method according to claim 1, wherein In step S3, during the training process, model lightweight processing is performed based on weight importance pruning, quantization and knowledge distillation technology, including: S31. For each weight in the model, the influence of the weight on the loss function is evaluated by comprehensively considering the gradient size and the consistency between the gradient direction and the weight update direction, and the corresponding influence degree is converted into weight importance; S32. According to a preset score threshold, the weights in the model whose weight importance scores are lower than the score threshold are reset to 0 to achieve sparse model structure; S33. According to a uniform quantization strategy based on sensitivity analysis, the weights retained after pruning are converted from high-precision floating-point numbers to low-precision integers to reduce the model storage space while speeding up the inference speed. S34. Obtain the output of the high-precision teacher model and guide the quantized student model to perform accuracy recovery training based on knowledge distillation technology to ensure that the quantized and pruned model can approach the performance level of the teacher model while maintaining a small size and fast inference.
5. The method according to claim 4, characterized in that In step S31, the influence of the weight on the loss function is evaluated by comprehensively considering the gradient size, the direction of the gradient and the consistency of the weight update direction, and the corresponding influence degree is converted into the weight importance, including: S311. Calculate the gradient size and gradient direction of the weight based on the partial derivative of the loss function with respect to the weight; S312, determining directional consistency between the gradient direction and the weight update direction based on the cosine similarity between the gradient direction and the weight update direction; S313: constructing an adjustment coefficient based on the directional consistency through a preset mapping function; S314: Multiply the gradient of the weight by the adjustment coefficient to obtain a comprehensive score reflecting the importance of the weight.
6. The method according to claim 5, characterized in that In step S3, during the training process, the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are weighted and selected based on the attention mechanism to extract the most critical feature information for the classification task, including: S315. Based on the feature dimension alignment method, the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are dimensionally aligned to obtain a fused feature set; S316, performing weighted processing on each feature in the fusion feature set by calculating the attention weight based on the attention mechanism to obtain a weighted feature set; S317: Based on the weighted feature set, the most critical feature information for the classification task is screened out through a principal component analysis algorithm.
7. A classification and identification system for endometrial inflammation based on lightweight yolov8, characterized by: The system includes a historical data acquisition module, a data partitioning module, a classification model training module, and a diagnosis assistance module, wherein: The historical data acquisition module is used to determine the classified target historical hysteroscopic image data, wherein the classification labels include a normal classification group indicating normal endometrium and a pathological classification group indicating the presence of endometritis; The data division module is used to divide the target historical hysteroscopic image data according to a preset distribution ratio to obtain training data and verification data; The classification model training module is used to input the training data and the verification data into the yolov8 classification model. During the training process, the model is lightweighted based on weight importance pruning, quantization and knowledge distillation technology, and the target area features related to the endometrium detected by yolov8 and the pre-acquired auxiliary modality features are weighted and selected based on the attention mechanism to extract the feature information most critical to the classification task; The diagnosis auxiliary module is used to input real-time hysteroscopic image data into the trained yolov8 classification model to obtain the classification results of endometrial inflammation for auxiliary diagnosis.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for classifying and identifying endometrial inflammation based on lightweight yolov8 according to any one of claims 1 to 6 is implemented.
9. A classification, identification and control device for endometrial inflammation based on lightweight yolov8, characterized in that: The system comprises a communication interface, a memory, a communication bus, and a processor, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. The memory is used to store computer programs; The processor is used to implement the steps of a method for classifying and identifying endometrial inflammation based on lightweight yolov8 as described in any one of claims 1 to 6 when executing the program stored in the memory.
Citation Information
Cited By
Intelligent identification method for endometriosis focus based on image processing
CN121304682A