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
First download the RAM-H1200 dataset from Hugging Face:
For example:
git clone https://huggingface.co/datasets/TokyoTechMagicYang/RAM-H1200-v1Then 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.txtThis 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/MedSAMPlease 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/.
Main benchmark scripts in the repository root:
train_seg.sh: bone segmentation trainingtest_seg.sh: bone segmentation testingtrain_be_seg.sh: BE segmentation trainingtest_be_seg.sh: BE segmentation testingtrain_score_cls.sh: BE/JSN scoring trainingtrain_score_cls_ddp.sh: BE/JSN scoring distributed trainingtest_score_cls.sh: BE/JSN scoring testingtest_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.
Training:
GPU_ID=0 DATA_PATH=/path/to/segmentation_data bash train_seg.shTesting:
GPU_ID=0 DATA_PATH=/path/to/segmentation_data bash test_seg.shTraining:
GPU_ID=0 DATA_PATH=/path/to/segmentation_data bash train_be_seg.shTesting:
GPU_ID=0 DATA_PATH=/path/to/segmentation_data bash test_be_seg.shFirst convert the BE segmentation dataset to the nnU-Net directory layout:
python convert_be_seg_to_nnunet.pyThis script prepares the dataset under:
models/nnUNet/DATASET/
Then continue with the nnU-Net workflow inside models/nnUNet.
Typical next steps are:
- Set the nnU-Net environment variables to the directories under
models/nnUNet/DATASET. - Run planning and preprocessing.
- Run nnU-Net training.
- 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_integrityTraining:
nnUNetv2_train 120 2d 0 -tr nnUNetTrainerBEInference:
nnUNetv2_predict \
-i /path/to/input_images \
-o /path/to/output_predictions \
-d 120 \
-c 2d \
-f 0 \
-tr nnUNetTrainerBEIf you want to use the provided repository-level evaluation entry for BE segmentation inference, you can run:
bash test_be_seg_nnunet.shThe scoring task uses joint ROI .bmp files together with JSON score keys. The mapping used in the code is listed below.
| 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 |
| 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.shJSN 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- Most scripts support single-run mode through environment variables such as
MODEL,CHECKPOINT, andDATA_PATH. - Batch benchmark mode is controlled by the
EXPERIMENTSarray inside each script. - Some evaluation and summary utilities are kept as local helper scripts and may not be tracked in Git.
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}
}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}
}