Downloads · 30 days
0
SEARCH-IHI/ius
ius is a image classification model from SEARCH-IHI. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
[](https://github.com/innoisys/ius/) [](README.md) [](https://opensource.org/licenses/MIT)
Downloads · 30 days
0
Access
Public
Updated May 2, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py101 KB · 81%
From the Hugging Face model README
This repository currently contains the official PyTorch implementation of the IUS measure, introduced in "Interpretable Similarity of Synthetic Image Utility" , published in IEEE Transactions on Medical Imaging (TMI).
Status: This repository currently contains the official PyTorch code for IUS.
Pretrained checkpoints are not included yet and will be released separately.
IUS (Interpretable Utility Similarity) is an interpretable measure for assessing the utility of synthetic medical image datasets for downstream clinical decision support (CDS) tasks, built upon the EPU-CNN framework introduced in E pluribus unum interpretable convolutional neural networks and available in our previous code repository.
Clone the repository:
git clone https://github.com/innoisys/ius.git
cd ius
Install dependencies:
pip install -r requirements.txt
ius/
├── configs/ # YAML configuration files
├── data/ # Data loading and preprocessing
│ ├── data_utils.py # Common utilities for image/data handling
│ ├── dataloader.py # Dataloader definitions
│ ├── dataset.py # Dataset implementations
│ ├── loading.py # Dataset setup from YAML configuration
│ ├── parsers.py # Data parser implementations
│ └── perceptual_transforms.py # PFM (Perceptual Feature Map) generation
├── datasets/ # Real datasets for EPU-CNN training & baseline feature contribution profile estimation
├── datasets_synthetic/ # Synthetic data for IUS evaluation
├── ius/ # IUS implementation
│ ├── ius.py # IUS measure class
│ └── ius_eval_parser.py # Suggested synthetic data parser (not requiring label information)
├── model/ # EPU-CNN model implementation
│ ├── epu.py # Main EPU-CNN model definition
│ ├── module_mapping.py # Mappings from YAML config names to torch.nn layers/activations
│ ├── register_modules.py # Registry for configurable model components
│ ├── subnetworks.py # Subnetwork implementation
│ └── subnetwork_utilities.py # Subnetwork helper modules
├── results/ # Training and inference outputs
│ ├── cb_vectors.py # Saved baseline feature contribution profiles (from infer_cb_vector.py)
│ ├── checkpoints.py # Saved EPU-CNN checkpoints and training configurations (from train_epu.py)
│ ├── classification_performance.py # Classification performance results (from infer_epu.py)
│ ├── ius_eval.py # IUS evaluation results (from eval_ius.py)
│ └── logs.py # TensorBoard logs (from train_epu.py )
├── scripts/ # Training and inference scripts
│ ├── eval_ius.py # Runs synthetic data evaluation with IUS
│ ├── infer_cb_vector.py # Estimates baseline feature contribution profiles
│ ├── infer_epu.py # Runs EPU-CNN inference/evaluation
│ └── train_epu.py # Trains EPU-CNN models
└── utils/ # Utility functions
├── callbacks.py # Training callbacks
├── config_utils.py # YAML/configuration utilities
├── early_stopping.py # Early stopping logic
├── eval_utils.py # Utilities for EPU-CNN evaluation scripts
├── metrics.py # Classification performance metrics
├── omega_parser.py # OmegaConf-based configuration parser
├── sanity_utils.py # Configuration validation and sanity checks
├── tensorboard.py # Tensorboard utilities
├── train_utils.py # Training setup and helping utilities
└── trainer.py # Main training loop implementation
Create a YAML configuration file in configs/ with the following structure:
model:
num_subnetworks: 4 # set to 4, corresponds to number of perceptual feature maps,
num_classes: 1
epu_activation: "sigmoid"
subnetwork_config:
architecture: "base_one" # default ius backbone
input_channels: 1 # number of channels in perceptual feature decomposition, set to 1
base_channels: 32
fc_hidden_units: 64
pred_activation: "tanh"
data_params:
dataset_path: "../datasets/dataset_name"
images_extension: "jpg"
data_loading:
batch_size: 64
shuffle: true
num_workers: 0
pin_memory: false
persistent_workers: false
data_preprocessing:
data_mode: "rgb" # "rgb" or "grayscale"
data_parser: "filename" # "filename" or "folder" or "medmnist"
resize_dims: [128, 128]
medmnist_csv_file: None
label_mapping:
abnormal: 1
normal: 0
train_params:
mode: "binary"
loss: "binary_cross_entropy"
epochs: 200
optimizer: "sgd"
learning_rate: 0.001
momentum: 0.9
weight_decay: 0.001
early_stopping_patience: 30
early_stopping_monitor: "val_loss" # "val_loss" or "val_metrics.auc"
early_stopping_mode: "min" # "min" or "max"
log_dir: "../results/logs" # default parent path
checkpoint_dir: "../results/checkpoints" # default parent path
experiment_name: "ius_dataset_name" # desired experiment path
Key Points:
n_classes: 1, epu_activation: "sigmoid"input_size and batch_size based on your GPU memorylabel_mapping according to your dataset classesEPU-CNN training supports multiple dataset organization patterns. Complete examples are provided below:
datasets/
├── dataset_name/
├── train/
│ ├── abnormal_001.jpg
│ ├── abnormal_002.jpg
│ ├── normal_001.jpg
│ ├── normal_002.jpg
├── validation/
│ ├── abnormal_003.jpg
│ ├── normal_003.jpg
└── test/
├── abnormal_004.jpg
└── normal_004.jpg
Configuration Example:
data_params:
dataset_path: "../datasets/dataset_name"
images_extension: "jpg"
data_preprocessing:
data_mode: "rgb" # "rgb" or "grayscale"
data_parser: "filename"
resize_dims: [128, 128]
medmnist_csv_file: None
label_mapping:
abnormal: 1
normal: 0
Key Points:
datasets/
├── dataset_name/
├── train/
│ ├── abnormal
│ │ ├── image_001.jpg
│ │ └── image_002.jpg
│ └── normal
│ ├── image_001.jpg
│ └── image_002.jpg
├── validation/
│ ├── abnormal
│ │ └── image_003.jpg
│ └── normal
│ └── image_003.jpg
└── test/
├── abnormal
│ └── image_004.jpg
└── normal
└── image_004.jpg
Configuration Example:
data_params:
dataset_path: "../datasets/dataset_name"
images_extension: "jpg"
data_preprocessing:
data_mode: "rgb" # "rgb" or "grayscale"
data_parser: "folder"
resize_dims: [128, 128]
medmnist_csv_file: None
label_mapping:
abnormal: 1
normal: 0
Key Points:
datasets/
├── pneumoniamnist/
│ ├── pneumoniamnist.csv
│ ├── test_0_0.png
│ ├── test_1_1.png
│ ├── train_0_1.png
│ ├── train_1_0.png
│ ├── train_2_0.png
│ ├── train_3_1.png
│ ├── val_0_1.png
│ └── val_1_0.png
Configuration Example:
data_params:
dataset_path: "../datasets/pneumoniamnist"
images_extension: "png"
data_preprocessing:
data_mode: "rgb" # "rgb" or "grayscale"
data_parser: "folder"
resize_dims: [128, 128]
medmnist_csv_file: "../datasets/pneumoniamnist/pneumoniamnist.csv"
label_mapping:
pneumonia: 1
normal: 0
Key Points:
To train EPU-CNN, run one of the following commands after setting up a config.yaml file:
# Basic training
python scripts/train_epu.py --config_filepath configs/train_config.yaml
# Training with TensorBoard monitoring
python scripts/train_epu.py --config_filepath configs/train_config.yaml --tensorboard
The script saves trained model checkpoints and YAML training config in results/checkpoints under automatically generated name as: {experiment_name}{subnetwork_backbone}{run_id}_{timestamp}
When using the --tensorboard flag, the script automatically:
logs directoryhttp://localhost:6006To assess the classification performance of a trained EPU-CNN model run:
python scripts/infer_epu.py --experiment_folder_name ius_dataset_name_base_one_0000_timestamp
For each trained EPU-CNN model instance, the baseline feature contribution profile must be estimated only once using ether:
# Estimates all baseline feature contribution profiles
python scripts/infer_cb_vector.py --experiment_folder_name ius_dataset_name_base_one_0000_timestamp
# Estimates the baseline feature contribution profile of a single class
python scripts/infer_cb_vector.py --experiment_folder_name ius_dataset_name_base_one_0000_timestamp --cb_data normal
To evaluate the utility of synthetic images using IUS, run:
# For synthetic dataset IUS evaluation
python scripts/eval_ius.py --experiment_folder_name ius_dataset_name_base_one_0000_timestamp --cb_vector_tag normal --synthetic_images datasets_synthetic/dataset_name/normal --synthetic_img_extension png
# For a single image IUS evaluation
python scripts/eval_ius.py --experiment_folder_name ius_dataset_name_base_one_0000_timestamp --cb_vector_tag normal --synthetic_images datasets_synthetic/dataset_name/normal/seed_000.png --synthetic_img_extension png
Both commands produce two outputs saved under results/ius_eval/{experiment_folder_name}
Key Points:
Suggested synthetic data structure
datasets_synthetic/
├── dataset_name/
├── normal/
├── seed_000.png
└── seed_001.png
If you use this code or find our work useful in your research, please cite:
APA
P. Gatoula, G. Dimas and D. K. Iakovidis, "Interpretable Similarity of Synthetic Image Utility," in IEEE Transactions on Medical Imaging, doi: 10.1109/TMI.2026.3679527.
BibTeX
@article{
author = {Panagiota Gatoula and George Dimas and Dimitris K. Iakovidis},
title = {Interpretable Similarity of Synthetic Image Utility},
journal = {IEEE Transactions on Medical Imaging},
year = {2026},
publisher = {IEEE},
doi = {10.1109/TMI.2026.3679527}
}
Prof. Dimitris Iakovidis
Director of Biomedical Imaging Lab
University of Thessaly
This project is licensed under the MIT License.