README.md
March 21, 2025 Β· View on GitHub
MambaMIC: An Efficient Baseline for Microscopic Image Classification with State Space Models
[Paper]
[Project Page]
Abstract
In recent years, CNN and Transformer-based methods have made significant progress in Microscopic Image Classification (MIC). However, existing approaches still face the dilemma between global modeling and efficient computation. While the Selective State Space Model (SSM) can simulate long-range dependencies with linear complexity, it still encounters challenges in MIC, such as local pixel forgetting, channel redundancy, and lack of local perception. To address these issues, we propose a simple yet efficient vision backbone for MIC tasks, named MambaMIC. Specifically, we introduce a Local-Global dualbranch aggregation module: the MambaMIC Block, designed to effectively capture and fuse local connectivity and global dependencies. In the local branch, we use local convolutions to capture pixel similarity, mitigating local pixel forgetting and enhancing perception. In the global branch, SSM extracts global dependencies, while Locally Aware Enhanced Filter reduces channel redundancy and local pixel forgetting. Additionally, we design a Feature Modulation Interaction Aggregation Module for deep feature interaction and key feature re-localization. Extensive benchmarking shows that MambaMIC achieves state-of-the-art performance across five datasets.
Overview
πLet's Get Started!
A. Installation
Note that the code in this repo runs under Linux system.
The repo is based on the VMama repo, thus you need to install it first. The following installation sequence is taken from the VMamba repo.
Step 1: Clone the repository:
Clone this repository and navigate to the project directory:
git clone https://github.com/zs1314/MambaMIC.git
cd MambaMIC
Step 2: Environment Setup:
It is recommended to set up a conda environment and installing dependencies via pip. Use the following commands to set up your environment:
Create and activate a new conda environment
conda create -n MambaMIC
conda activate MambaMIC
Install dependencies
pip install -r requirements.txt
cd kernels/selective_scan && pip install .
B. Data Preparation
The five datasets RPE, MHIST , SARS ,TissueMnist and MedMf_colon are used for MIC experiments. Please download them and make them have the following folder/file structure:
${DATASET_ROOT} # Dataset root directory, for example: /home/username/data
βββ RPE
βββ train
β βββ class 1
β β βββ00001.png
β β βββ00002.png
β β βββ00003.png
β β ...
β β
β βββ class 2
β β βββ00001.png
β β ...
β β
β βββ class n
β βββ00001.png
β ...
βββ val
β βββ ...
βββ test
β βββ ...
β ...
βββ MHIST
βββ SARS
βββ TissueMnist
βββ MedMf_Colon
Or you can download it from here: baidu Netdisk
C. Model Training
python train.py
D. Model Testing
python test.py
π₯: Before training and testing, configure the relevant parameters in the script. You are better off calculating the mean and std for each data set, which also helps to further improve model performance. get_means.py
π Results
- results in Table 1 of the main paper
- results in Figure 1 of the main paper
π€Acknowledgments
This project is based on VMamba (paper, code). Thanks for their excellent works!!
πQ & A
For any questions, please feel free to contact us.
πReference
If this code or paper contributes to your research, please kindly consider citing our paper and give this repo βοΈ π
@article{zou2024microscopic,
title={MambaMIC: An Efficient Baseline for Microscopic Image Classification with State Space Models},
author={Zou, Shun and Zhang, Zhuo and Zou, Yi and Gao, Guangwei},
journal={ICME},
year={2025}
}