Sovereign 8s.is mirror of standardgalactic/CryoAID
  • Python 91.6%
  • HTML 6.7%
  • Shell 1.5%
  • TeX 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-11-24 09:29:01 +08:00
heatmaps/configs First submit 2024-11-26 15:03:05 +08:00
models update codea 2025-07-16 11:00:19 +08:00
presets First submit 2024-11-26 15:03:05 +08:00
transfer/AI_FFPE_main update codes 2025-07-16 10:57:32 +08:00
utils First submit 2024-11-26 15:03:05 +08:00
vis_utils First submit 2024-11-26 15:03:05 +08:00
wsi_core First submit 2024-11-26 15:03:05 +08:00
1-create_patches.sh First submit 2024-11-26 15:03:05 +08:00
2-extract_features.sh update codes 2025-07-16 10:56:24 +08:00
3-create_splits.sh update codes 2025-07-16 10:56:24 +08:00
4-train.sh update codes 2025-07-16 10:56:24 +08:00
4-train_external.sh update codes 2025-07-16 10:56:24 +08:00
5-eval.sh update codes 2025-07-16 10:56:24 +08:00
6-heatmap.sh First submit 2024-11-26 15:03:05 +08:00
build_preset.py First submit 2024-11-26 15:03:05 +08:00
create_heatmaps.py First submit 2024-11-26 15:03:05 +08:00
create_patches.py First submit 2024-11-26 15:03:05 +08:00
create_patches_fp.py First submit 2024-11-26 15:03:05 +08:00
create_splits_seq.py Update codes 2025-10-17 15:47:23 +08:00
create_splits_seq_kfold.py First submit 2024-11-26 15:03:05 +08:00
create_splits_seq_traval.py Update codes 2025-10-17 15:47:23 +08:00
environment.yml update envs 2024-12-11 10:54:23 +08:00
eval.py Update codes 2025-10-17 15:47:23 +08:00
extract_features_fp_FM_AIFFPE.py update codes 2025-07-16 10:56:24 +08:00
LICENSE Create LICENSE 2025-11-14 20:13:45 +08:00
main.py Update codes 2025-10-17 15:47:23 +08:00
main_external.py Update codes 2025-10-17 15:47:23 +08:00
plot_v3.py Update codes 2025-10-17 15:47:23 +08:00
README.md Update README.md 2025-11-24 09:29:01 +08:00
requirements.txt update envs 2024-12-11 10:54:23 +08:00
timm-0.5.4.tar Update codes 2025-10-17 15:47:23 +08:00

CryoAID

The codes for CryoAID. The datasets are available at https://zenodo.org/records/17373753 upon requests.

Prerequisites

Install

  • Clone this repo:
git clone https://github.com/MianxinLiu/CryoAID
cd CryoAID
  • For pip users, please type the command pip install -r requirements.txt. Note that for running CHIEF, one should create a copied environment, download "timm-0.5.4.tar" (offered here or their page) and install the tar.

  • For Conda users, you can create a new Conda environment using conda env create -f environment.yml.

Configuration

  • AI-FFPE: The code for AI-FFPE should be downloaded at https://github.com/DeepMIALab/AI-FFPE). In the paper we downloaded and used AI-FFPE pre-trained model parameter (Brain/FrozGanModels/wAtt_wLoss/Case-I). In addition, modify the --name and --checkpoints_dir argument in options/base_options.py. If you put the model under path as "PATH/wAtt_wLoss/Case-I", then --name=wAtt_wLoss/Case-I and --checkpoints_dir=PATH. Remember to add the path when running feature extraction (search "sys.path.append('/ailab/user/liumianxin/transfer/AI_FFPE_main/')" in "extract_features_fp_FM_AIFFPE.py" and set to your path).
  • FMs: For most of the FMs, one can refer to their origianl Github pages. For CHIEF model, note that they used a modified swimtransformer. For running CHIEF, one should create a copied environment, download "timm-0.5.4.tar" (offered here or their page) and install the tar (details refer to ctranspath or CHIEF model).

Training and Test

Run the bash files in order.

  • segment and patching: 1-create_patches.sh (can refer to CLAM at https://github.com/mahmoodlab/CLAM). It will generate tissue segmentation and patches for input slides.
  • extract features from pathches: 2-extract_features.sh. The base commend will run "extract_features_fp_FM_AIFFPE.py" to apply AI-FFPE and different pathology foundation model to extract feature from patches. The --no_gen argument can be set to skip AI-FFPE generation. --FM can select the foundation model after downloading the FM parameters and configuring the path. It is recommended to set the output path as "features_xxx" where "xxx" is the FM or setting (e.g. features_chief, features_resnet). This will benefit to the model training with different configurations.
  • train and test splits: 3-create_splits.sh. Generate cross-valiation splits from the excels in Dataset_csv folder. Notet that this bash generate splits with overlaps. Run "create_splits_seq_kfold.py" to obtain splits without overlaps. In addition, "create_splits_seq_traval.py" combines internal and external datasets to generate a split for external testing with a training on internal data.
  • train model: 4-train.sh. Modifing the feature_path parameter for ablation studies. Using other 4-train_external.sh for external evaluations. --model_type can specify the classifier model.
  • evaluate: 5-eval.sh. Evaluate trained model on desirde datasets.
  • visualize the heatmaps: 6-heatmap.sh (can refer to CLAM at https://github.com/mahmoodlab/CLAM).