camil-iclr-clone
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.7%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: kuro2907
- Language: Python
- Default Branch: main
- Size: 360 MB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
CAMIL: Context-Aware Multiple Instance Learning for Cancer Detection and Subtyping in Whole Slide Images (ICLR 2024 spotlight)
Tensorflow implementation for the multiple instance learning model described in the paper CAMIL (work in progress)
Pipeline Overview

Model Workflow
- WSI Preprocessing: Segment and tile WSIs.
- Feature Extraction: Extract 1024-dimensional feature representations using a pre-trained model.
- Feature Transformation: A Nystromformer module enhances feature embeddings.
- Neighbor-Constrained Attention: Captures spatial dependencies between patches.
- Final Classification: Aggregates tile-level scores to generate the final slide classification.
Installation
Two separate conda environments are used for different stages of the workflow: - dl_torch for WSI preprocessing and feature extraction - alma for model training and evaluation
To create and activate these environments, run the following commands: bash $ conda env create --name torchenv --file torchenv.yml $ conda activate torch_env
WSI preprocessing
we follow the CLAM's WSI processing solution (https://github.com/mahmoodlab/CLAM)
bash
WSI Segmentation and Patching
python createpatchesfp.py --source DATADIRECTORY --savedir PATCHESRESULTSDIRECTORY --patchsize 256 --preset bwhbiopsy.csv --seg --patch --stitch
- source: Path to the input WSI dataset.
- save_dir: Output directory for the extracted patches.
- patch_size: Tile size (default: 256x256).
- preset: CSV preset for segmentation parameters.
Feature extraction
Extract features using pre-trained weights and save them to the output directory.
WSI Segmentation and Patching
python featureextractor/computefeats.py --weights weightdir/*.pth --dataset "PATCHESRESULTSDIRECTORY/*" --output FEATRESULTSDIRECTORY --slidedir DATA_DIRECTORY
- weight_dir: Directory containing checkpoints, one from the TCGA-NSCLC and the other from Calmeyon-16.
- output_dir: Directory where the H5 files are stored.
- slide_dir: Directory where the slides are stored.
Train
Run model training using extracted features. python run.py --experimentname EXPNAME --epoch 30 --featurepath FEATRESULTSDIRECTORY --labelfile LABELFILE --csvfile SPLITDIR --savedir WEIGHT_DIR
- experiment_name: The name of the experiment.
- epoch: The number of training epochs.
- feature_path: The path where the features are stored.
- label_file: The path to the CSV file containing labels.
- csv_file: The path to the CSV file containing data splits.
- save_dir: The directory where the weights are saved stored.
The label file should be a CSV file with the following comma-separated fields: caseid, slideid, label, slide_label
Test
Run model evaluation on test data. python run.py --experimentname EXPNAME --test --featurepath FEATRESULTSDIRECTORY --labelfile LABELFILE --csvfile SPLITDIR --savedir WEIGHT_DIR
- experiment_name: The name of the experiment.
- feature_path: The path where the features are stored.
- label_file: The path to the CSV file containing labels.
- csv_file: The path to the CSV file containing data splits.
- save_dir: The directory where the weights are saved stored.
- test: Flag indicating the test stage
If you use this code, please cite our work using:
```bibtex @inproceedings{fourkioti2024camil, title={{CAMIL}: Context-Aware Multiple Instance Learning for Cancer Detection and Subtyping in Whole Slide Images}, author={Olga Fourkioti and Matt {De Vries} and Chris Bakal}, booktitle={The Twelfth International Conference on Learning Representations}, year={2024}, url={https://openreview.net/forum?id=rzBskAEmoc} }
Owner
- Login: kuro2907
- Kind: user
- Repositories: 1
- Profile: https://github.com/kuro2907
GitHub Events
Total
- Member event: 1
- Push event: 5
- Create event: 1
Last Year
- Member event: 1
- Push event: 5
- Create event: 1
Dependencies
- absl-py ==2.2.2
- aiohappyeyeballs ==2.6.1
- aiohttp ==3.12.0
- aiosignal ==1.3.2
- astunparse ==1.6.3
- async-timeout ==5.0.1
- attrs ==25.3.0
- cachetools ==5.5.2
- certifi ==2025.4.26
- charset-normalizer ==3.4.2
- datasets ==3.6.0
- dill ==0.3.8
- einops ==0.4.1
- filelock ==3.18.0
- flatbuffers ==25.2.10
- frozenlist ==1.6.0
- fsspec ==2025.3.0
- gast ==0.4.0
- google-auth ==2.40.2
- google-auth-oauthlib ==1.0.0
- google-pasta ==0.2.0
- grpcio ==1.71.0
- h5py ==3.13.0
- hf-xet ==1.1.2
- huggingface-hub ==0.32.0
- idna ==3.10
- joblib ==1.5.1
- keras ==2.13.1
- libclang ==18.1.1
- markdown ==3.8
- markupsafe ==3.0.2
- multidict ==6.4.4
- multiprocess ==0.70.16
- numpy ==1.24.3
- oauthlib ==3.2.2
- opt-einsum ==3.4.0
- pandas ==2.2.3
- propcache ==0.3.1
- protobuf ==4.25.7
- pyarrow ==20.0.0
- pyasn1 ==0.6.1
- pyasn1-modules ==0.4.2
- pytz ==2025.2
- pyyaml ==6.0.2
- requests ==2.32.3
- requests-oauthlib ==2.0.0
- rsa ==4.9.1
- scikit-learn ==1.6.1
- scipy ==1.13.1
- tensorboard ==2.13.0
- tensorboard-data-server ==0.7.2
- tensorflow ==2.13.1
- tensorflow-addons ==0.17.0
- tensorflow-estimator ==2.13.0
- tensorflow-macos ==2.13.1
- termcolor ==3.1.0
- threadpoolctl ==3.6.0
- tqdm ==4.67.1
- typeguard ==4.4.2
- tzdata ==2025.2
- urllib3 ==2.4.0
- werkzeug ==3.1.3
- wrapt ==1.17.2
- xxhash ==3.5.0
- yarl ==1.20.0