Skip to content

repo for FengRu Cup 2024: Survival Analysis based on medical image

License

Notifications You must be signed in to change notification settings

Frankie-Dejong/Survival-Analysis

Repository files navigation

Cancer Prediction

Our work takes inspiration from the paper Histopathology images predict multi-omics aberrations and prognoses in colorectal cancer patients, and make some essential changes for better performance.

Requirements

conda create --name your_env_name python=3.10
conda activate your_env_name
pip install -r requirements.txt

Openslide

pip install Openslide-python

For Windows:

Download from OpenSlide, add bin and lib to environment variables.

If you encounter any errors during the import openslide process, find the file lowlevel.py from your error message, then add the code following:

import os
os.add_dll_directory("<your openslide bin path>")

For Ubuntu:

sudo apt install openslide-tools

Data Preparation

TCGA

Data source: GDC Data Portal

Filter:

  • Cases
    • Primary Site: colon, rectum
    • Program: TCGA
    • Project: TCGA-COAD, TCGA-READ
  • Files
    • Data Type: Slide Image
    • Experimental Strategy: Tissue Slide

Download tool: gdc-data-transfer-tool

Data Proprocessing

To run our code, change the configuration at configuration/tcga_cfg.yaml.

Processing TCGA

To get norms from TCGA slides, run

python data_preprocessing/main.py --norm_only

To pretrain our cnn model for feature extraction, run

python pretrain/train.py

Extract Features

After pretraining, to extract features from TCGA slides, run

python data_preprocessing/main.py

Train

To train our model for survival prediction, run

python survival_prediction/train.py

Evaluation

To evaluate our model, run

python survival_prediction/eval.py

About

repo for FengRu Cup 2024: Survival Analysis based on medical image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages