Acute leukemia classification method and system based on frequency domain attention and multi-scale fusion
By introducing frequency domain attention and a multi-scale feature pyramid network into the ResNet50 network, the problems of difficulty in extracting subtle features and insufficient multi-scale information in the classification of microscopic images of acute leukemia are solved, achieving high-precision and robust classification results.
Patent Information
- Application Number
- CN202511643975.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-01-09
AI Technical Summary
Existing technologies have poor robustness to subtle features in the classification of microscopic images of acute leukemia, and do not make full use of multi-scale information, resulting in limited classification accuracy and generalization ability.
We adopt a frequency domain attention and multi-scale fusion approach, which enhances feature extraction and fusion capabilities by introducing a frequency domain attention module and a multi-scale feature pyramid network into the deep residual network ResNet50. This includes dynamic block DCT transformation, dual-path attention collaboration, and a multi-scale attention module, thereby improving the local correlation and global representation of features.
It significantly improves the classification performance of leukemia cell microscopic images, enhances the ability to capture minute features and utilize multi-scale information, and strengthens the model's diagnostic potential and robustness.
Smart Images

Figure CN121304641A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image analysis technology and relates to a method and system for classifying acute leukemia based on frequency domain attention and multi-scale fusion. Background Technology
[0002] Acute leukemia (AL) is a malignant hematologic disorder characterized by rapid onset and progression. Its pathological mechanism involves the excessive proliferation of immature or primitive cells at different developmental stages, while their differentiation and apoptosis processes are inhibited. This leads to an abnormal increase in the number and proportion of these two types of cells, ultimately destroying normal hematopoietic function and endangering life.
[0003] Acute leukemia can be divided into two main subtypes: acute myeloid leukemia (AML) and acute lymphoblastic leukemia (ALL). AML is more common in adults, accounting for about 60% of adult patients; while ALL is more common in children, accounting for more than 70% of pediatric patients.
[0004] Accurate subtype classification is crucial for clinical diagnosis, targeted therapy, and the selection of individualized intervention strategies. Traditional classification methods for acute leukemia mainly rely on manual microscopic examination. This method is highly dependent on the subjective experience and operational procedures of pathologists, resulting in low detection efficiency, poor diagnostic consistency, and consequently, increased rates of missed diagnoses and misdiagnoses.
[0005] In recent years, with the rapid development of deep learning technology, Convolutional Neural Networks (CNNs) have achieved revolutionary breakthroughs in the field of computer vision and have shown great application potential in the field of medical image analysis. CNNs can automatically learn and extract multi-level, abstract features from raw images, which greatly simplifies the complex manual feature engineering in traditional image analysis and provides a new technical approach for the automatic classification of leukemia cells.
[0006] However, existing technologies still have the following drawbacks:
[0007] Poor robustness to subtle features: When processing microscopic images affected by noise and staining differences, existing network models have limited ability to capture and utilize key subtle features (such as nucleoli and chromatin texture), which directly affects their classification accuracy and generalization ability.
[0008] Insufficient utilization of multi-scale information: Existing models have difficulty effectively integrating and utilizing pathological information from different scales, which limits their performance when processing complex images and prevents them from fully depicting pathological features, thus limiting the diagnostic potential of the models. Summary of the Invention
[0009] The purpose of this invention is to address the aforementioned problems in existing technologies by proposing a classification method and system for acute leukemia based on frequency domain attention and multi-scale fusion.
[0010] To achieve the above objectives, the basic solution of this invention is: an acute leukemia classification method based on frequency domain attention and multi-scale fusion, comprising the following steps:
[0011] Acquire microscopic images of the patient's acute leukemia;
[0012] The patient's acute leukemia microscopic images were input into the ResNet50 deep residual network backbone network. Frequency domain attention modules were introduced into its multiple deep processing stages. In particular, an efficient multi-scale attention module (EMA) was introduced between the last deep processing stage and its corresponding frequency domain attention module. Through channel grouping and reshaping and dual-path parallel subnets, the correlation of local features was enhanced.
[0013] The output of all frequency domain attention modules is input to a multi-scale feature pyramid network to extract and fuse feature sets.
[0014] The features extracted by the backbone network are fused with the features extracted by the multi-scale feature pyramid network, and then input into a fully connected classification head to output the classification result.
[0015] The working principle and beneficial effects of this basic scheme are as follows: This technical scheme improves upon the standard ResNet50 network, constructing a DCT-MSA-ResNet model. This model retains the powerful feature extraction capabilities of ResNet and innovatively embeds a frequency-domain attention module and a multi-scale feature pyramid network. This modular design allows the model to simultaneously enhance features from both the frequency domain and multi-scale dimensions, thereby effectively improving classification performance.
[0016] Furthermore, the frequency domain attention module includes two stages: dynamic block DCT transform and dual-path attention collaboration;
[0017] Dynamic block DCT transform stage:
[0018] Dynamic padding calibration: The dimensions (h, w) of the input feature map output by the ResNet50 backbone network are dynamically padded to ensure they are divisible by a preset block size K. The padding amount is calculated as follows:
[0019] ,
[0020] Where h: height of the input feature map; w: width of the input feature map; K: preset block size; a hyperparameter, for example, the default value is 7. This means that the feature map is to be divided into several K × K (e.g., 7 × 7) small squares for processing. pad The number of rows needed to fill the bottom in order for the height h to be divisible by K; w pad : The number of columns to fill on the right side so that the width w is divisible by K; modK: Modulo operation, which means calculating the remainder when a number is divided by K;
[0021] With inputs of different sizes, all pixels can be completely incorporated into independent K×K blocks for processing, preventing information loss;
[0022] Block-based frequency domain analysis: The feature map is unfolded into a K×K grid to form a three-dimensional tensor. , where N is the total number of blocks;
[0023] Perform a Fast Fourier Transform (FFT) on each individual block and extract its real part:
[0024] ,
[0025] Where F: Fast Fourier Transform, a mathematical operation that transforms a signal from the spatial domain to the frequency domain; X blocks : Input block feature map tensor; Re{}: Real part extraction operation, the FFT output is a complex number, only the real part is retained; D dct The frequency domain representation of the output DCT coefficients after transformation;
[0026] Feature map reconstruction: After the frequency domain transformation, a reversible folding operation is used to restore these frequency-domain processed and enhanced feature blocks back to the spatial domain, generating dimension-preserving enhanced feature maps. ;
[0027] The padding area added initially is cropped, restoring the feature map to its original size.
[0028] The frequency domain attention module is the key to solving the problem of extracting minute features in this invention. It uses the frequency domain characteristics of images to separate and enhance the detailed information that is crucial for classification, while suppressing noise and background interference.
[0029] Furthermore, the dual-path attention coordination stage:
[0030] The channel attention branch generates channel attention weights by performing global average pooling on the frequency domain feature map and utilizing a bottleneck structure consisting of two fully connected layers. ;
[0031] The spatial attention branch generates spatial attention weights by compressing channels and eliminating batch size dependency through 1×1 convolution and grouping normalization. It focuses on key spatial locations in the feature map.
[0032] After DCT transformation, the obtained frequency domain features are nonlinearly calibrated through a parallel dual-path attention mechanism to achieve dynamic enhancement of key features.
[0033] Furthermore, channel weights and spatial weights The fusion process is performed to obtain the final fusion weight. :
[0034] ,
[0035] The fusion weights are multiplied by channel-spatial broadcasting with the input feature map when entering the "dual-path attention collaboration stage", and combined with residual connections to obtain the final enhanced output feature map.
[0036] The fusion weights are multiplied by channel-wise spatial broadcasting with the original feature map, and then combined with residual connections to obtain the final enhanced output feature map. This mechanism preserves global information while significantly enhancing the ability to express local details.
[0037] Furthermore, the data processing procedure of the multi-scale attention module (EMA) includes:
[0038] Channel group reshaping process:
[0039] The channel dimension of the input feature map is grouped and reshaped into a batch dimension, allowing each subgroup to independently carry out feature learning before proceeding to the subsequent local feature extraction and cross-attention stages, so that the spatial semantic features are evenly distributed within the group.
[0040] Dual-path parallel processing:
[0041] The input feature map is input spatial mask branch, which is then processed by average pooling, concatenation, and 1×1 convolution to perform preliminary processing of global information. Then, the channel attention weights are generated by splitting and the weights are assigned using the sigmoid function.
[0042] For each feature group, local spatial features are extracted through 3×3 convolution (3×3 Conv) and then input into the cross attention module. Different feature groups undergo group normalization to ensure the stability of feature distribution.
[0043] The Cross Attention module generates attention weights through average pooling and softmax operations; the outputs of the two parallel attention branches are added together and the final attention weights are generated through the Sigmoid function.
[0044] The output of the spatial mask branch is fused with the cross-attention and grouped normalized features to finally output an enhanced feature map.
[0045] Adding an EMA module to the network architecture enhances the correlation of local features and improves the overall model performance.
[0046] Furthermore, the output of all frequency domain attention modules is input to a multi-scale feature pyramid network, and the method for extracting the fused feature set is as follows:
[0047] Feature maps of different scales, F2, F3, and F4, are extracted from multiple convolutional layers of ResNet50, corresponding to sizes and number of channels of 28×28×512, 14×14×1024, and 7×7×2048, respectively. These feature maps form a feature pyramid.
[0048] Perform a 1×1 convolution on the feature map of each layer to unify the number of channels to a preset value out_channels, and use group normalization for calibration;
[0049] Starting from the high-level feature map, the fusion is performed step by step downwards. The size of the high-level feature map is aligned with the feature map of the next layer through bilinear interpolation upsampling operation, and then the feature map of the next layer is added element by element.
[0050] After obtaining the initial pyramid features, the representation capability is improved through dynamic adaptive pooling and nonlinear fusion:
[0051] In the bottom-up fusion process, AdaptiveAvgPool2d is used to match the fusion feature size of the previous layer with the feature size of the current layer.
[0052] After alignment, 3×3 convolution is used in conjunction with GELU activation function and DropBlock regularization to perform feature mixing, outputting a fusion feature set covering different receptive fields.
[0053] The multi-scale feature pyramid network is the core of this invention in solving the problem of insufficient multi-scale feature fusion. Its design concept is to construct a structure that enables bidirectional and dynamic feature interaction, so as to ensure that information from different scales can be fully integrated, thereby comprehensively characterizing the pathological features of leukemia cells.
[0054] Furthermore, the features extracted by the backbone network and the features extracted by the multi-scale feature pyramid network are fused together and input into a fully connected classification head to output the classification result, which is:
[0055] ,
[0056] ,
[0057] Among them, F cat The fused feature tensor is the unified feature representation input to the final classifier; Concat(): Channel-dimensional concatenation operation, connecting multiple feature maps along the channel dimension; AdaptivePool(P2), AdaptivePool(P3): Adaptive pooling operations, where P2 and P3 are two different levels of enhanced feature maps in the feature pyramid that fuse multi-scale information. Represents the augmented feature map containing the most abstract and high-level semantic information; ŷ: the predicted probability distribution, representing the probability that the input image belongs to each category; Softmax(): the Softmax activation function, which transforms the output of the linear layer into a probability distribution; W c : The weight matrix of the fully connected classification head; Flatten(F cat Flattening operation;
[0058] The fused features (P2, P3, P4) from the multi-scale feature pyramid network are uniformly sampled to a 7×7 size and then channel-stitched to form a fused feature map with a size of 7×7 and 256×3=768 channels. ;
[0059] Fusion Feature Map Through a fully connected classification head To enable the prediction of pathological types.
[0060] By fusing features from the improved backbone network (enhanced by the EMA module) and the multi-scale pyramid network, classification performance is significantly improved.
[0061] The present invention also provides an acute leukemia classification system based on frequency domain attention and multi-scale fusion, including a data acquisition module and a processing module, wherein the data acquisition module is used to acquire microscopic images of acute leukemia in patients;
[0062] The input terminal of the processing module is connected to the output terminal of the data acquisition module. The processing module executes the method described in this invention to obtain the classification results of acute leukemia.
[0063] This system, based on data acquisition and processing modules, solves the problems of weak ability of traditional networks to extract minute features and insufficient fusion of multi-scale features in existing acute leukemia microscopic image classification methods.
[0064] Furthermore, the processing module uses the deep residual network ResNet50 as the backbone network and introduces frequency domain attention modules (DCT) in multiple deep processing stages. In particular, a multi-scale attention module (EMA) is introduced between the last deep processing stage and its corresponding frequency domain attention module. The multi-scale attention module (EMA) is used to enhance feature attention, and the frequency domain attention module (DCT) is used to introduce frequency domain information.
[0065] The processing module also includes a multi-scale feature pyramid network and a classifier;
[0066] The outputs of all frequency domain attention modules are connected to a multi-scale feature pyramid network, which is used to extract fused feature sets.
[0067] The features extracted by the backbone network are fused with the features extracted by the multi-scale feature pyramid network and then input into the classifier to output the classification result.
[0068] The processing module retains ResNet's powerful feature extraction capabilities and innovatively embeds a frequency domain attention module and a multi-scale feature pyramid network. This modular design enables the model to enhance features simultaneously from both the frequency domain and multi-scale dimensions, thereby effectively improving classification performance.
[0069] Furthermore, the frequency domain attention module includes a dynamic block DCT transform module and a dual-path attention coordination module;
[0070] The dynamic block DCT transform module is used to transform spatial features to the frequency domain and enhance them. The dynamic block DCT transform module includes a dynamic filling calibration module, a block frequency domain analysis module, and a feature map reconstruction module connected in sequence. The dynamic filling calibration module receives the input feature map from the corresponding stage of the ResNet50 backbone network, calculates and performs zero padding on the right and bottom of the feature map according to the preset block size K, and ensures that its height and width are divisible by K, in order to prepare for subsequent block operations. The output filled feature map with the appropriate size is directly sent to the block frequency domain analysis module.
[0071] The input of the block frequency domain analysis module is connected to the output of the dynamic filling calibration module. It receives the filled feature map, divides and expands the input feature map into a K×K grid to form a block tensor, performs a fast Fourier transform on each independent block and extracts the real part, which is equivalent to completing the discrete cosine transform, transforming the feature information from the spatial domain to the frequency domain, outputting the block feature tensor after frequency domain transformation, and passing it to the feature map reconstruction module.
[0072] The feature map reconstruction module receives the frequency domain block tensor from the block frequency domain analysis module, performs a reversible folding operation that is the opposite of "unfolding", restores the processed frequency domain feature blocks back to the spatial domain, generates an enhanced feature map, and trims the added padding area to restore it to the original input size, outputting a spatial feature map enhanced by the frequency domain.
[0073] The dual-path attention coordination module is used to perform adaptive calibration from both channel and spatial dimensions based on frequency domain enhancement. The dual-path attention coordination module includes two parallel processing paths and a fusion output section.
[0074] First path: Channel attention branch, learns and highlights feature channels that are more important to the current classification task, and suppresses unimportant channels, including:
[0075] Global average pooling: Global average pooling is performed on each channel of the feature map, compressing the H×W spatial information of each channel into a scalar, resulting in a channel description vector. Bottleneck structure: Consists of two fully connected layers: The first fully connected layer: compresses the number of channels from CC to C / r, where r is the reduction ratio, introducing non-linearity; The second fully connected layer: restores the number of channels from C / r back to CC.
[0076] The Sigmoid function normalizes the output to the [0, 1] interval and generates channel attention weights Wc. The closer the weight value is to 1, the more important the channel is.
[0077] The second approach: Spatial attention branch, which learns and highlights spatial regions in the feature map that are key to classification, including:
[0078] 1×1 convolution: used to compress channel dimensions, reduce computation, and integrate cross-channel information;
[0079] Group normalization: Unaffected by batch size, it stabilizes the training process and eliminates the dependence on batch statistics;
[0080] ReLU activation: introduces nonlinearity;
[0081] 1×1 convolution: Adjust the number of channels back to be the same as the input;
[0082] The Sigmoid function generates spatial attention weights. Each point on the weight map has a value between 0 and 1, indicating the importance of that spatial location.
[0083] The frequency domain attention module utilizes the frequency domain characteristics of images to separate and enhance details that are crucial for classification, while suppressing noise and background interference.
[0084] Furthermore, the multi-scale attention module (EMA) includes a channel grouping reshaping module and a dual-path parallel processing module;
[0085] The channel grouping and reshaping module includes a channel grouping unit and a dimension reshaping unit, which are used to divide the channel dimension of the input feature map into multiple factor groups and reshape the grouped dimensions into the batch dimension to form a new feature map after grouping.
[0086] The dual-path parallel processing module includes a spatial mask branch and a cross-attention branch connected in parallel. The spatial mask branch includes the following sequentially connected branches:
[0087] Average pooling layer is used to compress spatial dimensions;
[0088] Feature splicing layer, used to fuse multi-scale information;
[0089] A 1×1 convolutional layer is used for feature transformation;
[0090] A segmentation operation layer is used to generate channel attention weights;
[0091] The cross-attention branches include sequentially connected:
[0092] 3×3 convolutional layers are used to extract multi-scale spatial features;
[0093] Grouping normalization layers are used to stabilize feature distributions;
[0094] The cross-attention computation unit achieves interactive learning between feature groups through matrix multiplication and Softmax operations;
[0095] The outputs of the spatial mask branch and the cross attention branch are fused by element-wise addition, and then the final attention weights are generated by the Sigmoid activation function.
[0096] The final attention weights are modulated and fused with the grouped and normalized features in the cross-attention branch, and then added to the original input of the module through residual connections to output an enhanced feature map.
[0097] The channel grouping reshaping module receives input feature maps from the ResNet50 backbone network, and the output of the channel grouping reshaping module is sent to the spatial mask branch and the cross attention branch.
[0098] The spatial mask branch generates spatial mask weights through average pooling, concatenation, 1×1 convolution and segmentation operations, while the cross attention branch realizes feature interaction through 3×3 convolution, group normalization and cross attention calculation.
[0099] The outputs of the two branches are summed and activated by a Sigmoid function to generate the final attention map. The attention map is then modulated with the feature map and output as the final result through residual connections. This multi-scale attention module (EMA) avoids information loss in traditional attention mechanisms through an innovative channel grouping and reshaping strategy. It utilizes a dual-path parallel architecture to achieve effective fusion of multi-scale features, significantly improving the model's ability to perceive and distinguish complex features in microscopic images of acute leukemia cells.
[0100] By reshaping through channel grouping and using dual-path parallel subnetworks, multi-scale feature fusion and cross-spatial attention learning are achieved, enhancing the correlation of local features and improving the overall model performance.
[0101] Furthermore, an "improved bottom-up feature enhancement" path was introduced; and "dynamic adaptive pooling" was used for size alignment.
[0102] The multi-scale feature pyramid network includes a feature extraction module, a side convolution calibration module, a top-down fusion path, a bottom-up enhancement path, and a feature output module.
[0103] The input of the feature extraction module is connected to the output of all frequency domain attention modules, and is used to extract feature maps F2, F3, and F4 of different scales from multiple stages of the ResNet50 backbone network.
[0104] The side convolution calibration module includes multiple parallel 1×1 convolutional layers and grouped normalization layers, which are respectively connected to the output ends of the feature extraction module, and are used to uniformly calibrate the number of channels of the feature maps at each stage to the preset number of output channels Cp.
[0105] The top-down fusion path includes a multi-level bilinear interpolation upsampler and a feature fusionist connected in sequence. This path processes features from high-level features to low-level features, aligns the size of the high-level feature map with the adjacent low-level feature map through upsampling operations, and achieves the downflow of semantic information through element-wise addition.
[0106] The bottom-up enhancement path includes a dynamic adaptive pooling module and a non-linear fusion module. This path receives the intermediate results of the top-down fusion path, achieves feature map size matching and alignment through adaptive average pooling, and then performs cross-scale feature enhancement through 3×3 convolution combined with GELU activation function and DropBlock regularization.
[0107] The input of the feature output module is connected to the output of the bottom-up enhancement path, and outputs the final multi-scale fusion feature set [P2,P3,P4].
[0108] The connection relationships between the modules are as follows:
[0109] The input of the feature extraction module is connected to the output of all frequency domain attention modules, and the output of the feature extraction module is connected to the input of the side convolution calibration module. The output of the side convolution calibration module is connected to the input of the top-down fusion path, and the output of the top-down fusion path is connected to the input of the bottom-up enhancement path.
[0110] The bottom-up enhancement path connects to the input of the feature output module. The multi-scale feature pyramid network constructs a fusion feature pyramid covering different receptive fields through a cascaded architecture of bidirectional feature fusion, realizing cross-scale feature interaction and enhancement, and providing multi-level feature representation for the accurate classification of acute leukemia cells.
[0111] We need to construct a structure that enables bidirectional and dynamic feature interaction to ensure that information from different scales can be fully integrated, thereby comprehensively characterizing the pathological features of leukemia cells. Attached Figure Description
[0112] Figure 1 This is a flowchart illustrating the acute leukemia classification method based on frequency domain attention and multi-scale fusion of the present invention.
[0113] Figure 2 This is a flowchart illustrating the frequency domain attention module of the acute leukemia classification method based on frequency domain attention and multi-scale fusion of the present invention.
[0114] Figure 3 This is a flowchart illustrating the multi-scale feature pyramid network of the acute leukemia classification method based on frequency domain attention and multi-scale fusion of the present invention.
[0115] Figure 4 This is a flowchart illustrating the multi-scale attention module of the acute leukemia classification method based on frequency domain attention and multi-scale fusion of the present invention. Detailed Implementation
[0116] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0117] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0118] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0119] This invention discloses a classification method for acute leukemia based on frequency domain attention and multi-scale fusion. It aims to address the shortcomings of existing acute leukemia microscopic image classification methods, such as the weak ability of traditional networks to extract minute features and insufficient multi-scale feature fusion. Using a deep residual network (ResNet50) as the backbone, and through improvements made via the following core modules, it achieves high-precision and robust classification of leukemia microscopic images. Figure 1 As shown, the acute leukemia classification method based on frequency domain attention and multi-scale fusion includes the following steps:
[0120] Acquire microscopic images of the patient's acute leukemia;
[0121] The patient's acute leukemia microscopic images were input into the ResNet50 backbone network of the deep residual network. Frequency domain attention modules (DCT Frequency Attention) were introduced into its multiple deep processing stages. In particular, an efficient multi-scale attention module (EMA) was introduced between the last deep processing stage and its corresponding frequency domain attention module. Through channel grouping and reconstruction and dual-path parallel subnetwork, the correlation of local features was enhanced.
[0122] The output of all frequency domain attention modules is input to a multi-scale feature pyramid network to extract the fused feature set.
[0123] The features extracted by the backbone network are fused with the features extracted by the multi-scale feature pyramid network, and then input into a fully connected classification head to output the classification result.
[0124] Appendix Figure 1In this context, STAGE 0, STAGE 1, STAGE 2, STAGE 3, STAGE 4 → Stage 0, Stage 1, Stage 2, Stage 3, Stage 4; MultiScale Pyramid → Multi-scale (feature) pyramid; EMA → Efficient multi-scale attention module or EMA module; DCT → Frequency domain attention module or DCT module; Adaptive AvgPool → Adaptive average pooling; Flatten → Flattening; Linear → Linear layer or fully connected layer; Dropout → Random dropout; Classifier → Classifier.
[0125] Appendix Figure 2 In the middle section, 1. Basic operations and transformations; Unfold → unfold or expand in blocks; Fold → fold or recombine features; Pad → fill; FFT → Fast Fourier Transform;
[0126] 2. Network Layers and Operations: 1×1 Conv → 1×1 convolution; Avg Pool → average pooling; GroupNorm → group normalization; ReLU → rectified linear unit or ReLU activation function;
[0127] 3. Dimensions and Representation: blocks x block size² → number of blocks × block size²; B x C x H x W → batch × channel × height × width (it is recommended to retain the letter abbreviation: B×C×H×W); B x C x 1 x 1 → B×C×1×1; B x 1 x H x W → B×1×H×W; B x (C / / reduction) x H x W → B×(C / / reduction rate)×H×W;
[0128] 4. Activation functions: Sigmoid → S-shaped function or Sigmoid function; ReLU → Linear rectified unit or ReLU function;
[0129] 5. Other terms: Output → Output.
[0130] Appendix Figure 3 Translation of core structure and data flow
[0131] OUTPUT → Output; STAGE 0, STAGE 1, STAGE 2, STAGE 3, STAGE 4 → Stage 0, Stage 1, Stage 2, Stage 3, Stage 4; Lateral Convs → Lateral Convolution;
[0132] Note: This is a standard term in FPN, used for lateral connections to adjust the number of channels in backbone network features.
[0133] Interpolate → upsampling or interpolation; AvgPool → average pooling; + → feature addition (can be marked with ⊕ or addition in the flowchart);
[0134] Feature map dimension translation:
[0135] 7x7x2048 → 7×7×2048 (Keep the number, use × for multiplication in Chinese context); 14x14x1024 → 14×14×1024; 28x28x512 → 28×28×512; 7x7xCp → 7×7×Cp (or 7×7×number of channels, keep Cp as the symbol for the preset number of channels);
[0136] Fusion module translation:
[0137] Fusion Conv → Fusion Convolution
[0138] This module typically includes the following operations:
[0139] 3*3 Conv, Padding=1 → 3×3 convolution, padding=1; DropBlock → DropBlock regularization (proper terms can be kept in English); GELU → GELU activation function (proper terms can be kept in English).
[0140] Side convolution module translation: 1*1 Conv → 1×1 convolution;
[0141] GroupNorm → Group Normalization; Cp x H x W → Cp×H×W (or number of channels × height × width).
[0142] Appendix Figure 4 In the middle, core parameters and grouping
[0143] Batchsize = channel / / factor: Batch size = number of channels / / grouping factor; Explanation: This formula precisely describes the channel grouping reshaping operation, that is, by dividing the number of channels by the grouping factor, the group dimension is reshaped into the batch dimension.
[0144] Group 1, Group 2, ... Group factor: Group 1, Group 2, ..., Group n (or Group 1, Group 2, ..., Group n), Explanation: Intuitively represents the multiple feature groups into which the input feature map is divided.
[0145] Modules and branches:
[0146] Spatial Mask: Spatial mask or spatial mask branch; Description: This is one of the two branches of the EMA module, responsible for generating spatial attention weights.
[0147] Cross Attention: Another branch of the EMA module, responsible for implementing attention interactions between different feature groups.
[0148] Operations and Layers:
[0149] Avg Pool: Average pooling; concate: Concatenation;
[0150] 1*1 Conv: 1×1 convolution; split: segmentation;
[0151] 3*3 Conv: 3×3 convolution; Group Norm (the "Group Norm" in the figure is incomplete): group normalization; Matmul: matrix multiplication; Softmax: softmax function or flexible maximum function (it is recommended to keep Softmax in the figure).
[0152] In a preferred embodiment of the present invention, the frequency domain attention module is key to solving the problem of difficult extraction of minute features, especially in leukemia cell smear images where cell-background interference is significant, and subtle cell morphological features are easily obscured by noise and background information. The design concept utilizes the frequency domain characteristics of images to transform image information from the spatial domain to the frequency domain, thereby more effectively separating and enhancing crucial classification details (high-frequency features) while suppressing complex background and noise interference (low-frequency features).
[0153] like Figure 2 As shown, the frequency domain attention module consists of two stages: dynamic block DCT transform and dual-path attention collaboration. This module innovatively adopts an adaptive block strategy to achieve decoupling and enhancement of frequency domain features.
[0154] Dynamic block DCT transform stage:
[0155] Dynamic padding calibration: Before performing frequency domain analysis, to prevent image edge information from being truncated, the size (h, w) of the input feature map output by the ResNet50 backbone network is dynamically padded to ensure it is divisible by a preset block size K (which can be set to 7 by default). The padding amount is calculated as follows:
[0156] ,
[0157] Where h: height of the input feature map; w: width of the input feature map; K: preset block size; a hyperparameter, for example, the default value is 7. This means that the feature map is to be divided into several K × K (e.g., 7 × 7) small squares for processing. pad The number of rows needed to fill the bottom in order for the height h to be divisible by K; w pad : The number of columns to fill on the right side so that the width w is divisible by K; modK: Modulo operation, which means calculating the remainder when a number is divided by K;
[0158] This step avoids edge information truncation caused by size mismatch by performing zero padding on the right and bottom of the feature map. This adaptive padding strategy ensures that all pixels (especially key details at the edges) can be fully incorporated into independent K×K blocks for processing, even with inputs of different sizes, thus preventing information loss.
[0159] Block-based frequency domain analysis: The feature map is unfolded into a K×K grid to form a three-dimensional tensor. , where N is the total number of blocks;
[0160] Perform a Fast Fourier Transform (FFT) on each individual block and extract its real part:
[0161] ,
[0162] Where F: Fast Fourier Transform, a mathematical operation that transforms a signal from the spatial domain to the frequency domain; X blocks : Input block feature map tensor; Re{}: Real part extraction operation, the FFT output is a complex number, only the real part is retained; D dct The output DCT coefficients are transformed into their frequency domain representation. This operation is equivalent to Discrete Cosine Transform (DCT), which converts image information from the spatial domain to the frequency domain. Low-frequency components represent smooth regions and contours of the image, while high-frequency components represent details, textures, and edge information. This transformation allows the model to more easily target high-frequency details, as these details are often mixed with noise in the spatial domain.
[0163] The core advantage of DCT lies in its superior energy concentration capability, which converts the spatial information of an image into frequency domain coefficients, effectively separating the low-frequency components that carry the overall contour of the image from the high-frequency components that represent key details such as fine textures and edges. This allows the model to more specifically process these high-frequency features that are crucial for leukemia subtype classification, while naturally suppressing low-frequency interference such as background noise.
[0164] Feature map reconstruction: After the frequency domain transformation, a reversible folding operation is used to restore these frequency-domain processed and enhanced feature blocks back to the spatial domain, generating dimension-preserving enhanced feature maps. ;
[0165] The padding regions added initially are cropped, restoring the feature map to its original size. This step ensures that the complete spatial structure of the original feature map is preserved while enhancing the frequency domain features, providing high-quality input for the subsequent attention module.
[0166] In a preferred embodiment of the present invention, the dual-path attention coordination stage includes:
[0167] After DCT transformation, the obtained frequency domain features are nonlinearly calibrated through a parallel dual-path attention mechanism. First, the channel attention branch generates channel attention weights by performing global average pooling on the frequency domain feature map and utilizing a bottleneck structure consisting of two fully connected layers. This process enables the model to learn and highlight feature channels that are more important for classification tasks.
[0168] The spatial attention branch generates spatial attention weights by compressing channels and eliminating batch size dependency through 1×1 convolution and grouping normalization. This allows the model to focus on key spatial locations in the feature map.
[0169] Preferably, channel weights and spatial weights Perform fusion (e.g., element-wise addition) to obtain the final fusion weight. :
[0170] ,
[0171] The fusion weights are then multiplied channel-by-channel spatially by the input feature map entering the "dual-path attention collaboration stage" (i.e., the frequency domain enhanced feature map output after the "dynamic block DCT transform" but before attention weighting), and combined with residual connections to obtain the final enhanced output feature map. This mechanism preserves global information while significantly enhancing the ability to express local details.
[0172] In a preferred embodiment of the present invention, an EMA module is added to the network architecture to further enhance the correlation of local features and improve the overall model performance. The core design of the EMA module is to achieve multi-scale feature fusion and cross-spatial attention learning through channel grouping reshaping and dual-path parallel subnetworks.
[0173] like Figure 4As shown, the data processing procedure of the Efficient Multi-Scale Attention Module (EMA) includes:
[0174] Channel grouping and reshaping (channel grouping and reshaping is an innovative tensor transformation technique that reorganizes the dimensions of feature maps to achieve specific learning objectives) process:
[0175] EMA innovatively groups and reshapes the channel dimension of the input feature map into a batch dimension. This avoids the information loss caused by channel dimensionality reduction in traditional attention mechanisms, while allowing each subgroup to learn features independently. This results in a more even distribution of spatial semantic features within the group, improving the correlation of local features. This leads to subsequent local feature extraction and cross-attention steps, ensuring a more even distribution of spatial semantic features within the group. Specifically:
[0176] 1. Input feature map, assuming the dimensions of the input feature map are: [B, C, H, W], where B = batch size (e.g., 4), C = number of channels (e.g., 256), H = height (e.g., 14), and W = width (e.g., 14).
[0177] 2. Grouping operations:
[0178] First, divide the channel dimension C into G groups: set the number of groups G (e.g., 8), the number of channels in each group = C / G = 256 / 8 = 32, the new dimension: [B, G, C / G, H, W] = [4, 8, 32, 14, 14];
[0179] 3. Reshape into batch dimension:
[0180] This is the most crucial step: merging the grouping dimension G into the batch dimension B. The new batch size = B × G = 4 × 8 = 32, the new number of channels = C / G = 32, and the reshaped dimension: [B×G, C / G, H, W] = [32,32, 14, 14].
[0181] Specific examples
[0182] Suppose we have a specific feature map:
[0183] Input: [4, 256, 14, 14] # 4 images, 256 channels, 14×14 resolution, number of groups G = 8;
[0184] Processing procedure:
[0185] Original: [4, 256, 14, 14];
[0186] After grouping: [4, 8, 32, 14, 14] ← Divide the 256 channels into 8 groups of 32 channels each;
[0187] After reshaping: [32, 32, 14, 14] ← Use 4×8=32 as the new batch size;
[0188] Purpose and effect:
[0189] 1. Independent Feature Learning
[0190] After reshaping, the original 256 channels of one sample became 32 channels of 32 samples;
[0191] Each "new sample" contains only a subset of the original features, forcing the model to learn specific patterns within a narrower range of channels;
[0192] 2. Uniform spatial semantic distribution:
[0193] Since each group has only 32 channels (instead of 256), the model cannot rely on a few "strong feature channels," forcing each channel to contribute meaningful spatial information, preventing some channels from "slacking off," and allowing semantic features to be distributed more evenly within the group.
[0194] 3. Basis for subsequent processing
[0195] This reshaping provides an ideal structure for subsequent steps:
[0196] Local feature extraction: Each 32-channel "sub-feature map" can be independently convolved with 3×3;
[0197] Cross-attention: Attention weights can be calculated among the 32 "sub-samples" to achieve cross-group feature interaction;
[0198] Its overall role in the EMA module:
[0199] Input → Channel grouping and reshaping → Dual-path parallel processing (spatial mask branch + cross-attention branch) → Output;
[0200] Advantages:
[0201] This design avoids the information loss caused by channel dimensionality reduction in traditional attention mechanisms, enhances the relevance and diversity of local features, and provides structured input for subsequent cross-attention mechanisms. This design enables the EMA module to simultaneously focus on global context and local details, making it particularly effective in acute leukemia cell classification, as pathological features are often distributed across different spatial locations and feature channels.
[0202] Dual-path parallel processing:
[0203] The core is its dual-path parallel sub-network architecture, which contains two processing paths running simultaneously.
[0204] The input feature map is input spatial mask branch, which is then processed by average pooling, concatenation, and 1×1 convolution to perform preliminary processing of global information. Then, the channel attention weights are generated by splitting and the weights are assigned using the sigmoid function.
[0205] For each feature group, local spatial features are extracted through 3×3 convolution (3×3 Conv) and then input into the Cross Attention module. Different feature groups undergo group normalization to ensure the stability of feature distribution. This branch uses its local convolution kernel to capture multi-scale spatial features.
[0206] These two branches complement each other, working together to ensure that the model can simultaneously focus on global contextual information and local detailed features.
[0207] The Cross Attention module generates attention weights through average pooling and softmax operations; the outputs of two parallel attention branches are added together and the final attention weights are generated through the sigmoid function; feature interaction is achieved through matrix multiplication, and the correlation of local features is further enhanced by combining global feature compression and softmax weight allocation.
[0208] The output of the spatial mask branch is fused with the features obtained from cross-attention and grouping normalization to finally output the enhanced features. A spatial attention map is generated through a pooling operation that separates height and width to dynamically adjust the importance of different spatial locations.
[0209] In a preferred embodiment of the present invention, such as Figure 3 As shown, the multi-scale feature pyramid network is the core of this invention in solving the problem of insufficient multi-scale feature fusion. Its design philosophy is to construct a structure capable of bidirectional, dynamic feature interaction, ensuring that information from different scales can be fully fused, thereby comprehensively characterizing the pathological features of leukemia cells. The outputs of all frequency domain attention modules are input to the multi-scale feature pyramid network, and the method for extracting the fused feature set is as follows:
[0210] Feature maps of different scales, F2, F3, and F4, are extracted from multiple convolutional layers of ResNet50, corresponding to sizes and number of channels of 28×28×512, 14×14×1024, and 7×7×2048, respectively. These feature maps form a feature pyramid, which contains rich spatial details and highly abstract semantic information from low to high levels.
[0211] Side convolution calibration: Perform 1×1 convolution on the feature map of each layer to unify the number of channels to a preset value out_channels, and use group normalization (Group Normal) for calibration to avoid the bias caused by mini-batch training;
[0212] Hierarchical fusion: This path starts from the high-level feature map and fuses it down level by level. The size of the high-level feature map is aligned with the feature map of the next layer through bilinear interpolation upsampling operation, and then element-wise addition is performed with the feature map of the next layer. This allows the rich semantic information of the high-level layer to penetrate into the lower layer, enhancing its discriminative ability.
[0213] After obtaining the initial pyramid features, the representation capability is improved through dynamic adaptive pooling and nonlinear fusion:
[0214] Dynamic size alignment: In the bottom-up fusion process, adaptive average pooling (AdaptiveAvgPool2d) is used to match the fusion feature size of the previous layer with the feature size of the current layer; this dynamic adjustment strategy ensures the accurate alignment of features at different scales and avoids information misalignment.
[0215] Nonlinear feature fusion: After alignment, 3×3 convolution combined with the GELU activation function and DropBlock regularization is used for feature mixing, outputting a fused feature set covering different receptive fields. This nonlinear fusion method is more effective than simple addition in mixing and improving the expressive power of features. DropBlock regularization forces the model to learn more robust feature representations by randomly discarding continuous feature regions, which is particularly suitable for preventing overfitting to local noise in pathological images.
[0216] Cross-scale information propagation: Through this bottom-up cascading fusion, spatial detail information at lower levels can be transmitted upwards to supplement the fine information lost by features at higher levels, ultimately outputting a set of fused features covering different receptive fields.
[0217] In a preferred embodiment of the present invention, features extracted by the backbone network (enhanced by the EMA module) are fused with features extracted by the multi-scale feature pyramid network, and input into a fully connected classification head to output the classification result, which is:
[0218] ,
[0219] ,
[0220] Among them, F cat The fused feature tensor is the unified feature representation input to the final classifier; Concat(): Channel-dimensional concatenation operation, connecting multiple feature maps along the channel dimension; AdaptivePool(P2), AdaptivePool(P3): Adaptive pooling operations. Represents the augmented feature map containing the most abstract and high-level semantic information; ŷ: the predicted probability distribution, representing the probability that the input image belongs to each category; Softmax(): the Softmax activation function, which transforms the output of the linear layer into a probability distribution; W c : The weight matrix of the fully connected classification head; Flatten(F cat Flattening operation;
[0221] P2 and P3 are two enhanced feature maps at different levels in the feature pyramid, incorporating multi-scale information. P2 (from a lower level, such as Stage 2) has a larger spatial size (e.g., 28x28) and is rich in spatial details and minute features. Its role in classification is to provide fine information about cell morphology, such as cell edges, clear outlines of the nucleolus, and subtle chromatin texture. These are key details for distinguishing subclasses. Because its size does not match P4, it needs to be downsampled to 7x7 using an AdaptivePool (P2) for channel concatenation with P4.
[0222] P3 (from an intermediate layer, such as Stage 3), spatial size: medium (e.g., 14x14), strikes a balance between detail and semantics. Its role in classification: it preserves some spatial information while incorporating higher-level semantic concepts than P2, potentially capturing a wider range of cellular structure patterns. It is downsampled to 7x7 via AdaptivePool (P3) to unify the size.
[0223] P4 (from the highest level, such as Stage 4), spatial size: small (e.g., 7x7), contains the most abstract and high-level semantic information. Its role in classification: provides a macroscopic judgment of "what this is," such as highly confirming the presence of abnormal cells in an image. It loses detail but has the strongest semantic meaning. No pooling is needed: because it is itself 7x7 in size. The fused features (P2, P3, P4) from the multi-scale feature pyramid network are uniformly sampled to a 7×7 size and then concatenated by channels to form a fused feature map with a size of 7×7 and 256×3=768 channels. ;
[0224] Fusion Feature Map Through a fully connected classification head To enable the prediction of pathological types.
[0225] In actual testing, the model proposed in this invention (DCT-MSA-ResNet) achieved an accuracy of 96.51% and a recall of 92.66% on the acute leukemia microscopic image classification task, which is significantly better than the traditional ResNet50 and other benchmark networks.
[0226] Enhanced ability to capture minute features: The application of the frequency domain attention module enables the model to effectively extract and utilize minute features that are difficult for traditional networks to capture and are crucial for classification, greatly improving the model's robustness to noise and color variations.
[0227] Efficient multi-scale information fusion: The bidirectional fusion multi-scale feature pyramid network can dynamically and efficiently integrate feature information from different scales, comprehensively characterize pathological features, and significantly improve the model's generalization ability and diagnostic accuracy.
[0228] Enhancing the correlation of local features: The introduction of the EMA module further enhances the correlation of local features through channel reshaping and cross-spatial learning, enabling the model to have a stronger ability to recognize subtle structures in pathological images.
[0229] This invention also provides an acute leukemia classification system based on frequency domain attention and multi-scale fusion, including a data acquisition module and a processing module. The data acquisition module is used to acquire microscopic images of acute leukemia in patients. The input end of the processing module is connected to the output end of the data acquisition module, and the processing module executes the method described in this invention to obtain the acute leukemia classification results.
[0230] In a preferred embodiment of the present invention, the processing module uses a deep residual network ResNet50 as the backbone network and introduces a frequency domain attention module (DCT) in each of its multiple deep processing stages. In particular, a multi-scale attention module (EMA) is introduced between the last deep processing stage and its corresponding frequency domain attention module. The multi-scale attention module (EMA) is used to enhance feature attention, and the frequency domain attention module (DCT) is used to introduce frequency domain information.
[0231] The processing module also includes a multi-scale feature pyramid network and a classifier. The outputs of all frequency domain attention modules are connected to the multi-scale feature pyramid network, which is used to extract the fused feature set. The features extracted by the backbone network are fused with the features extracted by the multi-scale feature pyramid network and then input into the classifier to output the classification result.
[0232] The processing module retains ResNet's powerful feature extraction capabilities and innovatively embeds a frequency domain attention module and a multi-scale feature pyramid network. This modular design enables the model to enhance features simultaneously from both the frequency domain and multi-scale dimensions, thereby effectively improving classification performance.
[0233] In a preferred embodiment of the present invention, the frequency domain attention module includes a dynamic block DCT transform module and a dual-path attention coordination module;
[0234] The dynamic block DCT transform module is used to transform spatial features to the frequency domain and enhance them. The dynamic block DCT transform module includes a dynamic filling calibration module, a block frequency domain analysis module, and a feature map reconstruction module connected in sequence. The dynamic filling calibration module receives the input feature map from the corresponding stage of the ResNet50 backbone network, calculates and performs zero padding on the right and bottom of the feature map according to the preset block size K, and ensures that its height and width are divisible by K, in preparation for subsequent block operations. The output filled feature map with the appropriate size is directly sent to the block frequency domain analysis module.
[0235] The input of the block frequency domain analysis module is connected to the output of the dynamic filling calibration module. It receives the filled feature map, divides and expands the input feature map into a K×K grid to form a block tensor, performs a fast Fourier transform on each independent block and extracts the real part, which is equivalent to completing the discrete cosine transform, transforming the feature information from the spatial domain to the frequency domain, outputting the block feature tensor after frequency domain transformation, and passing it to the feature map reconstruction module.
[0236] The feature map reconstruction module receives the frequency domain block tensor from the block frequency domain analysis module, performs a reversible folding operation that is the opposite of "unfolding", restores the processed frequency domain feature blocks back to the spatial domain, generates an enhanced feature map, and trims the added padding area to restore it to the original input size, outputting a spatial feature map enhanced by the frequency domain.
[0237] The dual-path attention co-processing module is used to perform adaptive calibration from both channel and spatial dimensions based on frequency domain enhancement. This module contains two parallel processing paths (dual-path) and a fusion output section.
[0238] Input: Frequency domain enhanced feature map after dynamic block DCT transformation and cropping
[0239] Output: The final enhanced feature map after channel and spatial attention calibration.
[0240] First path: Channel attention branch, learns and highlights feature channels that are more important to the current classification task, and suppresses unimportant channels, including:
[0241] Global average pooling: Global average pooling is performed on each channel of the feature map, compressing the H×W spatial information of each channel into a scalar, resulting in a channel description vector. Bottleneck structure: Consists of two fully connected layers.
[0242] The first fully connected layer: compresses the number of channels from CC to C / r (rr is the reduction ratio), introducing non-linearity.
[0243] The second fully connected layer restores the number of channels from C / rC / r to CC.
[0244] The Sigmoid function normalizes the output to the [0, 1] interval and generates channel attention weights Wc. The closer the weight value is to 1, the more important the channel is.
[0245] The second approach: Spatial attention branch, which learns and highlights spatial regions in the feature map that are key to classification (e.g., the location of the cell nucleus), including:
[0246] 1×1 convolution: used to compress channel dimensions, reduce computation, and integrate cross-channel information.
[0247] Grouping normalization: Unaffected by batch size, it stabilizes the training process and eliminates the dependence on batch statistics.
[0248] ReLU activation: introduces nonlinearity.
[0249] 1×1 convolution: Adjust the number of channels back to be the same as the input.
[0250] The Sigmoid function generates spatial attention weights. Each point on the weight map has a value between 0 and 1, indicating the importance of that spatial location.
[0251] This module completes the final processing through weight fusion and feature calibration. First, the channel weights Wc output from the channel attention branch and the spatial weights Ws output from the spatial attention branch are added element-wise to obtain the fusion weight Wfusion = Wc⊕Ws, which comprehensively represents the importance of channels and space. Then, feature calibration is performed by multiplying the fusion weight Wfusion with the original feature map enhanced by DCT transformation through a channel-spatial broadcast multiplication, so that each pixel position in each channel of the feature map is adaptively adjusted according to its corresponding channel and spatial importance. Based on this, a residual connection is introduced, adding the calibrated feature map to the original input. This preserves the integrity of the original frequency domain structure and effectively enhances the response intensity of key features, ultimately outputting a feature representation with stronger discriminative power.
[0252] In a preferred embodiment of the present invention, the multi-scale attention module (EMA) includes a channel grouping reshaping module and a dual-path parallel processing module;
[0253] The channel grouping and reshaping module includes a channel grouping unit and a dimension reshaping unit, which are used to divide the channel dimension of the input feature map into multiple factor groups and reshape the grouped dimensions into the batch dimension to form a new feature map after grouping.
[0254] The dual-path parallel processing module includes a spatial mask branch and a cross-attention branch connected in parallel. The spatial mask branch includes the following sequentially connected branches:
[0255] Average pooling layer is used to compress spatial dimensions;
[0256] Feature splicing layer, used to fuse multi-scale information;
[0257] A 1×1 convolutional layer is used for feature transformation;
[0258] A segmentation operation layer is used to generate channel attention weights;
[0259] The cross-attention branches include sequentially connected:
[0260] 3×3 convolutional layers are used to extract multi-scale spatial features;
[0261] Grouping normalization layers are used to stabilize feature distributions;
[0262] The cross-attention computation unit achieves interactive learning between feature groups through matrix multiplication and Softmax operations;
[0263] The outputs of the spatial mask branch and the cross attention branch are fused by element-wise addition, and then the final attention weights are generated by the Sigmoid activation function.
[0264] The final attention weights are modulated and fused with the grouped and normalized features in the cross-attention branch, and then added to the original input of the module through residual connections to output an enhanced feature map.
[0265] The channel grouping reshaping module receives input feature maps from the ResNet50 backbone network, and the output of the channel grouping reshaping module is sent to the spatial mask branch and the cross attention branch.
[0266] The spatial mask branch generates spatial mask weights through average pooling, concatenation, 1×1 convolution and segmentation operations, while the cross attention branch realizes feature interaction through 3×3 convolution, group normalization and cross attention calculation.
[0267] The outputs of the two branches are summed and activated by a Sigmoid function to generate the final attention map. The attention map is then modulated with the feature map and output as the final result through residual connections. This multi-scale attention module (EMA) avoids information loss in traditional attention mechanisms through an innovative channel grouping and reshaping strategy. It utilizes a dual-path parallel architecture to achieve effective fusion of multi-scale features, significantly improving the model's ability to perceive and distinguish complex features in microscopic images of acute leukemia cells.
[0268] In a preferred embodiment of the present invention, an "improved bottom-up feature enhancement" path is introduced, and "dynamic adaptive pooling" is used for size alignment.
[0269] The multi-scale feature pyramid network includes a feature extraction module, a side convolution calibration module, a top-down fusion path, a bottom-up enhancement path, and a feature output module;
[0270] The input of the feature extraction module is connected to the output of all frequency domain attention modules, and is used to extract feature maps F2, F3, and F4 of different scales from multiple stages of the ResNet50 backbone network.
[0271] The lateral convolution calibration module includes multiple parallel 1×1 convolutional layers and grouped normalization layers, which are connected to the outputs of the feature extraction module, respectively, to uniformly calibrate the number of channels of the feature maps at each stage to the preset number of output channels Cp.
[0272] The top-down fusion path includes a multi-level bilinear interpolation upsampler and a feature fusionist connected in sequence. This path processes features from high-level features to low-level features, aligns the size of the high-level feature map with the adjacent low-level feature map through upsampling operations, and achieves the downflow of semantic information through element-wise addition.
[0273] The bottom-up enhancement path includes a dynamic adaptive pooling module and a non-linear fusion module. This path receives the intermediate results from the top-down fusion path, achieves feature map size matching and alignment through adaptive average pooling, and then performs cross-scale feature enhancement through 3×3 convolution combined with GELU activation function and DropBlock regularization.
[0274] The input of the feature output module is connected to the output of the bottom-up enhancement path, and the final multi-scale fusion feature set [P2,P3,P4] is output.
[0275] The connection relationships between the modules are as follows:
[0276] The input of the feature extraction module is connected to the output of all frequency domain attention modules, and the output of the feature extraction module is connected to the input of the side convolution calibration module. The output of the side convolution calibration module is connected to the input of the top-down fusion path, and the output of the top-down fusion path is connected to the input of the bottom-up enhancement path.
[0277] The bottom-up enhancement path connects to the input of the feature output module. The multi-scale feature pyramid network constructs a fusion feature pyramid covering different receptive fields through a cascaded architecture of bidirectional feature fusion, realizing cross-scale feature interaction and enhancement, and providing multi-level feature representation for the accurate classification of acute leukemia cells.
[0278] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.
Claims
1. A classification method for acute leukemia based on frequency domain attention and multi-scale fusion, characterized in that, Includes the following steps: Acquire microscopic images of the patient's acute leukemia; The patient's acute leukemia microscopic images were input into the ResNet50 deep residual network backbone network. Frequency domain attention modules were introduced into its multiple deep processing stages. In particular, an efficient multi-scale attention module (EMA) was introduced between the last deep processing stage and its corresponding frequency domain attention module. Through channel grouping and reshaping and dual-path parallel subnets, the correlation of local features was enhanced. The output of all frequency domain attention modules is input to a multi-scale feature pyramid network to extract and fuse feature sets. The features extracted by the backbone network are fused with the features extracted by the multi-scale feature pyramid network, and then input into a fully connected classification head to output the classification result.
2. The acute leukemia classification method based on frequency domain attention and multi-scale fusion according to claim 1, characterized in that, The frequency domain attention module includes two stages: dynamic block DCT transform and dual-path attention collaboration. Dynamic block DCT transform stage: Dynamic padding calibration: The dimensions (h, w) of the input feature map output by the ResNet50 backbone network are dynamically padded to ensure they are divisible by a preset block size K. The padding amount is calculated as follows: , Where h: height of the input feature map; w: width of the input feature map; K: preset block size; h pad The number of rows needed to fill the bottom in order for the height h to be divisible by K; w pad : The number of columns to fill on the right side so that the width w is divisible by K; modK: Modulo operation, which means calculating the remainder when a number is divided by K; With inputs of different sizes, all pixels can be completely incorporated into independent K×K blocks for processing, preventing information loss; Block-based frequency domain analysis: The feature map is unfolded into a K×K grid to form a three-dimensional tensor. , where N is the total number of blocks; Perform a Fast Fourier Transform (FFT) on each individual block and extract its real part: , Where F: Fast Fourier Transform, a mathematical operation that transforms a signal from the spatial domain to the frequency domain; X blocks : Input block feature map tensor; Re{}: Real part extraction operation, the FFT output is a complex number, only the real part is retained; D dct The frequency domain representation of the output DCT coefficients after transformation; Feature map reconstruction: After the frequency domain transformation, a reversible folding operation is used to restore these frequency-domain processed and enhanced feature blocks back to the spatial domain, generating dimension-preserving enhanced feature maps. ; The padding area added initially is cropped, restoring the feature map to its original size.
3. The acute leukemia classification method based on frequency domain attention and multi-scale fusion according to claim 2, characterized in that, Dual-path attention coordination phase: The channel attention branch generates channel attention weights by performing global average pooling on the frequency domain feature map and utilizing a bottleneck structure consisting of two fully connected layers. ; The spatial attention branch generates spatial attention weights by compressing channels and eliminating batch size dependency through 1×1 convolution and grouping normalization. Focusing on key spatial locations in the feature map; Channel weights and spatial weights The fusion process is performed to obtain the final fusion weight. : , The fusion weights are multiplied by channel-spatial broadcasting with the input feature map when entering the "dual-path attention collaboration stage", and combined with residual connections to obtain the final enhanced output feature map.
4. The acute leukemia classification method based on frequency domain attention and multi-scale fusion according to claim 1, characterized in that, The image processing procedure of the multi-scale attention module (EMA) includes: Channel group reshaping process: The channel dimension of the input feature map is grouped and reshaped into a batch dimension, allowing each subgroup to independently carry out feature learning before proceeding to the subsequent local feature extraction and cross-attention stages, so that the spatial semantic features are evenly distributed within the group. Dual-path parallel processing: The input feature map is used as the input space mask branch. After average pooling, concatenation, and 1×1 convolution, the global information is initially processed. Then, through segmentation, channel attention weights are generated, and the Sigmoid function is used to assign the weights. For each feature group, local spatial features are extracted through 3×3 convolution, and then input into the cross-attention module. Different feature groups undergo grouping and normalization operations to ensure the stability of feature distribution. The cross-attention module generates attention weights through average pooling and softmax operations; the outputs of the two parallel attention branches are added together and the final attention weights are generated through the sigmoid function. The output of the spatial mask branch is fused with the cross-attention and grouped normalized features to finally output an enhanced feature map.
5. The acute leukemia classification method based on frequency domain attention and multi-scale fusion according to claim 4, characterized in that, The output of all frequency domain attention modules is input to a multi-scale feature pyramid network. The method for extracting the fused feature set is as follows: Feature maps of different scales, F2, F3, and F4, are extracted from multiple convolutional layers of ResNet50, corresponding to sizes and number of channels of 28×28×512, 14×14×1024, and 7×7×2048, respectively. These feature maps form a feature pyramid. Perform a 1×1 convolution on the feature map of each layer to unify the number of channels to a preset value out_channels, and use group normalization for calibration; Starting from the high-level feature map, the fusion is performed step by step downwards. The size of the high-level feature map is aligned with the feature map of the next layer through bilinear interpolation upsampling operation, and then the feature map of the next layer is added element by element. After obtaining the initial pyramid features, the representation capability is improved through dynamic adaptive pooling and nonlinear fusion: In the bottom-up fusion process, AdaptiveAvgPool2d is used to match the fusion feature size of the previous layer with the feature size of the current layer. After alignment, 3×3 convolution is used in conjunction with GELU activation function and DropBlock regularization to perform feature mixing, outputting a fusion feature set covering different receptive fields.
6. The acute leukemia classification method based on frequency domain attention and multi-scale fusion according to claim 1, characterized in that, The features extracted by the backbone network and the features extracted by the multi-scale feature pyramid network are fused together and input into a fully connected classification head. The output classification result is as follows: , , Among them, F cat The fused feature tensor is the unified feature representation input to the final classifier; Concat(): Channel-dimensional concatenation operation, connecting multiple feature maps along the channel dimension; AdaptivePool(P2), AdaptivePool(P3): Adaptive pooling operations, where P2 and P3 are two different levels of enhanced feature maps in the feature pyramid that fuse multi-scale information. Represents the augmented feature map containing the most abstract and high-level semantic information; ŷ: the predicted probability distribution, representing the probability that the input image belongs to each category; Softmax(): the Softmax activation function, which transforms the output of the linear layer into a probability distribution; W c : The weight matrix of the fully connected classification head; Flatten(F cat Flattening operation; The fused features (P2, P3, P4) from the multi-scale feature pyramid network are uniformly sampled to a 7×7 size and then channel-stitched to form a fused feature map with a size of 7×7 and 256×3=768 channels. ; Fusion Feature Map Through a fully connected classification head To enable the prediction of pathological types.
7. An acute leukemia classification system based on frequency domain attention and multi-scale fusion, characterized in that, It includes a data acquisition module and a processing module, wherein the data acquisition module is used to acquire microscopic images of acute leukemia in patients; The input terminal of the processing module is connected to the output terminal of the data acquisition module, and the processing module executes the method described in any one of claims 1-6 to obtain the classification result of acute leukemia; The processing module uses the deep residual network ResNet50 as the backbone network and introduces frequency domain attention modules (DCT) in multiple deep processing stages. In particular, a multi-scale attention module (EMA) is introduced between the last deep processing stage and its corresponding frequency domain attention module. The multi-scale attention module (EMA) is used to enhance feature attention, and the frequency domain attention module (DCT) is used to introduce frequency domain information. The processing module also includes a multi-scale feature pyramid network and a classifier; The outputs of all frequency domain attention modules are connected to a multi-scale feature pyramid network, which is used to extract fused feature sets. The features extracted by the backbone network are fused with the features extracted by the multi-scale feature pyramid network and then input into the classifier to output the classification result.
8. The acute leukemia classification system based on frequency domain attention and multi-scale fusion according to claim 7, characterized in that, The frequency domain attention module includes a dynamic block DCT transform module and a dual-path attention coordination module; The dynamic block DCT transform module is used to transform spatial features to the frequency domain and enhance them. The dynamic block DCT transform module includes a dynamic filling calibration module, a block frequency domain analysis module, and a feature map reconstruction module connected in sequence. The dynamic filling calibration module receives the input feature map from the corresponding stage of the ResNet50 backbone network, calculates and performs zero padding on the right and bottom of the feature map according to the preset block size K, and ensures that its height and width are divisible by K, in order to prepare for subsequent block operations. The output filled feature map with the appropriate size is directly sent to the block frequency domain analysis module. The input of the block frequency domain analysis module is connected to the output of the dynamic filling calibration module. It receives the filled feature map, divides and expands the input feature map into a K×K grid to form a block tensor, performs a fast Fourier transform on each independent block and extracts the real part, which is equivalent to completing the discrete cosine transform, transforming the feature information from the spatial domain to the frequency domain, outputting the block feature tensor after frequency domain transformation, and passing it to the feature map reconstruction module. The feature map reconstruction module receives the frequency domain block tensor from the block frequency domain analysis module, performs a reversible folding operation that is the opposite of "unfolding", restores the processed frequency domain feature blocks back to the spatial domain, generates an enhanced feature map, and trims the added padding area to restore it to the original input size, outputting a spatial feature map enhanced by the frequency domain. The dual-path attention coordination module is used to perform adaptive calibration from both channel and spatial dimensions based on frequency domain enhancement. The dual-path attention coordination module includes two parallel processing paths and a fusion output section. First path: Channel attention branch, learns and highlights feature channels that are more important to the current classification task, and suppresses unimportant channels, including: Global average pooling: Global average pooling is performed on each channel of the feature map, compressing the H×W spatial information of each channel into a scalar, resulting in a channel description vector. Bottleneck structure: Consists of two fully connected layers: The first fully connected layer: compresses the number of channels from CC to C / r, where r is the reduction ratio, introducing non-linearity; The second fully connected layer: restores the number of channels from C / r back to CC. The Sigmoid function normalizes the output to the [0, 1] interval and generates channel attention weights Wc. The closer the weight value is to 1, the more important the channel is. The second approach: Spatial attention branch, which learns and highlights spatial regions in the feature map that are key to classification, including: 1×1 convolution: used to compress channel dimensions, reduce computation, and integrate cross-channel information; Group normalization: Unaffected by batch size, it stabilizes the training process and eliminates the dependence on batch statistics; ReLU activation: introduces nonlinearity; 1×1 convolution: Adjust the number of channels back to be the same as the input; The Sigmoid function generates spatial attention weights. Each point on the weight map has a value between 0 and 1, indicating the importance of that spatial location.
9. The acute leukemia classification system based on frequency domain attention and multi-scale fusion according to claim 7, characterized in that, The Multi-Scale Attention Module (EMA) includes a channel grouping reshaping module and a dual-path parallel processing module. The channel grouping and reshaping module includes a channel grouping unit and a dimension reshaping unit, which are used to divide the channel dimension of the input feature map into multiple factor groups and reshape the grouped dimensions into the batch dimension to form a new feature map after grouping. The dual-path parallel processing module includes a spatial mask branch and a cross-attention branch connected in parallel. The spatial mask branch includes the following sequentially connected branches: Average pooling layer is used to compress spatial dimensions; Feature splicing layer, used to fuse multi-scale information; A 1×1 convolutional layer is used for feature transformation; A segmentation operation layer is used to generate channel attention weights; The cross-attention branches include sequentially connected: 3×3 convolutional layers are used to extract multi-scale spatial features; Grouping normalization layers are used to stabilize feature distributions; The cross-attention computation unit achieves interactive learning between feature groups through matrix multiplication and Softmax operations; The outputs of the spatial mask branch and the cross attention branch are fused by element-wise addition, and then the final attention weights are generated by the Sigmoid activation function. The final attention weights are modulated and fused with the grouped and normalized features in the cross-attention branch, and then added to the original input of the module through residual connections to output an enhanced feature map.
10. The acute leukemia classification system based on frequency domain attention and multi-scale fusion according to claim 7, characterized in that, The multi-scale feature pyramid network includes a feature extraction module, a side convolution calibration module, a top-down fusion path, a bottom-up enhancement path, and a feature output module. The input of the feature extraction module is connected to the output of all frequency domain attention modules, and is used to extract feature maps F2, F3, and F4 of different scales from multiple stages of the ResNet50 backbone network. The side convolution calibration module includes multiple parallel 1×1 convolutional layers and grouped normalization layers, which are respectively connected to the output ends of the feature extraction module, and are used to uniformly calibrate the number of channels of the feature maps at each stage to the preset number of output channels Cp. The top-down fusion path includes a multi-level bilinear interpolation upsampler and a feature fusionist connected in sequence. This path processes features from high-level features to low-level features, aligns the size of the high-level feature map with the adjacent low-level feature map through upsampling operations, and achieves the downflow of semantic information through element-wise addition. The bottom-up enhancement path includes a dynamic adaptive pooling module and a non-linear fusion module. This path receives the intermediate results of the top-down fusion path, achieves feature map size matching and alignment through adaptive average pooling, and then performs cross-scale feature enhancement through 3×3 convolution combined with GELU activation function and DropBlock regularization. The input of the feature output module is connected to the output of the bottom-up enhancement path, and outputs the final multi-scale fusion feature set [P2,P3,P4].
Citation Information
Cited By
Color equivariant and frequency domain attention-based cataract classification method and system
CN121640192A
Image damage identification method based on multi-scale feature fusion
CN121810684A