Skip to content

YSongxiao/RAM-H1200

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Official Code Repository of RAM-H1200: A Unified Evaluation and Dataset on Hand Radiographs for Rheumatoid Arthritis

This repository contains benchmark code for RAM-H1200 tasks, including:

  • Bone segmentation
  • BE segmentation
  • Scoring of SvdH BE / JSN

Setup

First download the RAM-H1200 dataset from Hugging Face:

For example:

git clone https://huggingface.co/datasets/TokyoTechMagicYang/RAM-H1200-v1

Then prepare your Python environment and update the placeholder paths in the shell scripts, or pass them through environment variables.

Install the Python dependencies with:

pip install -r requirements.txt

This repository also includes local packages for some components. Install them when needed:

pip install -e ./models/nnUNet
pip install -e ./models/segment-anything
pip install -e ./models/MedSAM

Please install a CUDA-compatible PyTorch build first if you are using GPU training or inference.

Common path placeholders:

  • /path/to/segmentation_data
  • /path/to/be_scoring_data
  • /path/to/jsn_scoring_data

Outputs are typically written under ./ckpts/.

Benchmark Entry Points

Main benchmark scripts in the repository root:

  • train_seg.sh: bone segmentation training
  • test_seg.sh: bone segmentation testing
  • train_be_seg.sh: BE segmentation training
  • test_be_seg.sh: BE segmentation testing
  • train_score_cls.sh: BE/JSN scoring training
  • train_score_cls_ddp.sh: BE/JSN scoring distributed training
  • test_score_cls.sh: BE/JSN scoring testing
  • test_be_seg_nnunet.sh: nnU-Net BE segmentation testing

Each script contains an EXPERIMENTS array for batch benchmark runs. Uncomment or edit the entries you want to run.

Typical Usage

Bone Segmentation

Training:

GPU_ID=0 DATA_PATH=/path/to/segmentation_data bash train_seg.sh

Testing:

GPU_ID=0 DATA_PATH=/path/to/segmentation_data bash test_seg.sh

BE Segmentation

Training:

GPU_ID=0 DATA_PATH=/path/to/segmentation_data bash train_be_seg.sh

Testing:

GPU_ID=0 DATA_PATH=/path/to/segmentation_data bash test_be_seg.sh

nnU-Net can also be used for BE segmentation.

First convert the BE segmentation dataset to the nnU-Net directory layout:

python convert_be_seg_to_nnunet.py

This script prepares the dataset under:

models/nnUNet/DATASET/

Then continue with the nnU-Net workflow inside models/nnUNet.

Typical next steps are:

  1. Set the nnU-Net environment variables to the directories under models/nnUNet/DATASET.
  2. Run planning and preprocessing.
  3. Run nnU-Net training.
  4. Run inference or testing.

Example command templates:

cd models/nnUNet

export nnUNet_raw="/path/to/RAM-H1200/models/nnUNet/DATASET/nnUNet_raw"
export nnUNet_preprocessed="/path/to/RAM-H1200/models/nnUNet/DATASET/nnUNet_preprocessed"
export nnUNet_results="/path/to/RAM-H1200/models/nnUNet/DATASET/nnUNet_trained_models"

Planning and preprocessing:

nnUNetv2_plan_and_preprocess -d 120 -c 2d --verify_dataset_integrity

Training:

nnUNetv2_train 120 2d 0 -tr nnUNetTrainerBE

Inference:

nnUNetv2_predict \
    -i /path/to/input_images \
    -o /path/to/output_predictions \
    -d 120 \
    -c 2d \
    -f 0 \
    -tr nnUNetTrainerBE

If you want to use the provided repository-level evaluation entry for BE segmentation inference, you can run:

bash test_be_seg_nnunet.sh

Scoring

The scoring task uses joint ROI .bmp files together with JSON score keys. The mapping used in the code is listed below.

BE joint mapping

ROI file stem JSON score key Display name
R BE_R Radius
U BE_U Ulna
IP BE_IP IP
L BE_L Lunate
MCP-T BE_MCP-T MCP1
MCP-I BE_MCP-I MCP2
MCP-M BE_MCP-M MCP3
MCP-R BE_MCP-R MCP4
MCP-S BE_MCP-S MCP5
CMC-T BE_CMC-T CMC1
PIP-I BE_PIP-I PIP2
PIP-M BE_PIP-M PIP3
PIP-R BE_PIP-R PIP4
PIP-S BE_PIP-S PIP5
S BE_S Scaphoid
Tm BE_Tm Trapezium

JSN joint mapping

ROI file stem JSON score key Display name
MCP-T JSN_MCP-T MCP1
MCP-I JSN_MCP-I MCP2
MCP-M JSN_MCP-M MCP3
MCP-R JSN_MCP-R MCP4
MCP-S JSN_MCP-S MCP5
PIP-I JSN_PIP-I PIP2
PIP-M JSN_PIP-M PIP3
PIP-R JSN_PIP-R PIP4
PIP-S JSN_PIP-S PIP5
CMC-M JSN_CMC-M CMC-M
CMC-R JSN_CMC-R CMC-R
CMC-S JSN_CMC-S CMC-S
SC JSN_SC SC
SR JSN_SR SR
STT JSN_STT STT

BE scoring:

GPU_ID=0 SCORE_TYPE=BE DATA_PATH=/path/to/be_scoring_data bash train_score_cls.sh
GPU_ID=0 SCORE_TYPE=BE DATA_PATH=/path/to/be_scoring_data bash test_score_cls.sh

JSN scoring:

GPU_ID=0 SCORE_TYPE=JSN DATA_PATH=/path/to/jsn_scoring_data bash train_score_cls.sh
GPU_ID=0 SCORE_TYPE=JSN DATA_PATH=/path/to/jsn_scoring_data bash test_score_cls.sh

Notes

  • Most scripts support single-run mode through environment variables such as MODEL, CHECKPOINT, and DATA_PATH.
  • Batch benchmark mode is controlled by the EXPERIMENTS array inside each script.
  • Some evaluation and summary utilities are kept as local helper scripts and may not be tracked in Git.

Citation

If you use RAM-H1200 in your research, please cite:

@misc{yang2026ramh1200,
  title={RAM-H1200: A Unified Evaluation and Dataset on Hand Radiographs for Rheumatoid Arthritis},
  author={Songxiao Yang and Haolin Wang and Yao Fu and Junmu Peng and Lin Fan and Hongruixuan Chen and Jian Song and Masayuki Ikebe and Shinya Takamaeda-Yamazaki and Masatoshi Okutomi and Tamotsu Kamishima and Yafei Ou},
  year={2026},
  eprint={2605.05616},
  archivePrefix={arXiv},
  primaryClass={cs.CV},
  url={https://arxiv.org/abs/2605.05616}
}

Suggested Citation

If you use the benchmark code or experimental settings, we also recommend citing:

@article{yang2026ram,
  title={RAM-W600: A Multi-Task Wrist Dataset and Benchmark for Rheumatoid Arthritis},
  author={Yang, Songxiao and Wang, Haolin and Fu, Yao and Tian, Ye and Kamishima, Tamotsu and Ikebe, Masayuki and Ou, Yafei and Okutomi, Masatoshi},
  journal={Advances in Neural Information Processing Systems},
  volume={38},
  year={2026}
}

About

Official Repository of RAM-H1200

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors