Hypergraph-Guided Self-Supervised Hashing-Encoding Retrieval
Method and codes of the paper: Hypergraph-Guided Slide-Level Histology Retrieval with Self-Supervised Hashing.
THe following steps show how to run HSHR in your device.
Make the ./WSI
folder, download whole slide images there, and simply organize them into the following structure.
WSI
└── SUBTYPE_1
└── TCGA-XXXX-PID01-XXXX-XXXX.svs
TCGA-XXXX-PID01-XXXX-XXXX.svs
TCGA-XXXX-PID02-XXXX-XXXX.svs
TCGA-XXXX-PID03-XXXX-XXXX.svs
SUBTYPE_2
└── TCGA-XXXX-PID04-XXXX-XXXX.svs
TCGA-XXXX-PID04-XXXX-XXXX.svs
TCGA-XXXX-PID05-XXXX-XXXX.svs
TCGA-XXXX-PID05-XXXX-XXXX.svs
SUBTYPE_3
└── TCGA-XXXX-PID06-XXXX-XXXX.svs
TCGA-XXXX-PID07-XXXX-XXXX.svs
TCGA-XXXX-PID08-XXXX-XXXX.svs
To preprocess the raw WSIs, you need to specify the following arguments:
python preprocess.py --SVS_DIR THE/PATH/OF/YOUR/WSI/DATASETS --RESULT_DIR A/PATH/TO/SAVE/YOUR/PREPROCESSED/RESULTS --TMP THE/PATH/TO/SAVE/SOME/NECESSARY/TMP/FILES
To train your SSL hash encoder, you need to specify the following arguments:
python ssl_encoder_training.py --RESULT_DIR A/PATH/TO/SAVE/YOUR/PREPROCESSED/RESULTS --TMP THE/PATH/TO/SAVE/SOME/NECESSARY/TMP/FILES --MODEL_DIR = A/PATH/TO/SAVE/YOUR/TRAINED/HASH/ENCODER/MODEL --DATASETS SUBTYPE_A SUBTYPE_B SUBTYPE_C
To retrieve with HSHR, you need to specify the following arguments:
python hypergraph_retrieval.py --MODEL_DIR = A/PATH/TO/SAVE/YOUR/TRAINED/HASH/ENCODER/MODEL --DATASETS SUBTYPE_A SUBTYPE_B SUBTYPE_C --RESULT_DIR A/PATH/TO/SAVE/YOUR/PREPROCESSED/RESULTS --TMP THE/PATH/TO/SAVE/SOME/NECESSARY/TMP/FILES