Attention mechanism-fused laryngeal cancer primary screening and lesion area positioning method and device
By using the parallel architecture of Inception-v4 and ViT and a multi-objective loss function, combined with Grad-CAM and SHAP models, the problems of missed diagnosis, misdiagnosis, and interpretability in laryngeal cancer screening were solved, achieving high accuracy and reliability in early laryngeal cancer screening.
Patent Information
- Application Number
- CN202511168938.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-12-26
AI Technical Summary
Current laryngeal cancer screening technologies rely on laryngoscopy and pathological biopsy, which can lead to missed diagnoses and misdiagnoses, and are highly invasive. Deep learning models have limitations in capturing global information and identifying fine-grained lesions, and lack interpretable diagnostic evidence.
We employ a parallel architecture of Inception-v4 and ViT, combining a hybrid dynamic attention mechanism and a cross-modal attention mechanism. We use Grad-CAM and SHAP models to achieve synchronous output of diagnostic results and lesion localization. We design a multi-objective loss function to improve model accuracy and interpretability.
It improves the accuracy and reliability of early laryngeal cancer screening, enhances the interpretability of the model, and meets the needs of clinical application.
Smart Images

Figure CN121213992A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of medical laryngoscopy image analysis and computer vision, and in particular relates to a method and device for primary screening and lesion localization of laryngeal cancer by incorporating attention mechanisms. Background Technology
[0002] Laryngeal cancer is a common malignant tumor of the head and neck, and early screening is crucial for improving patient survival rates. Clinically, diagnosis mainly relies on laryngoscopy and pathological biopsy. However, laryngoscopy is heavily influenced by the physician's subjective experience, leading to missed or misdiagnosed cases, while pathological biopsy is invasive and unsuitable for large-scale screening. Therefore, computer-aided diagnostic (CAD) technology based on medical imaging is gaining increasing attention.
[0003] In recent years, deep learning has made significant progress in medical image analysis. Among them, convolutional neural networks (CNNs) are effective at extracting local features and have shown outstanding performance in medical image classification and segmentation tasks. However, CNNs have certain limitations in capturing global information, while models based solely on the Transformer structure, although adept at global modeling, have low sensitivity to fine-grained lesion regions. Furthermore, most existing models use general loss functions without optimization for lesion region features, which may lead to insufficient ability to identify early lesions. At the same time, model interpretability is also an important factor affecting clinical application; how to provide transparent and reliable diagnostic evidence remains an urgent problem to be solved.
[0004] Therefore, by employing an attention-integrated method for laryngeal cancer screening and lesion localization, local and global features can be combined more fully, feature fusion strategies can be optimized, and interpretability analysis mechanisms can be introduced to improve the accuracy and reliability of laryngeal cancer screening. Summary of the Invention
[0005] The present invention aims to overcome the above-mentioned shortcomings of the prior art and provide a method and device for laryngeal cancer screening and lesion area localization that integrates attention mechanisms, so as to improve the accuracy of early laryngeal cancer screening and enhance the interpretability and clinical applicability of the model.
[0006] This invention employs a parallel architecture of Inception-v4 and ViT, enhances the extraction of local lesion features through a hybrid dynamic attention (HDA) mechanism, captures global long-range dependencies using ViT, and combines Grad-CAM and SHAP models to achieve simultaneous output of diagnostic results, lesion localization, and interpretive reports.
[0007] The first aspect of this invention relates to a method for initial screening and lesion localization of laryngeal cancer that incorporates attention mechanisms, the specific steps of which include the following:
[0008] S1. Perform standardization and non-uniformity correction preprocessing on the laryngoscope images;
[0009] S1-1. Normalize the input laryngoscope image to standardize the pixel value range to [0,1].
[0010] S1-2. The illumination components are separated by Gaussian filtering (σ=3), and nonlinear stretching (γ=1.6) is performed on the V channel of the HSV color space to eliminate the ring spot caused by the laryngoscope light source.
[0011] S1-3. Use CLAHE (contrast-limited adaptive histogram equalization) to improve local contrast, set 8×8 grid for local histogram equalization, limit clip limit to 0.02, and use 3×3 median filter to eliminate equalization noise.
[0012] S2. Construct a parallel deep learning model;
[0013] S2-1. An improved hybrid dynamic attention model is designed for the Inception-v4 branch. In the Stem module of Inception-v4, the 3×3 convolution is replaced with a 7×7 depthwise separable convolution (stride = 2), reducing computation by 35%. A hybrid dynamic attention (HDA) layer is inserted after each Inception Block, dynamically selecting the fusion weights of the 3×3 and 5×5 convolution kernels (initial ratio 0.6:0.4). The output channels are compressed to 192 dimensions to adapt to the sparsity of laryngeal mucosal features, resulting in a final output feature map size of 28×28. Figure 1 .
[0014] S2-2. Design a lightweight cross-modal interface for the ViT branch, using 14×14 overlapping slices (stride=7) as input, and replacing linear projection with a three-layer CNN (7×7→5×5→3×3, channels 64→128→256). The Transformer encoder is simplified to 8 layers, with 4 heads per layer. A cross-modal feature injection interface is added after multi-head attention, receiving 192-dimensional features from the Inception branch as an auxiliary key, and outputting 256×14×14 global features, such as... Figure 2 .
[0015] S2-3. Design a dual-branch collaborative training process, employing a three-stage progressive unfreezing strategy: the first stage trains only the Inception+HDA module (loading ImageNet pre-trained weights); the second stage unlocks the last 4 layers of ViT and all AFF modules; and the third stage fine-tunes the entire network. Gradient clipping (threshold = 2.0) and mixed-precision training are used to ensure stability.
[0016] S3. Design an Adaptive Dynamic Feature Fusion (AFF) module;
[0017] S3-1. Design a cross-modal feature alignment layer. Perform a 3×3 depthwise separable convolution (depth_multiplier=2) on the 192×28×28 features output by the Inception branch to enhance the mucosal texture details. Interpolate to 14×14 resolution through a sub-pixel offset compensation algorithm. Unify the dimension to 256 with the 256-dimensional features of the ViT branch through a 1×1 convolution. The spatial alignment error is controlled within ±0.5 pixels through bicubic interpolation.
[0018] S3-2. Design a local → global attention pathway, using the CLS Token of the ViT branch as the query and the local features of the Inception branch as the key / value pair, to calculate the attention weights guided by the lesion region. Top-30% sparsity processing is employed (retaining the 30% of connections with the highest weights), and the attention head dimension is set to 64, outputting a 256×14×14 dimensional enhanced global feature.
[0019] S3-3. Design a global → local attention pathway. Use the lesion candidate region features of the Inception branch (pre-generated by the HDA module) as the query and the global features of the ViT branch as the key / value to construct a reverse attention pathway. Similarly, use a 64-dimensional attention head and sparsification processing to output 192×14×14-dimensional refined local features.
[0020] S3-4. Design a dynamic feature weighted output system. This system uses a dual-path dynamic fusion of channel weights (GAP→FC→Sigmoid) and spatial weights (7×7 dilated convolution→Sigmoid). The final output formula is:
[0021]
[0022] S4. Design a multi-objective optimization loss function suitable for laryngeal cancer primary screening tasks;
[0023] S4-1. Using weighted Focal Loss to handle class imbalance:
[0024] In the initial screening task for laryngeal cancer, since the number of healthy samples is usually much greater than that of lesion samples, directly using cross-entropy loss may cause the model to favor predicting the healthy category. Therefore, FocalLoss is used to reduce the loss contribution of easily classified samples and increase attention to difficult-to-classify samples. Its calculation formula is as follows:
[0025] L focal =-∑ i w i (1-p i ) γ logp i(4-1)
[0026] Where: p i Let w be the predicted probability of class i, γ be an adjustment factor that controls the penalty for easily classified samples, and w be the predicted probability of class i. i The weights are categorical, with diseased categories having a higher weight than healthy categories, in order to balance the class imbalance problem.
[0027] S4-2, Heatmap Constraint Loss:
[0028] To ensure that the Grad-CAM heatmaps generated by the model more accurately indicate lesion areas, a heatmap constraint loss needs to be introduced to better match the lesion areas annotated by the physician. This loss is based on the Dice coefficient and is defined as follows:
[0029]
[0030] Wherein: H pred For the heatmap generated by Grad-CAM, H gt The lesion area marked by the doctor.
[0031] S4-3, Designing Attention-Guided Loss:
[0032] In the Vision Transformer (ViT) branch, the attention mechanism is used to establish long-range dependencies. However, if attention is overly concentrated in certain local regions, it may lead to insufficient utilization of overall features. To optimize the attention mechanism, this paper designs an attention distribution regularization loss, which maximizes the entropy value to make the attention more evenly distributed globally. Its definition is as follows:
[0033] L attn =-∑AlogA(4-3)
[0034] Where A is the attention weight matrix calculated by ViT.
[0035] S4-4, Final Loss Function Combination:
[0036] The final loss function comprehensively considers classification optimization (FocalLoss), lesion region matching (Heatmap Loss), and attention optimization (Attention Loss), and the overall loss function is:
[0037] L=αL focal +βL heatmap +γL attn (4-4)
[0038] α, β, and γ are hyperparameters that control the weights of different losses.
[0039] S5. Construct a dual interpretability verification system using Grad-CAM and SHAP;
[0040] S5-1. Calculate Grad-CAM after the last HDA module in the Inception-v4 branch and overlay it with the original image.
[0041] S5-2. Calculate the SHAP value, analyze the impact of input features on the final classification decision, and output a feature contribution report.
[0042] S5-3. Combine the SHAP results with the lesion areas generated by Grad-CAM to analyze the rationality of the classification decision.
[0043] S6. Generate diagnostic results and visualize them.
[0044] A second aspect of the present invention relates to a laryngeal cancer screening and lesion region localization device involving a fusion attention mechanism, comprising a memory and one or more processors, the memory being used to store program code, deep neural network model parameters, and medical image data; the one or more processors, when executing the executable code, are used to implement the laryngeal cancer screening and lesion region localization method of embodiment 1 using a fusion attention mechanism.
[0045] The device can be deployed in hospital-based image-assisted diagnostic systems, intelligent laryngoscopes, or edge inference platforms to assist in early screening for laryngeal cancer and automatic localization of lesions. The corresponding system-level workflow for this device is as follows: Figure 4 As shown.
[0046] A third aspect of the invention relates to a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the method for laryngeal cancer screening and lesion region localization using a fusion attention mechanism as described in Embodiment 1.
[0047] The computer-readable storage medium may be in the form of a hard disk, optical disk, flash memory, solid-state drive, ROM, RAM, USB flash drive, local storage for edge devices, or cloud storage space, etc. The program is stored in this medium in a modular manner and includes the following functional instruction segments:
[0048] S1, Image Input and Preprocessing Instruction Section, is used to read and process laryngoscope image data, including performing operations such as image normalization, Gaussian filtering, HSV color space brightness enhancement, CLAHE local contrast enhancement, and median filtering noise reduction to standardize the input image quality.
[0049] S2, Neural Network Model Loading Instruction Section, is used to load two trained deep learning sub-network model files from the storage medium:
[0050] S2-1, an improved Inception-v4 model file containing a Hybrid Dynamic Attention Module (HDA);
[0051] S2-2, a lightweight Vision Transformer model file containing a cross-modal feature injection structure;
[0052] It also initializes network weights and configures the basic infrastructure required for graph inference.
[0053] S3, Feature Extraction and Fusion Instruction Section, is used to execute the feature encoding process of laryngoscope images in two sub-networks, extract local and global feature maps, align the feature maps in terms of spatial and channel dimensions, construct bidirectional attention paths (local → global and global → local), and achieve adaptive fusion based on channel weights and spatial weights.
[0054] S4, the inference execution and interpretability calculation instruction segment, is used to generate classification prediction results during the inference phase, calculate the Grad-CAM heatmap based on the Inception branch output, calculate the SHAP feature contribution value based on the ViT attention layer and the final decision result, and generate model interpretability information.
[0055] S5, Visualization Output Command Section, is used to convert screening results, lesion localization heatmaps, and interpretive analysis charts into terminal images or report formats for doctors to reference, review, or archive.
[0056] The program can be loaded and executed by embedded processing systems, AI edge devices, image diagnostic terminals, or medical workstations, enabling complete laryngeal cancer screening in a local environment without a network connection. Simultaneously, the program can also be deployed on a cloud server via API, allowing remote diagnostic support from remotely accessing terminals.
[0057] This invention employs a parallel architecture of Inception-v4 and ViT, introducing a Hybrid Dynamic Attention (HDA) mechanism into the Inception-v4 branch to effectively enhance local feature extraction capabilities. An Adaptive Dynamic Fusion (AFF) module, combined with a Cross-Modal Attention (CMAF) mechanism, achieves efficient interaction between local and global features. A multi-objective loss function is specifically designed to address the needs of early laryngeal cancer screening. At the model output, Grad-CAM heatmap localization and SHAP credibility assessment are integrated simultaneously, constructing a complete and interpretable diagnostic system.
[0058] The beneficial effects of this invention are as follows:
[0059] This invention proposes a method for laryngeal cancer initial screening and lesion region localization that integrates an attention mechanism. By improving laryngoscopy image preprocessing to enhance input data quality, and constructing a parallel deep learning model of Inception-v4 and ViT, a hybrid dynamic attention (HDA) mechanism is introduced into the Inception-v4 branch, combined with cross-modal attention (CMAF) and adaptive feature reweighting (AWF) to optimize feature fusion. Simultaneously, a multi-objective loss function for laryngeal cancer screening is designed, combining classification loss, region attention loss, and confidence loss to improve lesion detection accuracy and screening reliability. Grad-CAM generates lesion region heatmaps, SHAP calculates the contribution of input features, and a confidence evaluation system is constructed to improve the interpretability of screening results. This method meets the real-time requirements of clinical practice while improving the accuracy of laryngeal cancer lesion identification and the reliability of screening. Attached Figure Description
[0060] Figure 1 This is the network model of the improved Inception v4 branch of this invention;
[0061] Figure 2 This is the network model of the improved Vision transformer branch of this invention;
[0062] Figure 3 This is a flowchart of the method of the present invention;
[0063] Figure 4 This is a system-level flowchart of the device of the present invention. Detailed Implementation
[0064] To further understand the content of the present invention, the present invention will be described in detail with reference to the embodiments. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0065] Example 1
[0066] Reference Figure 3 The method for initial screening and lesion localization of laryngeal cancer involved in this embodiment includes the following steps:
[0067] S1. Perform standardization and non-uniformity correction preprocessing on the laryngoscope images;
[0068] S1-1. Normalize the input laryngoscope image to standardize the pixel value range to [0,1].
[0069] S1-2. The illumination components are separated by Gaussian filtering (σ=3), and nonlinear stretching (γ=1.6) is performed on the V channel of the HSV color space to eliminate the ring spot caused by the laryngoscope light source.
[0070] S1-3. Use CLAHE (contrast-limited adaptive histogram equalization) to improve local contrast, set 8×8 grid for local histogram equalization, limit clip limit to 0.02, and use 3×3 median filter to eliminate equalization noise.
[0071] S2. Construct a parallel deep learning model;
[0072] S2-1. An improved hybrid dynamic attention model was designed for the Inception-v4 branch. In the Stem module of Inception-v4, the 3×3 convolution was replaced with a 7×7 depthwise separable convolution (stride = 2), reducing computation by 35%. A hybrid dynamic attention (HDA) layer was inserted after each Inception Block, dynamically selecting the fusion weights of the 3×3 and 5×5 convolution kernels (initial ratio 0.6:0.4). The output channels were compressed to 192 dimensions to adapt to the sparsity of laryngeal mucosal features, resulting in a final output feature map size of 28×28.
[0073] S2-2. Design a lightweight cross-modal interface for the ViT branch, using 14×14 overlapping slices (stride=7) as input, and replacing linear projection with a three-layer CNN (7×7→5×5→3×3, channels 64→128→256). The Transformer encoder is simplified to 8 layers, with 4 heads per layer. A cross-modal feature injection interface is added after multi-head attention, receiving 192-dimensional features from the Inception branch as an auxiliary key, and outputting 256×14×14 global features.
[0074] S2-3. Design a dual-branch collaborative training process, employing a three-stage progressive unfreezing strategy: the first stage trains only the Inception+HDA module (loading ImageNet pre-trained weights); the second stage unlocks the last 4 layers of ViT and all AFF modules; and the third stage fine-tunes the entire network. Gradient clipping (threshold = 2.0) and mixed-precision training are used to ensure stability.
[0075] S3. Design an Adaptive Dynamic Feature Fusion (AFF) module;
[0076] S3-1. Design a cross-modal feature alignment layer. Perform a 3×3 depthwise separable convolution (depth_multiplier=2) on the 192×28×28 features output by the Inception branch to enhance the mucosal texture details. Interpolate to 14×14 resolution through a sub-pixel offset compensation algorithm. Unify the dimension to 256 with the 256-dimensional features of the ViT branch through a 1×1 convolution. The spatial alignment error is controlled within ±0.5 pixels through bicubic interpolation.
[0077] S3-2. Design a local → global attention pathway, using the CLS Token of the ViT branch as the query and the local features of the Inception branch as the key / value pair, to calculate the attention weights guided by the lesion region. Top-30% sparsity processing is employed (retaining the 30% of connections with the highest weights), and the attention head dimension is set to 64, outputting a 256×14×14 dimensional enhanced global feature.
[0078] S3-3. Design a global → local attention pathway. Use the lesion candidate region features of the Inception branch (pre-generated by the HDA module) as the query and the global features of the ViT branch as the key / value to construct a reverse attention pathway. Similarly, use a 64-dimensional attention head and sparsification processing to output 192×14×14-dimensional refined local features.
[0079] S3-4. Design a dynamic feature weighted output system. This system uses a dual-path dynamic fusion of channel weights (GAP→FC→Sigmoid) and spatial weights (7×7 dilated convolution→Sigmoid). The final output formula is:
[0080]
[0081] S4. Design a multi-objective optimization loss function suitable for laryngeal cancer primary screening tasks;
[0082] S4-1. Using weighted Focal Loss to handle class imbalance:
[0083] In the initial screening task for laryngeal cancer, since the number of healthy samples is usually much greater than that of lesion samples, directly using cross-entropy loss may cause the model to favor predicting the healthy category. Therefore, FocalLoss is used to reduce the loss contribution of easily classified samples and increase attention to difficult-to-classify samples. Its calculation formula is as follows:
[0084] L focal =-∑ i w i (1-p i ) γ logp i (4-1)
[0085] Where: p i Let w be the predicted probability of class i, γ be an adjustment factor that controls the penalty for easily classified samples, and w be the predicted probability of class i. i The weights are categorical, with diseased categories having a higher weight than healthy categories, in order to balance the class imbalance problem.
[0086] S4-2, Heatmap Constraint Loss:
[0087] To ensure that the Grad-CAM heatmaps generated by the model more accurately indicate lesion areas, a heatmap constraint loss needs to be introduced to better match the lesion areas annotated by the physician. This loss is based on the Dice coefficient and is defined as follows:
[0088]
[0089] Wherein: H pred For the heatmap generated by Grad-CAM, H gt The lesion area marked by the doctor.
[0090] S4-3, Designing Attention-Guided Loss:
[0091] In the Vision Transformer (ViT) branch, the attention mechanism is used to establish long-range dependencies. However, if attention is overly concentrated in certain local regions, it may lead to insufficient utilization of overall features. To optimize the attention mechanism, this paper designs an attention distribution regularization loss, which maximizes the entropy value to make the attention more evenly distributed globally. Its definition is as follows:
[0092] L attn =-∑AlogA(4-3)
[0093] Where A is the attention weight matrix calculated by ViT.
[0094] S4-4, Final Loss Function Combination:
[0095] The final loss function comprehensively considers classification optimization (FocalLoss), lesion region matching (Heatmap Loss), and attention optimization (Attention Loss), and the overall loss function is:
[0096] L=αL focal +βL heatmap +γL attn (4-4)
[0097] α, β, and γ are hyperparameters that control the weights of different losses.
[0098] S5. Construct a dual interpretability verification system using Grad-CAM and SHAP;
[0099] S5-1. Calculate Grad-CAM after the last HDA module in the Inception-v4 branch and overlay it with the original image.
[0100] S5-2. Calculate the SHAP value, analyze the impact of input features on the final classification decision, and output a feature contribution report.
[0101] S5-3. Combine the SHAP results with the lesion areas generated by Grad-CAM to analyze the rationality of the classification decision.
[0102] S6. Generation and visualization of diagnostic results.
[0103] Example 2
[0104] This embodiment relates to a laryngeal cancer screening and lesion area localization device that integrates attention mechanisms, such as... Figure 4 The device includes a memory and one or more processors. The memory stores program code, deep neural network model parameters, and medical image data. When the one or more processors execute the executable code, they implement the laryngeal cancer screening and lesion area localization method based on the fusion attention mechanism of Embodiment 1. Specifically, when the device executes the program code, it performs the following steps:
[0105] S1. Call the image acquisition and preprocessing module to acquire the input laryngoscope image, normalize the image, extract the brightness component through Gaussian filtering, perform γ correction in the V channel of HSV space to eliminate light spot interference, then apply the CLAHE algorithm to improve local contrast, and suppress noise through median filtering.
[0106] S2. Call the parallel deep feature extraction module, where the Inception-v4 branch inserts a hybrid dynamic attention mechanism after each InceptionBlock to enhance the response of the lesion area; the ViT branch uses 14×14 sliding slices and constructs a Patch embedding sequence through multi-layer convolution, introduces the output of the Inception branch as an auxiliary key, and performs cross-modal attention fusion in the Transformer.
[0107] S3. In the feature fusion stage, feature map size alignment is performed. The local feature map output by the Inception branch is adjusted to the same spatial resolution and channel dimension as the output of the ViT branch through depthwise separable convolution and subpixel interpolation. A local to global attention path guided by CLS Token and a global to local reverse attention path based on lesion candidate regions are constructed. The fusion weighted output is performed by combining channel attention and spatial attention mechanisms.
[0108] S4. Perform the three-stage progressive training process in sequence: In the first stage, train only the Inception branch; in the second stage, unlock the later layers of the ViT branch and the fusion module; in the third stage, perform full network fine-tuning and use gradient pruning and mixed precision training to control stability and resource consumption.
[0109] S5. During training, weighted Focal Loss is used in combination to address the class imbalance problem. Dice loss is calculated based on the heatmap generated by Grad-CAM and the doctor-annotated region to supervise the accuracy of lesion localization. Entropy regularization optimization is performed on the attention weight distribution of ViT. Finally, a multi-objective loss function is formed by weighted combination.
[0110] S6. During the inference phase, Grad-CAM is executed to generate lesion region response maps and calculate the SHAP value of each region in the input image for the prediction results. Finally, the classification results, lesion localization heatmap, and interpretive analysis report are output.
[0111] The device can be deployed in hospital-based image-assisted diagnostic systems, intelligent laryngoscopes, or edge inference platforms to assist in early screening for laryngeal cancer and automatic localization of lesions. The system-level flow corresponding to the device in this embodiment is as follows: Figure 4 As shown.
[0112] Example 3
[0113] This embodiment relates to a computer-readable storage medium storing a program that, when executed by a processor, implements the method for laryngeal cancer screening and lesion area localization using a fusion attention mechanism as described in Embodiment 1.
[0114] The computer-readable storage medium may be in the form of a hard disk, optical disk, flash memory, solid-state drive, ROM, RAM, USB flash drive, local storage for edge devices, or cloud storage space, etc. The program is stored in this medium in a modular manner and includes the following functional instruction segments:
[0115] S1, Image Input and Preprocessing Instruction Section, is used to read and process laryngoscope image data, including performing operations such as image normalization, Gaussian filtering, HSV color space brightness enhancement, CLAHE local contrast enhancement, and median filtering noise reduction to standardize the input image quality.
[0116] S2, Neural Network Model Loading Instruction Section, is used to load two trained deep learning sub-network model files from the storage medium:
[0117] S2-1, an improved Inception-v4 model file containing a Hybrid Dynamic Attention Module (HDA);
[0118] S2-2, a lightweight Vision Transformer model file containing a cross-modal feature injection structure;
[0119] It also initializes network weights and configures the basic infrastructure required for graph inference.
[0120] S3, Feature Extraction and Fusion Instruction Section, is used to execute the feature encoding process of laryngoscope images in two sub-networks, extract local and global feature maps, align the feature maps in terms of spatial and channel dimensions, construct bidirectional attention paths (local → global and global → local), and achieve adaptive fusion based on channel weights and spatial weights.
[0121] S4, the inference execution and interpretability calculation instruction segment, is used to generate classification prediction results during the inference phase, calculate the Grad-CAM heatmap based on the Inception branch output, calculate the SHAP feature contribution value based on the ViT attention layer and the final decision result, and generate model interpretability information.
[0122] S5, Visualization Output Command Section, is used to convert screening results, lesion localization heatmaps, and interpretive analysis charts into terminal images or report formats for doctors to reference, review, or archive.
[0123] The program can be loaded and executed by embedded processing systems, AI edge devices, image diagnostic terminals, or medical workstations, enabling complete laryngeal cancer screening in a local environment without a network connection. Simultaneously, the program can also be deployed on a cloud server via API, allowing remote diagnostic support from remotely accessing terminals.
[0124] The present invention has been described in detail above with reference to the embodiments, but the content described is only a preferred embodiment of the present invention and should not be considered as limiting the scope of the present invention. All equivalent changes and improvements made in accordance with the scope of the present invention should still fall within the patent coverage of the present invention.
Claims
1. A method for primary screening and lesion localization of laryngeal cancer that integrates attention mechanisms, characterized in that: Includes the following steps: S1. Perform standardization and non-uniformity correction preprocessing on the laryngoscope image; acquire the input laryngoscope image, normalize the image to standardize the pixel values to a specified range; extract the brightness component through Gaussian filtering, perform γ correction in the V channel of HSV space to eliminate light spot interference; and use contrast-limited adaptive histogram equalization (CLAHE) to improve local contrast, and suppress noise caused by equalization through median filtering to improve the visibility of the lesion area. S2. Construct a parallel deep learning model; design the Inception-v4 branch, insert a hybrid dynamic attention mechanism after each Inception Block to enhance the response of the lesion area; and design the ViT branch, using 14×14 sliding slices and constructing a Patch embedding sequence through multi-layer convolution, using the output of the Inception branch as an auxiliary key, and performing cross-modal attention fusion in the Transformer structure to achieve complementary expression of local and global features. S3. Design an adaptive dynamic feature fusion (AFF) module; adjust the local feature map output by the Inception branch to the same spatial resolution and channel dimension as the output of the ViT branch through depthwise separable convolution and subpixel interpolation; construct a local to global attention path guided by CLSToken, and a global to local reverse attention path based on lesion candidate regions. It combines channel attention and spatial attention mechanisms to perform fusion weighted output, thereby achieving adaptive dynamic fusion of cross-modal features; S4. Design a multi-objective optimization loss function suitable for laryngeal cancer primary screening tasks; adopt weighted FocalLoss to address the class imbalance problem; calculate Dice loss based on the heatmap generated by Grad-CAM and the doctor-annotated region to supervise the accuracy of lesion localization; and perform entropy regularization optimization on the ViT attention weight distribution to improve the uniformity of attention in the global scope; finally, combine the various loss terms according to their weights to form a multi-objective optimization loss function. S5. Construct a dual interpretability verification system using Grad-CAM and SHAP; use Grad-CAM to generate lesion region response maps to locate potential lesion regions; use the SHAP method to calculate the feature contribution of each region of the input image to the prediction results; and compare and cross-verify the two interpretability results to verify the rationality and credibility of the model's classification decision. S6. Generate diagnostic results and visualize them; integrate and output the classification results, lesion localization heat map and interpretive analysis report, and present them on the terminal in the form of image overlay, report text, etc.; the method can be deployed in hospital-end image-assisted diagnostic systems, intelligent laryngoscope devices or edge inference platforms to assist in early screening of laryngeal cancer and automatic localization of lesion areas.
2. The method for primary screening and lesion localization of laryngeal cancer based on the fusion of attention mechanisms according to claim 1, characterized in that... Step S1, which involves standardizing and correcting the non-uniformity of the laryngoscope image, specifically includes: S1-1. Normalize the input laryngoscope image to standardize the pixel value range to [0,1]. S1-2. The illumination components are separated by Gaussian filtering (σ=3), and nonlinear stretching (γ=1.6) is performed on the V channel of the HSV color space to eliminate the ring spot caused by the laryngoscope light source. S1-3. Employ contrast-limited adaptive histogram equalization (CLAHE) to enhance local contrast. Set an 8×8 grid for local histogram equalization with a clip limit of 0.02, and use a 3×3 median filter to eliminate equalization noise.
3. The method for primary screening and lesion localization of laryngeal cancer based on the fusion of attention mechanisms according to claim 1, characterized in that... Step S2 involves constructing a parallel deep learning model. Step S2 specifically includes: S2-1. Design a hybrid dynamic attention improvement for the Inception-v4 branch. In the Stem module of Inception-v4, replace the 3×3 convolution with a 7×7 depthwise separable convolution with stride=2. Insert a hybrid dynamic attention HDA layer after each Inception Block, dynamically select the fusion weights of the 3×3 and 5×5 convolution kernels with an initial ratio of 0.6:0.4, compress the output channels to 192 dimensions to adapt to the sparsity of laryngeal mucosal features, and finally output feature map size is 28×28. S2-2. Design a lightweight cross-modal interface for the ViT branch, using 14×14 overlapping slices as input, stride=7, and replacing linear projection with a three-layer CNN (7×7→5×5→3×3, channels 64→128→256); the Transformer encoder is simplified to 8 layers, with 4 heads per layer, and a cross-modal feature injection interface is added after multi-head attention, receiving 192-dimensional features from the Inception branch as an auxiliary key, and outputting 256×14×14 global features; S2-3. Design a dual-branch collaborative training process and adopt a three-stage progressive unfreezing strategy: the first stage only trains the Inception+HDA module and loads ImageNet pre-trained weights; the second stage unlocks the last 4 layers of ViT and all AFF modules; the third stage fine-tunes the entire network; gradient clipping and mixed precision training are used to ensure stability.
4. The method for primary screening and lesion localization of laryngeal cancer based on an attention mechanism as described in claim 1 is characterized in that... The design of the adaptive dynamic feature fusion (AFF) module described in step S3 specifically includes: S3-1. Design a cross-modal feature alignment layer. Perform a 3×3 depthwise separable convolution (depth_multiplier=2) on the 192×28×28 features output by the Inception branch to enhance the mucosal texture details. Interpolate to 14×14 resolution through a sub-pixel offset compensation algorithm. Unify the dimension to 256 with the 256-dimensional features of the ViT branch through a 1×1 convolution. The spatial alignment error is controlled within ±0.5 pixels through bicubic interpolation. S3-2. Design a local → global attention pathway. Use the CLS Token of the ViT branch as the Query and the local features of the Inception branch as the Key / Value to calculate the attention weights guided by the lesion region. Use top-30% sparsity processing to retain the 30% of connections with the largest weights. Set the attention head dimension to 64 and output the enhanced global features in 256×14×14 dimensions. S3-3. Design a global → local attention pathway. Use the lesion candidate region features of the Inception branch (pre-generated by the HDA module) as the query and the global features of the ViT branch as the key / value to construct a reverse attention pathway. Similarly, use a 64-dimensional attention head and sparsification to output 192×14×14-dimensional refined local features. S3-4. Design a dynamic feature weighted output system. This system uses a dual-path dynamic fusion of channel weights (GAP→FC→Sigmoid) and spatial weights (7×7 dilated convolution→Sigmoid). The final output formula is:
5. The method for primary screening and lesion localization of laryngeal cancer based on the fusion of attention mechanisms according to claim 1, characterized in that... The design of the multi-objective optimization loss function for laryngeal cancer primary screening task described in step S4 specifically includes: S4-1. Using weighted Focal Loss to handle class imbalance: Focal Loss is used to reduce the loss contribution of easily classified samples. The calculation formula is as follows: L focal =-∑ i w i (1-p i ) γ logp i (4-1) Where: p i Let w be the predicted probability of class i, γ be an adjustment factor that controls the penalty for easily classified samples, and w be the predicted probability of class i. i The weights are determined by the category, with the disease category having a greater weight than the healthy category, in order to balance the category imbalance problem. S4-2, Heatmap Constraint Loss: To ensure that the Grad-CAM heatmap generated by the model can more accurately indicate lesion areas, a heatmap constraint loss needs to be introduced to make the region generated by Grad-CAM more consistent with the lesion areas annotated by the doctor. This loss is based on the Dice coefficient and is defined as follows: Wherein: H pred For the heatmap generated by Grad-CAM, H gt The lesion area marked by the doctor; S4-3, Designing Attention-Guided Loss: The attention distribution regularization loss is designed to maximize the entropy value, making the attention more evenly distributed globally. Its definition is as follows: L attn =-∑AlogA(4-3) Where A is the attention weight matrix calculated by ViT; S4-4, Final Loss Function Combination: The final loss function comprehensively considers classification optimization (FocalLoss), lesion region matching (Heatmap Loss), and attention optimization (Attention Loss). The overall loss function is as follows: L=αL focal +βL heatmap +γL attn (4-4) α, β, and γ are hyperparameters that control the weights of different losses.
6. The method for primary screening and lesion localization of laryngeal cancer based on the fusion of attention mechanisms according to claim 1, characterized in that... Step S5, which describes the construction of a dual interpretability verification system combining Grad-CAM and SHAP, specifically includes: S5-1. Calculate Grad-CAM after the last HDA module in the Inception-v4 branch and overlay it with the original image for display; S5-2. Calculate the SHAP value, analyze the impact of input features on the final classification decision, and output a feature contribution report; S5-3. Combine the SHAP results with the lesion areas generated by Grad-CAM to analyze the rationality of the classification decision.
7. A laryngeal cancer screening and lesion area localization device integrating attention mechanisms, characterized in that, The device includes a memory and one or more processors. The memory is used to store program code, deep neural network model parameters, and medical image data. When the one or more processors execute the executable code, they are used to implement the laryngeal cancer screening and lesion area localization method based on the fusion attention mechanism of Embodiment 1.
8. A computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the method for primary screening and lesion localization of laryngeal cancer using a fusion attention mechanism as described in claim 1.
Citation Information
Cited By
Edge AI automatic judgment method and device for HPM damage level
CN121542929A