OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Hiformer

HiFormer is an MIT-licensed research implementation of a hierarchical multi-scale medical-image segmentation method. It combines Swin Transformer and CNN-based feature representations using Double-Level Fusion, with repository workflows for training and testing on the Synapse multi-organ dataset.

Independent OpenViST project profile, based on linked sources.

Hiformer — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use the repository when you need a research implementation and documented Synapse training and testing workflow, or want to examine its transformer–CNN feature-fusion design.

Who it is for

  • Medical-imaging researchers studying segmentation methods.
  • Developers seeking a Python and PyTorch implementation to adapt for segmentation research.
  • Researchers examining transformer and CNN feature fusion.

Documented uses

  • Train a HiFormer variant on the Synapse multi-organ segmentation dataset.
  • Test a trained variant and save inference results.
  • Study or adapt a hierarchical transformer–CNN fusion approach for medical-image segmentation.
Before you choose

Requirements & limits

The public GitHub repository specifies an MIT license.

  • The repository’s complete preparation, training and testing instructions target the Synapse dataset.
  • The documented software requirements are Python 3 and PyTorch.
  • Three model choices are documented: HiFormer-S, HiFormer-B and HiFormer-L.
  • The method’s distinguishing design is Double-Level Fusion of transformer and CNN feature representations.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Train HiFormer on the Synapse dataset

Prepare the Synapse data and train a selected HiFormer model variant.

Before you start

  • Python 3 and PyTorch.
  • The Synapse dataset, downloaded from the README-linked dataset location.

Steps

  1. Download the Synapse dataset and prepare its training and test data paths.

  2. Install the repository requirements with the command below.

    Documented command
    pip install -r requirements.txt
  3. Run the command below, adjusting the paths and choosing hiformer-s, hiformer-b, or hiformer-l as needed.

    Documented command
    python train.py --root_path ./data/Synapse/train_npz --test_path ./data/Synapse/test_vol_h5 --model_name hiformer-b --batch_size 10 --eval_interval 20 --max_epochs 400

Expected outcome

The training procedure runs for the Synapse dataset with the selected model variant and configured paths and parameters.

Guide limitations

  • The repository points to Instructions.ipynb for complete dataset-preparation and train/test details.
  • The README lists Python 3 and PyTorch but does not specify versions.
Source-based practical guide

Test a trained HiFormer model on Synapse

Run Synapse test inference using an existing trained HiFormer weights file.

Before you start

  • A trained HiFormer model weights file.
  • The Synapse test data at the path supplied to the test script.
  • Python 3 and PyTorch.

Steps

  1. Prepare the Synapse test data and identify the trained model weights file.

  2. Run the command below, updating the data path, model variant, and weights path as appropriate.

    Documented command
    python test.py --test_path ./data/Synapse/test_vol_h5 --model_name hiformer-b --is_savenii --model_weight './hiformer-b_best.pth'

Expected outcome

The test script runs inference on the Synapse test data; `--is_savenii` controls whether results are saved during inference.

Guide limitations

  • The README directs users to Instructions.ipynb for complete dataset preparation and train/test details.
  • The README does not describe the saved output format or provide a test script result guarantee.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
amirhossein-kz/HiFormer · Official homepage title · retained in its source language