A lightweight medical image classification method
By designing a lightweight medical image classification method, LiteMusaNet, and utilizing techniques such as multi-scale adaptive blocks and hybrid attention blocks, the high computational complexity of existing models is addressed, enabling efficient lesion detection on edge devices and improving the accuracy and applicability of lung disease classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2026-04-13
- Publication Date
- 2026-05-29
AI Technical Summary
Existing deep learning models have high computational complexity in medical image analysis, making them difficult to deploy on resource-constrained edge devices. Furthermore, traditional convolutional neural networks and Transformer models have limitations in capturing correlations and global correlations of lung lesions.
A lightweight medical image classification method is designed, which adopts a hybrid network LiteMusaNet consisting of multi-scale adaptive blocks, convolution-Transformer hybrid attention blocks, multi-scale dilated convolution blocks, and channel and spatial recalibration blocks. Feature extraction and fusion are performed through a multi-stage encoder framework, which reduces computational complexity and improves the ability to capture lesion features.
While maintaining high accuracy, it significantly reduces the number of parameters and computational complexity, making it suitable for edge computing devices. It improves the accuracy and efficiency of lung lesion detection and is suitable for deployment on mobile medical devices or edge computing platforms.
Smart Images

Figure CN122115996A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image classification technology, and in particular to a lightweight medical image classification method. Background Technology
[0002] In recent years, with the rapid development of artificial intelligence technology, computer vision has made breakthrough progress in the application of medical image analysis, especially in the field of automatic identification and assisted diagnosis of lung diseases. Chest X-ray images are widely used in clinical respiratory disease screening due to their convenient acquisition and low cost. As an important branch of artificial intelligence, computer vision has improved diagnostic efficiency and alleviated the pressure on medical resources. However, existing deep learning models face many challenges in practical deployment: many models are optimized for single tasks and lack versatility in handling diverse classification tasks; high-performance models rely on complex architectures and large amounts of computing resources, making them difficult to apply in resource-constrained environments such as mobile medical devices or embedded systems.
[0003] Traditional convolutional neural networks (CNNs) extract local features such as edges and textures through sliding windows of convolutional kernels and combine them with pooling layers to achieve hierarchical abstraction of features, exhibiting a lightweight advantage among shallow networks. However, their inductive bias is limited to the local receptive field, resulting in insufficient ability to model long-range dependencies such as the correlation between lesions between lung lobes and the spatial relationship between ribs and lung fields, making it difficult to capture the global correlation of ground-glass opacity changes across lung regions. In contrast, Transformer-based models can effectively capture global relationships, but their computational complexity increases quadratically with the input size, leading to high resource requirements. In the field of medical imaging, real-time processing is crucial, necessitating models that balance performance, efficiency, and adaptability. In recent years, deep learning technology has achieved significant results in medical image analysis, especially in the automatic detection of lung diseases. However, many existing models have a large number of parameters and are computationally complex, making them difficult to deploy on edge devices or in resource-constrained environments. Furthermore, lesion regions in medical images often have multi-scale, blurred, and irregular characteristics, and traditional convolutional neural networks have limitations in capturing these complex features.
[0004] To address the aforementioned problems, this invention proposes a lightweight medical image classification method. Summary of the Invention
[0005] The purpose of this invention is to provide a lightweight medical image classification method that, while maintaining high accuracy, significantly reduces the number of parameters and computational complexity, is suitable for edge computing devices, and effectively captures key lesion features in chest X-ray images, thereby improving the detection accuracy of lung lesions.
[0006] To achieve the above objectives, the present invention provides the following solution: A lightweight medical image classification method includes: Obtain the chest X-ray image to be detected; The chest X-ray image to be detected is input into a lightweight medical image classification model, which extracts features from low-level anatomical edges to high-level semantic lesions and outputs classification results. The lightweight medical image classification model consists of several encoding stages and integrates multi-scale adaptive blocks, convolution-Transformer hybrid attention blocks, multi-scale dilated convolution blocks, and channel and spatial recalibration blocks.
[0007] Optionally, the lightweight medical image classification model outputs classification results including: The chest X-ray image to be detected is input into the first encoding stage, and shallow feature extraction is performed through the first multi-scale adaptive block to output a shallow low-level feature map containing basic spatial details. The downsampled shallow low-level feature map is input into the second encoding stage. The multi-scale and global context are initially fused through the second multi-scale adaptive block and the first convolution-Transformer hybrid attention block, and the mid-level feature map that fuses the multi-scale local structure and the initial global relationship is output. The middle-layer feature map is input into the third encoding stage, and deep semantic abstraction and feature enhancement are performed through the second convolution-Transformer hybrid attention block and the third multi-scale adaptive block to output the first deep feature map. The first deep feature map is input into the fourth encoding stage, and the semantic expression of the blurred lesion features is enhanced by the fourth multi-scale adaptive block, and the second deep feature map is output. The second deep feature map is input into the fifth encoding stage, and the diffuse lesions are captured and key regions are enhanced through the fifth multi-scale adaptive block and multi-scale dilated convolution block, and the enhanced feature map is output. The enhanced feature map is input into the channel and spatial recalibration block to dynamically enhance low-frequency or blurred key lesion regions, and the final optimized global feature representation is output. The final optimized global feature representation is input into the classification head, and the classification result is output.
[0008] Optionally, shallow feature extraction via the first multi-scale adaptive block includes: The chest X-ray image to be detected is compressed by convolution, and the compressed feature map is processed by multi-scale parallel branches to extract features at different scales. Features of different scales are concatenated along the channel dimension and weighted by SE attention. The weighted features are then batch normalized to obtain the fusion result. The fusion result is added to the chest X-ray image to be detected using residual connection and activated by ReLU to obtain the shallow low-level feature map.
[0009] Optionally, the multi-scale parallel branches include: 3×3 convolution branches, 5×5 convolution branches, dilated convolution branches, and depthwise separable convolution branches.
[0010] Optionally, the initial fusion of multi-scale and global context through a second multi-scale adaptive block and a first convolutional-Transformer hybrid attention block includes: The shallow low-level feature map is input into the second multi-scale adaptive block to extract lesion features of different sizes; The lesion features of different sizes are input into the first convolution-transformer hybrid attention block, which combines local convolution features with a lightweight global self-attention mechanism to output the mid-layer feature map.
[0011] Optionally, the first convolution-Transformer hybrid attention block combines local convolutional features with a lightweight global self-attention mechanism, including: Depth-separable convolution is used to extract local features from lesions of different sizes. The local features are then flattened and normalized to obtain flattened and normalized features. The normalized features are processed using multi-head self-attention, and the attention output is calculated. The attention output is added to the flattened features, and the added features are input into the MLP module for processing. After feature reshaping, the features are added to the lesion features of different sizes, and the mid-layer feature map is output.
[0012] Optionally, deep semantic abstraction and feature enhancement through the second convolution-Transformer hybrid attention block and the third multi-scale adaptive block include: inputting the mid-layer feature map into the second convolution-Transformer hybrid attention block for deep global long-range dependency modeling, and inputting the output into the third multi-scale adaptive block for adaptive recalibration and detail refinement.
[0013] Optionally, capturing diffuse lesions and enhancing key regions through a fifth multi-scale adaptive block and a multi-scale dilated convolution block includes: inputting the second deep feature map into the fifth multi-scale adaptive block for feature extraction, and inputting the output result into the multi-scale dilated convolution block for parallel dilated convolution processing.
[0014] Optionally, the parallel dilated convolution processing of the multi-scale dilated convolution blocks includes: The output of the fifth multi-scale adaptive block is input into the parallel dilated convolution branch. The output of the parallel dilated convolution branch is then concatenated, compressed, normalized, and activated along the channel dimension, and then added to the output of the fifth multi-scale adaptive block.
[0015] Optionally, the channel and spatial recalibration block dynamically enhances low-frequency or blurred key lesion regions, including: The enhanced feature map is subjected to global average pooling and local spatial pooling. The features after global average pooling and local spatial pooling are aligned by bilinear interpolation. Channel and spatial recalibration weights are generated by convolution and activation operations. The recalibration weights are multiplied element-wise with the enhanced feature map to output the final optimized global feature representation.
[0016] The beneficial effects of this invention are as follows: This invention proposes a lightweight medical image classification method. The lightweight multi-scale adaptive network LiteMusaNet in this method is specifically designed for chest X-ray image classification tasks to address the challenges of high computational complexity and resource constraints in medical image analysis. By introducing MuSABlock multi-scale adaptive blocks, CoTrABlock convolution-Transformer hybrid attention blocks, DiPABlock multi-scale dilated convolution blocks, and CARE channel and spatial recalibration blocks, LiteMusaNet significantly reduces computational requirements while maintaining high classification accuracy. Experimental results show that the model achieves an accuracy of 98.40% in binary classification tasks and 96.88% in four-class classification tasks on the D1 and D2 datasets, outperforming many classic models and demonstrating significant advantages compared with other existing technologies. The model has only 5.42M parameters and a floating-point operation cost of 2.03G, demonstrating the superiority of its lightweight design and making it very suitable for deployment on mobile devices or edge computing platforms.
[0017] The success of LiteMusaNet stems from its innovative multi-scale feature extraction strategy and modular architecture design, effectively addressing the diversity and complexity of lesions in medical images. The multi-scale modeling capabilities of MuSABlock and DiPABlock enhance the perception of lesions of different sizes, CoTrABlock improves the capture of global contextual information, and the CARE module optimizes the response to low-frequency lesions through an attention mechanism. Ablation experiments further validated the synergistic effect of each module, demonstrating the efficiency of its overall architecture. LiteMusaNet not only surpasses existing methods in performance but also achieves a good balance in computational efficiency, providing an efficient, lightweight, and practical solution for medical image classification tasks. Despite the significant achievements of LiteMusaNet, there are still many aspects worthy of further exploration. The current model's ability to identify extremely small or blurred lesions still has room for improvement, which can be achieved by introducing more refined attention mechanisms or multi-task learning frameworks.
[0018] Meanwhile, LiteMusaNet's structured design and its design philosophy can be easily extended to medical image tasks such as segmentation, further expanding its application potential in clinical auxiliary diagnosis and providing more support for promoting the practical deployment of artificial intelligence in the medical field. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a structural diagram of the lightweight medical image classification model according to an embodiment of the present invention; Figure 2 This is a structural diagram of the MuSABlock multi-scale adaptive block according to an embodiment of the present invention; Figure 3 This is a structural diagram of the CoTrABlock convolution-Transformer hybrid attention block according to an embodiment of the present invention; Figure 4 This is a structural diagram of the DiPABlock multi-scale dilated convolutional block according to an embodiment of the present invention; Figure 5 Examples of the dataset categories in this embodiment of the invention are shown, where (a) is an example of the categories of the COVID-19 radiological image database, and (b) is an example of the categories of the chest X-ray image dataset. Figure 6 This is a diagram showing the performance of the lightweight medical image classification model of this invention on the validation set during the training process. Figure 7 This is a flowchart illustrating the data processing of the CAREBlock channel and spatial recalibration block in an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] This embodiment proposes a lightweight medical image classification method, including: Obtain the chest X-ray image to be detected; The chest X-ray image to be detected is input into the lightweight medical image classification model LiteMusaNet, which extracts features from low-level anatomical edges to high-level semantic lesions and outputs classification results. The lightweight medical image classification model consists of several encoding stages and integrates multi-scale adaptive blocks (MuSABlock), convolution-transformer hybrid attention blocks (CoTrABlock), multi-scale dilated convolution blocks (DiPABlock), and channel and spatial recalibration blocks (CAREBlock).
[0024] Specifically, LiteMusaNet is a lightweight, multi-scale hybrid network designed for efficient and accurate classification of chest X-ray images, with a particular focus on lung lesion detection. The entire architecture is built upon a staged encoder framework that progressively extracts features from low-level anatomical margins to high-level semantic lesions. It utilizes adaptive convolution techniques to reduce model parameters, improving training efficiency while maintaining low computational complexity, making it suitable for real-time or edge deployments in clinical settings.
[0025] like Figure 1 As shown, LiteMusaNet integrates MuSABlock, CoTrABlock, DiPABlock, and CAREBlock to form a lightweight framework with only 5.42 million parameters and 2.03 GFLOPs. MuSABlock achieves adaptive fusion of multi-scale features through multi-branch parallel convolutions and adaptive attention; CoTrABlock combines depthwise separable convolutions with a lightweight Transformer to improve global modeling efficiency; and DiPABlock and CAREBlock optimize deep semantics and key region attention, respectively. The overall design maintains high classification accuracy while reducing computational complexity, providing an efficient and scalable solution for medical image classification tasks. The network consists of five encoding stages, applying residual connections inside and outside modules to maintain feature continuity and mitigate information loss due to downsampling. The model further incorporates a CARE module in the final stage to enhance sensitivity to critical but often underrepresented lesion regions. Output features are input to the classification layer, supporting the detection of multi-class lung diseases and the screening head that distinguishes between normal and abnormal lungs. The entire model has only 5.42 million parameters and 2.03 GFLOPs (billion floating-point operations), highlighting its suitability for lightweight deployment without sacrificing semantic understanding capabilities.
[0026] Furthermore, the lightweight medical image classification model outputs classification results including: The chest X-ray image to be detected is input into the first encoding stage, and shallow feature extraction is performed through the first multi-scale adaptive block to output a shallow low-level feature map containing basic spatial details. The downsampled shallow low-level feature map is input into the second encoding stage. The multi-scale and global context are initially fused through the second multi-scale adaptive block and the first convolution-Transformer hybrid attention block, and the mid-level feature map that fuses the multi-scale local structure and the initial global relationship is output. The middle-layer feature map is input into the third encoding stage, and deep semantic abstraction and feature enhancement are performed through the second convolution-Transformer hybrid attention block and the third multi-scale adaptive block to output the first deep feature map. The first deep feature map is input into the fourth encoding stage, and the semantic expression of the blurred lesion features is enhanced by the fourth multi-scale adaptive block, and the second deep feature map is output. The second deep feature map is input into the fifth encoding stage, and the diffuse lesions are captured and key regions are enhanced through the fifth multi-scale adaptive block and multi-scale dilated convolution block, and the enhanced feature map is output. The enhanced feature map is input into the channel and spatial recalibration block to dynamically enhance low-frequency or blurred key lesion regions, and the final optimized global feature representation is output. The final optimized global feature representation is input into the classification head, and the classification result is output.
[0027] Specifically, the first stage (Stage 1): shallow feature extraction; Input: Preprocessed medical images (such as chest X-ray images with uniform resolution adjusted to 224 x 224).
[0028] Processing: The image is input into the first-stage MuSA module, which uses multi-scale parallel branches to extract local pattern features such as shallow anatomical edges and texture cues, and maintains feature continuity through residual connections.
[0029] Output: A shallow low-level feature map containing basic spatial details, which is downsampled and passed to the second stage.
[0030] Stage 2: Initial fusion of multi-scale and global context; Input: Shallow feature map output from the first stage.
[0031] Processing: This stage employs a combination of MuSA and CoTrA. Features are first further extracted into lesion features of different sizes using the MuSA module; then, the output is passed to the CoTrA module, which begins the combination of local convolutional features with a lightweight global self-attention mechanism.
[0032] Output: A mid-level feature map that integrates multi-scale local structures and preliminary global relationships.
[0033] Stage 3: Deep semantic abstraction and feature enhancement.
[0034] Input: The mid-level feature map output from the second stage. Processing: This stage uses a combination of CoTrA and MuSA. To balance context awareness and detail capture, the features are first input into the CoTrA module for deep global long-range dependency modeling, and then the results are passed to the MuSA module for adaptive recalibration and detail refinement.
[0035] Output: Deep feature maps with higher-level semantic abstraction and rich global context representation.
[0036] Stage 4: Transition of mid-to-deep features; Input: Deep feature map output from the third stage.
[0037] Processing: The features are input into the fourth-stage MuSA module. This stage serves as a transition zone connecting mid-level structural features with deep, extensive lesions, continuously enhancing the semantic expression of ambiguous lesion features.
[0038] Output: A highly abstract, deep semantic feature map ready for final large-scale lesion capture.
[0039] Stage 5 and its output: Diffuse lesion capture and enhancement of key areas.
[0040] Input: Deep semantic feature map output from the fourth stage.
[0041] Processing: This stage combines MuSA and DiPA modules (features are first extracted by MuSA and then fed into DiPA). Primarily, the parallel dilated convolution of the DiPA module covers multi-scale receptive fields without reducing resolution, addressing the information flow fragmentation problem caused by deep semantic compression, thus capturing widely prevalent diffuse lesions.
[0042] The output of Stage 5 is then fed into the CARE module, which dynamically enhances sensitivity to low-frequency or ambiguous key lesion areas through a combined channel-region attention mechanism.
[0043] Output: The final optimized global feature representation is input into a multi-task classification head (such as a binary or quadruple classification screening head) and outputs the final disease prediction probability.
[0044] Experimental experience shows that in chest X-rays, most diagnostic features can be perceived through local patterns in the superficial and intermediate layers, while global relationships only need to be addressed at the key semantic stage. Therefore, the MuSA module was chosen to extract features such as superficial edges and texture cues for global modeling at each stage, with CoTrA or DiPA introduced as enhancement modules at different stages. In the intermediate stages, combined modules were used to fuse local structural features with global contextual representations, progressively enhancing semantic abstraction. Stage 4 used MuSA as a transition zone connecting the mid-layer structures and the extraction of blurred lesion features to the deep, widespread lesions, continuously strengthening semantic features. The final stage used DiPA to address the information flow fragmentation caused by deep semantic compression, capturing widely existing lesions. Finally, the CARE module selectively enhances category-sensitive regions by applying joint channel-region attention, specifically handling newly emerging or low-frequency symptoms.
[0045] Furthermore, shallow feature extraction via the first multi-scale adaptive block includes: The chest X-ray image to be detected is compressed by convolution, and the compressed feature map is processed by multi-scale parallel branches to extract features at different scales. Features of different scales are concatenated along the channel dimension and weighted by SE attention. The weighted features are then batch normalized to obtain the fusion result. The fusion result is added to the chest X-ray image to be detected using residual connection and activated by ReLU to obtain the shallow low-level feature map.
[0046] Specifically, to effectively model lesion regions of different sizes and shapes, a lightweight modular structure integrating multi-scale convolution, channel compression, and adaptive weighting is proposed. MuSA Block uses global average pooling to compress the feature map of each channel into a scalar, capturing global features. Four branches process the input in parallel, extracting features at different scales respectively. The outputs of the four branches are concatenated along the channel dimension, and then channel weights are generated through an attention mechanism. The concatenated features are recalibrated to achieve adaptive fusion of branch features, enhancing the modeling ability of multi-scale lesion characteristics. Finally, 1×1 convolution compresses the high-dimensional features back to the original number of channels, fusing information from each branch. Residual connections are used to ensure smooth gradient propagation. Figure 2 The structure shown includes: 1. Channel compression: via Convolution reduces the number of input channels from Compress to To reduce computational overhead: .
[0047] 2. Multi-scale parallel branching: This involves processing the compressed feature map... The process involves four parallel branches to extract features at different scales: Convolutional branches: using Convolution kernel, Maintain space dimensions: ; Convolutional branches: using Convolution kernel, Maintain space dimensions: ; Dilated convolution branch: using Convolution kernel, , Expanding the sensory field: ; Depthwise Separable Convolution (DSC) branch: includes depthwise convolution ( , ) and pointwise convolution: ; The output size of each branch is... .
[0048] 3. Feature concatenation and SE attention weighting: The outputs of the four branches are concatenated along the channel dimension to obtain... : ; Channel attention weights are then generated using the Squeeze-and-Excitation (SE) module. : Squeeze: Global average pooling, compresses spatial dimensions. ; Excitation: Through two layers Convolution generates weights. : ; This refers to the Sigmoid function.
[0049] Weighted fusion: for Perform channel weighting: ; 4. Feature fusion and residual connection: through Convolution extracts weighted features from The channel has been restored to Channel, and apply BatchNorm: ; Finally, the input is connected via residual connections. Add the fusion result and apply ReLU activation: .
[0050] Furthermore, the initial fusion of multi-scale and global context is achieved through a second multi-scale adaptive block and a first convolutional-Transformer hybrid attention block, including: The shallow low-level feature map is input into the second multi-scale adaptive block to extract lesion features of different sizes; The lesion features of different sizes are input into the first convolution-transformer hybrid attention block, which combines local convolution features with a lightweight global self-attention mechanism to output the mid-layer feature map.
[0051] Furthermore, the first convolutional-Transformer hybrid attention block combines local convolutional features with a lightweight global self-attention mechanism, including: Depth-separable convolution is used to extract local features from lesions of different sizes. The local features are then flattened and normalized to obtain flattened and normalized features. The normalized features are processed using multi-head self-attention, and the attention output is calculated. The attention output is added to the flattened features, and the added features are input into the MLP module for processing. After feature reshaping, the features are added to the lesion features of different sizes, and the mid-layer feature map is output.
[0052] Specifically, the CoTrA Block, as a second pathway, enhances global modeling capabilities by adding a lightweight DW convolution to a Transformer. This combines the local feature extraction capabilities of convolution with the global modeling capabilities of the Transformer, optimizing for the characteristics of "clear local structures + significant global correlations" in chest X-ray images. Local features are extracted through depthwise separable convolutions, and lightweight multi-head self-attention and MLP modules are used to capture long-range dependencies. CBS uses SiLU instead of ReLU; SiLU is smoother, with a continuous derivative. This characteristic is beneficial for gradient-based optimization algorithms during backpropagation, making the model training process more stable and facilitating smoother gradient propagation, thus improving classification accuracy. However, SiLU has relatively high computational cost, so it is only used when extracting local features. Figure 3 The structure shown includes: 1. Local Feature Extraction: Local features are extracted using depthwise separable convolution (DW convolution), with a kernel size of [missing value]. , , This is followed by BatchNorm and SiLU / ReLU activation (Note: The formula illustration uses ReLU, but the text emphasizes that SiLU was used for local feature extraction to maintain derivative continuity; it is recommended to refer to the text description). ; 2. Transformer Modeling: Flattening and Normalization: Flatten into a sequence And apply LayerNorm: ; Multi-Head Self-Attention (MHSA): Applying the MHSA module ( ), calculate the attention output and add it to the input: ; MLP module: through two fully connected layers ( Further modeling was performed, incorporating ReLU activation and applying residual connections: ; ; 3. Feature reshaping and residual connection: [This section appears to be incomplete and requires further context.] Reshape back to feature map shape and with the original input Add: .
[0053] Furthermore, the deep semantic abstraction and feature enhancement through the second convolution-Transformer hybrid attention block and the third multi-scale adaptive block include: inputting the mid-layer feature map into the second convolution-Transformer hybrid attention block for deep global long-range dependency modeling, and inputting the output into the third multi-scale adaptive block for adaptive recalibration and detail refinement.
[0054] Furthermore, the capture of diffuse lesions and enhancement of key regions through the fifth multi-scale adaptive block and the multi-scale dilated convolution block include: inputting the second deep feature map into the fifth multi-scale adaptive block for feature extraction, and inputting the output result into the multi-scale dilated convolution block for parallel dilated convolution processing.
[0055] Furthermore, the parallel dilated convolution processing of the multi-scale dilated convolution blocks includes: The output of the fifth multi-scale adaptive block is input into the parallel dilated convolution branch. The output of the parallel dilated convolution branch is then concatenated, compressed, normalized, and activated along the channel dimension, and then added to the output of the fifth multi-scale adaptive block.
[0056] Specifically, the DiPA Block (Dilated Parallel Aggregation Block) is designed for deep feature extraction. It captures multi-scale contextual information through parallel dilated convolutions. Unlike the ASPP module in semantic segmentation, DiPA Block specifically employs a convolutional architecture for blurry, large-scale diffuse lesions in chest X-ray images. Its attention mechanism dynamically adjusts the fusion weights of each branch, avoiding detail loss due to reduced feature resolution. DiPA Block uses a fixed kernel size combined with different dilation rates to cover multi-scale receptive fields from local to global without increasing the number of spatial parameters. It maintains lightweight characteristics while improving training stability through residual connections. Figure 4 The structure shown includes: The input to the DiPA Block is a feature map. ,in The number of channels (e.g., 256). The process is as follows: 1. Parallel dilated convolution branches: Four parallel branches are used, with dilation rates of 1, 3, 5, and 7, and the kernel size is [missing value]. Padding is adjusted accordingly to maintain the space dimensions: Expansion rate = 1: ; Expansion rate = 3: ; Expansion rate = 5: ; Expansion rate = 7: ; The output size of each branch is... .
[0057] 2. Feature Concatenation and Fusion: The outputs of the four branches are concatenated along the channel dimension to obtain... : ; pass Convolution reduces the number of channels from Compress back Followed by BatchNorm and ReLU: ; 3. Residual connection: Add the fusion result to the input: .
[0058] Furthermore, the channel and spatial recalibration block dynamically enhances low-frequency or blurred key lesion areas, including: The enhanced feature map is subjected to global average pooling and local spatial pooling. The features after global average pooling and local spatial pooling are aligned by bilinear interpolation. Channel and spatial recalibration weights are generated by convolution and activation operations. The recalibration weights are multiplied element-wise with the enhanced feature map to output the final optimized global feature representation.
[0059] Specifically, the data processing flow of the CARE Block is as follows: Figure 7As shown, the CARE Block (Channel and Spatial Recalibration Block) is an innovative module designed to optimize feature representation by combining global and local spatial information. Its spatial structure primarily includes global average pooling (GlobalAvgPool2d) and local spatial pooling (AdaptiveAvgPool2d to a 3×3 region). Subsequently, bilinear interpolation aligns local and global features, followed by 1×1 convolution and sigmoid activation to generate recalibrated weights for the channel and spatial dimensions. These recalibrated weights are then element-wise multiplied with the original input feature map to dynamically weight features from different channels and spatial locations. Finally, to ensure the stability of gradient propagation and prevent the loss of underlying information, the module introduces residual connections, which element-wise add the weighted features to the original input features to output the final optimized global feature representation. This design allows the CARE Block to dynamically enhance the sensitivity of key lesion areas, such as low-frequency or blurred lung lesions, while suppressing irrelevant background noise, thereby enabling more precise feature focusing in high-resolution chest X-ray images.
[0060] Let the input feature map be The generated calibration weights are The final output The calculation process is as follows: ; ; in, This indicates element-wise multiplication. This indicates element-wise addition (residual join).
[0061] The CARE module was introduced to address the diversity of complex lesion features in medical images, particularly within the five-stage encoding architecture of LiteMusaNet. Especially in the final stage, the CARE module addresses the information fragmentation problem that can result from deep semantic compression by combining channel and spatial attention mechanisms. Traditional models underperform in handling low-frequency lesion categories (such as early manifestations of COVID-19), while the CARE module enhances the responsiveness to these critical but often underestimated lesion regions through adaptive weight adjustment. This is crucial for improving classification accuracy and diagnostic interpretability.
[0062] In chest X-ray classification tasks, the CARE module significantly improves the model's generalization and real-time inference capabilities, especially on resource-constrained edge devices. Combined with LiteMusaNet's lightweight design (only 5.42M parameters and 2.03 GFLOPs), the CARE module reduces unnecessary computational overhead by optimizing feature selection. Experimental results (such as 98.40% and 96.88% accuracy on the D1 and D2 datasets, respectively) validate its effectiveness in binary and quadruple classification tasks, providing practical support for real-time clinical deployment, and further enhancing the model's robustness, particularly when dealing with multi-scale lesions.
[0063] This embodiment includes experiments to verify the functionality and efficiency of the LiteMusaNet model in classification tasks. The experiments include: comparative experiments to examine the model's performance on binary and quadruple classification tasks; and ablation experiments to analyze the contributions of different modules in the model to the classification task.
[0064] Experimental setup and performance metrics: The integrated development environment (IDE) was PyCharm for Python, built on PyTorch, utilizing GPU acceleration for computation. The code uses configuration classes to set detailed training parameters, including batch size, number of training epochs, and learning rate. Performance metrics for the classification task included accuracy, precision, recall, F1 score, Cohen's Kappa coefficient, number of parameters, number of floating-point operations, and confusion matrix. The D1 and D2 datasets were divided into training, validation, and test sets in an 8:1:1 ratio, with a uniform resolution of 224×224.
[0065] The datasets include: To comprehensively evaluate the performance of LiteUtraNet in image classification tasks, we used two publicly available chest X-ray datasets, adapted for binary and quadruple classification tasks, respectively. Table 1 summarizes the key features of these datasets.
[0066] Table 1 Both datasets used were downloaded from the Kaggle platform and are designated D1 and D2, respectively.
[0067] D1 (COVID-19 Radiographic Image Database): Developed jointly by Qatar University and Dhaka University (Rahman et al., 2021), it contains four categories of images: 3,616 COVID-19 positive cases, 10,192 normal cases, 6,012 cases of non-COVID lung infection with pulmonary consolidation, and 1,345 cases of viral pneumonia. Based on these four categories of chest X-ray images, D1 is used for a four-class classification task. Figure 5 (a) shows example graphs of each category in the dataset.
[0068] D2 (Chest X-ray Image Dataset): A pneumonia dataset for children aged 1-5 years (Kermany et al., 2018), containing 4,273 pneumonia images and 1,583 normal images, totaling 5,856 chest X-ray images. Based on these two types of chest X-ray images, D2 is used for a binary classification task. Figure 5 (b) shows example graphs of each category in the dataset.
[0069] The formula for the model performance evaluation index is as follows: ; ; ; ; ; TP is the true positive value, FP is the false positive value, TN is the true negative value, and FN is the false negative value.
[0070] The model's performance on the validation set during training is as follows: Figure 6 As shown, LiteMusaNet exhibits extremely fast convergence speed in the early stages of training, with the validation set accuracy rapidly increasing and stabilizing. No significant overfitting degradation was observed throughout the training process, and the curve showed minimal oscillations. This not only demonstrates that the SiLU activation function and widely used residual connections ensure stable gradient propagation, but also verifies the significant advantages of the proposed lightweight multi-scale fusion architecture and CARE module in terms of generalization ability and resistance to overfitting.
[0071] To verify the performance of LiteMusaNet, a comparative experiment was conducted. The experimental settings were as follows: the initial learning rate was set to 0.0001, the decay weight was 1e-4, the training period was 50, the batch size was 32, and the optimizer was Adam.
[0072] Table 2 shows the results of binary classification using D2. LiteMusaNet performs excellently in the binary classification task, achieving an accuracy of 98.40%, which is superior to MobileNetV2 (92.21%), InceptionV3 (92.96%), EfficientNet (96.82%), and DenseNet201 (93.39%). LiteMusaNet also achieved the highest values in precision, recall, and F1 score, at 98.37%, 98.40%, and 98.36%, respectively, with a Kappa coefficient of 94.24%, indicating strong consistency and classification ability. Furthermore, LiteMusaNet has only 5.42M parameters, significantly lower than other models, demonstrating its advantage in lightweight design and suitability for resource-constrained environments.
[0073] Table 2 The results of multi-class classification using D1 are shown in Table 3. In the four-class classification task, LiteMusaNet achieved an accuracy of 96.88%, outperforming MobileNetV2 (90.54%), InceptionV3 (88.14%), EfficientNet (90.42%), and DenseNet201 (90.52%). The precision, recall, and F1 score were 96.74%, 96.88%, and 96.82%, respectively, with a Kappa coefficient of 93.59%, indicating that the model has good discriminative ability in multi-class classification tasks. LiteMusaNet's parameter count remained at 5.42M, significantly lower than InceptionV3 and DenseNet201, validating the advantages of its lightweight design.
[0074] Table 3 Table 4 shows the comparison results between binary classification and other existing technologies. LiteMusaNet achieved an accuracy of 98.40% in the binary classification task, surpassing studies such as Ortiz-Toro et al. (91.40%), Manickam et al. (93.06%), and Kilicarslan et al. (95.37%), and slightly higher than Balmuri et al. (97.10%). LiteMusaNet also performed excellently in precision, recall, and F1 score, at 98.37%, 98.40%, and 98.36%, respectively, indicating its competitiveness in pneumonia detection tasks.
[0075] Table 4 Based on comparisons with other literature on multi-class classification, as shown in Table 5, LiteMusaNet achieved an accuracy of 96.88% in the four-class classification task, significantly outperforming studies such as Azade and Anand (81.97%), Ahmed Ali et al. (86.70%), and Bouila et al. (94.20%). Precision, recall, and F1 score were 96.74%, 96.88%, and 96.82%, respectively, indicating superior performance of the model in classifying multiple lung diseases.
[0076] Table 5 Experiments show that LiteMusaNet performs well in binary classification, quadruple classification, and image segmentation tasks, while maintaining real-time inference capabilities, providing a general solution for the practical deployment of chest X-ray analysis.
[0077] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A lightweight medical image classification method, characterized in that, include: Obtain the chest X-ray image to be detected; The chest X-ray image to be detected is input into a lightweight medical image classification model, which extracts features from anatomical edges to semantic lesions and outputs classification results. The lightweight medical image classification model consists of several encoding stages and integrates multi-scale adaptive blocks, convolution-Transformer hybrid attention blocks, multi-scale dilated convolution blocks, and channel and spatial recalibration blocks.
2. The lightweight medical image classification method according to claim 1, characterized in that, The lightweight medical image classification model outputs the following classification results: The chest X-ray image to be detected is input into the first encoding stage, and shallow feature extraction is performed through the first multi-scale adaptive block to output a shallow low-level feature map containing basic spatial details. The downsampled shallow low-level feature map is input into the second encoding stage. The multi-scale and global context are initially fused through the second multi-scale adaptive block and the first convolution-Transformer hybrid attention block, and the mid-level feature map that fuses the multi-scale local structure and the initial global relationship is output. The middle-layer feature map is input into the third encoding stage, and deep semantic abstraction and feature enhancement are performed through the second convolution-Transformer hybrid attention block and the third multi-scale adaptive block to output the first deep feature map. The first deep feature map is input into the fourth encoding stage, and the semantic expression of the blurred lesion features is enhanced by the fourth multi-scale adaptive block, and the second deep feature map is output. The second deep feature map is input into the fifth encoding stage, and the diffuse lesions are captured and key regions are enhanced through the fifth multi-scale adaptive block and multi-scale dilated convolution block, and the enhanced feature map is output. The enhanced feature map is input into the channel and spatial recalibration block to dynamically enhance low-frequency or blurred key lesion regions, and the final optimized global feature representation is output. The final optimized global feature representation is input into the classification head, and the classification result is output.
3. The lightweight medical image classification method according to claim 2, characterized in that, Shallow feature extraction via the first multi-scale adaptive block includes: The chest X-ray image to be detected is compressed by convolution, and the compressed feature map is processed by multi-scale parallel branches to extract features at different scales. Features of different scales are concatenated along the channel dimension and weighted by SE attention. The weighted features are then batch normalized to obtain the fusion result. The fusion result is added to the chest X-ray image to be detected using residual connection and activated by ReLU to obtain the shallow low-level feature map.
4. The lightweight medical image classification method according to claim 3, characterized in that, The multi-scale parallel branches include: 3×3 convolution branches, 5×5 convolution branches, dilated convolution branches, and depthwise separable convolution branches.
5. The lightweight medical image classification method according to claim 2, characterized in that, Preliminary fusion of multi-scale and global context is achieved through a second multi-scale adaptive block and a first convolutional-Transformer hybrid attention block, including: The shallow low-level feature map is input into the second multi-scale adaptive block to extract lesion features of different sizes; The lesion features of different sizes are input into the first convolution-transformer hybrid attention block, which combines local convolution features with a lightweight global self-attention mechanism to output the mid-layer feature map.
6. The lightweight medical image classification method according to claim 5, characterized in that, The first convolutional-Transformer hybrid attention block combines local convolutional features with a lightweight global self-attention mechanism, including: Depth-separable convolution is used to extract local features from lesions of different sizes. The local features are then flattened and normalized to obtain flattened and normalized features. The normalized features are processed using multi-head self-attention, and the attention output is calculated. The attention output is added to the flattened features, and the added features are input into the MLP module for processing. After feature reshaping, the features are added to the lesion features of different sizes, and the mid-layer feature map is output.
7. The lightweight medical image classification method according to claim 2, characterized in that, Deep semantic abstraction and feature enhancement through a second convolution-Transformer hybrid attention block and a third multi-scale adaptive block include: inputting the mid-layer feature map into the second convolution-Transformer hybrid attention block for deep global long-range dependency modeling, and inputting the output into the third multi-scale adaptive block for adaptive recalibration and detail refinement.
8. The lightweight medical image classification method according to claim 2, characterized in that, Capturing diffuse lesions and enhancing key regions through a fifth multi-scale adaptive block and a multi-scale dilated convolution block includes: inputting the second deep feature map into the fifth multi-scale adaptive block for feature extraction, and inputting the output result into the multi-scale dilated convolution block for parallel dilated convolution processing.
9. The lightweight medical image classification method according to claim 8, characterized in that, The parallel dilation convolution process performed on the multi-scale dilated convolution block includes: The output of the fifth multi-scale adaptive block is input into the parallel dilated convolution branch. The output of the parallel dilated convolution branch is then concatenated, compressed, normalized, and activated along the channel dimension, and then added to the output of the fifth multi-scale adaptive block.
10. The lightweight medical image classification method according to claim 2, characterized in that, The channel and spatial recalibration block dynamically enhances key lesion areas that are low-frequency or blurred, including: The enhanced feature map is subjected to global average pooling and local spatial pooling. The features after global average pooling and local spatial pooling are aligned by bilinear interpolation. Channel and spatial recalibration weights are generated by convolution and activation operations. The recalibration weights are multiplied element-wise with the enhanced feature map to output the final optimized global feature representation.