M2ORT: Many-To-One Regression Transformer for Spatial Transcriptomics Prediction from Histopathology Images

April 16, 2025 ยท View on GitHub

This is a preview of the code for M2ORT. Please do not redistribute it without contacting the authors as we have not included the LICENSE file yet.

Please note that this is NOT the code for our AAAI 2025 work M2OST. M2OST has a different network structure design, so the pretrained weights in this repo won't work on M2OST. We are still sweeping the code of M2OST right now, so please wait for that part of release with patient. You are welcome to send a pull request for any repos.

1. Clone the code

Clone the code by running:

git clone git@github.com/Dootmaan/M2ORT.git

then cd into this directory.

2. Prepare your datasets

Download the datasets from their official site.

3. Train or validate the model

Start training the M2ORT model using the following command:

CUDA_VISIBLE_DEVICES=0,1 nohup python3 -u train_m2ort.py --dataset HBC --dataset_path='/your/path/to/dataset' --variant [small,base,large] --checkpoint './weights/your_checkpoint.pth' >train_m2ort.log 2>&1