Lucius-lsr / HSHR

6 stars 1 forks source link

HSHR

Hypergraph-Guided Self-Supervised Hashing-Encoding Retrieval

Method and codes of the paper: Hypergraph-Guided Slide-Level Histology Retrieval with Self-Supervised Hashing.

Requirement

Usage

THe following steps show how to run HSHR in your device.

Step 1: Data Organization

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

Step 2: Preprocessing

To preprocess the raw WSIs, you need to specify the following arguments:

Step 3: SSL Encoder Training

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

Step 4: Hypergraph-guided Retrieval

To retrieve with HSHR, you need to specify the following arguments: