HMCFormer (hierarchical multi-scale convolutional transformer): a hybrid CNN+Transformer network for intelligent VIA screening

Bo Feng, Chao Xu, Zhengping Li, Chuanyi ZhangPeerJ Comput. Sci 2025 · DOI

TL;DR

This paper introduces HMCFormer, a novel hybrid CNN-Transformer network designed for intelligent Visual Inspection with Acetic Acid (VIA) screening for cervical cancer. By effectively fusing hierarchical local feature extraction from CNNs with global context modeling from Transformers, HMCFormer achieves state-of-the-art accuracy in both binary and multi-class classification of cervical lesions, paving the way for more accessible and affordable screening.

What Problem Does This Paper Address?

Cervical cancer remains a significant global health challenge, particularly in developing countries where access to effective screening methods is limited. While AI-assisted screening holds promise for cost-effectiveness and accessibility, current methods often suffer from low accuracy or require expensive equipment. Traditional VIA screening, though cost-effective, can be subjective and its accuracy is limited by the availability of skilled professionals. This paper addresses the need for an accurate, automated, and affordable VIA screening system that can overcome the limitations of existing AI approaches and traditional methods, making early detection more accessible to a wider population.

Methods

The core of this work is the HMCFormer, a parallel CNN-Transformer network designed to leverage the strengths of both architectures.

  • Hybrid Architecture: HMCFormer comprises two parallel branches:
  • Transformer Branch: Processes original, unenhanced lesion images, utilizing a modified Swin Transformer architecture for global context understanding.
  • CNN Branch: Processes images enhanced by a novel dual-color space enhancement algorithm. This branch employs a Hierarchical Multi-Scale Pixel Excitation (HMSPE) module for efficient multi-scale and multi-level local feature extraction.
  • Dual-Color Space Image Enhancement: A novel algorithm that decomposes images into LAB and YCrCb color spaces and applies Local Truncated Contrast Limited Adaptive Histogram Equalization (LT-CLAHE) to enhance the color contrast between lesion areas and normal cervical skin. This helps highlight subtle lesion features without increasing roughness. The enhanced images are then converted to grayscale for the CNN branch.
  • Hierarchical Multi-Scale Pixel Excitation (HMSPE) Module: This module efficiently integrates multi-scale and multi-level feature extraction within the CNN branch, using a combination of convolutions and pixel-wise excitation to capture rich local details.
  • Superiority-Inferiority Fusion: A novel fusion strategy that aims to maximize the synergistic potential of the CNN and Transformer branches. It involves adaptive preprocessing and a specific fusion mechanism within the HMCFormer block, ensuring that neither branch completely dominates the other, thus maintaining feature diversity and reducing redundancy. Mutual information is used as an evaluation metric for fusion strategies.

Datasets

The authors compiled and organized data from three publicly available sources:

  • Google cervical cancer segmentation (GitHub)
  • Intel & MobileODT cervical cancer screening dataset (Kaggle)
  • NIH cervical cancer dataset (The Cancer Imaging Archive - TCIA)

These datasets were combined and classified to form the PCC5000 dataset, comprising 5,000 samples suitable for VIA screening. This dataset includes:

  • 2,066 samples of non-cervical intraepithelial neoplasia
  • 1,212 samples of CIN1
  • 1,225 samples of CIN2
  • 662 samples of CIN3

All images in the PCC5000 dataset were re-annotated by professional gynecologists.

Key Insights and Ideas

  • Synergy is Key: The paper strongly advocates for the synergistic fusion of CNNs and Transformers, demonstrating that their combined strengths significantly outperform individual architectures for cervical lesion detection.
  • Enhancement Matters for Subtle Lesions: The novel dual-color space enhancement is crucial for detecting subtle, low-grade lesions (CIN1) that might otherwise be missed by standard image processing or AI models.
  • Balancing Information Flow: The "superiority-inferiority fusion" concept is a clever way to ensure that both branches contribute meaningfully without one overwhelming the other, leading to better feature diversity and reduced redundancy.
  • Mutual Information as a Fusion Metric: Using mutual information to evaluate fusion strategies provides a principled, information-theoretic approach to understanding how well the network is leveraging the combined information from its branches.
  • Targeted Input Strategy: Feeding original images to the Transformer and enhanced grayscale images to the CNN branch is a deliberate strategy to leverage the Transformer's global context for overall structure and the CNN's local detail extraction on enhanced features.

Key Results

  • High Accuracy: HMCFormer achieved a screening accuracy of 97.4% and a grading accuracy of 94.8% on the PCC5000 dataset.
  • Superior Performance: In binary classification, HMCFormer achieved an accuracy of 97.4%, sensitivity of 98.1%, and an F1-score of 97.0%, outperforming 23 other representative neural networks.
  • Efficiency: HMCFormer is computationally efficient, with a model size of approximately 12M parameters and competitive FLOPs compared to other high-performing models. It uses fewer parameters and FLOPs than many Transformer-based models while achieving higher accuracy.
  • Ternary Classification: In three-class classification, HMCFormer achieved an accuracy of 94.8%, outperforming other models, including hybrid and Transformer-based networks.
  • Ablation Studies: The dual-color space enhancement significantly improved performance, and the proposed fusion method with adaptive preprocessing was superior to other fusion strategies.

Limitations and Future Work

  • Dataset Reliance: The current dataset relies entirely on publicly available sources. The authors plan to collaborate with hospitals to refine and expand the dataset.
  • Auxiliary Software Development: They aim to develop auxiliary diagnostic software for cervical cancer and integrate it with a platform for professional gynecologist confirmation.
  • Inexpensive Colposcope: A future goal is to develop an inexpensive colposcope with acetic acid spraying and network transmission capabilities to further democratize screening.
  • Further Refinement of Fusion: While the proposed fusion method is effective, the authors suggest there is room for further improvement in fusion strategies.

Summary updated

BibTeX
@article{feng2025hmcformer,
  author = {Bo Feng and Chao Xu and Zhengping Li and Chuanyi Zhang},
  title = {{HMCFormer (hierarchical multi-scale convolutional transformer): a hybrid CNN+Transformer network for intelligent VIA screening}},
  journal = {PeerJ Comput. Sci.},
  year = {2025},
  doi = {10.7717/peerj-cs.3088},
}
Figure