A classification method for the degree of adenoid hypertrophy
By preprocessing and feature extraction of nasal endoscopic images, combined with contrastive learning and weighted methods, the problem of inaccurate judgment of the degree of adenoid hypertrophy was solved, and the accurate classification and grading of the degree of adenoid hypertrophy was achieved.
Patent Information
- Application Number
- CN202411776047.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The current technology for determining the degree of adenoid hypertrophy is inaccurate, especially in monocular endoscopy, where the lesion area varies greatly depending on the distance, resulting in insufficient accuracy in grading.
By acquiring nasal endoscopic images and preprocessing them, white and black regions are divided, features are extracted and contrast learning is performed, the relative area ratio of black and white regions is calculated, and a weighted method is used to obtain accurate classification results of the degree of adenoid hypertrophy.
It improves the accuracy and stability of adenoid hypertrophy assessment, achieves precise segmentation and grading, and provides reliable support for lesion analysis.
Smart Images

Figure CN119723175B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a method for classifying the degree of adenoid hypertrophy. Background Technology
[0002] Clinically, adenoid hypertrophy is graded from 1 to 3 by measuring the distance between the vomer and adenoid tissue under nasal endoscopy. Currently, medical imaging processing often uses segmented lesion images as a reference for lesion grading, such as in brain tumor grading and lung nodule detection. Segmentation technology can accurately distinguish lesions from normal tissue and provide information such as location and shape. However, due to individual patient differences, the application of this technology faces challenges: grading based solely on the absolute size and location of the lesion is prone to error, especially in monocular endoscopy, where the lesion area varies greatly depending on distance, affecting the accuracy of grading. Ultimately, this leads to inaccurate assessments of adenoid hypertrophy by physicians.
[0003] The prior art CN113116305A discloses a method for processing nasopharyngeal endoscopy images. By acquiring nasopharyngeal endoscopy images, the posterior nasal cavity region and the adenoid obstruction region of the nasopharyngeal endoscopy image are determined, and the degree of adenoid hypertrophy is determined based on the posterior nasal cavity region and the adenoid obstruction region, thereby making the obtained degree of adenoid hypertrophy more accurate.
[0004] Current technology identifies the posterior nasal cavity and adenoid obstruction area in nasopharyngeal endoscopy images to directly determine the degree of adenoid hypertrophy. However, it does not perform any image analysis or processing and relies entirely on experience to judge the degree of adenoid hypertrophy, which also suffers from the problem of inaccurate judgment of adenoid hypertrophy. Summary of the Invention
[0005] The technical problem solved by this invention is to overcome the problems existing in the prior art and provide a method for classifying the degree of adenoid hypertrophy that can accurately determine the degree of adenoid hypertrophy.
[0006] The objective of this invention is achieved through the following technical solution:
[0007] A method for classifying the degree of adenoid hypertrophy is disclosed, including the following steps:
[0008] S1: Acquire complete endoscopic images of the adenoids and nasopharynx using a nasal endoscopy. Preprocess the images to obtain a masked image. mask ;
[0009] S2: Transfer the image mask The image is divided into two complementary white and black regions. Feature extraction is performed on the two regions to obtain the segmentation feature output F. out ;
[0010] S3: Output F of segmentation features out Comparative learning is performed, and the learned results are used to predict the classification result Y. p ;
[0011] S4: Obtain the black and white dual-zone A w and A b The ratio of their relative areas R; for Y p We use a weighted method to assign appropriate weights to R, thereby obtaining accurate classification results.
[0012] Preferably, in step S1, the preprocessing includes classifying and labeling adenoids and nasopharyngeal cavities with different degrees of hypertrophy, and then inputting the image into a segmentation model for preliminary segmentation to obtain an image with a mask. mask .
[0013] Preferably, step S2 includes the following steps:
[0014] S21: Perform a meshing operation on the original image, dividing it into multiple mesh images, denoted as I = {p1, p2, ..., p...}. n Then, set the input image size I to 3×H×W; then, based on the image... mask Divide the image into white areas and black area
[0015] S22: For the i-th grid image in the black and white region respectively and Perform feature extraction to generate corresponding feature representations. and
[0016] S23: Will and With the help of fusion operation F w and F b The data is fused to enhance information complementarity, thereby constructing the final segmentation feature output F. out .
[0017] Preferably, in step S22, the lesion area I w Non-lesion area I b Subdivided into multiple small blocks and The feature extraction function f(·) is then applied to each block to obtain the corresponding feature vector:
[0018]
[0019] Calculate the cross-entropy between the white and black regions. First, P c (x) is defined as the probability of finding a class in block x; these probabilities are used to quantitatively measure the contribution of each region to the image information:
[0020]
[0021] c represents the category; ultimately, through comparison... and The difference in information contribution between white and black areas was analyzed.
[0022] Preferably, in step S23, F out The calculation formula is:
[0023] F out =α·F w +(1-α)·F b
[0024] Where α∈[0,1] is the fusion weight, which is used to control the contribution ratio of white and black region features.
[0025] Preferably, step S5 includes:
[0026] S31: Calculate the contrastive loss through contrastive learning;
[0027] S32: Fuse multi-level feature blocks to integrate information from different levels, and use the fused features for prediction through the decoder.
[0028] Preferably, in step S31,
[0029]
[0030] Where cos(·) represents the cosine similarity function, τ is a hyperparameter, and g(·) is a shallow fully connected network; the set ∧ - It consists of feature pairs embedded that are different from the input image;
[0031] The distance between each patch pair is then calculated using the cosine similarity of the refined feature pair embeddings. A contrastive learning method is then applied to calculate the contrastive loss, thereby amplifying the differences between feature pairs. The cosine similarity is used to measure the distance between patch embeddings.
[0032]
[0033] And standardize the range of values between 0 and 1:
[0034]
[0035] F out Used as input to the feature pair contrastive learning module; generates feature map P. w (White area) and P b (Black area); Predicted score The threshold ∈ determines the confidence level of the classification: when At that time, it was classified as a high-confidence category. when At that time, it was classified as a low-confidence category. Feature extraction is applied to N blocks in each region, and the similarity and distance between classes are further calculated; P is captured. w and P b The complementary relationship between them;
[0036] The technical formula for the learning error of black-and-white dual-region pairing comparison is:
[0037]
[0038] in, and F represents the logarithm of the high confidence level and the logarithm of the low confidence level, respectively; high and F low These represent high confidence levels. and Feature embedding of low-confidence pairs.
[0039] Preferably, step S32 includes: firstly, fusing multi-level feature blocks to integrate information from different levels; and mapping the category distribution generated by the decoder to the hierarchical result.
[0040] Where seg(·) is the segmentation decoder. The input image I c The prediction results;
[0041] The segmentation loss is calculated by combining the prediction results generated by the decoder with the predicted categories of the feature pairs.
[0042]
[0043] N represents the total number of pixels in the image. Indicates input image I c The actual segmentation image;
[0044] The formula for calculating cross-entropy loss is:
[0045]
[0046] y i Let be the true category label of the i-th pixel. The predicted class label is obtained through the decoder. By calculating this segmentation loss, the predicted classification result Y of the image is obtained. p .
[0047] Preferably, in step S4,
[0048] The formula for calculating the area ratio R is:
[0049]
[0050] A W A represents the area of the white region. b This indicates the area of the black zone.
[0051] Preferably, in step S4, let P l Let A(x) represent the predicted probability of label l at position x, and A(x) represent the area ratio. Then, the formula for calculating the final label l(x) is:
[0052]
[0053] Using segmentation loss Used to optimize the accuracy of image segmentation. It is a feature-pair contrastive learning loss, which strengthens the feature relationships and feature discrimination of the input image through contrastive learning. The focus is on optimizing the black and white region features in the contrastive learning module, improving the model's discriminative ability by reducing intra-class distance and increasing inter-class separation; the final total loss function is the weighted sum of these loss terms; the formula for calculating the total damage function is:
[0054]
[0055] α, β, and γ are the weighting coefficients for each loss term.
[0056] Compared with existing technologies, it has the following beneficial effects:
[0057] 1) By constructing an inverse relationship between black and white regions, the accuracy and stability of segmentation and grading are improved. Introducing dual-region contrastive learning makes similar features more closely clustered and dispersive features from different classes, enhancing the model's discriminative ability and generalization performance. Finally, a weighted method is used to assign corresponding weights, thereby processing the image and improving the accuracy of judging the degree of adenoid hypertrophy.
[0058] 2) It can achieve precise segmentation and generate accurate grading results, providing reliable support for lesion analysis. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating a method for classifying the degree of adenoid hypertrophy according to the present invention.
[0060] Figure 2 This is a simulation result diagram of the adenoid hypertrophy classification method of the present invention;
[0061] Figure 3 This is an F1-Confidence curve diagram in the adenoid hypertrophy classification method of the present invention;
[0062] Figure 4 This is a comparison diagram of actual segmentation and model-predicted segmentation in a method for classifying the degree of adenoid hypertrophy according to the present invention;
[0063] Figure 5 This is a comparison chart of grading results in a method for classifying the degree of adenoid hypertrophy according to the present invention. Detailed Implementation
[0064] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0065] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below.
[0066] Furthermore, it should be understood in the description of this application that the terms "center," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "axial," "radial," and "circumferential," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this application. In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0067] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection, an electrical connection, or a communication connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0068] In this application, unless otherwise expressly specified and limited, the "above" or "below" of the second feature can mean that the first and second features are in direct contact, or that the first and second features are in indirect contact through an intermediate medium. In the description of this specification, references to terms such as "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples.
[0069] Example 1
[0070] like Figure 1 As shown, a method for classifying the degree of adenoid hypertrophy is disclosed, including the following steps:
[0071] S1: Acquire complete endoscopic images of the adenoids and nasopharynx using a nasal endoscopy. Preprocess the images to obtain a masked image. mask ;
[0072] S2: Transfer the image mask The image is divided into two complementary white and black regions. Feature extraction is performed on the two regions to obtain the segmentation feature output F. out ;
[0073] S3: Output F of segmentation features out Comparative learning is performed, and the learned results are used to predict the classification result Y. p ;
[0074] S4: Obtain the black and white dual-zone A w and A b The ratio of their relative areas R; for Y p We use a weighted method to assign appropriate weights to R, thereby obtaining accurate classification results.
[0075] In this embodiment, complete endoscopic images of the adenoids and nasopharynx are collected, and the adenoids and nasopharynx are classified and labeled according to different degrees of hypertrophy. The images are input into a segmentation model for preliminary segmentation, thereby obtaining images with masks. mask .
[0076] Then, a meshing operation is performed on the original image, dividing it into multiple mesh images I = {p1, p2, ..., p...}. n}, where n represents the number of grid cells. Then, based on the previously obtained image... mask The mask positions are used to further divide these grids into two complementary region images, with the white region I. w (Representing the masked lesion area) and black area I b (Represents the non-lesion area outside the mask).
[0077] Feature extraction is performed on the i-th grid image in the black and white region respectively to generate the corresponding feature representation. and
[0078] Will and With the help of fusion operation F w and F b The data is fused to enhance information complementarity, thereby constructing the final segmentation feature output F. out .
[0079] The obtained work F out To compare the input of the learning module, calculate the patch prediction score. and Simultaneously calculate the contrastive learning loss. Finally, the model is optimized using patch contrastive learning error loss (PLE). Then, clustering is applied to group the features, making features within the same category closer together and features from different categories farther apart, ultimately obtaining the finely segmented white region A. w With black area A b .
[0080] After contrastive learning is completed, a decoder head is introduced to merge multi-level feature block embeddings for prediction. This process is implemented through a simple multilayer perceptron (MLP) layer. The decoder's prediction is combined with the predicted class results of the feature pairs to calculate the segmentation loss. Specifically, each p c The predicted category is directly mapped to p cFor each pixel within the range, this is used as the pixel's category to calculate the segmentation loss, thereby obtaining the predicted classification result Y. p .
[0081] The black-and-white dual regions A obtained after clustering in step 3 are... w and A b The ratio of the relative areas, this ratio R is one of the classification results.
[0082] Multi-level weighted part: The weighted result Y p And, using a weighted method, according to Y p Assign weights to Y and R based on their respective importance or contribution to the overall classification system. This weighting method is then used to classify Y... p By taking into account both R and R, the classification results are optimized to make the final classification results more accurate and reasonable, and better reflect the actual classification situation.
[0083] By constructing an inverse relationship between black and white regions, the accuracy and stability of segmentation and grading are improved. Introducing dual-region contrastive learning makes similar features more closely clustered and dispersive features from different classes, enhancing the model's discriminative ability and generalization performance. Finally, a weighted method is used to assign corresponding weights, thereby processing the image and providing accuracy in judging the degree of adenoid hypertrophy.
[0084] Example 2
[0085] A method for classifying the degree of adenoid hypertrophy is disclosed, including the following steps:
[0086] S1: Acquire complete endoscopic images of the adenoids and nasopharynx using a nasal endoscopy. Preprocess the images to obtain a masked image. mask ;
[0087] S2: Transfer the image mask The image is divided into two complementary white and black regions. Feature extraction is performed on the two regions to obtain the segmentation feature output F. out ;
[0088] S3: Output F of segmentation features out Comparative learning is performed, and the learned results are used to predict the classification result Y. p ;
[0089] S4: Obtain the black and white dual-zone A w and A b The ratio of their relative areas R; for Y p We use a weighted method to assign appropriate weights to R, thereby obtaining accurate classification results.
[0090] The difference between this embodiment and Embodiment 1 is that the construction of the black and white dual regions specifically includes: performing a gridding operation on the original image, dividing it into multiple grid images, denoted as I = {p1, p2, ..., p...}. n Then, set the input image I to 3×H×W. Next, based on the image... mask Divide the image into white areas and black zone The division of regions depends on the position of the segmentation mask. Specifically, if the lesion is located in the upper right corner of the image, the detected mask will also be located in the upper right corner, while non-lesion regions will be located in the lower left corner. These two regions satisfy an inverse relationship: when the area of one region decreases, the area of the corresponding other region will increase, and this always satisfies I... w +I b =I. Feature extraction part: targeting the i-th grid image in the black and white region respectively. and Perform feature extraction to generate the corresponding feature representation. and
[0091] Lesion area I w Non-lesion area I b Subdivided into multiple small blocks and The feature extraction function f(·) is then applied to each block to obtain the corresponding feature vector:
[0092]
[0093] Then, calculate the cross-entropy between the white and black regions. First, P c (x) is defined as the probability of finding class c in block x. These probabilities are used to quantitatively measure the contribution of each region to the image information:
[0094]
[0095] c represents the category; ultimately, through comparison... and The difference in information contribution between white and black areas was analyzed.
[0096] Will and With the help of fusion operation F w and F b The fusion is performed by weighted combination to generate a unified feature representation, as shown in the formula:
[0097] Fout =α·F w +(1-α)·F b
[0098] Where α∈[0,1] is the fusion weight, which is used to control the contribution ratio of white and black region features.
[0099] In this embodiment, a contrastive learning method based on feature pairs is used to calculate the contrastive loss. Its main objectives are twofold: to strengthen the relationship between different representations of the input image to enhance the core features of black and white regions, and to improve discriminative power. By reducing intra-class distance and increasing inter-class separation, the differences between black and white regions are further amplified.
[0100]
[0101] Where cos(·) represents the cosine similarity function, τ is a hyperparameter, and g(·) is a shallow fully connected network. (Set ∧) - It consists of feature pairs embedded that are different from the input image.
[0102] The distance between each patch pair is then calculated using the cosine similarity of the refined feature pair embeddings. A contrastive learning method is then applied to calculate the contrastive loss, the main purpose of which is to further amplify the differences between feature pairs by reducing intra-class distance, increasing inter-class separation, and widening the distance between feature pairs with high prediction scores. Cosine similarity is used to measure the distance between patch embeddings.
[0103]
[0104] The higher the similarity value, the closer the two embedded classes are; the lower the value, the farther apart they are. To more clearly illustrate the similarity, the values between 0 and 1 are standardized as follows:
[0105]
[0106] F out Used as input to the feature pair contrastive learning module. Generates feature map P. w (White area) and P b (Black area). Predicted score The threshold ∈ determines the confidence level of the classification: when Classified as a high confidence category when At that time, it was classified as a low-confidence category. Feature extraction is applied to N blocks in each region, and the similarity and distance between classes are further calculated. Capture P w and P b The complementary relationships between these features are then combined for the final segmentation prediction.
[0107] The learning error (PLE) of pairwise comparison between black and white regions can be expressed as:
[0108]
[0109] in, and F represents the logarithm at high confidence level and low confidence level, respectively. high and F low These represent high confidence levels. and low confidence pairs Feature embedding.
[0110] In the decoder section, multi-level feature blocks are first fused to integrate information from different levels. This fusion process is implemented through a multilayer perceptron (MLP) layer. Each feature block embedding is passed through the MLP layer to generate a representation vector with higher-level feature representation. Subsequently, the decoder uses these fused features for prediction.
[0111] Features of black and white areas P w and P b After concatenation, a comprehensive feature representation containing information from multiple regions is formed. The decoder then processes these fused features through an MLP layer to predict the category of each pixel. In this way, the decoder not only captures detailed features within a region but also incorporates the visual relationship between two regions, thus more accurately reflecting the severity of the lesion in the generated predicted segmentation results. Finally, the model maps the category distribution generated by the decoder to the grading results. This results in more accurate and reliable image classification.
[0112]
[0113] Where seg(·) is the segmentation decoder. The input image I c The prediction results.
[0114] The prediction results generated by the decoder are combined with the predicted class results of the feature pairs to calculate the segmentation loss. Specifically, p c The predicted category results are directly mapped to p. c For each pixel within the range, the segmentation loss is calculated using that category as the label for each pixel. Thus, the segmentation loss... This can be expressed by the following formula:
[0115]
[0116] Where N represents the total number of pixels in the image. This represents the ground truth segmentation map of the input image. The expression for cross-entropy loss is:
[0117]
[0118] y i Let be the true category label of the i-th pixel. The predicted class label is obtained through the decoder. By calculating this segmentation loss, the predicted classification result Y of the image is obtained. p This reflects the hierarchical results for the entire image or target region. This process fully utilizes the effect of multi-level feature fusion, enabling the model to accurately segment and classify complex regional structures.
[0119] After clustering, the model obtained black area A. b and White Zone A w The area of the two regions was used to assess the severity of the lesion. To evaluate the severity of the lesion, the model calculated the relative area ratio of these two regions and used it as a key indicator to quantify the extent of the lesion. Specifically, the area ratio R was calculated using the following formula:
[0120]
[0121] Among them, A w A represents the area of the white region. b This represents the area of the dark region. Using this formula, the model can obtain the proportion of the white region in the total area, used to assess the relative size of the lesion area to the surrounding normal tissue. The area ratio R reflects the relative extent of the lesion area; a higher R value usually indicates a more severe lesion, thus this indicator plays an important role in the model's grading process.
[0122] In the final classification decision process, the model fuses multiple predicted labels. For each spatial location x in a given image I, the model obtains a predicted label and a corresponding probability. For example, the model predicts a probability of 0.95 for "completely hypertrophic" and 0.55 for "moderately hypertrophic"; simultaneously, the result calculated based on the area ratio also indicates that the location is "completely hypertrophic." Therefore, the final classification result needs to be weighted and fused by combining the predicted probabilities and the area ratio to determine the most appropriate label.
[0123] Specifically, let P l Let A(x) represent the predicted probability of the label at position x, and let A(x) represent the area ratio. Then, the final label l(x) can be calculated using the following formula:
[0124]
[0125] This formula calculates the probability P of each label. lThe final classification result for location x is determined by the weighted product of the predicted probability and the area ratio A(x). This fusion method effectively combines classification information based on predicted probability and area ratio, resulting in more accurate and robust classification results.
[0126] To ensure the model's segmentation and ranking performance, a combined loss function is used for optimization. Specifically, the segmentation loss... Used to optimize the accuracy of image segmentation. It is a feature-pair contrastive learning loss, which strengthens the feature relationships and feature discrimination of the input image through contrastive learning. The focus is on optimizing the black and white region features in the contrastive learning module, improving the model's discriminative ability by reducing intra-class distance and increasing inter-class separation.
[0127] To comprehensively optimize the segmentation and classification results, the final total loss function is a weighted sum of these loss terms:
[0128]
[0129] Here, α, β, and γ are the weight coefficients of each loss term. By adjusting these weights, the model can achieve a balance between segmentation accuracy, classification accuracy, and the effectiveness of feature contrastive learning. This multi-task loss optimization method improves the model's performance on different tasks, making the segmentation and classification results more reliable.
[0130] Example 3
[0131] The difference between this embodiment and Embodiment 1 is that, in order to further demonstrate the beneficial effects of the present invention, this embodiment conducts a test experiment, specifically including the following steps:
[0132] (1) Constructing the test set
[0133] A high-quality test set was constructed. First, representative image samples were selected from the database of the Department of Otolaryngology at Zhuzhou People's Hospital. These samples covered different degrees of lesion types (e.g., normal, mild, moderate, and severe hypertrophy), and the image size was adjusted to 224×224. Then, each image in the test set was precisely labeled using Labelme software, and the lesion region and nasal meatus region were manually divided.
[0134] (2) Test model.
[0135] The test samples from the test set are input into the model sequentially in batches of 64 to obtain preliminary segmentation and classification results. Evaluation metrics include mean Intersection over Union (mIoU), precision, recall, Dice coefficient, and mean average precision (mAP). The calculation methods for the first four metrics are as follows:
[0136]
[0137] TP, FP, TN, and FN represent: the number of correctly identified positive samples (True Positives), the number of samples incorrectly identified as positive (False Positives), the number of correctly identified negative samples (True Negatives), and the number of samples incorrectly identified as negative (False Negatives), respectively.
[0138] Simulation results:
[0139] In this experiment, the loss and performance metrics on the training and validation sets were monitored, and the results are shown in the attached figure. Figure 2 As shown:
[0140] As can be observed from the figure, during training, the box loss, segmentation loss, classification loss, and DFL loss all gradually decrease with the increase of the number of iterations, and tend to converge around 100 iterations. This indicates that the model gradually learns more accurate features in object detection and segmentation tasks. Meanwhile, on the validation set, these loss values also show a decreasing trend, demonstrating that the model has good generalization ability.
[0141] In terms of performance metrics, precision, recall, and mean accuracy (mAP) all improved significantly during training. In particular, mAP@50 and mAP@50-95 reached high values around 100 iterations, indicating that the model has strong accuracy and robustness in segmentation and detection tasks.
[0142] Appendix Figure 3 The figure shows the F1-Confidence curves, the changes in F1 values for different categories (normal, fairly, nasal, almost, slightly) with confidence level, and the overall performance of all categories.
[0143] It can be observed that the F1 scores for each category rise rapidly at lower confidence levels, stabilize near their peak, and then decrease at higher confidence levels. The F1 scores for the "fairly" and "normal" categories show high stability across most confidence levels. Overall, the combined F1 score for all categories reaches a maximum of 0.89 at a confidence level of 0.517, demonstrating the model's optimal performance at this level. These results indicate that the model can effectively balance precision and recall within a certain confidence threshold, achieving high detection and segmentation performance.
[0144] Therefore, the results show that the model can accurately segment the adenoids and nasopharynx, and can accurately classify different degrees of adenoid hypertrophy.
[0145] Appendix Figure 4 as well as Figure 5 The comparison between actual segmentation and model-predicted segmentation, as well as the comparison between single-target and dual-target grading, is presented. A heatmap visually illustrates the feature regions of interest to the model. As can be seen from the figures, the model of this invention not only achieves accurate segmentation but also generates accurate grading results, providing reliable support for lesion analysis.
[0146] The figure below shows a comparison between the actual segmentation and the model's predicted segmentation, as well as a comparison between single-target grading and dual-target grading. A heatmap visually presents the feature regions of interest to the model. As can be seen from the figure, the model of this invention not only achieves accurate segmentation results but also generates accurate grading results, providing reliable support for lesion analysis.
[0147] Obviously, the above embodiments are merely examples to clearly illustrate the technical solutions of the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A method for classifying the degree of adenoid hypertrophy, characterized in that, Includes the following steps: S1: Acquire complete endoscopic images of the adenoids and nasopharynx, preprocess the images to obtain images with masks. ; S2: Transfer image The image is divided into two complementary white and black regions. Feature extraction is performed on the two regions to obtain the final segmentation feature output. ; S3: Output of segmentation features Comparative learning is performed, and the learned results are used to predict the classification results. ; S4: The white area is obtained as and the black area is The ratio of their relative areas, R; for We use a weighted method to assign appropriate weights to R, thereby obtaining accurate classification results; In step S1, the preprocessing includes classifying and labeling adenoids and nasopharyngeal cavities for different degrees of hypertrophy, and then processing the images. The image is input into a segmentation model for initial segmentation, thereby obtaining an image with a mask. ; Step S2 includes the following steps: S21: For the original image Implement grid-based operations, Divide into multiple grid images, denoted as Then, set the input image size. for Based on Divide the image into white areas and black area ; S22: Specifically targeting the first [item] in the black area. A grid image and the first in the white area A grid image Perform feature extraction to generate corresponding feature representations. and ; S23: Will and With the help of fusion operation and The data is fused to enhance information complementarity, thereby constructing the final segmentation feature output. ; In step S22, the white area and the black area Subdivided into multiple small blocks and and apply feature extraction functions Process each block to obtain the corresponding feature vector: Calculate the cross-entropy between the white and black regions. First of all Defined in block The probability of finding a category is used to quantitatively measure the contribution of each region to the image information. c represents the category; ultimately, through comparison... and The difference in information contribution between white and black areas was analyzed; S3 includes: S31: Calculate the contrastive loss through contrastive learning; S32: Fuse multi-level feature blocks to integrate information from different levels, and use the fused features for prediction through the decoder; In step S31 in Represents the cosine similarity function. It's a hyperparameter. It is a shallow fully connected network; set It consists of feature pairs embedded that are different from the input image; The distance between each patch pair is then calculated using the cosine similarity of the refined feature pair embeddings. A contrastive learning method is then applied to calculate the contrastive loss, thereby amplifying the differences between feature pairs. The cosine similarity is used to measure the distance between patch embeddings. And standardize the range of values between 0 and 1: Used as input to the feature pair contrastive learning module; generates white region feature maps. and black area feature map Predicted score With threshold The confidence level of the classification is determined when At that time, it was classified as a high-confidence category. ;when At that time, it was classified as a low confidence category. Feature extraction is applied to each region. Each block is further used to calculate the similarity and distance between classes; capturing and The complementary relationship between them; The technical formula for the learning error of black-and-white dual-region pairing comparison is: in, and These represent the logarithms for high confidence and low confidence levels, respectively. and These represent high confidence levels. and Feature embedding of low-confidence pairs.
2. The method for classifying the degree of adenoid hypertrophy according to claim 1, characterized in that, In step S23 The calculation formula is: in It is the fusion weight, used to control the contribution ratio of features from white and black regions.
3. The method for classifying the degree of adenoid hypertrophy according to claim 1, characterized in that, Step S32 includes: firstly, fusing multi-level feature blocks to integrate information from different levels; and secondly, mapping the category distribution generated by the decoder to the hierarchical results. in It is a segmentation decoder. It is the input image The prediction results; The segmentation loss is calculated by combining the prediction results generated by the decoder with the predicted category results of the feature pairs. ; This represents the total number of pixels in the image. Indicates the input image The actual segmentation image; The formula for calculating cross-entropy loss is: Let i be the true category label of the i-th pixel. The image's predicted classification result is obtained by calculating the segmentation loss, based on the category label predicted by the decoder. .
4. The method for classifying the degree of adenoid hypertrophy according to claim 1, characterized in that, In step S4 The formula for calculating the area ratio R is: Indicates the area of the white region. This indicates the area of the black zone.
5. The method for classifying the degree of adenoid hypertrophy according to claim 1, characterized in that, In step S4, let Indicates position Label The predicted probability, Indicating area ratio, the final label The calculation formula is: Using segmentation loss Used to optimize the accuracy of image segmentation. It is the loss of feature contrastive learning, which strengthens the feature relationships and feature discrimination of the input image through contrastive learning. The focus is on optimizing the black and white region features in the contrastive learning module, improving the model's discriminative ability by reducing intra-class distance and increasing inter-class separation; the final total loss function is the weighted sum of these loss terms; the formula for calculating the total damage function is: , , These are the weighting coefficients for each loss term.
Citation Information
Patent Citations
Processing method and device of nasopharynx endoscope image, electronic equipment and storage medium
CN113116305A
Head-side sheet adenoid image automatic evaluation method and device based on deep learning
CN113688942A
Adenoid identification method and device based on nasopharyngeal endoscope imaging
CN118038442A
