MIAFEx: An Attention-based Feature Extraction Method for Medical Image Classification

Oscar Ramos-Soto, Jorge Ramos-Frutos, Ezequiel Perez-Zarate, Diego Oliva, Sandra E. Balderas-Mata
1/15/2025
cs.CVcs.LG

Official code: Oscar-RamosS/Medical-Image-Attention-based-Feature-Extractor-MIAFEx (7 stars, MIT, last commit 2025-09-26).

Abstract

Feature extraction techniques are crucial in medical image classification; however, classical feature extractors, in addition to traditional machine learning classifiers, often exhibit significant limitations in providing sufficient discriminative information for complex image sets. While Convolutional Neural Networks (CNNs) and Vision Transformer (ViT) have shown promise in feature extraction, they are prone to overfitting due to the inherent characteristics of medical imaging data, including small sample sizes or high intra-class variance. In this work, the Medical Image Attention-based Feature Extractor (MIAFEx) is proposed, a novel method that employs a learnable refinement mechanism to enhance the classification token within the Transformer encoder architecture. This mechanism adjusts the token based on learned weights, improving the extraction of salient features and enhancing the model's adaptability to the challenges presented by medical imaging data. The MIAFEx output feature quality is compared against classical feature extractors using traditional and hybrid classifiers. Also, the performance of these features is compared against modern CNN and ViT models in classification tasks, demonstrating their superiority in accuracy and robustness across multiple complex medical imaging datasets. This advantage is particularly pronounced in scenarios with limited training data, where traditional and modern models often struggle to generalize effectively. The source code of this proposal can be found at https://github.com/Oscar-RamosS/Medical-Image-Attention-based-Feature-Extractor-MIAFEx

View on arXivView PDF

Code Implementations(1)

MIT

MIAFEx is a Transformer-based extractor for medical images that refines the [CLS] token to produce robust features, improving results on small or imbalanced datasets and supporting feature selection and classifier design. These features can be directly used with classical classifiers (SVM, RF, etc.) or combined with more sophisticaded approaches.

71PythonDec 9, 20241 years agoMIT
feature-extractionmedical-image-classificationtransformer-encoder-architecture

Similar Papers

Cite this paper

@article{ramossoto2025miafex,
  title  = {MIAFEx: An Attention-based Feature Extraction Method for Medical Image Classification},
  author = {Oscar Ramos-Soto and Jorge Ramos-Frutos and Ezequiel Perez-Zarate and Diego Oliva and Sandra E. Balderas-Mata},
  year   = {2025},
  eprint = {2501.08562},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.08562v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.08562.svg)](https://codeofpaper.com/paper/2501.08562)

Discussion