- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .idea | ||
| assets | ||
| feature_extract | ||
| global_aggregation | ||
| .gitignore | ||
| README.md | ||
| tempt.jpg | ||
Frequency-domain multi-scale fusion attention for pathological image classification
Figure 1: MFHA mechanism fuses low-frequency global information and high-frequency details via wavelet decomposition
Project Introduction
Pathological image classification is critical for early cancer diagnosis and precise subtyping, but challenges remain in large heterogeneity, complex textures, insufficient utilization of local details, and weak inter-subband interaction in frequency-domain methods. To address these issues, this study proposes a Multi-scale Frequency-domain Hybrid Attention (MFHA) mechanism. Using wavelet transform, it decomposes images into low-frequency global structures and high-frequency fine details, then enhances high-frequency representations via multi-scale convolutions and subband fusion to synergize global semantics and local details. A spatial attention module integrating cosine similarity and multi-dimensional statistical features is further introduced to boost feature robustness and discriminability. Experiments on multiple pathological datasets show that the proposed method surpasses baseline models, with accuracy gains of 1.97% and 2.71%. This work provides a new perspective for pathological image feature modeling, effectively improving classification accuracy and robustness.
Repository: https://github.com/AnaStartz/WSI-processing-framework
Method Overview
1. Multi-scale Frequency-domain Hybrid Attention (MFHA)
The MFHA architecture consists of these core modules (shown in Figure 2):
- Channel Select: Adaptively filters key channels to focus on task-relevant features, reducing dimensionality and improving efficiency.
- Wavelet Decomposition: Uses Haar DWT to decompose feature maps into 4 sub-bands (LL: low-frequency global; LH/HL/HH: high-frequency details), fusing low and high frequencies to enhance representation.
- Dual Upsampling Module (Wave Up): Combines IDWT and PixelShuffle, using high-frequency components to guide reconstruction while preserving details and accelerating speed. Please refer to https://github.com/smin-hwang/WaveDH.
- Spatial Attention: Integrates cosine similarity and multi-dimensional statistics (Max/Avg/Std Pool, L2 Norm) to build robust feature representations.

Figure 2: Modular structure of MFHA (including Channel Select, wavelet decomposition, and attention modules)
2. WSI Pathological Image Analysis Framework
A two-stage processing pipeline (shown in Figure 3):
- Patch-level Encoder: Based on the MFTrans architecture, uses MFHA-based Patch Embed to encode 224×224 tissue patches, with feature extraction via Swin Transformer.
- Slide-level Encoder: Uses LongNet's Dilated Attention to capture long-range dependencies across patches, generating global WSI embeddings for classification.

Figure 3: Two-stage WSI analysis framework (Patch-level feature extraction and Slide-level global aggregation)
Experimental Results
1. Lung Cancer Gene Mutation Classification
On the lung cancer gene mutation dataset, MFTrans outperforms the baseline CTranspath:
- Average AUROC improved by 1.19%
- Balanced Accuracy (BACC) improved by 1.59%
- AUPRC for positive samples improved by 2.69%
2. Sipakmed Classification
Strong performance in cross-dataset and cross-task scenarios:
- Sipakmed (cervical cancer pathology classification): 95.56% accuracy, outperforming mainstream attention mechanisms.

Figure 4: Grad-CAM heatmap comparison between MFHA and standard ResNet
Quick Start
Please refer to https://github.com/prov-gigapath/prov-gigapath.
Citation
If this project contributes to your research, please cite:
@article{
title={Frequency domain multi scale fusion guided classification of lung cancer genetic mutations},
author={Team Name},
journal={Journal Name},
year={2025},
doi={article DOI}
}
Acknowledgments
The numerical calculations in this paper have been done on the Advanced Computing system in National Advanced Computing Taiyuan center and Taihang Laboratory In Shanxi Province(Advanced ComputingLaboratory In Shanxi Province).