Sidaty El Hadramy1 · Nazim Haouchine2 · Michael Wehrli1 · Philippe C. Cattin1
1 Department of Biomedical Engineering, University of Basel, Allschwil, Switzerland | 2 Harvard Medical School, Brigham and Women's Hospital, Boston, United States
This repository contains the implementation of NOIR, a framework that reformulates medical imaging tasks as a function mapping problem by learning mappings between Implicit Neural Representations (INRs) using a Neural Operator. We provide an example on the Shenzhen chest X-ray dataset, covering training of the input INR, output INR, and Neural Operator, as well as a test script to reproduce our segmentation results.
Running the test script produces the following sample outputs:
We use the Shenzhen Hospital Chest X-ray Dataset, publicly available from the U.S. National Library of Medicine. Download it online
Once downloaded, set the dataset path in the relevant config files under config/shenzhen/ (look for the data.path field). We provide the train/val/test split used in our experiments as a JSON file in the same directory, add it within your daset folder, next to img/ and mask/ folders.
NOIR/
├── noir/ # Core source code
│ ├── datasets.py # Dataset implementations (Shenzhen single, segmentation, paired)
│ ├── inrs.py # ModulatedSIREN implementation
│ ├── metalearning.py # Inner/outer loop optimization of INRs (MAML-style)
│ ├── no.py # Neural Operator architecture
│ └── utils.py # Utility functions
│
├── train/ # Training scripts
│ ├── train_input_inr.py # Train the input INR
│ ├── train_output_inr.py # Train the output INR
│ └── train_no.py # Train the Neural Operator
│
├── test/ # Test scripts
│ └── test_no.py # End-to-end test of the Neural Operator
│
├── config/shenzhen/ # Configuration files
│ ├── train_input_inr.yaml
│ ├── train_output_inr.yaml
│ ├── train_no.yaml
│ └── test_no.yaml
│
├── models/ # Pretrained weights
│ ├── input_inr.pth # Input INR weights
│ ├── output_inr.pth # Output INR weights
│ └── neural_operator.pth # Neural Operator weights
│
├── output/ # All results are saved here (auto-created)
│ ├── train/
│ │ ├── input_inr/ # Input INR training results
│ │ ├── output_inr/ # Output INR training results
│ │ └── no/ # Neural Operator training results
│ └── test/
│ └── no/ # Neural Operator test results and visualizations
│
├── assets/img/ # Figures
├── environment.yml # Conda environment file
└── README.md
| File | Description |
|---|---|
inrs.py |
Implementation of the modulated SIREN used as the INR backbone, including SirenLayer, Siren, and ModulatedSiren
|
metalearning.py |
Handles INR optimization via inner/outer loop meta-learning, including inner_loop and outer_step
|
no.py |
Neural Operator MLP that maps input latent codes |
datasets.py |
Dataset classes for the Shenzhen example: ShenzhenSingleImageDataset, ShenzhenSegmentationDataset, and ShenzhenPairedDataset
|
utils.py |
Shared utilities (resolution degradation, logging, etc.) |
We provide a conda environment file for easy setup.
1. Create the environment:
conda env create -f noir_environment.yml2. Activate the environment:
conda activate noirNote on CUDA: The
environment.ymltargets CUDA 11.8 by default. If you are on CUDA 12, edit the file and replacepytorch-cuda=11.8withpytorch-cuda=12.1before creating the environment.
We provide pretrained weights for all three components in the models/ directory:
| Model | File | Description |
|---|---|---|
| Input INR | models/shenzhen_input_inr.pth |
Modulated SIREN fitted on chest X-ray images |
| Output INR | models/shenzhen_output_inr.pth |
Modulated SIREN fitted on lung segmentation masks |
| Neural Operator | models/shenzhen_neural_operator.pth |
NO mapping |
Download the Shenzhen dataset, set its path in config/shenzhen/test_no.yaml, and run:
python -m test.test_no --config ./config/shenzhen/test_no.yamlThe split JSON file used in our experiments is provided alongside the config. Results and visualizations will be saved to output/test/no/.
Each component can be trained independently using its respective script and config file.
Train the Input INR (fits modulated SIRENs on input images):
python -m train.train_input_inr --config ./config/shenzhen/train_input_inr.yamlTrain the Output INR (fits modulated SIRENs on segmentation masks):
python -m train.train_output_inr --config ./config/shenzhen/train_output_inr.yamlTrain the Neural Operator (learns the latent-to-latent mapping):
python -m train.train_no --config ./config/shenzhen/train_no.yamlTraining the INRs first is required before training the Neural Operator, as the NO is trained on the latent codes produced by the fitted INRs.


