All model training results are saved in the model_results/ directory, organized by dataset and architecture:
model_results/
└── segthor_clean/
├── enet/
├── enet_se/
└── segformer_b0/
Each model run directory contains:
bestmodel.pkl- Complete saved model (architecture + weights)bestweights.pt- Model weights onlybest_epoch.txt- Information about the best performing epochbest_epoch/- Predictions from the best epochloss_tra.npy- Training loss historyloss_val.npy- Validation loss historydice_tra.npy- Training Dice coefficient historydice_val.npy- Validation Dice coefficient historyiter{XXX}/- Predictions from each epoch
The following architectures are available via the --arch flag:
- enet - Standard ENet architecture
- enet_se - ENet with Squeeze-and-Excitation blocks
- segformer_b0 - SegFormer-B0 (MiT encoder + lightweight decoder)
python main.py --dataset SEGTHOR_CLEAN --mode full --dest <output_directory> --arch <architecture> --epochs <num_epochs> [--gpu]python main.py --dataset SEGTHOR_CLEAN --mode full --dest model_results/segthor_clean/enet/base --arch enet --epochs 20 --gpupython main.py --dataset SEGTHOR_CLEAN --mode full --dest model_results/segthor_clean/enet_se/base --arch enet_se --epochs 20 --gpupython main.py --dataset SEGTHOR_CLEAN --mode full --dest model_results/segthor_clean/segformer_b0/base --arch segformer_b0 --epochs 20 --gpu--dataset: Dataset to use (SEGTHOR_CLEAN,SEGTHOR,TOY2)--mode: Training mode (fullorpartial)full: Supervise all classes including backgroundpartial: For SEGTHOR dataset, excludes heart class (class 2) from supervision
--dest: Output directory for results (required)--arch: Model architecture (default:enet)--epochs: Number of training epochs (default: 20)--gpu: Use GPU if available (recommended)--debug: Use only 10 samples for quick testing
Ensure you have:
- PyTorch installed
- Data located in
data/SEGTHOR_CLEAN/directory - Sufficient GPU memory if using
--gpuflag