Backup full source code, Step 1 results CSVs, logs, and README
Browse files- README.md +46 -0
- code/1p19q.pkl +3 -0
- code/IDH.pkl +3 -0
- code/LHG.pkl +3 -0
- code/Train_CMTLNet_Step1.py +744 -0
- code/Train_CMTLNet_Step2.py +693 -0
- code/check_keys.py +11 -0
- code/clinicaldata.csv +502 -0
- code/config.py +54 -0
- code/dataLoder/dataload_utils.py +383 -0
- code/dataLoder/loader_S1.py +477 -0
- code/dataLoder/loader_S2.py +397 -0
- code/mke_pkl.py +89 -0
- code/model/CMTLNet.py +481 -0
- code/model/densenet.py +345 -0
- code/model/utils.py +488 -0
- code/survivalstandalone/dataset.py +142 -0
- code/survivalstandalone/losses.py +64 -0
- code/survivalstandalone/model.py +54 -0
- code/survivalstandalone/train.py +108 -0
- code/utiles.py +151 -0
- logs/step1_nohup.log +0 -0
- results/CFE/Fold_0/log_1p19q.csv +61 -0
- results/CFE/Fold_0/log_IDH.csv +61 -0
- results/CFE/Fold_0/log_LHG.csv +61 -0
- results/CFE/Fold_0/log_mean.csv +61 -0
- results/CFE/Fold_1/log_1p19q.csv +61 -0
- results/CFE/Fold_1/log_IDH.csv +61 -0
- results/CFE/Fold_1/log_LHG.csv +61 -0
- results/CFE/Fold_1/log_mean.csv +61 -0
- results/CFE/Fold_2/log_1p19q.csv +61 -0
- results/CFE/Fold_2/log_IDH.csv +61 -0
- results/CFE/Fold_2/log_LHG.csv +61 -0
- results/CFE/Fold_2/log_mean.csv +61 -0
- results/CFE/Fold_3/log_1p19q.csv +61 -0
- results/CFE/Fold_3/log_IDH.csv +61 -0
- results/CFE/Fold_3/log_LHG.csv +61 -0
- results/CFE/Fold_3/log_mean.csv +61 -0
- results/CFE/Fold_4/log_1p19q.csv +61 -0
- results/CFE/Fold_4/log_IDH.csv +61 -0
- results/CFE/Fold_4/log_LHG.csv +61 -0
- results/CFE/Fold_4/log_mean.csv +61 -0
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
task_categories:
|
| 4 |
+
- tabular-classification
|
| 5 |
+
- image-classification
|
| 6 |
+
- feature-extraction
|
| 7 |
+
tags:
|
| 8 |
+
- medical-imaging
|
| 9 |
+
- glioma
|
| 10 |
+
- multi-task-learning
|
| 11 |
+
- survival-analysis
|
| 12 |
+
- cmtlnet
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# CMTLNet: Cooperative Multi-Task Learning for Glioma Subtyping & Survival Analysis
|
| 16 |
+
|
| 17 |
+
This repository contains the checkpoints, trained models, logs, results, and source code for the **CMTLNet** framework.
|
| 18 |
+
|
| 19 |
+
## 🏆 Step 1: 5-Fold Cross-Validation CFE Performance
|
| 20 |
+
|
| 21 |
+
Stage 1 trains the **Common Feature Extractor (CFE)** across all 5 folds (60 epochs each) on three cooperative clinical tasks:
|
| 22 |
+
1. **1p/19q Co-deletion** (INT vs CODEL)
|
| 23 |
+
2. **IDH Mutation** (Wildtype vs Mutant)
|
| 24 |
+
3. **Tumor Grade (LHG)** (LGG Grade 2/3 vs HGG Grade 4)
|
| 25 |
+
|
| 26 |
+
### Cross-Validation Summary:
|
| 27 |
+
|
| 28 |
+
| Fold | Epochs | Best Test F1 (Macro) | Best Accuracy | Best Epoch | Checkpoint Path in Repo |
|
| 29 |
+
| :---: | :---: | :---: | :---: | :---: | :--- |
|
| 30 |
+
| **Fold 0** | 60 | **78.04%** | 91.42% | Epoch 7 | `best_models/fixedone/Fold_0/CFE_F1_78.04_step_3088.pkl` |
|
| 31 |
+
| **Fold 1** | 60 | **73.22%** | 93.00% | Epoch 13 | `best_models/fixedone/Fold_1/CFE_F1_73.22_step_5432.pkl` |
|
| 32 |
+
| **Fold 2** | 60 | **77.30%** | 89.67% | Epoch 7 | `best_models/fixedone/Fold_2/CFE_F1_77.30_step_3112.pkl` |
|
| 33 |
+
| **Fold 3** | 60 | **73.91%** | 85.33% | Epoch 4 | `best_models/fixedone/Fold_3/CFE_F1_73.91_step_1945.pkl` |
|
| 34 |
+
| **Fold 4** | 60 | **78.47%** | 88.33% | Epoch 6 | `best_models/fixedone/Fold_4/CFE_F1_78.47_step_2744.pkl` |
|
| 35 |
+
|
| 36 |
+
**Mean 5-Fold Cross-Validation Test F1:** **76.19%**
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## 📁 Repository Structure
|
| 41 |
+
|
| 42 |
+
- `best_models/fixedone/Fold_{0..4}/`: Best performing CFE model weights for each fold.
|
| 43 |
+
- `checkpoints/fixedone/`: Intermediate training checkpoints saved every 5 epochs and final epoch 59.
|
| 44 |
+
- `results/CFE/Fold_{0..4}/`: Complete epoch-by-epoch CSV evaluation metrics (`log_mean.csv`, `log_1p19q.csv`, `log_IDH.csv`, `log_LHG.csv`).
|
| 45 |
+
- `logs/`: Complete runtime logs (`step1_nohup.log`).
|
| 46 |
+
- `code/`: Complete source code, models, dataset split pickles, and config files for Step 1 & Step 2.
|
code/1p19q.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cd67ccefb96cf9c1ad38f12f6dd7b7175695c29f34d0343694e495bffcea2508
|
| 3 |
+
size 46431
|
code/IDH.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3d4d48abff34187d2e50913fa64f64eb8696cbfdd092ebd997e41356e2f739c6
|
| 3 |
+
size 46431
|
code/LHG.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5dd1bd28b1c5180e10c0dcf27b0e9f36b509d49bafa1dbe413677411ec2c80f4
|
| 3 |
+
size 46431
|
code/Train_CMTLNet_Step1.py
ADDED
|
@@ -0,0 +1,744 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
| 3 |
+
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True" # <--- ADD THIS
|
| 4 |
+
import torch
|
| 5 |
+
import config
|
| 6 |
+
import monai
|
| 7 |
+
import warnings
|
| 8 |
+
import numpy as np
|
| 9 |
+
import pandas as pd
|
| 10 |
+
import psutil # <--- ADDED FOR MEMORY MONITORING
|
| 11 |
+
import wandb
|
| 12 |
+
|
| 13 |
+
# --- ADDED FOR HUGGING FACE ---
|
| 14 |
+
try:
|
| 15 |
+
import huggingface_hub
|
| 16 |
+
except ImportError:
|
| 17 |
+
print("⚠️ huggingface_hub not installed. Please run: pip install huggingface-hub")
|
| 18 |
+
|
| 19 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 20 |
+
if HF_TOKEN:
|
| 21 |
+
print("✅ Hugging Face token found — will upload checkpoints to cloud")
|
| 22 |
+
else:
|
| 23 |
+
print("⚠️ HF_TOKEN not set — checkpoints will only be saved locally")
|
| 24 |
+
# ------------------------------
|
| 25 |
+
|
| 26 |
+
from model.CMTLNet import CFE
|
| 27 |
+
|
| 28 |
+
from torch.nn import CrossEntropyLoss
|
| 29 |
+
from torch.utils.data import DataLoader
|
| 30 |
+
from torch.optim.lr_scheduler import ReduceLROnPlateau
|
| 31 |
+
from dataLoder.loader_S1 import TrainDataLoader_balance as TrainDataLoader
|
| 32 |
+
from dataLoder.loader_S1 import TestDataLoader
|
| 33 |
+
from utiles import save_model, get_learning_rate, calculate_classification_metrics, move_tensor_to_device, AverageMeter
|
| 34 |
+
from torch.cuda.amp import autocast, GradScaler # <--- ADDED AMP IMPORT
|
| 35 |
+
|
| 36 |
+
def validate(data_loader, model, mode_flag, ssl_index, class_name):
|
| 37 |
+
"""
|
| 38 |
+
Validates the model on a given dataset and computes loss and classification metrics.
|
| 39 |
+
|
| 40 |
+
Parameters:
|
| 41 |
+
data_loader (DataLoader): DataLoader for the dataset to validate.
|
| 42 |
+
model (torch.nn.Module): The model to validate.
|
| 43 |
+
mode_flag (str): Indicates whether the dataset is 'Train' or 'Test'.
|
| 44 |
+
ssl_index (int): SSL index used for model prediction.
|
| 45 |
+
class_name (str): Name of the class/category being validated.
|
| 46 |
+
|
| 47 |
+
Returns:
|
| 48 |
+
tuple: Contains average loss, accuracy, F1 score, precision, and recall.
|
| 49 |
+
"""
|
| 50 |
+
model.eval() # Set model to evaluation mode
|
| 51 |
+
cross_entropy_loss = CrossEntropyLoss(reduction='mean') # Define cross-entropy loss
|
| 52 |
+
all_targets, all_predictions = [], [] # Lists to store all true labels and predictions
|
| 53 |
+
loss_meter = AverageMeter() # Utility to track average loss
|
| 54 |
+
|
| 55 |
+
for batch_data in data_loader:
|
| 56 |
+
images, labels = batch_data
|
| 57 |
+
images = move_tensor_to_device(images, use_gpu=config.use_cuda) # Move images to GPU if available
|
| 58 |
+
labels = move_tensor_to_device(labels, use_gpu=config.use_cuda) # Move labels to GPU if available
|
| 59 |
+
|
| 60 |
+
with torch.no_grad(): # Disable gradient computation
|
| 61 |
+
outputs = model.predict(images, ssl_index) # Get model predictions
|
| 62 |
+
loss = cross_entropy_loss(outputs, labels) # Compute loss
|
| 63 |
+
loss_meter.update(loss.item(), 1) # Update loss meter
|
| 64 |
+
probabilities = torch.nn.functional.softmax(outputs, dim=1) # Compute probabilities
|
| 65 |
+
predicted_classes = torch.argmax(probabilities, dim=1).cpu().numpy() # Get predicted classes
|
| 66 |
+
true_labels = labels.cpu().detach().numpy() # Get true labels
|
| 67 |
+
all_predictions.extend(predicted_classes) # Collect predictions
|
| 68 |
+
all_targets.extend(true_labels) # Collect true labels
|
| 69 |
+
|
| 70 |
+
average_loss = loss_meter.average # Calculate average loss
|
| 71 |
+
all_predictions = np.array(all_predictions, dtype=np.int32)
|
| 72 |
+
all_targets = np.array(all_targets, dtype=np.int32)
|
| 73 |
+
# Compute classification metrics: Accuracy, F1, Precision, Recall, and Confusion Matrix
|
| 74 |
+
accuracy, f1, precision, recall, confusion_matrix = calculate_classification_metrics(
|
| 75 |
+
predictions=all_predictions,
|
| 76 |
+
targets=all_targets,
|
| 77 |
+
average_method="macro"
|
| 78 |
+
)
|
| 79 |
+
print(confusion_matrix) # Print confusion matrix
|
| 80 |
+
|
| 81 |
+
# Print metrics based on whether it's training or testing
|
| 82 |
+
if mode_flag == 'Test':
|
| 83 |
+
print(f'Test set {class_name} | Accuracy {accuracy:.4f} | F1 {f1:.4f} | Precision {precision:.4f} | Recall {recall:.4f} |')
|
| 84 |
+
else:
|
| 85 |
+
print(f'Train set {class_name} | Accuracy {accuracy:.4f} | F1 {f1:.4f} | Precision {precision:.4f} | Recall {recall:.4f} |')
|
| 86 |
+
|
| 87 |
+
model.train() # Set model back to training mode
|
| 88 |
+
|
| 89 |
+
return average_loss, accuracy, f1, precision, recall
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
def valid_metrics_by_class(model, train_loader, test_loader, ssl_index, class_name):
|
| 93 |
+
"""
|
| 94 |
+
Computes validation metrics for a specific class on both training and testing datasets.
|
| 95 |
+
|
| 96 |
+
Parameters:
|
| 97 |
+
model (torch.nn.Module): The model to validate.
|
| 98 |
+
train_loader (DataLoader): DataLoader for the training dataset.
|
| 99 |
+
test_loader (DataLoader): DataLoader for the testing dataset.
|
| 100 |
+
ssl_index (int): SSL index used for model prediction.
|
| 101 |
+
class_name (str): Name of the class/category being validated.
|
| 102 |
+
|
| 103 |
+
Returns:
|
| 104 |
+
tuple: Contains training metrics and testing metrics.
|
| 105 |
+
"""
|
| 106 |
+
# Validate on training data
|
| 107 |
+
train_loss, train_accuracy, train_f1, train_precision, train_recall = validate(
|
| 108 |
+
data_loader=train_loader,
|
| 109 |
+
model=model,
|
| 110 |
+
mode_flag='Train',
|
| 111 |
+
ssl_index=ssl_index,
|
| 112 |
+
class_name=class_name
|
| 113 |
+
)
|
| 114 |
+
|
| 115 |
+
# Validate on testing data
|
| 116 |
+
test_loss, test_accuracy, test_f1, test_precision, test_recall = validate(
|
| 117 |
+
data_loader=test_loader,
|
| 118 |
+
model=model,
|
| 119 |
+
mode_flag='Test',
|
| 120 |
+
ssl_index=ssl_index,
|
| 121 |
+
class_name=class_name
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
# Collect training and testing metrics
|
| 125 |
+
metrics_train = [train_loss, train_accuracy, train_f1, train_precision, train_recall]
|
| 126 |
+
metrics_test = [test_loss, test_accuracy, test_f1, test_precision, test_recall]
|
| 127 |
+
return metrics_train, metrics_test
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
def get_pandas_series(epoch, train_metrics, test_metrics):
|
| 131 |
+
"""
|
| 132 |
+
Creates a Pandas Series for logging metrics.
|
| 133 |
+
|
| 134 |
+
Parameters:
|
| 135 |
+
epoch (int): Current epoch number.
|
| 136 |
+
train_metrics (list): List of training metrics.
|
| 137 |
+
test_metrics (list): List of testing metrics.
|
| 138 |
+
|
| 139 |
+
Returns:
|
| 140 |
+
pd.Series: Series containing epoch and corresponding metrics.
|
| 141 |
+
"""
|
| 142 |
+
series = pd.Series([
|
| 143 |
+
epoch,
|
| 144 |
+
train_metrics[0], # Training loss
|
| 145 |
+
train_metrics[1], # Training accuracy
|
| 146 |
+
train_metrics[2], # Training F1 score
|
| 147 |
+
test_metrics[0], # Testing loss
|
| 148 |
+
test_metrics[1], # Testing accuracy
|
| 149 |
+
test_metrics[2], # Testing F1 score
|
| 150 |
+
], index=[
|
| 151 |
+
'epoch',
|
| 152 |
+
'Train_loss', 'Train_Accuracy', 'Train_F1',
|
| 153 |
+
'Val_loss', 'Val_Accuracy', 'Val_F1'
|
| 154 |
+
])
|
| 155 |
+
return series
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
def get_class_loaders(TrainDataset, TestDataset, transforms, fold, loader_id, pkl_path):
|
| 159 |
+
"""
|
| 160 |
+
Creates DataLoaders for training and validation datasets for a specific class.
|
| 161 |
+
|
| 162 |
+
Parameters:
|
| 163 |
+
TrainDataset (Dataset): Training dataset class.
|
| 164 |
+
TestDataset (Dataset): Testing dataset class.
|
| 165 |
+
transforms (Compose): Data transformation pipeline.
|
| 166 |
+
fold (int): Current fold number for cross-validation.
|
| 167 |
+
loader_id (str): Identifier for the class.
|
| 168 |
+
pkl_path (str): Path to the pickle file containing dataset information.
|
| 169 |
+
|
| 170 |
+
Returns:
|
| 171 |
+
tuple: Contains training DataLoader, validation training DataLoader, and validation testing DataLoader.
|
| 172 |
+
"""
|
| 173 |
+
# Create training dataset
|
| 174 |
+
train_dataset = TrainDataset(
|
| 175 |
+
mode='train',
|
| 176 |
+
fold=fold,
|
| 177 |
+
transform=transforms,
|
| 178 |
+
random_flag=config.random_flag,
|
| 179 |
+
pickle_path=pkl_path
|
| 180 |
+
)
|
| 181 |
+
|
| 182 |
+
# Create training DataLoader
|
| 183 |
+
train_loader = DataLoader(
|
| 184 |
+
train_dataset,
|
| 185 |
+
batch_size=config.batch_size,
|
| 186 |
+
shuffle=True,
|
| 187 |
+
drop_last=True,
|
| 188 |
+
num_workers=config.n_threads,
|
| 189 |
+
pin_memory=True, # Changed to True for Linux Server
|
| 190 |
+
prefetch_factor=4,
|
| 191 |
+
persistent_workers=True
|
| 192 |
+
)
|
| 193 |
+
print(f"Number of train_loader {loader_id} examples {len(train_dataset)}")
|
| 194 |
+
|
| 195 |
+
# Create validation training dataset
|
| 196 |
+
val_train_dataset = TestDataset(
|
| 197 |
+
mode='train',
|
| 198 |
+
fold=fold,
|
| 199 |
+
transform=transforms,
|
| 200 |
+
pickle_path=pkl_path
|
| 201 |
+
)
|
| 202 |
+
|
| 203 |
+
# Create validation training DataLoader
|
| 204 |
+
val_train_loader = DataLoader(
|
| 205 |
+
val_train_dataset,
|
| 206 |
+
batch_size=1,
|
| 207 |
+
shuffle=False,
|
| 208 |
+
drop_last=False,
|
| 209 |
+
num_workers=12,
|
| 210 |
+
pin_memory=True,
|
| 211 |
+
prefetch_factor=2,
|
| 212 |
+
persistent_workers=False
|
| 213 |
+
)
|
| 214 |
+
print(f"Number of val_train_loader {loader_id} examples {len(val_train_dataset)}")
|
| 215 |
+
|
| 216 |
+
# Create validation testing dataset
|
| 217 |
+
val_test_dataset = TestDataset(
|
| 218 |
+
mode='test',
|
| 219 |
+
fold=fold,
|
| 220 |
+
transform=transforms,
|
| 221 |
+
pickle_path=pkl_path
|
| 222 |
+
)
|
| 223 |
+
|
| 224 |
+
# Create validation testing DataLoader
|
| 225 |
+
val_loader = DataLoader(
|
| 226 |
+
val_test_dataset,
|
| 227 |
+
batch_size=1,
|
| 228 |
+
shuffle=False,
|
| 229 |
+
drop_last=False,
|
| 230 |
+
num_workers=12,
|
| 231 |
+
pin_memory=True,
|
| 232 |
+
prefetch_factor=2,
|
| 233 |
+
persistent_workers=False
|
| 234 |
+
)
|
| 235 |
+
print(f"Number of val_loader {loader_id} examples {len(val_test_dataset)}")
|
| 236 |
+
return train_loader, val_train_loader, val_loader
|
| 237 |
+
|
| 238 |
+
def reshape_input_data(data):
|
| 239 |
+
"""
|
| 240 |
+
Reshapes input data and moves it to the appropriate device (GPU or CPU).
|
| 241 |
+
|
| 242 |
+
Parameters:
|
| 243 |
+
data (tuple): Tuple containing images, tumour-related labels, and classification labels.
|
| 244 |
+
|
| 245 |
+
Returns:
|
| 246 |
+
tuple: Reshaped images, tumour-related labels, and classification labels.
|
| 247 |
+
"""
|
| 248 |
+
images, label_NT, labels = data
|
| 249 |
+
# Reshape images
|
| 250 |
+
images = images.view(
|
| 251 |
+
images.size(0) * images.size(1),
|
| 252 |
+
images.size(2),
|
| 253 |
+
images.size(3),
|
| 254 |
+
images.size(4),
|
| 255 |
+
images.size(5)
|
| 256 |
+
)
|
| 257 |
+
# Reshape non-target labels and target labels
|
| 258 |
+
label_NT = label_NT.view(-1)
|
| 259 |
+
labels = labels.view(-1)
|
| 260 |
+
|
| 261 |
+
# --- FORCE GPU OVERRIDE (Bypass Config completely) ---
|
| 262 |
+
images = images.to('cuda')
|
| 263 |
+
label_NT = label_NT.to('cuda')
|
| 264 |
+
labels = labels.to('cuda')
|
| 265 |
+
return images, label_NT, labels
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
def train(fold, pkl_paths, model): # Added model as parameter
|
| 269 |
+
"""
|
| 270 |
+
Main training function responsible for the entire training process, including data loading, model training,
|
| 271 |
+
validation, logging, and model saving.
|
| 272 |
+
|
| 273 |
+
Parameters:
|
| 274 |
+
fold (int): Current fold number for cross-validation.
|
| 275 |
+
pkl_paths (list): List of paths to pickle files for each class.
|
| 276 |
+
model (torch.nn.Module): The model to train.
|
| 277 |
+
"""
|
| 278 |
+
# Define data transformations
|
| 279 |
+
val_transforms = monai.transforms.Compose([
|
| 280 |
+
monai.transforms.ToTensor(),
|
| 281 |
+
])
|
| 282 |
+
|
| 283 |
+
# Get DataLoaders for each class
|
| 284 |
+
train_loader_1p19q, val_train_loader_1p19q, val_loader_1p19q = get_class_loaders(
|
| 285 |
+
TrainDataset=TrainDataLoader,
|
| 286 |
+
TestDataset=TestDataLoader,
|
| 287 |
+
transforms=val_transforms,
|
| 288 |
+
fold=fold,
|
| 289 |
+
loader_id='1p19q',
|
| 290 |
+
pkl_path=pkl_paths[0]
|
| 291 |
+
)
|
| 292 |
+
train_loader_IDH, val_train_loader_IDH, val_loader_IDH = get_class_loaders(
|
| 293 |
+
TrainDataset=TrainDataLoader,
|
| 294 |
+
TestDataset=TestDataLoader,
|
| 295 |
+
transforms=val_transforms,
|
| 296 |
+
fold=fold,
|
| 297 |
+
loader_id='IDH',
|
| 298 |
+
pkl_path=pkl_paths[1]
|
| 299 |
+
)
|
| 300 |
+
train_loader_LHG, val_train_loader_LHG, val_loader_LHG = get_class_loaders(
|
| 301 |
+
TrainDataset=TrainDataLoader,
|
| 302 |
+
TestDataset=TestDataLoader,
|
| 303 |
+
transforms=val_transforms,
|
| 304 |
+
fold=fold,
|
| 305 |
+
loader_id='LHG',
|
| 306 |
+
pkl_path=pkl_paths[2]
|
| 307 |
+
)
|
| 308 |
+
|
| 309 |
+
cross_entropy_loss = CrossEntropyLoss(reduction='mean') # Define cross-entropy loss
|
| 310 |
+
|
| 311 |
+
# Only optimize parameters that require gradients
|
| 312 |
+
optim_parameters = filter(lambda p: p.requires_grad, model.parameters())
|
| 313 |
+
optimizer = torch.optim.Adam(
|
| 314 |
+
optim_parameters,
|
| 315 |
+
lr=config.lr_self,
|
| 316 |
+
weight_decay=config.weight_decay
|
| 317 |
+
) # Using Adam optimizer
|
| 318 |
+
|
| 319 |
+
scaler = GradScaler() # <--- INITIALIZE MIXED PRECISION SCALER
|
| 320 |
+
|
| 321 |
+
# Learning rate scheduler
|
| 322 |
+
scheduler = ReduceLROnPlateau(
|
| 323 |
+
optimizer=optimizer,
|
| 324 |
+
factor=config.lr_reduce_factor,
|
| 325 |
+
patience=config.lr_reduce_patience,
|
| 326 |
+
mode='max',
|
| 327 |
+
min_lr=config.min_lr
|
| 328 |
+
)
|
| 329 |
+
|
| 330 |
+
global_step = 0 # Initialize global step
|
| 331 |
+
best_score = -1 # Initialize best score
|
| 332 |
+
start_epoch = 0
|
| 333 |
+
|
| 334 |
+
save_name = getattr(model, 'name', 'CFE')
|
| 335 |
+
save_path = os.path.join(config.data_dir, 'results', str(save_name), f'Fold_{fold}')
|
| 336 |
+
if not os.path.exists(save_path):
|
| 337 |
+
os.makedirs(save_path, exist_ok=True)
|
| 338 |
+
|
| 339 |
+
# Check if this fold is already fully completed
|
| 340 |
+
mean_log_file = os.path.join(save_path, 'log_mean.csv')
|
| 341 |
+
if os.path.exists(mean_log_file):
|
| 342 |
+
try:
|
| 343 |
+
df_existing = pd.read_csv(mean_log_file)
|
| 344 |
+
if len(df_existing) >= config.epochs_s1 and df_existing['epoch'].max() >= config.epochs_s1 - 1:
|
| 345 |
+
print(f"🎉 Fold {fold} is already fully completed ({len(df_existing)}/{config.epochs_s1} epochs). Skipping!")
|
| 346 |
+
return
|
| 347 |
+
except Exception as e:
|
| 348 |
+
print(f"Warning checking fold completion: {e}")
|
| 349 |
+
|
| 350 |
+
# Find the latest checkpoint for this fold automatically
|
| 351 |
+
import glob
|
| 352 |
+
latest_checkpoint = None
|
| 353 |
+
checkpoints = glob.glob(f'checkpoint_fold{fold}_epoch*.pkl')
|
| 354 |
+
if checkpoints:
|
| 355 |
+
# Extract epoch numbers and sort to find the latest
|
| 356 |
+
latest_checkpoint = max(checkpoints, key=lambda x: int(x.split('epoch')[1].split('.pkl')[0]))
|
| 357 |
+
|
| 358 |
+
resume_path = latest_checkpoint if latest_checkpoint else config.resume_checkpoint
|
| 359 |
+
|
| 360 |
+
if resume_path and os.path.exists(resume_path):
|
| 361 |
+
print(f"Resuming from checkpoint: {resume_path}")
|
| 362 |
+
checkpoint = torch.load(resume_path, weights_only=False)
|
| 363 |
+
model.load_state_dict(checkpoint['model_state_dict'])
|
| 364 |
+
|
| 365 |
+
if 'optimizer_state_dict' in checkpoint:
|
| 366 |
+
optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
|
| 367 |
+
if 'scheduler_state_dict' in checkpoint:
|
| 368 |
+
scheduler.load_state_dict(checkpoint['scheduler_state_dict'])
|
| 369 |
+
if 'scaler_state_dict' in checkpoint:
|
| 370 |
+
scaler.load_state_dict(checkpoint['scaler_state_dict'])
|
| 371 |
+
if 'global_step' in checkpoint:
|
| 372 |
+
global_step = checkpoint['global_step']
|
| 373 |
+
if 'best_f1' in checkpoint:
|
| 374 |
+
best_score = checkpoint['best_f1']
|
| 375 |
+
if 'epoch' in checkpoint:
|
| 376 |
+
start_epoch = checkpoint['epoch'] + 1
|
| 377 |
+
|
| 378 |
+
# Initialize DataFrames for logging, preserving prior epochs if resuming
|
| 379 |
+
def load_or_init_log(filename):
|
| 380 |
+
csv_p = os.path.join(save_path, filename)
|
| 381 |
+
if start_epoch > 0 and os.path.exists(csv_p):
|
| 382 |
+
try:
|
| 383 |
+
df = pd.read_csv(csv_p)
|
| 384 |
+
df = df[df['epoch'] < start_epoch]
|
| 385 |
+
print(f"Preserved {len(df)} previous epochs from {filename}")
|
| 386 |
+
return df
|
| 387 |
+
except Exception as e:
|
| 388 |
+
print(f"Warning reading existing {csv_p}: {e}")
|
| 389 |
+
return pd.DataFrame(columns=[
|
| 390 |
+
'epoch',
|
| 391 |
+
'Train_loss', 'Train_Accuracy', 'Train_F1',
|
| 392 |
+
'Val_loss', 'Val_Accuracy', 'Val_F1'
|
| 393 |
+
])
|
| 394 |
+
|
| 395 |
+
log_1p19q = load_or_init_log('log_1p19q.csv')
|
| 396 |
+
log_IDH = load_or_init_log('log_IDH.csv')
|
| 397 |
+
log_LHG = load_or_init_log('log_LHG.csv')
|
| 398 |
+
log_mean = load_or_init_log('log_mean.csv')
|
| 399 |
+
|
| 400 |
+
model.train() # Set model to training mode
|
| 401 |
+
|
| 402 |
+
# Initialize iterator indices
|
| 403 |
+
iter_index_IDH = 0
|
| 404 |
+
iter_index_LHG = 0
|
| 405 |
+
|
| 406 |
+
iter_IDH = iter(train_loader_IDH)
|
| 407 |
+
iter_LHG = iter(train_loader_LHG)
|
| 408 |
+
|
| 409 |
+
for epoch in range(start_epoch, config.epochs_s1):
|
| 410 |
+
print(f"\n--- STARTING EPOCH {epoch} ---") # Added to track epoch progress
|
| 411 |
+
if epoch == config.save_epoch:
|
| 412 |
+
best_score = -1 # Reset best score at a specific epoch
|
| 413 |
+
|
| 414 |
+
iter_1p19q = iter(train_loader_1p19q) # Get iterator for 1p19q class
|
| 415 |
+
|
| 416 |
+
# --- START PROGRESS BAR HERE ---
|
| 417 |
+
for batch_idx in range(len(train_loader_1p19q)):
|
| 418 |
+
# --- AGGRESSIVE PRE-LOAD CLEANUP ---
|
| 419 |
+
import gc
|
| 420 |
+
gc.collect()
|
| 421 |
+
# -----------------------------------
|
| 422 |
+
|
| 423 |
+
# --- MEMORY WATCHDOG ---
|
| 424 |
+
process = psutil.Process(os.getpid())
|
| 425 |
+
mem_gb = process.memory_info().rss / (1024 ** 3)
|
| 426 |
+
|
| 427 |
+
# -----------------------
|
| 428 |
+
|
| 429 |
+
iter_index_IDH += 1
|
| 430 |
+
iter_index_LHG += 1
|
| 431 |
+
|
| 432 |
+
# Reset iterators if they exceed dataset length
|
| 433 |
+
if iter_index_IDH >= len(train_loader_IDH):
|
| 434 |
+
iter_IDH = iter(train_loader_IDH)
|
| 435 |
+
iter_index_IDH = 0
|
| 436 |
+
|
| 437 |
+
if iter_index_LHG >= len(train_loader_LHG):
|
| 438 |
+
iter_LHG = iter(train_loader_LHG)
|
| 439 |
+
iter_index_LHG = 0
|
| 440 |
+
|
| 441 |
+
# Loading 1p19q data volume...
|
| 442 |
+
try:
|
| 443 |
+
data_1p19q = next(iter_1p19q)
|
| 444 |
+
except Exception as e:
|
| 445 |
+
print(f"CRITICAL ERROR LOADING 1p19q DATA: {e}")
|
| 446 |
+
raise e
|
| 447 |
+
imgs_1p19q, label_NT_1p19q, label_1p19q = reshape_input_data(data_1p19q)
|
| 448 |
+
del data_1p19q
|
| 449 |
+
gc.collect()
|
| 450 |
+
|
| 451 |
+
# Loading IDH data volume...
|
| 452 |
+
data_IDH = next(iter_IDH)
|
| 453 |
+
imgs_IDH, label_NT_IDH, label_IDH = reshape_input_data(data_IDH)
|
| 454 |
+
del data_IDH
|
| 455 |
+
gc.collect()
|
| 456 |
+
|
| 457 |
+
# Loading LHG data volume...
|
| 458 |
+
data_LHG = next(iter_LHG)
|
| 459 |
+
imgs_LHG, label_NT_LHG, label_LHG = reshape_input_data(data_LHG)
|
| 460 |
+
del data_LHG
|
| 461 |
+
gc.collect()
|
| 462 |
+
|
| 463 |
+
# Packaging multi-task tensors...
|
| 464 |
+
label_list = [label_1p19q, label_IDH, label_LHG]
|
| 465 |
+
combined_input = torch.cat((imgs_1p19q, imgs_IDH, imgs_LHG), dim=0)
|
| 466 |
+
labels_NG_list = [label_NT_1p19q, label_NT_IDH, label_NT_LHG]
|
| 467 |
+
|
| 468 |
+
# Commencing forward model execution on GPU...
|
| 469 |
+
|
| 470 |
+
# --- START 50% MEMORY SAVINGS W/ MIXED PRECISION ---
|
| 471 |
+
with autocast():
|
| 472 |
+
(logits_NG, labels_NG_all, out_cls_list_NG,
|
| 473 |
+
out_cls_list, out_cls_labels) = model(combined_input, labels_NG_list, label_list)
|
| 474 |
+
|
| 475 |
+
# Compute losses
|
| 476 |
+
loss_NG = cross_entropy_loss(logits_NG, labels_NG_all)
|
| 477 |
+
loss_cls_N1 = cross_entropy_loss(out_cls_list_NG[0], label_list[0])
|
| 478 |
+
loss_cls_N2 = cross_entropy_loss(out_cls_list_NG[1], label_list[1])
|
| 479 |
+
loss_cls_N3 = cross_entropy_loss(out_cls_list_NG[2], label_list[2])
|
| 480 |
+
loss_cls_1 = cross_entropy_loss(out_cls_list[0], out_cls_labels[0])
|
| 481 |
+
loss_cls_2 = cross_entropy_loss(out_cls_list[1], out_cls_labels[1])
|
| 482 |
+
loss_cls_3 = cross_entropy_loss(out_cls_list[2], out_cls_labels[2])
|
| 483 |
+
|
| 484 |
+
total_cls_loss = loss_cls_1 + loss_cls_2 + loss_cls_3 + loss_cls_N1 + loss_cls_N2 + loss_cls_N3
|
| 485 |
+
total_loss = loss_NG + total_cls_loss
|
| 486 |
+
# --- END MIXED PRECISION ---
|
| 487 |
+
|
| 488 |
+
optimizer.zero_grad(set_to_none=True)
|
| 489 |
+
|
| 490 |
+
# --- SCALE GRADIENTS FOR HALF-PRECISION MEMORY ---
|
| 491 |
+
scaler.scale(total_loss).backward()
|
| 492 |
+
scaler.step(optimizer)
|
| 493 |
+
scaler.update()
|
| 494 |
+
# --------------------------------------------------
|
| 495 |
+
|
| 496 |
+
if batch_idx % 10 == 0:
|
| 497 |
+
print(f" [Epoch {epoch}] Batch {batch_idx}/{len(train_loader_1p19q)} | Loss: {total_loss.item():.4f} | RAM: {mem_gb:.2f} GB")
|
| 498 |
+
|
| 499 |
+
# --- MASSIVE RAM & GPU CLEANUP AFTER EACH BATCH ---
|
| 500 |
+
del imgs_1p19q, imgs_IDH, imgs_LHG, combined_input
|
| 501 |
+
del logits_NG, labels_NG_all, out_cls_list_NG, out_cls_list, out_cls_labels
|
| 502 |
+
del total_loss, total_cls_loss, loss_NG
|
| 503 |
+
# REMOVED torch.cuda.empty_cache() to prevent VRAM fragmentation
|
| 504 |
+
gc.collect()
|
| 505 |
+
# --------------------------------------------------
|
| 506 |
+
|
| 507 |
+
global_step += 1
|
| 508 |
+
|
| 509 |
+
# Get current learning rate
|
| 510 |
+
current_lr = get_learning_rate(optimizer)
|
| 511 |
+
print(f'Global_Step {global_step} | Train Epoch: {epoch} | lr {current_lr:.2e} |')
|
| 512 |
+
|
| 513 |
+
# Define save path
|
| 514 |
+
save_path = os.path.join(config.data_dir, 'results', str(save_name), f'Fold_{fold}')
|
| 515 |
+
if not os.path.exists(save_path):
|
| 516 |
+
os.makedirs(save_path)
|
| 517 |
+
|
| 518 |
+
# Compute metrics for each class
|
| 519 |
+
metrics_train_1p19q, metrics_test_1p19q = valid_metrics_by_class(
|
| 520 |
+
model=model,
|
| 521 |
+
train_loader=val_train_loader_1p19q,
|
| 522 |
+
test_loader=val_loader_1p19q,
|
| 523 |
+
ssl_index=0,
|
| 524 |
+
class_name='1p19q'
|
| 525 |
+
)
|
| 526 |
+
|
| 527 |
+
metrics_train_IDH, metrics_test_IDH = valid_metrics_by_class(
|
| 528 |
+
model=model,
|
| 529 |
+
train_loader=val_train_loader_IDH,
|
| 530 |
+
test_loader=val_loader_IDH,
|
| 531 |
+
ssl_index=1,
|
| 532 |
+
class_name='IDH'
|
| 533 |
+
)
|
| 534 |
+
|
| 535 |
+
metrics_train_LHG, metrics_test_LHG = valid_metrics_by_class(
|
| 536 |
+
model=model,
|
| 537 |
+
train_loader=val_train_loader_LHG,
|
| 538 |
+
test_loader=val_loader_LHG,
|
| 539 |
+
ssl_index=2,
|
| 540 |
+
class_name='LHG'
|
| 541 |
+
)
|
| 542 |
+
|
| 543 |
+
# Calculate mean metrics across classes
|
| 544 |
+
metrics_train_mean = (np.array(metrics_train_1p19q) + np.array(metrics_train_IDH) +
|
| 545 |
+
np.array(metrics_train_LHG)) / 3.0
|
| 546 |
+
metrics_test_mean = (np.array(metrics_test_1p19q) + np.array(metrics_test_IDH) +
|
| 547 |
+
np.array(metrics_test_LHG)) / 3.0
|
| 548 |
+
|
| 549 |
+
# Create log entries
|
| 550 |
+
log_entry_1p19q = get_pandas_series(epoch, metrics_train_1p19q, metrics_test_1p19q)
|
| 551 |
+
log_entry_IDH = get_pandas_series(epoch, metrics_train_IDH, metrics_test_IDH)
|
| 552 |
+
log_entry_LHG = get_pandas_series(epoch, metrics_train_LHG, metrics_test_LHG)
|
| 553 |
+
log_entry_mean = get_pandas_series(epoch, metrics_train_mean, metrics_test_mean)
|
| 554 |
+
|
| 555 |
+
# Append logs to DataFrames and save to CSV (Updated for modern Pandas)
|
| 556 |
+
log_1p19q = pd.concat([log_1p19q, log_entry_1p19q.to_frame().T], ignore_index=True)
|
| 557 |
+
log_1p19q.to_csv(os.path.join(save_path, 'log_1p19q.csv'), index=False)
|
| 558 |
+
|
| 559 |
+
log_IDH = pd.concat([log_IDH, log_entry_IDH.to_frame().T], ignore_index=True)
|
| 560 |
+
log_IDH.to_csv(os.path.join(save_path, 'log_IDH.csv'), index=False)
|
| 561 |
+
|
| 562 |
+
log_LHG = pd.concat([log_LHG, log_entry_LHG.to_frame().T], ignore_index=True)
|
| 563 |
+
log_LHG.to_csv(os.path.join(save_path, 'log_LHG.csv'), index=False)
|
| 564 |
+
|
| 565 |
+
log_mean = pd.concat([log_mean, log_entry_mean.to_frame().T], ignore_index=True)
|
| 566 |
+
log_mean.to_csv(os.path.join(save_path, 'log_mean.csv'), index=False)
|
| 567 |
+
|
| 568 |
+
# Use the mean F1 score from the test set as the evaluation metric
|
| 569 |
+
current_f1 = metrics_test_mean[2]
|
| 570 |
+
|
| 571 |
+
# Save the best model based on F1 score
|
| 572 |
+
if epoch >= config.save_epoch:
|
| 573 |
+
if current_f1 > best_score:
|
| 574 |
+
save_config = {
|
| 575 |
+
'name': save_name,
|
| 576 |
+
'save_dir': save_path,
|
| 577 |
+
'global_step': global_step,
|
| 578 |
+
'Test_F1': current_f1
|
| 579 |
+
}
|
| 580 |
+
save_model(model=model, config=save_config)
|
| 581 |
+
|
| 582 |
+
# Reconstruct path generated by save_model to upload it
|
| 583 |
+
f1_percentage = current_f1 * 100
|
| 584 |
+
best_path = os.path.join(save_path, f"{save_name}_F1_{f1_percentage:.2f}_step_{global_step}.pkl")
|
| 585 |
+
|
| 586 |
+
# Upload best model to Hugging Face
|
| 587 |
+
hf_token = os.environ.get("HF_TOKEN")
|
| 588 |
+
if hf_token and os.path.exists(best_path):
|
| 589 |
+
try:
|
| 590 |
+
from huggingface_hub import upload_file
|
| 591 |
+
filename_only = os.path.basename(best_path)
|
| 592 |
+
upload_file(
|
| 593 |
+
path_or_fileobj=best_path,
|
| 594 |
+
path_in_repo=f"best_models/fixedone/Fold_{fold}/{filename_only}",
|
| 595 |
+
repo_id="unknownBrain/survivalanalysis_checkpointing",
|
| 596 |
+
repo_type="dataset",
|
| 597 |
+
token=hf_token,
|
| 598 |
+
)
|
| 599 |
+
print(f"☁️ Best model uploaded to Hugging Face: {filename_only}")
|
| 600 |
+
except Exception as e:
|
| 601 |
+
print(f"⚠️ Hugging Face best model upload failed: {e}")
|
| 602 |
+
|
| 603 |
+
best_score = current_f1
|
| 604 |
+
|
| 605 |
+
# Update the best score if current F1 is better
|
| 606 |
+
if current_f1 > best_score:
|
| 607 |
+
best_score = current_f1
|
| 608 |
+
|
| 609 |
+
# Step the scheduler based on the best score
|
| 610 |
+
scheduler.step(best_score)
|
| 611 |
+
|
| 612 |
+
# ===== LIGHT CHECKPOINT EVERY 5 EPOCHS OR FINAL EPOCH =====
|
| 613 |
+
if (epoch % 5 == 0 and epoch > 0) or (epoch == config.epochs_s1 - 1):
|
| 614 |
+
light_checkpoint_path = f'checkpoint_fold{fold}_epoch{epoch}.pkl'
|
| 615 |
+
torch.save({
|
| 616 |
+
'epoch': epoch,
|
| 617 |
+
'fold': fold,
|
| 618 |
+
'model_state_dict': model.state_dict(),
|
| 619 |
+
'optimizer_state_dict': optimizer.state_dict(),
|
| 620 |
+
'scheduler_state_dict': scheduler.state_dict(),
|
| 621 |
+
'scaler_state_dict': scaler.state_dict(),
|
| 622 |
+
'best_f1': best_score,
|
| 623 |
+
'global_step': global_step
|
| 624 |
+
}, light_checkpoint_path)
|
| 625 |
+
print(f"✅ Light checkpoint saved locally: {light_checkpoint_path}")
|
| 626 |
+
|
| 627 |
+
# Prune older intermediate checkpoints (keep latest 2) to preserve disk space
|
| 628 |
+
older_epoch = epoch - 10
|
| 629 |
+
older_checkpoint = f'checkpoint_fold{fold}_epoch{older_epoch}.pkl'
|
| 630 |
+
if os.path.exists(older_checkpoint):
|
| 631 |
+
try:
|
| 632 |
+
os.remove(older_checkpoint)
|
| 633 |
+
print(f"🧹 Removed older checkpoint to preserve disk: {older_checkpoint}")
|
| 634 |
+
except Exception as e:
|
| 635 |
+
pass
|
| 636 |
+
|
| 637 |
+
# Upload to W&B
|
| 638 |
+
if wandb.run is not None:
|
| 639 |
+
wandb.save(light_checkpoint_path)
|
| 640 |
+
print(f"☁️ Uploaded to W&B: {light_checkpoint_path}")
|
| 641 |
+
|
| 642 |
+
# Upload to Hugging Face
|
| 643 |
+
hf_token = os.environ.get("HF_TOKEN")
|
| 644 |
+
if hf_token:
|
| 645 |
+
try:
|
| 646 |
+
from huggingface_hub import upload_file
|
| 647 |
+
upload_file(
|
| 648 |
+
path_or_fileobj=light_checkpoint_path,
|
| 649 |
+
path_in_repo=f"checkpoints/fixedone/{light_checkpoint_path}",
|
| 650 |
+
repo_id="unknownBrain/survivalanalysis_checkpointing",
|
| 651 |
+
repo_type="dataset",
|
| 652 |
+
token=hf_token,
|
| 653 |
+
)
|
| 654 |
+
print(f"☁️ Uploaded to Hugging Face: {light_checkpoint_path}")
|
| 655 |
+
except Exception as e:
|
| 656 |
+
print(f"⚠️ Hugging Face upload failed: {e}")
|
| 657 |
+
else:
|
| 658 |
+
print("ℹ️ HF_TOKEN not set. Skipping Hugging Face upload.")
|
| 659 |
+
# ===== END LIGHT CHECKPOINT =====
|
| 660 |
+
|
| 661 |
+
# Log to W&B
|
| 662 |
+
if wandb.run is not None:
|
| 663 |
+
wandb.log({
|
| 664 |
+
"Train/Mean_Loss": metrics_train_mean[0],
|
| 665 |
+
"Train/Mean_Accuracy": metrics_train_mean[1],
|
| 666 |
+
"Train/Mean_F1": metrics_train_mean[2],
|
| 667 |
+
"Test/Mean_Loss": metrics_test_mean[0],
|
| 668 |
+
"Test/Mean_Accuracy": metrics_test_mean[1],
|
| 669 |
+
"Test/Mean_F1": metrics_test_mean[2],
|
| 670 |
+
"Epoch": epoch,
|
| 671 |
+
"Learning_Rate": current_lr,
|
| 672 |
+
"Global_Step": global_step
|
| 673 |
+
})
|
| 674 |
+
|
| 675 |
+
# Safely empty cache at the end of the epoch
|
| 676 |
+
torch.cuda.empty_cache()
|
| 677 |
+
|
| 678 |
+
|
| 679 |
+
if __name__ == '__main__':
|
| 680 |
+
# Ignore all warnings
|
| 681 |
+
warnings.filterwarnings("ignore")
|
| 682 |
+
|
| 683 |
+
# Set random seeds for reproducibility
|
| 684 |
+
seed = config.random_seed
|
| 685 |
+
np.random.seed(seed) # Python's random seed
|
| 686 |
+
os.environ['PYTHONHASHSEED'] = str(seed) # Disable Python hash randomization
|
| 687 |
+
torch.manual_seed(seed) # Torch CPU random seed
|
| 688 |
+
torch.cuda.manual_seed(seed) # Torch GPU random seed
|
| 689 |
+
torch.cuda.manual_seed_all(seed) # Torch multi-GPU random seed
|
| 690 |
+
|
| 691 |
+
# --- FIX PYTORCH 3D TENSOR RAM LEAK ---
|
| 692 |
+
torch.backends.cudnn.benchmark = True
|
| 693 |
+
torch.backends.cudnn.deterministic = True
|
| 694 |
+
|
| 695 |
+
# Define paths to pickle files for each class
|
| 696 |
+
pkl_paths = [
|
| 697 |
+
'./1p19q.pkl',
|
| 698 |
+
'./IDH.pkl',
|
| 699 |
+
'./LHG.pkl'
|
| 700 |
+
]
|
| 701 |
+
|
| 702 |
+
# Perform 5-fold cross-validation training
|
| 703 |
+
for fold in range(5):
|
| 704 |
+
# Quick check if fold is already completed before allocating model and wandb
|
| 705 |
+
save_path = os.path.join(config.data_dir, 'results', 'CFE', f'Fold_{fold}')
|
| 706 |
+
mean_log_file = os.path.join(save_path, 'log_mean.csv')
|
| 707 |
+
if os.path.exists(mean_log_file):
|
| 708 |
+
try:
|
| 709 |
+
df_existing = pd.read_csv(mean_log_file)
|
| 710 |
+
if len(df_existing) >= config.epochs_s1 and df_existing['epoch'].max() >= config.epochs_s1 - 1:
|
| 711 |
+
print(f"\n{'='*50}")
|
| 712 |
+
print(f"🎉 Fold {fold} is already fully completed ({len(df_existing)}/{config.epochs_s1} epochs). Skipping to next fold!")
|
| 713 |
+
print(f"{'='*50}\n")
|
| 714 |
+
continue
|
| 715 |
+
except Exception as e:
|
| 716 |
+
pass
|
| 717 |
+
|
| 718 |
+
torch.set_float32_matmul_precision('high') # Leverage Tensor Cores
|
| 719 |
+
model = CFE(in_channels=3, num_classes=2, Arcm=0.5, multi=3) # Initialize the model
|
| 720 |
+
model = model.to('cuda') # Move model to GPU
|
| 721 |
+
save_name = getattr(model, 'name', 'CFE') # Access before compile
|
| 722 |
+
|
| 723 |
+
# Compile model for speedup if using PyTorch 2.0+
|
| 724 |
+
if hasattr(torch, 'compile'):
|
| 725 |
+
model = torch.compile(model)
|
| 726 |
+
|
| 727 |
+
print(f"{save_name}_Fold_{fold}")
|
| 728 |
+
|
| 729 |
+
wandb.init(
|
| 730 |
+
project=config.wandb_project,
|
| 731 |
+
entity=config.wandb_entity,
|
| 732 |
+
name=f"{save_name}_Fold_{fold}",
|
| 733 |
+
config={
|
| 734 |
+
'epochs': config.epochs_s1,
|
| 735 |
+
'batch_size': config.batch_size,
|
| 736 |
+
'learning_rate': config.lr_self,
|
| 737 |
+
'num_workers': config.n_threads,
|
| 738 |
+
'save_epoch': config.save_epoch,
|
| 739 |
+
},
|
| 740 |
+
reinit=True
|
| 741 |
+
)
|
| 742 |
+
|
| 743 |
+
train(fold, pkl_paths, model)
|
| 744 |
+
wandb.finish()
|
code/Train_CMTLNet_Step2.py
ADDED
|
@@ -0,0 +1,693 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import glob
|
| 3 |
+
import gc
|
| 4 |
+
import wandb
|
| 5 |
+
from torch.cuda.amp import autocast, GradScaler
|
| 6 |
+
from huggingface_hub import upload_file
|
| 7 |
+
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
| 8 |
+
import torch
|
| 9 |
+
import config
|
| 10 |
+
import monai
|
| 11 |
+
import warnings
|
| 12 |
+
import numpy as np
|
| 13 |
+
import pandas as pd
|
| 14 |
+
from model.CMTLNet import CMTLNet
|
| 15 |
+
from torch.nn import CrossEntropyLoss
|
| 16 |
+
from torch.utils.data import DataLoader
|
| 17 |
+
from torch.optim.lr_scheduler import ReduceLROnPlateau
|
| 18 |
+
from dataLoder.loader_S2 import TrainDataLoader_balance as TrainDataLoader
|
| 19 |
+
from dataLoder.loader_S2 import TestDataLoader
|
| 20 |
+
from utiles import save_model, get_learning_rate, calculate_classification_metrics, move_tensor_to_device, AverageMeter
|
| 21 |
+
from survivalstandalone.losses import cox_ph_loss
|
| 22 |
+
|
| 23 |
+
def validate(data_loader, model, mode_flag, ssl_index, class_name):
|
| 24 |
+
"""
|
| 25 |
+
Validates the model on a given dataset and computes loss and classification metrics.
|
| 26 |
+
|
| 27 |
+
Parameters:
|
| 28 |
+
data_loader (DataLoader): DataLoader for the dataset to validate.
|
| 29 |
+
model (torch.nn.Module): The model to validate.
|
| 30 |
+
mode_flag (str): Indicates whether the dataset is 'Train' or 'Test'.
|
| 31 |
+
ssl_index (int): SSL index used for model prediction.
|
| 32 |
+
class_name (str): Name of the class/category being validated.
|
| 33 |
+
|
| 34 |
+
Returns:
|
| 35 |
+
tuple: Contains average loss, accuracy, F1 score, precision, and recall.
|
| 36 |
+
"""
|
| 37 |
+
model.eval() # Set model to evaluation mode
|
| 38 |
+
cross_entropy_loss = CrossEntropyLoss(reduction='mean') # Define cross-entropy loss
|
| 39 |
+
all_targets, all_predictions = [], [] # Lists to store all true labels and predictions
|
| 40 |
+
loss_meter = AverageMeter() # Utility to track average loss
|
| 41 |
+
|
| 42 |
+
for batch_data in data_loader:
|
| 43 |
+
images, labels = batch_data
|
| 44 |
+
images = move_tensor_to_device(images, use_gpu=config.use_cuda) # Move images to GPU if available
|
| 45 |
+
labels = move_tensor_to_device(labels, use_gpu=config.use_cuda) # Move labels to GPU if available
|
| 46 |
+
|
| 47 |
+
with torch.no_grad(): # Disable gradient computation
|
| 48 |
+
outputs = model.predict(images, ssl_index) # Get model predictions
|
| 49 |
+
loss = cross_entropy_loss(outputs, labels) # Compute loss
|
| 50 |
+
loss_meter.update(loss.item(), 1) # Update loss meter
|
| 51 |
+
probabilities = torch.nn.functional.softmax(outputs, dim=1) # Compute probabilities
|
| 52 |
+
predicted_classes = torch.argmax(probabilities, dim=1).cpu().numpy() # Get predicted classes
|
| 53 |
+
true_labels = labels.cpu().detach().numpy() # Get true labels
|
| 54 |
+
all_predictions.extend(predicted_classes) # Collect predictions
|
| 55 |
+
all_targets.extend(true_labels) # Collect true labels
|
| 56 |
+
|
| 57 |
+
average_loss = loss_meter.average # Calculate average loss
|
| 58 |
+
all_predictions = np.array(all_predictions, dtype=np.int32)
|
| 59 |
+
all_targets = np.array(all_targets, dtype=np.int32)
|
| 60 |
+
# Compute classification metrics: Accuracy, F1, Precision, Recall, and Confusion Matrix
|
| 61 |
+
accuracy, f1, precision, recall, confusion_matrix = calculate_classification_metrics(
|
| 62 |
+
predictions=all_predictions,
|
| 63 |
+
targets=all_targets,
|
| 64 |
+
average_method="macro"
|
| 65 |
+
)
|
| 66 |
+
print(confusion_matrix) # Print confusion matrix
|
| 67 |
+
|
| 68 |
+
# Print metrics based on whether it's training or testing
|
| 69 |
+
if mode_flag == 'Test':
|
| 70 |
+
print(f'Test set {class_name} | Accuracy {accuracy:.4f} | F1 {f1:.4f} | Precision {precision:.4f} | Recall {recall:.4f} |')
|
| 71 |
+
else:
|
| 72 |
+
print(f'Train set {class_name} | Accuracy {accuracy:.4f} | F1 {f1:.4f} | Precision {precision:.4f} | Recall {recall:.4f} |')
|
| 73 |
+
|
| 74 |
+
model.train() # Set model back to training mode
|
| 75 |
+
|
| 76 |
+
return average_loss, accuracy, f1, precision, recall
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def valid_metrics_by_class(model, train_loader, test_loader, ssl_index, class_name):
|
| 80 |
+
"""
|
| 81 |
+
Computes validation metrics for a specific class on both training and testing datasets.
|
| 82 |
+
|
| 83 |
+
Parameters:
|
| 84 |
+
model (torch.nn.Module): The model to validate.
|
| 85 |
+
train_loader (DataLoader): DataLoader for the training dataset.
|
| 86 |
+
test_loader (DataLoader): DataLoader for the testing dataset.
|
| 87 |
+
ssl_index (int): SSL index used for model prediction.
|
| 88 |
+
class_name (str): Name of the class/category being validated.
|
| 89 |
+
|
| 90 |
+
Returns:
|
| 91 |
+
tuple: Contains training metrics and testing metrics.
|
| 92 |
+
"""
|
| 93 |
+
# Validate on training data
|
| 94 |
+
train_loss, train_accuracy, train_f1, train_precision, train_recall = validate(
|
| 95 |
+
data_loader=train_loader,
|
| 96 |
+
model=model,
|
| 97 |
+
mode_flag='Train',
|
| 98 |
+
ssl_index=ssl_index,
|
| 99 |
+
class_name=class_name
|
| 100 |
+
)
|
| 101 |
+
|
| 102 |
+
# Validate on testing data
|
| 103 |
+
test_loss, test_accuracy, test_f1, test_precision, test_recall = validate(
|
| 104 |
+
data_loader=test_loader,
|
| 105 |
+
model=model,
|
| 106 |
+
mode_flag='Test',
|
| 107 |
+
ssl_index=ssl_index,
|
| 108 |
+
class_name=class_name
|
| 109 |
+
)
|
| 110 |
+
|
| 111 |
+
# Collect training and testing metrics
|
| 112 |
+
metrics_train = [train_loss, train_accuracy, train_f1, train_precision, train_recall]
|
| 113 |
+
metrics_test = [test_loss, test_accuracy, test_f1, test_precision, test_recall]
|
| 114 |
+
return metrics_train, metrics_test
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def get_pandas_series(epoch, train_metrics, test_metrics):
|
| 118 |
+
"""
|
| 119 |
+
Creates a Pandas Series for logging metrics.
|
| 120 |
+
|
| 121 |
+
Parameters:
|
| 122 |
+
epoch (int): Current epoch number.
|
| 123 |
+
train_metrics (list): List of training metrics.
|
| 124 |
+
test_metrics (list): List of testing metrics.
|
| 125 |
+
|
| 126 |
+
Returns:
|
| 127 |
+
pd.Series: Series containing epoch and corresponding metrics.
|
| 128 |
+
"""
|
| 129 |
+
series = pd.Series([
|
| 130 |
+
epoch,
|
| 131 |
+
train_metrics[0], # Training loss
|
| 132 |
+
train_metrics[1], # Training accuracy
|
| 133 |
+
train_metrics[2], # Training F1 score
|
| 134 |
+
test_metrics[0], # Testing loss
|
| 135 |
+
test_metrics[1], # Testing accuracy
|
| 136 |
+
test_metrics[2], # Testing F1 score
|
| 137 |
+
], index=[
|
| 138 |
+
'epoch',
|
| 139 |
+
'Train_loss', 'Train_Accuracy', 'Train_F1',
|
| 140 |
+
'Val_loss', 'Val_Accuracy', 'Val_F1'
|
| 141 |
+
])
|
| 142 |
+
return series
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
def get_class_loaders(TrainDataset, TestDataset, transforms, fold, loader_id, pkl_path):
|
| 146 |
+
"""
|
| 147 |
+
Creates DataLoaders for training and validation datasets for a specific class.
|
| 148 |
+
|
| 149 |
+
Parameters:
|
| 150 |
+
TrainDataset (Dataset): Training dataset class.
|
| 151 |
+
TestDataset (Dataset): Testing dataset class.
|
| 152 |
+
transforms (Compose): Data transformation pipeline.
|
| 153 |
+
fold (int): Current fold number for cross-validation.
|
| 154 |
+
loader_id (str): Identifier for the class.
|
| 155 |
+
pkl_path (str): Path to the pickle file containing dataset information.
|
| 156 |
+
|
| 157 |
+
Returns:
|
| 158 |
+
tuple: Contains training DataLoader, validation training DataLoader, and validation testing DataLoader.
|
| 159 |
+
"""
|
| 160 |
+
# Create training dataset
|
| 161 |
+
train_dataset = TrainDataset(
|
| 162 |
+
mode='train',
|
| 163 |
+
fold=fold,
|
| 164 |
+
transform=transforms,
|
| 165 |
+
pickle_path=pkl_path
|
| 166 |
+
)
|
| 167 |
+
|
| 168 |
+
# Create training DataLoader
|
| 169 |
+
train_loader = DataLoader(
|
| 170 |
+
train_dataset,
|
| 171 |
+
batch_size=config.batch_size,
|
| 172 |
+
shuffle=True,
|
| 173 |
+
drop_last=True,
|
| 174 |
+
num_workers=config.n_threads,
|
| 175 |
+
pin_memory=config.use_cuda
|
| 176 |
+
)
|
| 177 |
+
print(f"Number of train_loader {loader_id} examples {len(train_dataset)}")
|
| 178 |
+
|
| 179 |
+
# Create validation training dataset
|
| 180 |
+
val_train_dataset = TestDataset(
|
| 181 |
+
mode='train',
|
| 182 |
+
fold=fold,
|
| 183 |
+
transform=transforms,
|
| 184 |
+
pickle_path=pkl_path
|
| 185 |
+
)
|
| 186 |
+
|
| 187 |
+
# Create validation training DataLoader
|
| 188 |
+
val_train_loader = DataLoader(
|
| 189 |
+
val_train_dataset,
|
| 190 |
+
batch_size=1,
|
| 191 |
+
shuffle=False,
|
| 192 |
+
drop_last=False,
|
| 193 |
+
num_workers=config.n_threads,
|
| 194 |
+
pin_memory=config.use_cuda
|
| 195 |
+
)
|
| 196 |
+
print(f"Number of val_train_loader {loader_id} examples {len(val_train_dataset)}")
|
| 197 |
+
|
| 198 |
+
# Create validation testing dataset
|
| 199 |
+
val_test_dataset = TestDataset(
|
| 200 |
+
mode='test',
|
| 201 |
+
fold=fold,
|
| 202 |
+
transform=transforms,
|
| 203 |
+
pickle_path=pkl_path
|
| 204 |
+
)
|
| 205 |
+
|
| 206 |
+
# Create validation testing DataLoader
|
| 207 |
+
val_loader = DataLoader(
|
| 208 |
+
val_test_dataset,
|
| 209 |
+
batch_size=1,
|
| 210 |
+
shuffle=False,
|
| 211 |
+
drop_last=False,
|
| 212 |
+
num_workers=config.n_threads,
|
| 213 |
+
pin_memory=config.use_cuda
|
| 214 |
+
)
|
| 215 |
+
print(f"Number of val_loader {loader_id} examples {len(val_test_dataset)}")
|
| 216 |
+
return train_loader, val_train_loader, val_loader
|
| 217 |
+
|
| 218 |
+
def reshape_input_data(data):
|
| 219 |
+
images, labels, times, events = data
|
| 220 |
+
images = images.view(images.size(0) * images.size(1), images.size(2), images.size(3), images.size(4), images.size(5))
|
| 221 |
+
labels = labels.view(-1)
|
| 222 |
+
times = times.view(-1)
|
| 223 |
+
events = events.view(-1)
|
| 224 |
+
|
| 225 |
+
images = move_tensor_to_device(images, use_gpu=config.use_cuda)
|
| 226 |
+
labels = move_tensor_to_device(labels, use_gpu=config.use_cuda)
|
| 227 |
+
times = move_tensor_to_device(times, use_gpu=config.use_cuda)
|
| 228 |
+
events = move_tensor_to_device(events, use_gpu=config.use_cuda)
|
| 229 |
+
return images, labels, times, events
|
| 230 |
+
|
| 231 |
+
|
| 232 |
+
def train(fold, pkl_paths):
|
| 233 |
+
"""
|
| 234 |
+
Main training function responsible for the entire training process, including data loading, model training,
|
| 235 |
+
validation, logging, and model saving.
|
| 236 |
+
|
| 237 |
+
Parameters:
|
| 238 |
+
fold (int): Current fold number for cross-validation.
|
| 239 |
+
pkl_paths (list): List of paths to pickle files for each class.
|
| 240 |
+
"""
|
| 241 |
+
# Define data transformations
|
| 242 |
+
val_transforms = monai.transforms.Compose([
|
| 243 |
+
monai.transforms.ToTensor(),
|
| 244 |
+
])
|
| 245 |
+
|
| 246 |
+
# Get DataLoaders for each class
|
| 247 |
+
train_loader_1p19q, val_train_loader_1p19q, val_loader_1p19q = get_class_loaders(
|
| 248 |
+
TrainDataset=TrainDataLoader,
|
| 249 |
+
TestDataset=TestDataLoader,
|
| 250 |
+
transforms=val_transforms,
|
| 251 |
+
fold=fold,
|
| 252 |
+
loader_id='1p19q',
|
| 253 |
+
pkl_path=pkl_paths[0]
|
| 254 |
+
)
|
| 255 |
+
train_loader_IDH, val_train_loader_IDH, val_loader_IDH = get_class_loaders(
|
| 256 |
+
TrainDataset=TrainDataLoader,
|
| 257 |
+
TestDataset=TestDataLoader,
|
| 258 |
+
transforms=val_transforms,
|
| 259 |
+
fold=fold,
|
| 260 |
+
loader_id='IDH',
|
| 261 |
+
pkl_path=pkl_paths[1]
|
| 262 |
+
)
|
| 263 |
+
train_loader_LHG, val_train_loader_LHG, val_loader_LHG = get_class_loaders(
|
| 264 |
+
TrainDataset=TrainDataLoader,
|
| 265 |
+
TestDataset=TestDataLoader,
|
| 266 |
+
transforms=val_transforms,
|
| 267 |
+
fold=fold,
|
| 268 |
+
loader_id='LHG',
|
| 269 |
+
pkl_path=pkl_paths[2]
|
| 270 |
+
)
|
| 271 |
+
|
| 272 |
+
# Move model to GPU if available
|
| 273 |
+
if config.use_cuda:
|
| 274 |
+
model.cuda()
|
| 275 |
+
|
| 276 |
+
cross_entropy_loss = CrossEntropyLoss(reduction='mean') # Define cross-entropy loss
|
| 277 |
+
|
| 278 |
+
# Only optimize parameters that require gradients
|
| 279 |
+
optim_parameters = filter(lambda p: p.requires_grad, model.parameters())
|
| 280 |
+
optimizer = torch.optim.Adam(
|
| 281 |
+
optim_parameters,
|
| 282 |
+
lr=config.lr_self,
|
| 283 |
+
weight_decay=config.weight_decay
|
| 284 |
+
) # Using Adam optimizer
|
| 285 |
+
|
| 286 |
+
# Learning rate scheduler
|
| 287 |
+
scheduler = ReduceLROnPlateau(
|
| 288 |
+
optimizer=optimizer,
|
| 289 |
+
factor=config.lr_reduce_factor,
|
| 290 |
+
patience=config.lr_reduce_patience,
|
| 291 |
+
mode='max',
|
| 292 |
+
min_lr=config.min_lr
|
| 293 |
+
)
|
| 294 |
+
|
| 295 |
+
global_step = 0 # Initialize global step
|
| 296 |
+
best_score = -1 # Initialize best score
|
| 297 |
+
start_epoch = 0
|
| 298 |
+
scaler = GradScaler()
|
| 299 |
+
save_name = getattr(model, 'name', 'UFE_UCFC')
|
| 300 |
+
save_path = os.path.join(config.data_dir, 'results', 'UFE_UCFC', f'Fold_{fold}')
|
| 301 |
+
if not os.path.exists(save_path):
|
| 302 |
+
os.makedirs(save_path, exist_ok=True)
|
| 303 |
+
|
| 304 |
+
# Check if fold is already fully completed
|
| 305 |
+
mean_log_file = os.path.join(save_path, 'log_mean.csv')
|
| 306 |
+
if os.path.exists(mean_log_file):
|
| 307 |
+
try:
|
| 308 |
+
df_existing = pd.read_csv(mean_log_file)
|
| 309 |
+
if len(df_existing) >= config.epochs_s2 and df_existing['epoch'].max() >= config.epochs_s2 - 1:
|
| 310 |
+
print(f"🎉 Step 2 Fold {fold} is already fully completed ({len(df_existing)}/{config.epochs_s2} epochs). Skipping!")
|
| 311 |
+
return
|
| 312 |
+
except Exception as e:
|
| 313 |
+
print(f"Warning checking fold completion: {e}")
|
| 314 |
+
|
| 315 |
+
# Resume logic
|
| 316 |
+
import glob
|
| 317 |
+
checkpoints = glob.glob(os.path.join(save_path, f'checkpoint_fold{fold}_epoch*.pkl'))
|
| 318 |
+
if checkpoints:
|
| 319 |
+
latest_checkpoint = max(checkpoints, key=lambda x: int(x.split('epoch')[1].split('.pkl')[0]))
|
| 320 |
+
print(f"Resuming from checkpoint: {latest_checkpoint}")
|
| 321 |
+
checkpoint = torch.load(latest_checkpoint, weights_only=False)
|
| 322 |
+
model.load_state_dict(checkpoint['model_state_dict'])
|
| 323 |
+
if 'optimizer_state_dict' in checkpoint:
|
| 324 |
+
optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
|
| 325 |
+
if 'scheduler_state_dict' in checkpoint:
|
| 326 |
+
scheduler.load_state_dict(checkpoint['scheduler_state_dict'])
|
| 327 |
+
if 'scaler_state_dict' in checkpoint:
|
| 328 |
+
scaler.load_state_dict(checkpoint['scaler_state_dict'])
|
| 329 |
+
if 'global_step' in checkpoint:
|
| 330 |
+
global_step = checkpoint['global_step']
|
| 331 |
+
if 'best_f1' in checkpoint:
|
| 332 |
+
best_score = checkpoint['best_f1']
|
| 333 |
+
if 'epoch' in checkpoint:
|
| 334 |
+
start_epoch = checkpoint['epoch'] + 1
|
| 335 |
+
|
| 336 |
+
# Initialize DataFrames for logging, preserving prior epochs if resuming
|
| 337 |
+
def load_or_init_log(filename):
|
| 338 |
+
csv_p = os.path.join(save_path, filename)
|
| 339 |
+
if start_epoch > 0 and os.path.exists(csv_p):
|
| 340 |
+
try:
|
| 341 |
+
df = pd.read_csv(csv_p)
|
| 342 |
+
df = df[df['epoch'] < start_epoch]
|
| 343 |
+
print(f"Preserved {len(df)} previous epochs from {filename}")
|
| 344 |
+
return df
|
| 345 |
+
except Exception as e:
|
| 346 |
+
print(f"Warning reading existing {csv_p}: {e}")
|
| 347 |
+
return pd.DataFrame(columns=[
|
| 348 |
+
'epoch',
|
| 349 |
+
'Train_loss', 'Train_Accuracy', 'Train_F1',
|
| 350 |
+
'Val_loss', 'Val_Accuracy', 'Val_F1'
|
| 351 |
+
])
|
| 352 |
+
|
| 353 |
+
log_1p19q = load_or_init_log('log_1p19q.csv')
|
| 354 |
+
log_IDH = load_or_init_log('log_IDH.csv')
|
| 355 |
+
log_LHG = load_or_init_log('log_LHG.csv')
|
| 356 |
+
log_mean = load_or_init_log('log_mean.csv')
|
| 357 |
+
|
| 358 |
+
model.train() # Set model to training mode
|
| 359 |
+
|
| 360 |
+
# Initialize iterator indices
|
| 361 |
+
iter_index_IDH = 0
|
| 362 |
+
iter_index_LHG = 0
|
| 363 |
+
|
| 364 |
+
iter_IDH = iter(train_loader_IDH)
|
| 365 |
+
iter_LHG = iter(train_loader_LHG)
|
| 366 |
+
|
| 367 |
+
for epoch in range(start_epoch, config.epochs_s2):
|
| 368 |
+
print(f"\n{'='*40}")
|
| 369 |
+
print(f"🚀 STARTING EPOCH {epoch} (Fold {fold})")
|
| 370 |
+
print(f"{'='*40}")
|
| 371 |
+
|
| 372 |
+
if epoch == config.save_epoch:
|
| 373 |
+
best_score = -1 # Reset best score at a specific epoch
|
| 374 |
+
|
| 375 |
+
iter_1p19q = iter(train_loader_1p19q) # Get iterator for 1p19q class
|
| 376 |
+
|
| 377 |
+
import psutil
|
| 378 |
+
import gc
|
| 379 |
+
|
| 380 |
+
for batch_idx in range(len(train_loader_1p19q)):
|
| 381 |
+
iter_index_IDH += 1
|
| 382 |
+
iter_index_LHG += 1
|
| 383 |
+
|
| 384 |
+
# Reset iterators if they exceed dataset length
|
| 385 |
+
if iter_index_IDH >= len(train_loader_IDH):
|
| 386 |
+
iter_IDH = iter(train_loader_IDH)
|
| 387 |
+
iter_index_IDH = 0
|
| 388 |
+
|
| 389 |
+
if iter_index_LHG >= len(train_loader_LHG):
|
| 390 |
+
iter_LHG = iter(train_loader_LHG)
|
| 391 |
+
iter_index_LHG = 0
|
| 392 |
+
|
| 393 |
+
# Get data for each class
|
| 394 |
+
data_1p19q = next(iter_1p19q)
|
| 395 |
+
data_IDH = next(iter_IDH)
|
| 396 |
+
data_LHG = next(iter_LHG)
|
| 397 |
+
|
| 398 |
+
# Reshape input data
|
| 399 |
+
# Reshape input data
|
| 400 |
+
imgs_1p19q, label_1p19q, time_1p19q, event_1p19q = reshape_input_data(data_1p19q)
|
| 401 |
+
imgs_IDH, label_IDH, time_IDH, event_IDH = reshape_input_data(data_IDH)
|
| 402 |
+
imgs_LHG, label_LHG, time_LHG, event_LHG = reshape_input_data(data_LHG)
|
| 403 |
+
|
| 404 |
+
# Combine inputs and targets
|
| 405 |
+
label_list = [label_1p19q, label_IDH, label_LHG]
|
| 406 |
+
combined_input = torch.cat((imgs_1p19q, imgs_IDH, imgs_LHG), dim=0)
|
| 407 |
+
combined_times = torch.cat((time_1p19q, time_IDH, time_LHG), dim=0)
|
| 408 |
+
combined_events = torch.cat((event_1p19q, event_IDH, event_LHG), dim=0)
|
| 409 |
+
|
| 410 |
+
condition_1p19q = torch.tensor(0, dtype=torch.long, device=label_1p19q.device).repeat(1, label_1p19q.size(0))[0]
|
| 411 |
+
condition_IDH = torch.tensor(1, dtype=torch.long, device=label_IDH.device).repeat(1, label_IDH.size(0))[0]
|
| 412 |
+
condition_LHG = torch.tensor(2, dtype=torch.long, device=label_LHG.device).repeat(1, label_LHG.size(0))[0]
|
| 413 |
+
condition = torch.cat([condition_1p19q, condition_IDH, condition_LHG], dim=0)
|
| 414 |
+
|
| 415 |
+
# Forward pass with AMP
|
| 416 |
+
with autocast():
|
| 417 |
+
(out_cls_list_UFE, out_cls_labels_UFE,
|
| 418 |
+
out_cls_list_UCFC, out_cls_labels_UCFC, risk_scores) = model(combined_input, label_list, condition)
|
| 419 |
+
|
| 420 |
+
# --- CALCULATE COX LOSS ---
|
| 421 |
+
valid_mask = combined_times > 0
|
| 422 |
+
if valid_mask.sum() >= 2:
|
| 423 |
+
# Squeeze risk_scores to 1D to match combined_times and combined_events
|
| 424 |
+
# Otherwise, diff (N, 1) * event (N) creates an N x N matrix and explodes the loss!
|
| 425 |
+
risk_1d = risk_scores[valid_mask].squeeze()
|
| 426 |
+
loss_surv = cox_ph_loss(risk_1d, combined_times[valid_mask], combined_events[valid_mask])
|
| 427 |
+
else:
|
| 428 |
+
loss_surv = torch.tensor(0.0, device=risk_scores.device, requires_grad=True)
|
| 429 |
+
|
| 430 |
+
loss_cls_U1 = cross_entropy_loss(out_cls_list_UFE[0], out_cls_labels_UFE[0])
|
| 431 |
+
loss_cls_U2 = cross_entropy_loss(out_cls_list_UFE[1], out_cls_labels_UFE[1])
|
| 432 |
+
loss_cls_U3 = cross_entropy_loss(out_cls_list_UFE[2], out_cls_labels_UFE[2])
|
| 433 |
+
loss_cls_1 = cross_entropy_loss(out_cls_list_UCFC[0], out_cls_labels_UCFC[0])
|
| 434 |
+
loss_cls_2 = cross_entropy_loss(out_cls_list_UCFC[1], out_cls_labels_UCFC[1])
|
| 435 |
+
loss_cls_3 = cross_entropy_loss(out_cls_list_UCFC[2], out_cls_labels_UCFC[2])
|
| 436 |
+
|
| 437 |
+
total_loss = loss_cls_U1 + loss_cls_U2 + loss_cls_U3 + loss_cls_1 + loss_cls_2 + loss_cls_3 + (0.5 * loss_surv)
|
| 438 |
+
|
| 439 |
+
# Backward pass with AMP
|
| 440 |
+
optimizer.zero_grad()
|
| 441 |
+
scaler.scale(total_loss).backward()
|
| 442 |
+
scaler.step(optimizer)
|
| 443 |
+
scaler.update()
|
| 444 |
+
|
| 445 |
+
global_step += 1
|
| 446 |
+
|
| 447 |
+
if batch_idx % 10 == 0:
|
| 448 |
+
process = psutil.Process(os.getpid())
|
| 449 |
+
mem_gb = process.memory_info().rss / (1024 ** 3)
|
| 450 |
+
print(f" [Epoch {epoch}] Batch {batch_idx}/{len(train_loader_1p19q)} | Loss: {total_loss.item():.4f} | RAM: {mem_gb:.2f} GB")
|
| 451 |
+
print(f" -> UFE: {loss_cls_U1.item():.2f}, {loss_cls_U2.item():.2f}, {loss_cls_U3.item():.2f} | UCFC: {loss_cls_1.item():.2f}, {loss_cls_2.item():.2f}, {loss_cls_3.item():.2f} | Surv: {loss_surv.item():.2f}")
|
| 452 |
+
|
| 453 |
+
# Get current learning rate
|
| 454 |
+
current_lr = get_learning_rate(optimizer)
|
| 455 |
+
print(f'Global_Step {global_step} | Train Epoch: {epoch} | lr {current_lr:.2e} |')
|
| 456 |
+
|
| 457 |
+
|
| 458 |
+
|
| 459 |
+
# Compute metrics for each class
|
| 460 |
+
metrics_train_1p19q, metrics_test_1p19q = valid_metrics_by_class(
|
| 461 |
+
model=model,
|
| 462 |
+
train_loader=val_train_loader_1p19q,
|
| 463 |
+
test_loader=val_loader_1p19q,
|
| 464 |
+
ssl_index=0,
|
| 465 |
+
class_name='1p19q'
|
| 466 |
+
)
|
| 467 |
+
|
| 468 |
+
metrics_train_IDH, metrics_test_IDH = valid_metrics_by_class(
|
| 469 |
+
model=model,
|
| 470 |
+
train_loader=val_train_loader_IDH,
|
| 471 |
+
test_loader=val_loader_IDH,
|
| 472 |
+
ssl_index=1,
|
| 473 |
+
class_name='IDH'
|
| 474 |
+
)
|
| 475 |
+
|
| 476 |
+
metrics_train_LHG, metrics_test_LHG = valid_metrics_by_class(
|
| 477 |
+
model=model,
|
| 478 |
+
train_loader=val_train_loader_LHG,
|
| 479 |
+
test_loader=val_loader_LHG,
|
| 480 |
+
ssl_index=2,
|
| 481 |
+
class_name='LHG'
|
| 482 |
+
)
|
| 483 |
+
|
| 484 |
+
# Calculate mean metrics across classes
|
| 485 |
+
metrics_train_mean = (np.array(metrics_train_1p19q) + np.array(metrics_train_IDH) +
|
| 486 |
+
np.array(metrics_train_LHG)) / 3.0
|
| 487 |
+
metrics_test_mean = (np.array(metrics_test_1p19q) + np.array(metrics_test_IDH) +
|
| 488 |
+
np.array(metrics_test_LHG)) / 3.0
|
| 489 |
+
|
| 490 |
+
# Create log entries
|
| 491 |
+
log_entry_1p19q = get_pandas_series(epoch, metrics_train_1p19q, metrics_test_1p19q)
|
| 492 |
+
log_entry_IDH = get_pandas_series(epoch, metrics_train_IDH, metrics_test_IDH)
|
| 493 |
+
log_entry_LHG = get_pandas_series(epoch, metrics_train_LHG, metrics_test_LHG)
|
| 494 |
+
log_entry_mean = get_pandas_series(epoch, metrics_train_mean, metrics_test_mean)
|
| 495 |
+
|
| 496 |
+
# Append logs to DataFrames and save to CSV
|
| 497 |
+
log_1p19q = pd.concat([log_1p19q, log_entry_1p19q.to_frame().T], ignore_index=True)
|
| 498 |
+
log_1p19q.to_csv(os.path.join(save_path, 'log_1p19q.csv'), index=False)
|
| 499 |
+
|
| 500 |
+
log_IDH = pd.concat([log_IDH, log_entry_IDH.to_frame().T], ignore_index=True)
|
| 501 |
+
log_IDH.to_csv(os.path.join(save_path, 'log_IDH.csv'), index=False)
|
| 502 |
+
|
| 503 |
+
log_LHG = pd.concat([log_LHG, log_entry_LHG.to_frame().T], ignore_index=True)
|
| 504 |
+
log_LHG.to_csv(os.path.join(save_path, 'log_LHG.csv'), index=False)
|
| 505 |
+
|
| 506 |
+
log_mean = pd.concat([log_mean, log_entry_mean.to_frame().T], ignore_index=True)
|
| 507 |
+
log_mean.to_csv(os.path.join(save_path, 'log_mean.csv'), index=False)
|
| 508 |
+
|
| 509 |
+
# Use the mean F1 score from the test set as the evaluation metric
|
| 510 |
+
current_f1 = metrics_test_mean[2]
|
| 511 |
+
|
| 512 |
+
# Save the best model based on F1 score
|
| 513 |
+
if epoch >= config.save_epoch:
|
| 514 |
+
if current_f1 > best_score:
|
| 515 |
+
save_config = {
|
| 516 |
+
'name': save_name,
|
| 517 |
+
'save_dir': save_path,
|
| 518 |
+
'global_step': global_step,
|
| 519 |
+
'Test_F1': current_f1
|
| 520 |
+
}
|
| 521 |
+
save_model(model=model, config=save_config)
|
| 522 |
+
|
| 523 |
+
# Reconstruct path generated by save_model to upload it
|
| 524 |
+
f1_percentage = current_f1 * 100
|
| 525 |
+
best_path = os.path.join(save_path, f"{save_name}_F1_{f1_percentage:.2f}_step_{global_step}.pkl")
|
| 526 |
+
|
| 527 |
+
best_model_name = f'best_model_fold{fold}.pkl'
|
| 528 |
+
best_model_path = os.path.join(save_path, best_model_name)
|
| 529 |
+
import shutil
|
| 530 |
+
if os.path.exists(best_path):
|
| 531 |
+
shutil.copy(best_path, best_model_path)
|
| 532 |
+
|
| 533 |
+
# Upload best model to W&B
|
| 534 |
+
if wandb.run is not None:
|
| 535 |
+
wandb.save(best_model_path)
|
| 536 |
+
|
| 537 |
+
# Upload best model to Hugging Face
|
| 538 |
+
hf_token = os.environ.get("HF_TOKEN")
|
| 539 |
+
if hf_token and os.path.exists(best_model_path):
|
| 540 |
+
try:
|
| 541 |
+
from huggingface_hub import upload_file
|
| 542 |
+
upload_file(
|
| 543 |
+
path_or_fileobj=best_model_path,
|
| 544 |
+
path_in_repo=f"best_models/Fold_{fold}/{best_model_name}",
|
| 545 |
+
repo_id="unknownBrain/survivalanalysis_checkpointing",
|
| 546 |
+
repo_type="dataset",
|
| 547 |
+
token=hf_token,
|
| 548 |
+
)
|
| 549 |
+
print(f"☁️ Best model uploaded to Hugging Face: {best_model_name}")
|
| 550 |
+
except Exception as e:
|
| 551 |
+
print(f"⚠️ Hugging Face best model upload failed: {e}")
|
| 552 |
+
|
| 553 |
+
best_score = current_f1
|
| 554 |
+
|
| 555 |
+
# Update the best score if current F1 is better
|
| 556 |
+
if current_f1 > best_score:
|
| 557 |
+
best_score = current_f1
|
| 558 |
+
|
| 559 |
+
# Step the scheduler based on the best score
|
| 560 |
+
scheduler.step(best_score)
|
| 561 |
+
|
| 562 |
+
# ===== LIGHT CHECKPOINT EVERY 5 EPOCHS =====
|
| 563 |
+
if epoch % 5 == 0 and epoch > 0:
|
| 564 |
+
light_checkpoint_path = os.path.join(save_path, f'checkpoint_fold{fold}_epoch{epoch}.pkl')
|
| 565 |
+
torch.save({
|
| 566 |
+
'epoch': epoch,
|
| 567 |
+
'fold': fold,
|
| 568 |
+
'model_state_dict': model.state_dict(),
|
| 569 |
+
'optimizer_state_dict': optimizer.state_dict(),
|
| 570 |
+
'scheduler_state_dict': scheduler.state_dict(),
|
| 571 |
+
'scaler_state_dict': scaler.state_dict(),
|
| 572 |
+
'best_f1': best_score,
|
| 573 |
+
'global_step': global_step
|
| 574 |
+
}, light_checkpoint_path)
|
| 575 |
+
print(f"✅ Light checkpoint saved locally: {light_checkpoint_path}")
|
| 576 |
+
|
| 577 |
+
# Upload to W&B
|
| 578 |
+
if wandb.run is not None:
|
| 579 |
+
wandb.save(light_checkpoint_path)
|
| 580 |
+
print(f"☁️ Uploaded to W&B: {light_checkpoint_path}")
|
| 581 |
+
|
| 582 |
+
# Upload to Hugging Face
|
| 583 |
+
hf_token = os.environ.get("HF_TOKEN")
|
| 584 |
+
if hf_token:
|
| 585 |
+
try:
|
| 586 |
+
from huggingface_hub import upload_file
|
| 587 |
+
filename_only = os.path.basename(light_checkpoint_path)
|
| 588 |
+
upload_file(
|
| 589 |
+
path_or_fileobj=light_checkpoint_path,
|
| 590 |
+
path_in_repo=f"checkpoints/{filename_only}",
|
| 591 |
+
repo_id="unknownBrain/survivalanalysis_checkpointing",
|
| 592 |
+
repo_type="dataset",
|
| 593 |
+
token=hf_token,
|
| 594 |
+
)
|
| 595 |
+
print(f"☁️ Uploaded to Hugging Face: {light_checkpoint_path}")
|
| 596 |
+
except Exception as e:
|
| 597 |
+
print(f"⚠️ Hugging Face upload failed: {e}")
|
| 598 |
+
else:
|
| 599 |
+
print("ℹ️ HF_TOKEN not set. Skipping Hugging Face upload.")
|
| 600 |
+
# ===== END LIGHT CHECKPOINT =====
|
| 601 |
+
|
| 602 |
+
# Log to W&B
|
| 603 |
+
if wandb.run is not None:
|
| 604 |
+
wandb.log({
|
| 605 |
+
"Train/Mean_Loss": metrics_train_mean[0],
|
| 606 |
+
"Train/Mean_Accuracy": metrics_train_mean[1],
|
| 607 |
+
"Train/Mean_F1": metrics_train_mean[2],
|
| 608 |
+
"Test/Mean_Loss": metrics_test_mean[0],
|
| 609 |
+
"Test/Mean_Accuracy": metrics_test_mean[1],
|
| 610 |
+
"Test/Mean_F1": metrics_test_mean[2],
|
| 611 |
+
"Epoch": epoch,
|
| 612 |
+
"Learning_Rate": current_lr,
|
| 613 |
+
"Global_Step": global_step
|
| 614 |
+
})
|
| 615 |
+
|
| 616 |
+
# Safely empty cache at the end of the epoch
|
| 617 |
+
gc.collect()
|
| 618 |
+
torch.cuda.empty_cache()
|
| 619 |
+
|
| 620 |
+
|
| 621 |
+
if __name__ == '__main__':
|
| 622 |
+
# Ignore all warnings
|
| 623 |
+
warnings.filterwarnings("ignore")
|
| 624 |
+
|
| 625 |
+
# Set random seeds for reproducibility
|
| 626 |
+
seed = config.random_seed
|
| 627 |
+
np.random.seed(seed) # Python's random seed
|
| 628 |
+
os.environ['PYTHONHASHSEED'] = str(seed) # Disable Python hash randomization
|
| 629 |
+
torch.manual_seed(seed) # Torch CPU random seed
|
| 630 |
+
torch.cuda.manual_seed(seed) # Torch GPU random seed
|
| 631 |
+
torch.cuda.manual_seed_all(seed) # Torch multi-GPU random seed
|
| 632 |
+
torch.backends.cudnn.benchmark = False # Disable cuDNN benchmark
|
| 633 |
+
torch.backends.cudnn.deterministic = True # Enable deterministic algorithms
|
| 634 |
+
|
| 635 |
+
# Define paths to pickle files for each class
|
| 636 |
+
pkl_paths = [
|
| 637 |
+
'./1p19q.pkl',
|
| 638 |
+
'./IDH.pkl',
|
| 639 |
+
'./LHG.pkl'
|
| 640 |
+
]
|
| 641 |
+
|
| 642 |
+
|
| 643 |
+
|
| 644 |
+
# Perform 5-fold cross-validation training
|
| 645 |
+
for fold in range(5):
|
| 646 |
+
import glob
|
| 647 |
+
import wandb
|
| 648 |
+
cfe_pattern = f'results/CFE/Fold_{fold}/CFE_F1_*.pkl'
|
| 649 |
+
cfe_files = glob.glob(cfe_pattern)
|
| 650 |
+
if cfe_files:
|
| 651 |
+
latest_cfe = max(cfe_files, key=os.path.getmtime)
|
| 652 |
+
print(f"✅ Loading CFE model for Fold {fold}: {latest_cfe}")
|
| 653 |
+
else:
|
| 654 |
+
print(f"⚠️ No Step 1 (CFE) checkpoint found for Fold {fold}. Step 1 must complete Fold {fold} first. Skipping Fold {fold}.")
|
| 655 |
+
continue
|
| 656 |
+
|
| 657 |
+
model = CMTLNet(in_channels=3, num_classes=2, Arcm=0.5, multi=3) # Initialize the model
|
| 658 |
+
model = model.to(config.device if hasattr(config, 'device') else 'cuda')
|
| 659 |
+
model_basic_CFE = torch.load(latest_cfe, weights_only=False)
|
| 660 |
+
if isinstance(model_basic_CFE, dict):
|
| 661 |
+
state_dict = model_basic_CFE.get('model_state_dict', model_basic_CFE)
|
| 662 |
+
else:
|
| 663 |
+
state_dict = model_basic_CFE.state_dict()
|
| 664 |
+
# Strip '_orig_mod.' prefix added by torch.compile() in Step 1
|
| 665 |
+
cleaned_state_dict = {}
|
| 666 |
+
for k, v in state_dict.items():
|
| 667 |
+
new_key = k.replace('_orig_mod.', '', 1)
|
| 668 |
+
cleaned_state_dict[new_key] = v
|
| 669 |
+
missing, unexpected = model.ShareTask.load_state_dict(cleaned_state_dict, strict=False)
|
| 670 |
+
if missing:
|
| 671 |
+
print(f"⚠️ Missing keys in ShareTask: {len(missing)} keys")
|
| 672 |
+
if unexpected:
|
| 673 |
+
print(f"⚠️ Unexpected keys in ShareTask: {len(unexpected)} keys")
|
| 674 |
+
print(f"✅ ShareTask weights loaded successfully for Fold {fold}")
|
| 675 |
+
|
| 676 |
+
save_name = getattr(model, 'name', 'UFE_UCFC')
|
| 677 |
+
print(f"{save_name}_Fold_{fold}")
|
| 678 |
+
|
| 679 |
+
# Initialize wandb
|
| 680 |
+
wandb.init(
|
| 681 |
+
project="CMTLNet-Training",
|
| 682 |
+
name=f"Step2-Fold-{fold}",
|
| 683 |
+
config={
|
| 684 |
+
'epochs': config.epochs_s2,
|
| 685 |
+
'batch_size': config.batch_size,
|
| 686 |
+
'learning_rate': config.lr_self,
|
| 687 |
+
'num_workers': config.n_threads,
|
| 688 |
+
},
|
| 689 |
+
reinit=True
|
| 690 |
+
)
|
| 691 |
+
|
| 692 |
+
train(fold, pkl_paths) # Start training
|
| 693 |
+
wandb.finish()
|
code/check_keys.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import glob
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
cfe_files = glob.glob('results/CFE/Fold_0/CFE_F1_*.pkl')
|
| 6 |
+
latest_cfe = max(cfe_files, key=os.path.getmtime)
|
| 7 |
+
checkpoint = torch.load(latest_cfe, weights_only=False)
|
| 8 |
+
state_dict = checkpoint.get('model_state_dict', checkpoint)
|
| 9 |
+
for i, key in enumerate(state_dict.keys()):
|
| 10 |
+
if i < 10:
|
| 11 |
+
print(key)
|
code/clinicaldata.csv
ADDED
|
@@ -0,0 +1,502 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ID,Sex,Age at MRI,WHO CNS Grade,Final pathologic diagnosis (WHO 2021),MGMT status,MGMT index,1p/19q,IDH,1-dead 0-alive,OS,EOR,Biopsy prior to imaging,BraTS21 ID,BraTS21 Segmentation Cohort,BraTS21 MGMT Cohort
|
| 2 |
+
UCSF-PDGM-004,M,66,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,1303,STR,No,BraTS2021_00097,Training,Training
|
| 3 |
+
UCSF-PDGM-005,F,80,4,"Glioblastoma, IDH-wildtype",indeterminate,unknown,unknown,wildtype,1,274,biopsy,No,,,
|
| 4 |
+
UCSF-PDGM-007,M,70,4,"Glioblastoma, IDH-wildtype",indeterminate,unknown,unknown,wildtype,1,417,STR,No,BraTS2021_00103,Training,
|
| 5 |
+
UCSF-PDGM-008,M,70,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,185,STR,No,,,
|
| 6 |
+
UCSF-PDGM-009,F,68,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,389,STR,No,BraTS2021_00049,Training,Training
|
| 7 |
+
UCSF-PDGM-010,M,39,4,"Glioblastoma, IDH-wildtype",positive,7,unknown,wildtype,0,17,GTR,No,BraTS2021_00087,Training,Training
|
| 8 |
+
UCSF-PDGM-011,F,68,4,"Glioblastoma, IDH-wildtype",positive,5,unknown,wildtype,0,133,STR,No,BraTS2021_00068,Training,Training
|
| 9 |
+
UCSF-PDGM-012,F,74,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,15,GTR,No,,,
|
| 10 |
+
UCSF-PDGM-013,F,65,4,"Glioblastoma, IDH-wildtype",positive,13,unknown,wildtype,1,322,STR,No,BraTS2021_00056,Training,Training
|
| 11 |
+
UCSF-PDGM-014,F,64,4,"Glioblastoma, IDH-wildtype",positive,4,unknown,wildtype,1,313,STR,No,BraTS2021_00002,Training,Training
|
| 12 |
+
UCSF-PDGM-015,M,50,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,54,STR,No,BraTS2021_00021,Training,Training
|
| 13 |
+
UCSF-PDGM-016,F,57,4,"Glioblastoma, IDH-wildtype",positive,7,unknown,wildtype,0,14,STR,Yes,BraTS2021_00054,Training,Training
|
| 14 |
+
UCSF-PDGM-017,M,54,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,241,STR,No,BraTS2021_00003,Training,Training
|
| 15 |
+
UCSF-PDGM-018,M,51,4,"Glioblastoma, IDH-wildtype",positive,11,unknown,wildtype,0,1449,GTR,No,,,
|
| 16 |
+
UCSF-PDGM-019,F,50,4,"Glioblastoma, IDH-wildtype",positive,16,unknown,wildtype,1,719,GTR,No,BraTS2021_00027,Validation,Validation
|
| 17 |
+
UCSF-PDGM-020,M,49,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,551,GTR,No,BraTS2021_00032,Training,Training
|
| 18 |
+
UCSF-PDGM-021,M,41,4,"Astrocytoma, IDH-mutant",positive,8,unknown,mutated (NOS),0,1759,GTR,No,BraTS2021_00085,Training,Training
|
| 19 |
+
UCSF-PDGM-022,F,61,4,"Glioblastoma, IDH-wildtype",positive,14,unknown,wildtype,1,533,STR,No,BraTS2021_00013,Validation,Validation
|
| 20 |
+
UCSF-PDGM-023,F,67,4,"Glioblastoma, IDH-wildtype",positive,12,intact,wildtype,1,1161,GTR,No,BraTS2021_00035,Training,Training
|
| 21 |
+
UCSF-PDGM-024,M,51,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,1,653,STR,No,BraTS2021_00072,Training,Training
|
| 22 |
+
UCSF-PDGM-025,M,34,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,465,STR,No,BraTS2021_00094,Training,Training
|
| 23 |
+
UCSF-PDGM-026,F,83,4,"Glioblastoma, IDH-wildtype",positive,3,unknown,wildtype,0,236,biopsy,No,,,
|
| 24 |
+
UCSF-PDGM-027,F,54,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,298,STR,No,BraTS2021_00016,Training,
|
| 25 |
+
UCSF-PDGM-029,M,66,4,"Glioblastoma, IDH-wildtype",indeterminate,unknown,unknown,wildtype,1,75,biopsy,No,BraTS2021_01027,Training,
|
| 26 |
+
UCSF-PDGM-030,M,78,4,"Glioblastoma, IDH-wildtype",positive,3,unknown,wildtype,0,17,STR,No,BraTS2021_00098,Training,Training
|
| 27 |
+
UCSF-PDGM-031,F,40,4,"Astrocytoma, IDH-mutant",positive,13,intact,mutated (NOS),1,824,GTR,No,,,
|
| 28 |
+
UCSF-PDGM-032,F,66,4,"Glioblastoma, IDH-wildtype",indeterminate,unknown,unknown,wildtype,0,105,STR,No,BraTS2021_01028,Training,
|
| 29 |
+
UCSF-PDGM-033,M,37,4,"Glioblastoma, IDH-wildtype",positive,10,unknown,wildtype,1,1489,STR,No,BraTS2021_00070,Training,Training
|
| 30 |
+
UCSF-PDGM-034,M,63,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,52,STR,No,BraTS2021_00088,Training,Training
|
| 31 |
+
UCSF-PDGM-035,M,69,4,"Glioblastoma, IDH-wildtype",positive,2,unknown,wildtype,1,132,STR,No,,,
|
| 32 |
+
UCSF-PDGM-036,M,52,4,"Glioblastoma, IDH-wildtype",positive,8,intact,wildtype,0,1673,GTR,No,BraTS2021_00025,Training,Training
|
| 33 |
+
UCSF-PDGM-037,M,74,4,"Glioblastoma, IDH-wildtype",positive,17,unknown,wildtype,0,460,GTR,No,BraTS2021_00078,Training,Training
|
| 34 |
+
UCSF-PDGM-038,M,78,4,"Glioblastoma, IDH-wildtype",positive,16,unknown,wildtype,1,152,STR,No,BraTS2021_00082,Validation,Validation
|
| 35 |
+
UCSF-PDGM-039,M,53,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,0,134,GTR,No,BraTS2021_00024,Training,Training
|
| 36 |
+
UCSF-PDGM-040,M,65,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,716,GTR,No,,,
|
| 37 |
+
UCSF-PDGM-041,M,69,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,128,STR,No,BraTS2021_00015,Validation,Validation
|
| 38 |
+
UCSF-PDGM-042,M,58,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,635,GTR,No,BraTS2021_00044,Training,Training
|
| 39 |
+
UCSF-PDGM-043,F,58,4,"Glioblastoma, IDH-wildtype",positive,2,unknown,wildtype,1,1116,GTR,No,BraTS2021_00058,Training,Training
|
| 40 |
+
UCSF-PDGM-044,M,38,4,"Astrocytoma, IDH-mutant",positive,6,unknown,mutated (NOS),0,930,STR,No,BraTS2021_00059,Training,Training
|
| 41 |
+
UCSF-PDGM-045,M,32,4,"Astrocytoma, IDH-mutant",positive,11,relative co-deletion,mutated (NOS),0,1718,GTR,No,BraTS2021_00043,Training,Training
|
| 42 |
+
UCSF-PDGM-046,M,48,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,178,STR,Yes,BraTS2021_00030,Training,Training
|
| 43 |
+
UCSF-PDGM-047,M,55,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,0,385,STR,No,,,
|
| 44 |
+
UCSF-PDGM-048,M,74,4,"Glioblastoma, IDH-wildtype",positive,16,unknown,wildtype,1,54,biopsy,No,BraTS2021_00026,Training,Training
|
| 45 |
+
UCSF-PDGM-049,F,65,4,"Glioblastoma, IDH-wildtype",positive,13,unknown,wildtype,0,721,STR,No,,,
|
| 46 |
+
UCSF-PDGM-050,M,37,4,"Glioblastoma, IDH-wildtype",positive,7,unknown,wildtype,1,554,GTR,No,BraTS2021_00048,Training,Training
|
| 47 |
+
UCSF-PDGM-053,F,64,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,0,575,GTR,No,BraTS2021_00018,Training,Training
|
| 48 |
+
UCSF-PDGM-055,F,69,4,"Glioblastoma, IDH-wildtype",positive,13,unknown,wildtype,0,1328,GTR,No,BraTS2021_00011,Training,Training
|
| 49 |
+
UCSF-PDGM-056,F,79,4,"Glioblastoma, IDH-wildtype",positive,16,unknown,wildtype,1,207,STR,No,,,
|
| 50 |
+
UCSF-PDGM-057,M,38,4,"Glioblastoma, IDH-wildtype",positive,4,unknown,wildtype,0,224,STR,No,BraTS2021_00000,Training,Training
|
| 51 |
+
UCSF-PDGM-058,F,51,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,0,1540,GTR,No,,,
|
| 52 |
+
UCSF-PDGM-059,M,71,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,0,223,STR,No,BraTS2021_00036,Training,Training
|
| 53 |
+
UCSF-PDGM-061,F,46,4,"Astrocytoma, IDH-mutant",positive,16,intact,mutated (NOS),0,1907,STR,No,BraTS2021_00012,Training,Training
|
| 54 |
+
UCSF-PDGM-063,M,56,4,"Glioblastoma, IDH-wildtype",positive,2,unknown,wildtype,1,287,STR,No,BraTS2021_00031,Training,Training
|
| 55 |
+
UCSF-PDGM-064,M,49,4,"Glioblastoma, IDH-wildtype",positive,2,unknown,wildtype,1,187,GTR,No,,,
|
| 56 |
+
UCSF-PDGM-065,M,64,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,1,167,STR,No,BraTS2021_00095,Training,Training
|
| 57 |
+
UCSF-PDGM-066,F,38,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,1913,biopsy,No,BraTS2021_01035,Training,
|
| 58 |
+
UCSF-PDGM-067,M,71,4,"Glioblastoma, IDH-wildtype",positive,4,unknown,wildtype,1,299,STR,No,BraTS2021_00074,Training,Training
|
| 59 |
+
UCSF-PDGM-068,M,54,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,336,biopsy,No,BraTS2021_00047,Validation,Validation
|
| 60 |
+
UCSF-PDGM-069,M,55,4,"Glioblastoma, IDH-wildtype",positive,12,unknown,wildtype,1,245,biopsy,No,BraTS2021_00037,Validation,Validation
|
| 61 |
+
UCSF-PDGM-070,M,66,4,"Glioblastoma, IDH-wildtype",positive,5,unknown,wildtype,1,678,STR,No,BraTS2021_00052,Training,Training
|
| 62 |
+
UCSF-PDGM-071,F,71,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,315,STR,No,,,
|
| 63 |
+
UCSF-PDGM-072,M,52,4,"Glioblastoma, IDH-wildtype",positive,2,unknown,wildtype,0,184,STR,No,,,
|
| 64 |
+
UCSF-PDGM-073,F,54,4,"Astrocytoma, IDH-mutant",positive,12,unknown,mutated (NOS),0,1617,STR,No,BraTS2021_00079,Validation,Validation
|
| 65 |
+
UCSF-PDGM-074,M,61,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,583,GTR,Yes,BraTS2021_00084,Training,Training
|
| 66 |
+
UCSF-PDGM-075,M,61,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,421,GTR,No,BraTS2021_00061,Training,Training
|
| 67 |
+
UCSF-PDGM-076,M,76,4,"Glioblastoma, IDH-wildtype",positive,15,unknown,wildtype,0,108,biopsy,No,,,
|
| 68 |
+
UCSF-PDGM-077,M,84,4,"Glioblastoma, IDH-wildtype",positive,17,unknown,wildtype,1,142,STR,No,BraTS2021_00077,Training,Training
|
| 69 |
+
UCSF-PDGM-078,F,79,4,"Glioblastoma, IDH-wildtype",positive,2,unknown,wildtype,1,354,GTR,No,,,
|
| 70 |
+
UCSF-PDGM-079,F,79,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,1,560,STR,No,BraTS2021_00081,Training,Training
|
| 71 |
+
UCSF-PDGM-080,F,77,4,"Glioblastoma, IDH-wildtype",positive,4,unknown,wildtype,1,253,GTR,No,BraTS2021_00066,Training,Training
|
| 72 |
+
UCSF-PDGM-082,M,60,4,"Glioblastoma, IDH-wildtype",positive,16,unknown,wildtype,0,6,STR,No,,,
|
| 73 |
+
UCSF-PDGM-083,F,62,4,"Glioblastoma, IDH-wildtype",positive,17,unknown,wildtype,1,260,GTR,No,,,
|
| 74 |
+
UCSF-PDGM-084,M,60,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,902,GTR,No,BraTS2021_00045,Training,Training
|
| 75 |
+
UCSF-PDGM-085,M,77,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,232,GTR,No,BraTS2021_00017,Training,Training
|
| 76 |
+
UCSF-PDGM-086,F,72,4,"Glioblastoma, IDH-wildtype",positive,15,unknown,wildtype,0,266,STR,No,BraTS2021_00089,Training,Training
|
| 77 |
+
UCSF-PDGM-087,M,63,4,"Glioblastoma, IDH-wildtype",positive,7,intact,wildtype,1,406,GTR,No,BraTS2021_00071,Training,Training
|
| 78 |
+
UCSF-PDGM-088,F,60,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,1797,GTR,No,BraTS2021_00008,Training,Training
|
| 79 |
+
UCSF-PDGM-089,M,25,4,"Astrocytoma, IDH-mutant",positive,4,intact,IDH1 p.R132H,0,1785,STR,No,,,
|
| 80 |
+
UCSF-PDGM-090,M,65,4,"Glioblastoma, IDH-wildtype",positive,2,unknown,wildtype,1,749,STR,No,BraTS2021_00060,Training,Training
|
| 81 |
+
UCSF-PDGM-091,M,79,4,"Glioblastoma, IDH-wildtype",positive,12,unknown,wildtype,1,463,GTR,Yes,,,
|
| 82 |
+
UCSF-PDGM-092,F,52,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,1,567,GTR,No,BraTS2021_00009,Training,Training
|
| 83 |
+
UCSF-PDGM-093,M,79,4,"Glioblastoma, IDH-wildtype",positive,12,unknown,wildtype,1,994,GTR,No,BraTS2021_00020,Training,Training
|
| 84 |
+
UCSF-PDGM-094,M,61,4,"Glioblastoma, IDH-wildtype",positive,12,unknown,wildtype,0,161,STR,No,BraTS2021_00091,Validation,Validation
|
| 85 |
+
UCSF-PDGM-095,F,62,4,"Glioblastoma, IDH-wildtype",positive,13,unknown,wildtype,1,777,STR,No,BraTS2021_00046,Training,Training
|
| 86 |
+
UCSF-PDGM-096,M,46,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,591,STR,No,BraTS2021_00001,Validation,Validation
|
| 87 |
+
UCSF-PDGM-097,F,69,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,110,STR,No,BraTS2021_00022,Training,Training
|
| 88 |
+
UCSF-PDGM-099,M,48,4,"Glioblastoma, IDH-wildtype",positive,3,unknown,wildtype,1,472,GTR,No,BraTS2021_00028,Training,Training
|
| 89 |
+
UCSF-PDGM-101,M,50,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,705,STR,No,BraTS2021_00090,Training,Training
|
| 90 |
+
UCSF-PDGM-102,M,45,4,"Glioblastoma, IDH-wildtype",positive,6,unknown,wildtype,0,798,STR,No,,,
|
| 91 |
+
UCSF-PDGM-103,M,55,4,"Glioblastoma, IDH-wildtype",positive,5,intact,wildtype,0,1694,GTR,No,BraTS2021_00096,Training,Training
|
| 92 |
+
UCSF-PDGM-104,M,52,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,1,70,biopsy,No,BraTS2021_00053,Training,Training
|
| 93 |
+
UCSF-PDGM-105,M,66,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,667,GTR,No,,,
|
| 94 |
+
UCSF-PDGM-106,F,51,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,351,GTR,No,BraTS2021_00014,Training,Training
|
| 95 |
+
UCSF-PDGM-107,F,62,4,"Glioblastoma, IDH-wildtype",positive,14,unknown,wildtype,0,175,STR,No,,,
|
| 96 |
+
UCSF-PDGM-108,M,29,4,"Astrocytoma, IDH-mutant",positive,8,unknown,mutated (NOS),0,1715,GTR,No,BraTS2021_00033,Training,Training
|
| 97 |
+
UCSF-PDGM-109,M,51,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,611,STR,No,BraTS2021_00063,Training,Training
|
| 98 |
+
UCSF-PDGM-111,M,61,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,39,biopsy,No,BraTS2021_00019,Training,Training
|
| 99 |
+
UCSF-PDGM-112,M,55,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,1,301,STR,Yes,BraTS2021_00064,Training,Training
|
| 100 |
+
UCSF-PDGM-113,F,54,4,"Glioblastoma, IDH-wildtype",positive,11,intact,wildtype,1,1351,GTR,No,,,
|
| 101 |
+
UCSF-PDGM-114,F,63,4,"Glioblastoma, IDH-wildtype",positive,12,unknown,wildtype,1,92,GTR,No,BraTS2021_00062,Training,Training
|
| 102 |
+
UCSF-PDGM-115,M,58,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,430,GTR,No,BraTS2021_00080,Validation,Validation
|
| 103 |
+
UCSF-PDGM-116,F,37,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,0,1611,GTR,No,BraTS2021_00006,Training,Training
|
| 104 |
+
UCSF-PDGM-118,F,65,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,1,162,GTR,No,BraTS2021_00099,Training,Training
|
| 105 |
+
UCSF-PDGM-119,M,49,4,"Astrocytoma, IDH-mutant",positive,15,relative co-deletion,mutated (NOS),0,1650,STR,No,BraTS2021_00005,Training,Training
|
| 106 |
+
UCSF-PDGM-121,M,56,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,879,GTR,No,,,
|
| 107 |
+
UCSF-PDGM-122,M,64,4,"Glioblastoma, IDH-wildtype",positive,7,intact,wildtype,1,1024,GTR,No,BraTS2021_00535,Validation,Validation
|
| 108 |
+
UCSF-PDGM-123,M,52,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,485,GTR,No,,,
|
| 109 |
+
UCSF-PDGM-124,M,17,4,"Astrocytoma, IDH-mutant",negative,0,intact,IDH1 p.R132H,0,1299,STR,Yes,BraTS2021_00530,Training,Training
|
| 110 |
+
UCSF-PDGM-126,M,48,4,"Glioblastoma, IDH-wildtype",positive,7,intact,wildtype,1,919,GTR,No,BraTS2021_00517,Training,Training
|
| 111 |
+
UCSF-PDGM-127,M,53,4,"Glioblastoma, IDH-wildtype",positive,17,unknown,wildtype,0,1296,GTR,No,BraTS2021_00548,Training,Training
|
| 112 |
+
UCSF-PDGM-128,M,60,4,"Glioblastoma, IDH-wildtype",positive,17,unknown,wildtype,0,645,STR,No,BraTS2021_00511,Training,Training
|
| 113 |
+
UCSF-PDGM-129,M,47,4,"Glioblastoma, IDH-wildtype",positive,5,intact,wildtype,1,553,GTR,No,,,
|
| 114 |
+
UCSF-PDGM-130,M,60,4,"Glioblastoma, IDH-wildtype",positive,16,unknown,wildtype,0,1440,GTR,No,BraTS2021_00529,Training,Training
|
| 115 |
+
UCSF-PDGM-131,M,76,4,"Glioblastoma, IDH-wildtype",negative,0,unknown,wildtype,0,410,GTR,No,BraTS2021_00547,Training,Training
|
| 116 |
+
UCSF-PDGM-132,M,29,4,"Astrocytoma, IDH-mutant",positive,12,intact,IDH1 p.R132C,0,1139,STR,No,BraTS2021_00525,Training,Training
|
| 117 |
+
UCSF-PDGM-133,F,64,4,"Glioblastoma, IDH-wildtype",positive,1,unknown,wildtype,1,109,GTR,No,BraTS2021_00481,Training,Training
|
| 118 |
+
UCSF-PDGM-134,M,67,4,"Glioblastoma, IDH-wildtype",positive,2,unknown,wildtype,0,288,STR,No,BraTS2021_00502,Training,Training
|
| 119 |
+
UCSF-PDGM-135,F,36,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,868,GTR,No,BraTS2021_00549,Training,Training
|
| 120 |
+
UCSF-PDGM-136,M,78,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,586,GTR,No,,,
|
| 121 |
+
UCSF-PDGM-137,M,53,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,799,GTR,No,BraTS2021_00491,Training,Training
|
| 122 |
+
UCSF-PDGM-0429_FU003d,F,58,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,624,GTR,No,BraTS2021_00557,Training,Training
|
| 123 |
+
UCSF-PDGM-139,M,65,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,188,GTR,No,BraTS2021_00466,Training,Training
|
| 124 |
+
UCSF-PDGM-140,M,76,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,39,GTR,No,BraTS2021_00554,Training,Training
|
| 125 |
+
UCSF-PDGM-141,M,65,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,758,GTR,No,,,
|
| 126 |
+
UCSF-PDGM-142,M,61,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,430,GTR,No,BraTS2021_00553,Validation,Validation
|
| 127 |
+
UCSF-PDGM-143,M,81,4,"Glioblastoma, IDH-wildtype",positive,12,intact,wildtype,1,91,biopsy,No,BraTS2021_00552,Training,Training
|
| 128 |
+
UCSF-PDGM-144,M,57,4,"Glioblastoma, IDH-wildtype",positive,15,intact,wildtype,1,142,STR,No,BraTS2021_00559,Training,Training
|
| 129 |
+
UCSF-PDGM-145,M,57,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,310,GTR,No,BraTS2021_00463,Validation,Validation
|
| 130 |
+
UCSF-PDGM-146,M,57,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,1392,GTR,No,BraTS2021_00498,Training,Training
|
| 131 |
+
UCSF-PDGM-147,M,58,4,"Astrocytoma, IDH-mutant",positive,13,intact,IDH1 p.R132H,1,482,STR,No,BraTS2021_00532,Training,Training
|
| 132 |
+
UCSF-PDGM-148,F,78,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,86,biopsy,No,BraTS2021_00493,Training,Training
|
| 133 |
+
UCSF-PDGM-149,M,66,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,15,GTR,No,BraTS2021_00464,Training,Training
|
| 134 |
+
UCSF-PDGM-150,M,51,4,"Glioblastoma, IDH-wildtype",positive,15,intact,wildtype,1,1308,GTR,No,BraTS2021_00506,Training,Training
|
| 135 |
+
UCSF-PDGM-151,F,66,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,611,GTR,No,BraTS2021_00507,Training,Training
|
| 136 |
+
UCSF-PDGM-152,F,58,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,471,STR,No,,,
|
| 137 |
+
UCSF-PDGM-153,F,68,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,1,316,GTR,No,,,
|
| 138 |
+
UCSF-PDGM-154,M,63,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,394,GTR,No,,,
|
| 139 |
+
UCSF-PDGM-155,F,71,4,"Glioblastoma, IDH-wildtype",positive,15,intact,wildtype,1,1132,GTR,No,,,
|
| 140 |
+
UCSF-PDGM-156,F,27,4,"Astrocytoma, IDH-mutant",positive,16,intact,IDH1 p.R132C,0,1035,GTR,Yes,BraTS2021_00504,Training,Training
|
| 141 |
+
UCSF-PDGM-157,F,60,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,0,902,GTR,No,BraTS2021_00505,Training,Training
|
| 142 |
+
UCSF-PDGM-158,F,83,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,1,130,GTR,No,BraTS2021_00516,Training,Training
|
| 143 |
+
UCSF-PDGM-159,F,65,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,729,STR,No,BraTS2021_00483,Training,Training
|
| 144 |
+
UCSF-PDGM-160,F,67,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,628,STR,No,BraTS2021_00462,Validation,Validation
|
| 145 |
+
UCSF-PDGM-161,M,29,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,248,GTR,No,,,
|
| 146 |
+
UCSF-PDGM-162,M,33,4,"Astrocytoma, IDH-mutant",positive,14,intact,IDH1 p.R132C,0,1366,STR,No,BraTS2021_00543,Training,Training
|
| 147 |
+
UCSF-PDGM-163,M,51,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,194,STR,No,BraTS2021_00469,Training,Training
|
| 148 |
+
UCSF-PDGM-164,M,48,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,633,GTR,No,BraTS2021_00518,Training,Training
|
| 149 |
+
UCSF-PDGM-165,M,70,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,60,GTR,No,,,
|
| 150 |
+
UCSF-PDGM-166,F,49,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,689,STR,No,,,
|
| 151 |
+
UCSF-PDGM-167,M,60,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,1196,GTR,No,BraTS2021_00470,Training,Training
|
| 152 |
+
UCSF-PDGM-168,M,49,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,418,GTR,No,BraTS2021_00533,Training,Training
|
| 153 |
+
UCSF-PDGM-169,M,79,4,"Glioblastoma, IDH-wildtype",positive,7,intact,wildtype,1,,,No,BraTS2021_00556,Training,Training
|
| 154 |
+
UCSF-PDGM-170,M,42,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,418,biopsy,No,BraTS2021_00537,Training,Training
|
| 155 |
+
UCSF-PDGM-172,F,64,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,925,GTR,No,,,
|
| 156 |
+
UCSF-PDGM-173,M,80,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,72,GTR,No,BraTS2021_00551,Training,Training
|
| 157 |
+
UCSF-PDGM-174,M,26,4,"Astrocytoma, IDH-mutant",positive,8,intact,IDH1 p.R132H,1,376,STR,No,BraTS2021_00528,Training,Training
|
| 158 |
+
UCSF-PDGM-0396_FU175d,M,36,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,1084,STR,No,BraTS2021_00538,Training,Training
|
| 159 |
+
UCSF-PDGM-176,F,74,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,302,GTR,No,BraTS2021_00503,Validation,Validation
|
| 160 |
+
UCSF-PDGM-178,F,77,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,676,STR,No,BraTS2021_00512,Training,Training
|
| 161 |
+
UCSF-PDGM-179,M,75,4,"Glioblastoma, IDH-wildtype",positive,5,intact,wildtype,0,1201,GTR,No,BraTS2021_00472,Training,Training
|
| 162 |
+
UCSF-PDGM-180,M,71,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,494,GTR,No,BraTS2021_00545,Training,Training
|
| 163 |
+
UCSF-PDGM-0409_FU001d,F,56,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,0,1167,GTR,No,BraTS2021_00539,Training,Training
|
| 164 |
+
UCSF-PDGM-182,M,65,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,446,GTR,No,,,
|
| 165 |
+
UCSF-PDGM-183,F,76,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,1163,GTR,No,BraTS2021_00524,Training,Training
|
| 166 |
+
UCSF-PDGM-184,F,59,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,545,GTR,No,BraTS2021_00520,Training,Training
|
| 167 |
+
UCSF-PDGM-185,M,35,4,"Glioblastoma, IDH-wildtype",positive,15,intact,wildtype,0,1142,GTR,Yes,BraTS2021_00526,Training,Training
|
| 168 |
+
UCSF-PDGM-186,M,60,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,230,GTR,No,BraTS2021_00558,Training,Training
|
| 169 |
+
UCSF-PDGM-187,F,61,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,115,GTR,No,BraTS2021_00501,Training,Training
|
| 170 |
+
UCSF-PDGM-188,M,46,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,329,STR,Yes,BraTS2021_00513,Training,Training
|
| 171 |
+
UCSF-PDGM-189,F,62,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,0,416,STR,Yes,BraTS2021_00550,Training,Training
|
| 172 |
+
UCSF-PDGM-190,F,39,4,"Astrocytoma, IDH-mutant",positive,16,intact,IDH1 p.R132H,0,698,STR,No,BraTS2021_00523,Training,Training
|
| 173 |
+
UCSF-PDGM-191,F,26,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,837,GTR,No,BraTS2021_00478,Training,Training
|
| 174 |
+
UCSF-PDGM-193,M,61,4,"Glioblastoma, IDH-wildtype",positive,11,intact,wildtype,1,394,GTR,Yes,BraTS2021_00500,Training,Training
|
| 175 |
+
UCSF-PDGM-194,F,52,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,512,GTR,No,BraTS2021_00485,Training,Training
|
| 176 |
+
UCSF-PDGM-195,M,58,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,304,STR,No,BraTS2021_00510,Training,Training
|
| 177 |
+
UCSF-PDGM-196,M,72,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,150,GTR,No,BraTS2021_00496,Training,Training
|
| 178 |
+
UCSF-PDGM-197,M,43,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,809,GTR,No,,,
|
| 179 |
+
UCSF-PDGM-198,M,71,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,809,GTR,No,BraTS2021_00542,Training,Training
|
| 180 |
+
UCSF-PDGM-200,F,65,4,"Glioblastoma, IDH-wildtype",positive,15,intact,wildtype,1,141,GTR,No,BraTS2021_00479,Training,Training
|
| 181 |
+
UCSF-PDGM-201,M,46,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,1015,GTR,No,,,
|
| 182 |
+
UCSF-PDGM-202,M,58,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,920,GTR,No,BraTS2021_00519,Training,Training
|
| 183 |
+
UCSF-PDGM-203,M,81,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,421,GTR,Yes,BraTS2021_00540,Training,Training
|
| 184 |
+
UCSF-PDGM-204,F,68,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,428,GTR,No,BraTS2021_00467,Validation,Validation
|
| 185 |
+
UCSF-PDGM-205,F,67,4,"Astrocytoma, IDH-mutant",positive,11,intact,IDH1 p.R132H,1,60,GTR,Yes,BraTS2021_00474,Validation,Validation
|
| 186 |
+
UCSF-PDGM-206,M,35,4,"Astrocytoma, IDH-mutant",positive,2,intact,IDH1 p.R132H,0,125,STR,No,BraTS2021_00521,Validation,Validation
|
| 187 |
+
UCSF-PDGM-207,F,57,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,281,GTR,No,BraTS2021_00492,Validation,Validation
|
| 188 |
+
UCSF-PDGM-208,M,73,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,52,biopsy,Yes,,,
|
| 189 |
+
UCSF-PDGM-209,F,61,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,446,GTR,No,BraTS2021_00495,Training,Training
|
| 190 |
+
UCSF-PDGM-210,F,67,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,603,GTR,No,BraTS2021_00560,Validation,Validation
|
| 191 |
+
UCSF-PDGM-212,F,86,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,48,biopsy,No,BraTS2021_00514,Training,Training
|
| 192 |
+
UCSF-PDGM-213,M,76,4,"Glioblastoma, IDH-wildtype",positive,12,intact,wildtype,1,361,GTR,No,BraTS2021_00494,Training,Training
|
| 193 |
+
UCSF-PDGM-214,M,68,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,845,GTR,No,,,
|
| 194 |
+
UCSF-PDGM-215,M,79,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,128,biopsy,Yes,,,
|
| 195 |
+
UCSF-PDGM-223,M,55,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,961,GTR,Yes,BraTS2021_00488,Training,Training
|
| 196 |
+
UCSF-PDGM-225,M,72,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,108,biopsy,No,BraTS2021_00477,Training,Training
|
| 197 |
+
UCSF-PDGM-227,M,72,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,421,GTR,Yes,BraTS2021_00468,Training,Training
|
| 198 |
+
UCSF-PDGM-228,F,89,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,203,STR,No,BraTS2021_00555,Training,Training
|
| 199 |
+
UCSF-PDGM-229,M,69,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,476,GTR,No,,,
|
| 200 |
+
UCSF-PDGM-231,F,36,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,2043,STR,No,,,
|
| 201 |
+
UCSF-PDGM-232,M,22,2,"Astrocytoma, IDH-mutant",positive,11,intact,IDH1 p.R132H,1,1612,STR,No,,,
|
| 202 |
+
UCSF-PDGM-233,F,31,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1182,STR,No,,,
|
| 203 |
+
UCSF-PDGM-234,M,30,2,"Astrocytoma, IDH-mutant",positive,9,intact,IDH1 p.R132G,1,2191,GTR,No,,,
|
| 204 |
+
UCSF-PDGM-235,F,34,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH2 p.R172K,0,1848,GTR,No,,,
|
| 205 |
+
UCSF-PDGM-236,F,35,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,co-deletion,mutated (NOS),0,2209,GTR,No,,,
|
| 206 |
+
UCSF-PDGM-237,M,42,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,534,STR,No,,,
|
| 207 |
+
UCSF-PDGM-238,M,24,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,2098,STR,No,,,
|
| 208 |
+
UCSF-PDGM-239,M,57,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,co-deletion,mutated (NOS),0,157,STR,No,,,
|
| 209 |
+
UCSF-PDGM-240,F,26,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,2018,STR,No,,,
|
| 210 |
+
UCSF-PDGM-241,M,30,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,1382,STR,No,,,
|
| 211 |
+
UCSF-PDGM-242,M,37,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,1833,GTR,No,,,
|
| 212 |
+
UCSF-PDGM-243,M,59,3,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,relative co-deletion,mutated (NOS),0,1850,STR,No,,,
|
| 213 |
+
UCSF-PDGM-244,F,43,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,co-deletion,mutated (NOS),0,1714,STR,No,,,
|
| 214 |
+
UCSF-PDGM-245,M,34,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132C,0,1840,STR,No,,,
|
| 215 |
+
UCSF-PDGM-246,F,46,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,41,STR,No,,,
|
| 216 |
+
UCSF-PDGM-247,M,26,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,co-deletion,mutated (NOS),0,13,STR,No,,,
|
| 217 |
+
UCSF-PDGM-248,M,46,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1643,STR,No,,,
|
| 218 |
+
UCSF-PDGM-249,M,59,3,"Astrocytoma, IDH-wildtype",positive,9,intact,wildtype,0,22,STR,No,,,
|
| 219 |
+
UCSF-PDGM-250,M,44,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,14,STR,No,,,
|
| 220 |
+
UCSF-PDGM-251,M,36,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,689,STR,No,,,
|
| 221 |
+
UCSF-PDGM-252,F,35,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132G,0,1595,STR,No,,,
|
| 222 |
+
UCSF-PDGM-253,M,25,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1547,STR,Yes,,,
|
| 223 |
+
UCSF-PDGM-254,F,53,3,"Astrocytoma, IDH-wildtype",negative,0,intact,wildtype,1,718,STR,No,,,
|
| 224 |
+
UCSF-PDGM-255,F,40,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,1521,GTR,No,,,
|
| 225 |
+
UCSF-PDGM-256,F,28,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1513,GTR,No,,,
|
| 226 |
+
UCSF-PDGM-257,M,32,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1449,STR,No,,,
|
| 227 |
+
UCSF-PDGM-258,M,23,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,co-deletion,mutated (NOS),0,187,STR,No,,,
|
| 228 |
+
UCSF-PDGM-259,M,28,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),1,1421,STR,No,,,
|
| 229 |
+
UCSF-PDGM-260,F,56,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,relative co-deletion,mutated (NOS),0,1118,GTR,No,,,
|
| 230 |
+
UCSF-PDGM-261,F,29,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,805,STR,No,,,
|
| 231 |
+
UCSF-PDGM-262,M,44,3,"Astrocytoma, IDH-mutant",negative,0,intact,IDH1 p.R132S,0,1190,STR,No,,,
|
| 232 |
+
UCSF-PDGM-263,M,54,3,"Astrocytoma, IDH-wildtype",positive,1,intact,wildtype,1,663,STR,Yes,,,
|
| 233 |
+
UCSF-PDGM-264,F,48,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,839,STR,No,,,
|
| 234 |
+
UCSF-PDGM-265,F,44,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,co-deletion,mutated (NOS),0,916,STR,No,,,
|
| 235 |
+
UCSF-PDGM-266,M,31,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,mutated (NOS),0,689,STR,No,,,
|
| 236 |
+
UCSF-PDGM-267,M,45,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,co-deletion,mutated (NOS),0,55,STR,No,,,
|
| 237 |
+
UCSF-PDGM-268,F,51,3,"Astrocytoma, IDH-wildtype",positive,17,intact,wildtype,0,639,GTR,No,,,
|
| 238 |
+
UCSF-PDGM-269,M,48,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,co-deletion,mutated (NOS),0,565,STR,No,,,
|
| 239 |
+
UCSF-PDGM-270,F,46,4,"Glioblastoma, IDH-wildtype",positive,12,intact,wildtype,0,166,GTR,No,,,
|
| 240 |
+
UCSF-PDGM-272,M,35,3,"Astrocytoma, IDH-mutant",negative,unknown,intact,IDH2 p.Arg172Trp,0,574,STR,No,,,
|
| 241 |
+
UCSF-PDGM-273,M,47,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,0,483,GTR,No,BraTS2021_00544,Training,Training
|
| 242 |
+
UCSF-PDGM-274,F,35,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132C,0,728,biopsy,No,,,
|
| 243 |
+
UCSF-PDGM-275,F,65,4,"Glioblastoma, IDH-wildtype",positive,unknown,intact,wildtype,1,465,STR,Yes,BraTS2021_00480,Training,Training
|
| 244 |
+
UCSF-PDGM-276,M,51,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,439,STR,No,BraTS2021_00489,Validation,Validation
|
| 245 |
+
UCSF-PDGM-277,F,75,3,"Astrocytoma, IDH-wildtype",positive,11,intact,wildtype,1,629,biopsy,No,,,
|
| 246 |
+
UCSF-PDGM-0431_FU001d,M,69,4,"Glioblastoma, IDH-wildtype",positive,4,intact,wildtype,0,358,GTR,No,BraTS2021_00499,Training,Training
|
| 247 |
+
UCSF-PDGM-279,M,60,4,"Glioblastoma, IDH-wildtype",positive,12,intact,wildtype,0,163,STR,No,,,
|
| 248 |
+
UCSF-PDGM-280,M,62,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,773,GTR,No,BraTS2021_00734,Training,Training
|
| 249 |
+
UCSF-PDGM-281,M,46,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,relative co-deletion,mutated (NOS),0,836,STR,No,,,
|
| 250 |
+
UCSF-PDGM-282,F,48,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,763,GTR,No,,,
|
| 251 |
+
UCSF-PDGM-283,M,69,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,0,748,GTR,No,,,
|
| 252 |
+
UCSF-PDGM-284,F,69,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,685,GTR,Yes,,,
|
| 253 |
+
UCSF-PDGM-285,F,60,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,714,GTR,No,,,
|
| 254 |
+
UCSF-PDGM-286,F,39,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,189,STR,No,,,
|
| 255 |
+
UCSF-PDGM-287,F,59,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,435,biopsy,No,BraTS2021_00694,Training,Training
|
| 256 |
+
UCSF-PDGM-288,M,46,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,420,biopsy,Yes,,,
|
| 257 |
+
UCSF-PDGM-0391_FU016d,F,59,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,711,STR,No,,,
|
| 258 |
+
UCSF-PDGM-290,M,43,4,"Astrocytoma, IDH-mutant",positive,4,intact,IDH1 p.R132H,0,407,GTR,No,BraTS2021_00768,Training,Training
|
| 259 |
+
UCSF-PDGM-291,F,71,4,"Glioblastoma, IDH-wildtype",positive,15,intact,wildtype,1,396,biopsy,No,BraTS2021_00725,Training,Training
|
| 260 |
+
UCSF-PDGM-295,F,56,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,221,STR,No,,,
|
| 261 |
+
UCSF-PDGM-296,M,64,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,491,GTR,No,BraTS2021_00692,Training,Training
|
| 262 |
+
UCSF-PDGM-297,F,68,4,"Glioblastoma, IDH-wildtype",unknown,0,intact,wildtype,1,357,GTR,No,BraTS2021_01153,Training,
|
| 263 |
+
UCSF-PDGM-298,M,48,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,757,STR,No,,,
|
| 264 |
+
UCSF-PDGM-300,F,33,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,184,biopsy,Yes,,,
|
| 265 |
+
UCSF-PDGM-302,M,45,2,"Astrocytoma, IDH-wildtype",positive,5,intact,wildtype,1,999,biopsy,No,,,
|
| 266 |
+
UCSF-PDGM-303,M,64,3,"Astrocytoma, IDH-mutant",positive,15,intact,IDH1 p.R132H,0,624,STR,No,,,
|
| 267 |
+
UCSF-PDGM-304,M,52,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1176,STR,No,,,
|
| 268 |
+
UCSF-PDGM-305,F,36,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,706,GTR,Yes,,,
|
| 269 |
+
UCSF-PDGM-306,F,70,4,"Glioblastoma, IDH-wildtype",positive,9,intact,wildtype,1,163,STR,No,,,
|
| 270 |
+
UCSF-PDGM-307,M,31,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,740,STR,Yes,,,
|
| 271 |
+
UCSF-PDGM-308,M,45,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,720,biopsy,No,,,
|
| 272 |
+
UCSF-PDGM-309,M,57,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,319,STR,Yes,BraTS2021_00703,Training,Training
|
| 273 |
+
UCSF-PDGM-310,M,74,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,174,GTR,No,BraTS2021_00765,Training,Training
|
| 274 |
+
UCSF-PDGM-311,M,57,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,405,GTR,No,BraTS2021_00706,Training,Training
|
| 275 |
+
UCSF-PDGM-312,F,75,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,1,55,biopsy,No,BraTS2021_01154,Training,
|
| 276 |
+
UCSF-PDGM-313,M,71,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,349,STR,No,BraTS2021_00757,Training,Training
|
| 277 |
+
UCSF-PDGM-314,M,68,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,135,GTR,No,,,
|
| 278 |
+
UCSF-PDGM-0433_FU007d,M,65,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,205,GTR,No,BraTS2021_00758,Training,Training
|
| 279 |
+
UCSF-PDGM-316,M,60,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,300,GTR,No,BraTS2021_00682,Training,Training
|
| 280 |
+
UCSF-PDGM-317,M,69,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,677,GTR,No,BraTS2021_00728,Training,Training
|
| 281 |
+
UCSF-PDGM-318,F,33,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,128,biopsy,Yes,,,
|
| 282 |
+
UCSF-PDGM-319,F,83,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,275,GTR,No,BraTS2021_00697,Training,Training
|
| 283 |
+
UCSF-PDGM-320,F,54,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,0,571,GTR,No,BraTS2021_00772,Training,Training
|
| 284 |
+
UCSF-PDGM-321,F,63,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,0,280,STR,No,BraTS2021_00691,Training,Training
|
| 285 |
+
UCSF-PDGM-323,M,76,4,"Glioblastoma, IDH-wildtype",positive,15,intact,wildtype,1,332,GTR,No,BraTS2021_00698,Training,Training
|
| 286 |
+
UCSF-PDGM-324,M,37,4,"Astrocytoma, IDH-mutant",positive,2,intact,IDH1 p.R132G,0,15,STR,No,BraTS2021_00680,Training,Training
|
| 287 |
+
UCSF-PDGM-325,M,61,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,108,GTR,No,BraTS2021_00702,Validation,Validation
|
| 288 |
+
UCSF-PDGM-326,F,32,3,"Astrocytoma, IDH-mutant",positive,11,intact,IDH1 p.R132C,0,514,STR,No,,,
|
| 289 |
+
UCSF-PDGM-327,M,57,2,"Astrocytoma, IDH-wildtype",unknown,unknown,intact,wildtype,1,658,STR,No,,,
|
| 290 |
+
UCSF-PDGM-328,M,54,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,292,GTR,No,BraTS2021_00723,Training,Training
|
| 291 |
+
UCSF-PDGM-329,F,44,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,1812,STR,Yes,,,
|
| 292 |
+
UCSF-PDGM-330,F,63,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,1,599,GTR,No,BraTS2021_01155,Training,
|
| 293 |
+
UCSF-PDGM-331,M,46,3,"Astrocytoma, IDH-mutant",positive,10,intact,IDH1 p.R132H,0,1640,STR,No,,,
|
| 294 |
+
UCSF-PDGM-332,M,68,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,42,GTR,No,,,
|
| 295 |
+
UCSF-PDGM-333,F,52,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,496,GTR,No,BraTS2021_00719,Validation,Validation
|
| 296 |
+
UCSF-PDGM-334,F,62,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,386,GTR,No,BraTS2021_00778,Training,Training
|
| 297 |
+
UCSF-PDGM-335,F,41,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,1690,GTR,No,,,
|
| 298 |
+
UCSF-PDGM-336,M,57,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,1,177,GTR,No,BraTS2021_01156,Training,
|
| 299 |
+
UCSF-PDGM-337,M,48,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,1113,STR,Yes,BraTS2021_01157,Training,
|
| 300 |
+
UCSF-PDGM-338,M,62,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,356,GTR,No,BraTS2021_00686,Training,Training
|
| 301 |
+
UCSF-PDGM-339,M,50,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,0,930,GTR,Yes,,,
|
| 302 |
+
UCSF-PDGM-340,F,69,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,0,1347,GTR,No,BraTS2021_00708,Training,Training
|
| 303 |
+
UCSF-PDGM-341,F,57,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,1067,GTR,No,BraTS2021_00681,Validation,Validation
|
| 304 |
+
UCSF-PDGM-342,F,66,4,"Glioblastoma, IDH-wildtype",positive,11,intact,wildtype,1,1248,GTR,Yes,BraTS2021_00732,Training,Training
|
| 305 |
+
UCSF-PDGM-343,F,48,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,183,STR,No,BraTS2021_00704,Training,Training
|
| 306 |
+
UCSF-PDGM-344,M,66,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,329,STR,Yes,,,
|
| 307 |
+
UCSF-PDGM-345,F,46,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,743,GTR,No,BraTS2021_00731,Training,Training
|
| 308 |
+
UCSF-PDGM-346,F,72,4,"Glioblastoma, IDH-wildtype",positive,unknown,intact,wildtype,1,676,STR,Yes,,,
|
| 309 |
+
UCSF-PDGM-347,F,54,4,"Glioblastoma, IDH-wildtype",positive,6,intact,wildtype,0,1333,GTR,Yes,BraTS2021_00693,Training,Training
|
| 310 |
+
UCSF-PDGM-348,F,54,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,627,STR,Yes,BraTS2021_00769,Validation,Validation
|
| 311 |
+
UCSF-PDGM-349,M,52,3,"Astrocytoma, IDH-wildtype",negative,0,intact,wildtype,1,445,GTR,No,,,
|
| 312 |
+
UCSF-PDGM-350,M,44,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,643,STR,Yes,BraTS2021_00715,Training,Training
|
| 313 |
+
UCSF-PDGM-351,F,61,2,"Astrocytoma, IDH-wildtype",positive,1,intact,wildtype,0,1226,STR,No,,,
|
| 314 |
+
UCSF-PDGM-352,M,78,3,"Astrocytoma, IDH-wildtype",positive,16,intact,wildtype,1,631,STR,No,,,
|
| 315 |
+
UCSF-PDGM-353,F,59,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,539,GTR,No,BraTS2021_00746,Training,Training
|
| 316 |
+
UCSF-PDGM-354,F,56,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,248,STR,No,BraTS2021_00773,Training,Training
|
| 317 |
+
UCSF-PDGM-355,F,69,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,1037,GTR,No,BraTS2021_00756,Training,Training
|
| 318 |
+
UCSF-PDGM-356,M,61,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,1098,GTR,No,,,
|
| 319 |
+
UCSF-PDGM-357,F,43,3,"Astrocytoma, IDH-wildtype",negative,0,intact,wildtype,0,567,STR,No,,,
|
| 320 |
+
UCSF-PDGM-358,M,57,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,430,STR,Yes,BraTS2021_00712,Validation,Validation
|
| 321 |
+
UCSF-PDGM-359,F,69,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,681,GTR,Yes,BraTS2021_00709,Training,Training
|
| 322 |
+
UCSF-PDGM-360,F,62,4,"Glioblastoma, IDH-wildtype",positive,15,intact,wildtype,0,777,GTR,No,BraTS2021_00689,Training,
|
| 323 |
+
UCSF-PDGM-361,F,58,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,499,GTR,No,BraTS2021_00688,Training,Training
|
| 324 |
+
UCSF-PDGM-362,F,75,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,364,GTR,No,BraTS2021_00687,Training,Training
|
| 325 |
+
UCSF-PDGM-363,M,66,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,363,STR,Yes,BraTS2021_00724,Training,Training
|
| 326 |
+
UCSF-PDGM-364,M,47,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,740,GTR,No,BraTS2021_00733,Training,Training
|
| 327 |
+
UCSF-PDGM-365,M,74,3,"Astrocytoma, IDH-wildtype",positive,12,intact,wildtype,1,415,STR,No,,,
|
| 328 |
+
UCSF-PDGM-366,F,56,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,762,GTR,Yes,BraTS2021_00777,Training,Training
|
| 329 |
+
UCSF-PDGM-367,F,59,3,"Astrocytoma, IDH-mutant",positive,10,intact,IDH1 p.R132H,0,1029,STR,Yes,,,
|
| 330 |
+
UCSF-PDGM-368,F,59,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,561,GTR,No,BraTS2021_00729,Training,Training
|
| 331 |
+
UCSF-PDGM-369,F,58,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,421,GTR,Yes,BraTS2021_00759,Training,Training
|
| 332 |
+
UCSF-PDGM-370,F,76,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,461,STR,Yes,BraTS2021_00736,Training,Training
|
| 333 |
+
UCSF-PDGM-371,M,48,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,660,GTR,Yes,BraTS2021_00735,Training,Training
|
| 334 |
+
UCSF-PDGM-372,M,64,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,219,biopsy,No,BraTS2021_00774,Training,Training
|
| 335 |
+
UCSF-PDGM-373,F,65,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,1,18,GTR,No,BraTS2021_01158,Training,
|
| 336 |
+
UCSF-PDGM-374,F,63,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,566,GTR,Yes,BraTS2021_00684,Training,Training
|
| 337 |
+
UCSF-PDGM-375,M,44,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,0,616,GTR,No,BraTS2021_00775,Training,Training
|
| 338 |
+
UCSF-PDGM-376,F,57,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,509,STR,Yes,BraTS2021_00742,Training,Training
|
| 339 |
+
UCSF-PDGM-377,F,72,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,384,GTR,No,BraTS2021_00714,Training,Training
|
| 340 |
+
UCSF-PDGM-378,F,31,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,510,biopsy,Yes,BraTS2021_00753,Training,Training
|
| 341 |
+
UCSF-PDGM-379,M,43,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,213,biopsy,No,BraTS2021_00751,Training,Training
|
| 342 |
+
UCSF-PDGM-380,M,60,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,534,GTR,No,BraTS2021_00744,Training,Training
|
| 343 |
+
UCSF-PDGM-381,M,78,4,"Glioblastoma, IDH-wildtype",positive,4,intact,wildtype,0,302,GTR,No,BraTS2021_00779,Validation,Validation
|
| 344 |
+
UCSF-PDGM-382,M,68,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,19,STR,No,BraTS2021_00730,Training,Training
|
| 345 |
+
UCSF-PDGM-383,F,82,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,754,GTR,Yes,,,
|
| 346 |
+
UCSF-PDGM-384,M,60,4,"Glioblastoma, IDH-wildtype",positive,9,intact,wildtype,1,319,STR,No,BraTS2021_00750,Training,Training
|
| 347 |
+
UCSF-PDGM-385,F,54,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,450,STR,Yes,BraTS2021_00699,Validation,Validation
|
| 348 |
+
UCSF-PDGM-386,F,60,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,912,GTR,Yes,BraTS2021_00721,Validation,Validation
|
| 349 |
+
UCSF-PDGM-387,F,68,4,"Glioblastoma, IDH-wildtype",positive,11,intact,wildtype,0,86,biopsy,No,BraTS2021_00737,Training,Training
|
| 350 |
+
UCSF-PDGM-388,M,62,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,1119,STR,No,,,
|
| 351 |
+
UCSF-PDGM-389,M,58,4,"Glioblastoma, IDH-wildtype",positive,10,intact,wildtype,1,498,STR,No,,,
|
| 352 |
+
UCSF-PDGM-390,M,71,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,618,GTR,No,BraTS2021_00727,Training,Training
|
| 353 |
+
UCSF-PDGM-391,F,59,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,711,STR,No,BraTS2021_00716,Training,Training
|
| 354 |
+
UCSF-PDGM-392,F,67,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,363,biopsy,No,BraTS2021_00762,Validation,Validation
|
| 355 |
+
UCSF-PDGM-393,M,66,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,375,STR,No,BraTS2021_00685,Training,Training
|
| 356 |
+
UCSF-PDGM-394,M,57,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,0,565,GTR,Yes,BraTS2021_00740,Training,Training
|
| 357 |
+
UCSF-PDGM-395,F,60,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,1,785,GTR,Yes,BraTS2021_01159,Training,
|
| 358 |
+
UCSF-PDGM-396,M,36,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,1084,STR,No,,,
|
| 359 |
+
UCSF-PDGM-397,M,81,4,"Glioblastoma, IDH-wildtype",positive,9,intact,wildtype,1,19,GTR,No,BraTS2021_00690,Training,Training
|
| 360 |
+
UCSF-PDGM-398,F,58,4,"Glioblastoma, IDH-wildtype",positive,11,intact,wildtype,1,753,GTR,No,,,
|
| 361 |
+
UCSF-PDGM-399,M,48,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,548,GTR,No,,,
|
| 362 |
+
UCSF-PDGM-400,M,60,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,244,STR,Yes,BraTS2021_00747,Training,Training
|
| 363 |
+
UCSF-PDGM-401,M,78,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,114,biopsy,No,,,
|
| 364 |
+
UCSF-PDGM-402,M,61,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,90,STR,No,,,
|
| 365 |
+
UCSF-PDGM-403,M,64,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,69,STR,No,,,
|
| 366 |
+
UCSF-PDGM-404,M,69,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,191,GTR,No,BraTS2021_00683,Training,Training
|
| 367 |
+
UCSF-PDGM-405,M,45,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,319,GTR,No,BraTS2021_00718,Training,Training
|
| 368 |
+
UCSF-PDGM-406,M,52,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,169,GTR,No,BraTS2021_00760,Training,Training
|
| 369 |
+
UCSF-PDGM-407,M,42,4,"Astrocytoma, IDH-mutant",positive,17,intact,IDH1 p.R132H,0,165,GTR,No,,,
|
| 370 |
+
UCSF-PDGM-409,F,56,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,0,1167,GTR,No,,,
|
| 371 |
+
UCSF-PDGM-410,M,49,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,366,GTR,No,BraTS2021_00749,Validation,Validation
|
| 372 |
+
UCSF-PDGM-411,M,60,4,"Glioblastoma, IDH-wildtype",positive,7,intact,wildtype,0,388,GTR,Yes,BraTS2021_00739,Training,Training
|
| 373 |
+
UCSF-PDGM-412,M,47,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,239,biopsy,No,BraTS2021_00764,Training,Training
|
| 374 |
+
UCSF-PDGM-413,F,56,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,2144,GTR,Yes,BraTS2021_00707,Training,Training
|
| 375 |
+
UCSF-PDGM-414,F,77,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,351,GTR,No,BraTS2021_00767,Training,Training
|
| 376 |
+
UCSF-PDGM-415,M,30,4,"Astrocytoma, IDH-mutant",positive,7,intact,IDH1 p.R132H,0,1320,GTR,Yes,BraTS2021_00705,Training,Training
|
| 377 |
+
UCSF-PDGM-416,M,63,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,484,STR,No,,,
|
| 378 |
+
UCSF-PDGM-417,M,68,4,"Glioblastoma, IDH-wildtype",positive,5,intact,wildtype,1,334,GTR,No,BraTS2021_00625,Training,Training
|
| 379 |
+
UCSF-PDGM-418,M,52,4,"Glioblastoma, IDH-wildtype",positive,9,intact,wildtype,1,657,STR,No,BraTS2021_00610,Training,Training
|
| 380 |
+
UCSF-PDGM-419,M,77,4,"Glioblastoma, IDH-wildtype",positive,10,intact,wildtype,0,307,GTR,No,BraTS2021_00675,Training,Training
|
| 381 |
+
UCSF-PDGM-420,F,57,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,213,GTR,No,,,
|
| 382 |
+
UCSF-PDGM-421,M,80,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,518,GTR,No,BraTS2021_00615,Training,Training
|
| 383 |
+
UCSF-PDGM-422,M,78,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,264,GTR,No,,,
|
| 384 |
+
UCSF-PDGM-423,M,52,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,602,STR,No,BraTS2021_00676,Training,Training
|
| 385 |
+
UCSF-PDGM-424,M,42,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,504,GTR,No,BraTS2021_00651,Training,Training
|
| 386 |
+
UCSF-PDGM-425,M,54,4,"Glioblastoma, IDH-wildtype",positive,5,intact,wildtype,1,605,GTR,No,BraTS2021_00658,Training,Training
|
| 387 |
+
UCSF-PDGM-426,M,65,4,"Glioblastoma, IDH-wildtype",positive,8,intact,wildtype,0,249,STR,No,BraTS2021_00608,Training,Training
|
| 388 |
+
UCSF-PDGM-427,M,51,4,"Astrocytoma, IDH-mutant",positive,16,intact,IDH1 p.R132H,0,222,GTR,No,BraTS2021_00656,Training,Training
|
| 389 |
+
UCSF-PDGM-428,M,42,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,422,GTR,No,BraTS2021_00636,Training,Training
|
| 390 |
+
UCSF-PDGM-429,F,58,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,624,GTR,No,BraTS2021_00639,Training,Training
|
| 391 |
+
UCSF-PDGM-430,M,79,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,406,GTR,Yes,BraTS2021_00642,Training,Training
|
| 392 |
+
UCSF-PDGM-431,M,69,4,"Glioblastoma, IDH-wildtype",positive,4,intact,wildtype,0,358,GTR,No,,,
|
| 393 |
+
UCSF-PDGM-432,F,19,4,"Astrocytoma, IDH-mutant",positive,9,intact,IDH1 p.R132H,1,639,GTR,No,,,
|
| 394 |
+
UCSF-PDGM-433,M,65,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,205,GTR,No,BraTS2021_00626,Training,Training
|
| 395 |
+
UCSF-PDGM-434,M,67,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,134,STR,No,BraTS2021_00624,Training,Training
|
| 396 |
+
UCSF-PDGM-435,M,73,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,183,GTR,No,,,
|
| 397 |
+
UCSF-PDGM-436,F,57,3,"Astrocytoma, IDH-wildtype",positive,3,intact,wildtype,0,424,biopsy,No,,,
|
| 398 |
+
UCSF-PDGM-437,F,38,3,"Astrocytoma, IDH-mutant",negative,0,intact,IDH1 p.R132G,0,4177,STR,Yes,,,
|
| 399 |
+
UCSF-PDGM-438,F,38,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132C,0,1280,STR,No,,,
|
| 400 |
+
UCSF-PDGM-439,M,38,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1022,GTR,No,,,
|
| 401 |
+
UCSF-PDGM-440,M,31,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132G,0,1210,STR,No,,,
|
| 402 |
+
UCSF-PDGM-441,F,26,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,375,GTR,No,,,
|
| 403 |
+
UCSF-PDGM-442,F,66,2,"Astrocytoma, IDH-wildtype",negative,0,intact,wildtype,1,1145,STR,No,,,
|
| 404 |
+
UCSF-PDGM-443,F,47,2,"Astrocytoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,187,biopsy,No,,,
|
| 405 |
+
UCSF-PDGM-444,M,32,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1730,STR,No,,,
|
| 406 |
+
UCSF-PDGM-445,M,48,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,672,STR,No,,,
|
| 407 |
+
UCSF-PDGM-446,F,71,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,118,STR,No,,,
|
| 408 |
+
UCSF-PDGM-447,F,71,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,28,biopsy,No,BraTS2021_00638,Training,Training
|
| 409 |
+
UCSF-PDGM-448,M,55,2,"Astrocytoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,158,biopsy,No,,,
|
| 410 |
+
UCSF-PDGM-449,M,61,3,"Astrocytoma, IDH-wildtype",positive,4,intact,wildtype,1,404,biopsy,No,,,
|
| 411 |
+
UCSF-PDGM-450,F,55,4,"Glioblastoma, IDH-wildtype",positive,12,intact,wildtype,1,369,STR,No,,,
|
| 412 |
+
UCSF-PDGM-451,M,43,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,512,GTR,No,BraTS2021_00667,Training,Training
|
| 413 |
+
UCSF-PDGM-452,M,76,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,1,112,GTR,No,,,
|
| 414 |
+
UCSF-PDGM-453,M,75,4,"Glioblastoma, IDH-wildtype",positive,13,intact,wildtype,1,96,biopsy,No,BraTS2021_00606,Training,Training
|
| 415 |
+
UCSF-PDGM-454,M,64,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,0,285,STR,No,BraTS2021_00674,Training,Training
|
| 416 |
+
UCSF-PDGM-455,M,55,4,"Glioblastoma, IDH-wildtype",negative,unknown,intact,wildtype,1,165,STR,Yes,,,
|
| 417 |
+
UCSF-PDGM-456,M,66,2,"Astrocytoma, IDH-wildtype",positive,2,intact,wildtype,1,409,biopsy,No,,,
|
| 418 |
+
UCSF-PDGM-457,M,61,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,241,GTR,No,,,
|
| 419 |
+
UCSF-PDGM-458,M,65,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,1,110,STR,No,BraTS2021_01160,Training,
|
| 420 |
+
UCSF-PDGM-459,M,78,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,78,STR,No,BraTS2021_00641,Training,Training
|
| 421 |
+
UCSF-PDGM-460,F,33,4,"Astrocytoma, IDH-mutant",positive,14,intact,IDH1 p.R132C,0,106,STR,No,,,
|
| 422 |
+
UCSF-PDGM-461,F,73,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,66,STR,No,,,
|
| 423 |
+
UCSF-PDGM-462,M,83,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,84,GTR,No,BraTS2021_00618,Training,Training
|
| 424 |
+
UCSF-PDGM-463,F,74,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,108,STR,No,,,
|
| 425 |
+
UCSF-PDGM-464,F,75,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,0,10,biopsy,No,BraTS2021_00602,Training,Training
|
| 426 |
+
UCSF-PDGM-465,M,35,2,"Astrocytoma, IDH-wildtype",unknown,unknown,intact,wildtype,1,92,biopsy,No,,,
|
| 427 |
+
UCSF-PDGM-466,F,72,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,287,biopsy,No,BraTS2021_00668,Training,Training
|
| 428 |
+
UCSF-PDGM-467,M,75,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,169,STR,No,BraTS2021_00607,Training,Training
|
| 429 |
+
UCSF-PDGM-468,M,38,3,"Astrocytoma, IDH-mutant",positive,9,intact,IDH1 p.R132H,0,523,STR,No,,,
|
| 430 |
+
UCSF-PDGM-469,F,43,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1338,STR,Yes,,,
|
| 431 |
+
UCSF-PDGM-470,M,71,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,70,biopsy,No,BraTS2021_00650,Training,Training
|
| 432 |
+
UCSF-PDGM-471,F,26,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,1,319,STR,Yes,,,
|
| 433 |
+
UCSF-PDGM-472,F,76,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,38,biopsy,No,BraTS2021_00613,Training,Training
|
| 434 |
+
UCSF-PDGM-473,F,34,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,952,STR,No,,,
|
| 435 |
+
UCSF-PDGM-474,M,40,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,1,593,STR,No,,,
|
| 436 |
+
UCSF-PDGM-475,F,31,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1369,GTR,No,,,
|
| 437 |
+
UCSF-PDGM-476,F,22,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,1677,STR,No,,,
|
| 438 |
+
UCSF-PDGM-477,F,69,2,"Astrocytoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,792,STR,No,,,
|
| 439 |
+
UCSF-PDGM-478,M,37,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,957,STR,No,,,
|
| 440 |
+
UCSF-PDGM-479,M,67,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,475,STR,Yes,BraTS2021_00619,Training,Training
|
| 441 |
+
UCSF-PDGM-480,M,94,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,54,GTR,No,BraTS2021_00679,Training,Training
|
| 442 |
+
UCSF-PDGM-481,M,57,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,483,GTR,No,BraTS2021_00616,Training,Training
|
| 443 |
+
UCSF-PDGM-482,M,45,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,1,998,biopsy,No,,,
|
| 444 |
+
UCSF-PDGM-483,M,71,2,"Astrocytoma, IDH-wildtype",positive,1,intact,wildtype,0,342,STR,No,,,
|
| 445 |
+
UCSF-PDGM-484,F,60,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,1,149,GTR,Yes,,,
|
| 446 |
+
UCSF-PDGM-485,M,65,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,524,STR,No,,,
|
| 447 |
+
UCSF-PDGM-486,F,54,3,"Astrocytoma, IDH-wildtype",negative,0,intact,wildtype,0,232,STR,No,,,
|
| 448 |
+
UCSF-PDGM-487,M,21,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,111,STR,Yes,,,
|
| 449 |
+
UCSF-PDGM-488,M,77,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,142,GTR,Yes,BraTS2021_00646,Training,Training
|
| 450 |
+
UCSF-PDGM-489,M,42,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.Arg132His,0,846,STR,Yes,,,
|
| 451 |
+
UCSF-PDGM-490,M,29,2,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,505,STR,No,,,
|
| 452 |
+
UCSF-PDGM-491,M,64,3,"Astrocytoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,2708,STR,No,,,
|
| 453 |
+
UCSF-PDGM-492,F,63,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,262,GTR,No,BraTS2021_00605,Training,Training
|
| 454 |
+
UCSF-PDGM-493,M,74,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,114,GTR,No,BraTS2021_00663,Training,Training
|
| 455 |
+
UCSF-PDGM-494,F,71,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,111,GTR,No,BraTS2021_00644,Validation,Validation
|
| 456 |
+
UCSF-PDGM-495,M,71,4,"Glioblastoma, IDH-wildtype",positive,2,intact,wildtype,1,168,STR,No,,,
|
| 457 |
+
UCSF-PDGM-496,F,68,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,92,GTR,No,BraTS2021_00611,Training,Training
|
| 458 |
+
UCSF-PDGM-497,M,73,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,262,GTR,No,BraTS2021_00603,Validation,Validation
|
| 459 |
+
UCSF-PDGM-498,F,53,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,95,GTR,No,BraTS2021_01161,Training,
|
| 460 |
+
UCSF-PDGM-499,M,34,3,"Astrocytoma, IDH-mutant",unknown,unknown,intact,IDH1 p.R132H,0,12,GTR,No,,,
|
| 461 |
+
UCSF-PDGM-500,M,47,3,"Astrocytoma, IDH-wildtype",positive,1,intact,wildtype,1,185,biopsy,No,,,
|
| 462 |
+
UCSF-PDGM-501,M,26,3,"Astrocytoma, IDH-mutant",positive,16,intact,IDH1 p.R132H,1,531,STR,No,,,
|
| 463 |
+
UCSF-PDGM-502,F,77,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,59,GTR,No,,,
|
| 464 |
+
UCSF-PDGM-503,F,73,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,204,GTR,No,BraTS2021_00620,Training,Training
|
| 465 |
+
UCSF-PDGM-504,F,63,4,"Glioblastoma, IDH-wildtype",positive,9,intact,wildtype,0,1101,GTR,No,,,
|
| 466 |
+
UCSF-PDGM-505,M,63,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,208,GTR,No,,,
|
| 467 |
+
UCSF-PDGM-506,M,85,4,"Glioblastoma, IDH-wildtype",indeterminate,unknown,unknown,wildtype,1,86,STR,No,,,
|
| 468 |
+
UCSF-PDGM-507,F,61,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,35,GTR,No,BraTS2021_00645,Training,Training
|
| 469 |
+
UCSF-PDGM-508,M,61,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,81,STR,No,BraTS2021_00662,Validation,Validation
|
| 470 |
+
UCSF-PDGM-509,F,68,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,0,267,GTR,No,BraTS2021_00659,Training,Training
|
| 471 |
+
UCSF-PDGM-510,M,62,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,252,GTR,No,BraTS2021_00677,Training,Training
|
| 472 |
+
UCSF-PDGM-511,M,60,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,112,GTR,No,,,
|
| 473 |
+
UCSF-PDGM-512,F,80,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,1,303,GTR,No,BraTS2021_00649,Training,Training
|
| 474 |
+
UCSF-PDGM-513,F,73,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,1,80,GTR,No,,,
|
| 475 |
+
UCSF-PDGM-514,F,54,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,375,biopsy,No,BraTS2021_00623,Training,Training
|
| 476 |
+
UCSF-PDGM-515,F,82,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,45,GTR,No,BraTS2021_00654,Training,Training
|
| 477 |
+
UCSF-PDGM-516,F,55,4,"Glioblastoma, IDH-wildtype",positive,4,intact,wildtype,0,316,GTR,No,BraTS2021_00622,Training,Training
|
| 478 |
+
UCSF-PDGM-517,M,53,4,"Astrocytoma, IDH-mutant",positive,15,intact,IDH1 p.R132H,0,86,GTR,No,BraTS2021_00671,Validation,Validation
|
| 479 |
+
UCSF-PDGM-518,M,32,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,369,GTR,No,BraTS2021_00657,Training,Training
|
| 480 |
+
UCSF-PDGM-519,M,64,4,"Glioblastoma, IDH-wildtype",positive,14,intact,wildtype,0,320,GTR,No,,,
|
| 481 |
+
UCSF-PDGM-520,M,70,4,"Glioblastoma, IDH-wildtype",positive,8,intact,wildtype,0,373,GTR,No,BraTS2021_00655,Training,Training
|
| 482 |
+
UCSF-PDGM-521,M,58,4,"Glioblastoma, IDH-wildtype",unknown,unknown,intact,wildtype,0,305,biopsy,No,,,
|
| 483 |
+
UCSF-PDGM-522,M,62,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,306,GTR,No,BraTS2021_00631,Training,Training
|
| 484 |
+
UCSF-PDGM-523,F,65,4,"Glioblastoma, IDH-wildtype",positive,3,intact,wildtype,0,156,GTR,No,BraTS2021_00661,Training,Training
|
| 485 |
+
UCSF-PDGM-524,M,47,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,680,STR,Yes,BraTS2021_00628,Training,Training
|
| 486 |
+
UCSF-PDGM-525,F,62,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,37,biopsy,No,BraTS2021_00630,Training,Training
|
| 487 |
+
UCSF-PDGM-526,M,74,4,"Glioblastoma, IDH-wildtype",positive,1,intact,wildtype,0,126,GTR,No,BraTS2021_00601,Training,Training
|
| 488 |
+
UCSF-PDGM-527,F,58,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,150,GTR,No,BraTS2021_00640,Training,Training
|
| 489 |
+
UCSF-PDGM-528,M,57,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,54,biopsy,No,,,
|
| 490 |
+
UCSF-PDGM-529,M,34,4,"Astrocytoma, IDH-mutant",positive,14,intact,IDH1 p.R132S,0,112,GTR,No,BraTS2021_00604,Training,Training
|
| 491 |
+
UCSF-PDGM-530,F,34,3,"Astrocytoma, IDH-mutant",positive,13,intact,IDH1 p.R132H,0,96,STR,No,,,
|
| 492 |
+
UCSF-PDGM-531,M,36,4,"Astrocytoma, IDH-mutant",positive,15,intact,IDH1 p.R132H,0,21,STR,Yes,BraTS2021_00612,Training,Training
|
| 493 |
+
UCSF-PDGM-532,M,75,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,1,322,GTR,No,BraTS2021_00647,Validation,Validation
|
| 494 |
+
UCSF-PDGM-533,F,31,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,292,GTR,No,BraTS2021_00652,Training,Training
|
| 495 |
+
UCSF-PDGM-534,M,71,4,"Glioblastoma, IDH-wildtype",positive,17,intact,wildtype,0,55,biopsy,No,BraTS2021_00621,Training,Training
|
| 496 |
+
UCSF-PDGM-535,M,19,3,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",unknown,unknown,relative co-deletion,IDH1 p.R132H,0,749,GTR,No,,,
|
| 497 |
+
UCSF-PDGM-536,F,58,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,267,STR,No,,,
|
| 498 |
+
UCSF-PDGM-537,M,64,4,"Glioblastoma, IDH-wildtype",positive,16,intact,wildtype,0,334,biopsy,Yes,,,
|
| 499 |
+
UCSF-PDGM-538,F,41,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,287,GTR,No,,,
|
| 500 |
+
UCSF-PDGM-539,M,72,4,"Glioblastoma, IDH-wildtype",positive,12,intact,wildtype,0,291,GTR,No,,,
|
| 501 |
+
UCSF-PDGM-540,F,70,2,"Oligodendroglioma, IDH-mutant, 1p/19q-codeleted",positive,17,co-deletion,IDH1 p.R132H,0,215,STR,No,,,
|
| 502 |
+
UCSF-PDGM-541,F,68,4,"Glioblastoma, IDH-wildtype",negative,0,intact,wildtype,0,199,GTR,No,,,
|
code/config.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
|
| 3 |
+
# Check if CUDA (GPU) is available and set the device accordingly
|
| 4 |
+
use_cuda = torch.cuda.is_available()
|
| 5 |
+
device = torch.device("cuda" if use_cuda else "cpu")
|
| 6 |
+
|
| 7 |
+
# Number of worker threads for data loading
|
| 8 |
+
n_threads = 12
|
| 9 |
+
|
| 10 |
+
# Number of processes for multiprocessing (if applicable)
|
| 11 |
+
num_processes = 12
|
| 12 |
+
|
| 13 |
+
# Base batch size for training each individual task.
|
| 14 |
+
# For each task, we apply oversampling by selecting one sample with label 0 and one sample with label 1 per batch.
|
| 15 |
+
# The effective total batch size is batch_size * 6, accounting for the tasks 1p19q, IDH, and LHG.
|
| 16 |
+
batch_size = 1
|
| 17 |
+
|
| 18 |
+
# Random seed for reproducibility
|
| 19 |
+
random_seed = 1337
|
| 20 |
+
|
| 21 |
+
# Learning rate for the optimizer
|
| 22 |
+
lr_self = 1e-4
|
| 23 |
+
|
| 24 |
+
# Minimum learning rate for the learning rate scheduler
|
| 25 |
+
min_lr = 1e-6
|
| 26 |
+
|
| 27 |
+
# Weight decay (L2 regularization) to prevent overfitting
|
| 28 |
+
weight_decay = 2e-5
|
| 29 |
+
|
| 30 |
+
# Factor by which the learning rate will be reduced
|
| 31 |
+
lr_reduce_factor = 0.7
|
| 32 |
+
|
| 33 |
+
# Number of epochs with no improvement after which the learning rate will be reduced
|
| 34 |
+
lr_reduce_patience = 8
|
| 35 |
+
|
| 36 |
+
# Number of epochs for the first training stage
|
| 37 |
+
epochs_s1 = 60
|
| 38 |
+
|
| 39 |
+
# Number of epochs for the second training stage
|
| 40 |
+
epochs_s2 = 40
|
| 41 |
+
|
| 42 |
+
# Epoch number from which to start saving the model
|
| 43 |
+
save_epoch = 0
|
| 44 |
+
|
| 45 |
+
# Directory path where data and results will be stored
|
| 46 |
+
data_dir = './'
|
| 47 |
+
|
| 48 |
+
# Flag to enable or disable random operations (e.g., data shuffling)
|
| 49 |
+
random_flag = True
|
| 50 |
+
|
| 51 |
+
# W&B Settings
|
| 52 |
+
wandb_project = "CMTLNet-Training"
|
| 53 |
+
wandb_entity = None # Or your username
|
| 54 |
+
resume_checkpoint = None # Path to checkpoint to resume from, or None
|
code/dataLoder/dataload_utils.py
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import pickle
|
| 3 |
+
import nibabel as nib
|
| 4 |
+
import numpy as np
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def load_pickle(file: str, mode: str = 'rb'):
|
| 8 |
+
"""
|
| 9 |
+
Load and return a Python object from a pickle file.
|
| 10 |
+
|
| 11 |
+
Parameters:
|
| 12 |
+
- file (str): The path to the pickle file.
|
| 13 |
+
- mode (str): The mode in which to open the file. Defaults to 'rb' (read binary).
|
| 14 |
+
|
| 15 |
+
Returns:
|
| 16 |
+
- The object loaded from the pickle file.
|
| 17 |
+
"""
|
| 18 |
+
with open(file, mode) as f:
|
| 19 |
+
a = pickle.load(f) # Load the object from the pickle file
|
| 20 |
+
return a # Return the loaded object
|
| 21 |
+
|
| 22 |
+
def readDir(path, num):
|
| 23 |
+
"""
|
| 24 |
+
Read a specific subdirectory from the given path.
|
| 25 |
+
|
| 26 |
+
Parameters:
|
| 27 |
+
- path (str): The directory path to read.
|
| 28 |
+
- num (int): The index of the subdirectory to retrieve.
|
| 29 |
+
|
| 30 |
+
Returns:
|
| 31 |
+
- im (list): A list containing the name of the specified subdirectory.
|
| 32 |
+
"""
|
| 33 |
+
im = []
|
| 34 |
+
k = 0 # Initialize a counter
|
| 35 |
+
for root in os.walk(path): # Traverse the directory tree
|
| 36 |
+
if k == 0:
|
| 37 |
+
im.append(root[num]) # Append the nth subdirectory
|
| 38 |
+
k = k + 1 # Increment the counter to avoid further processing
|
| 39 |
+
if k == 1:
|
| 40 |
+
continue # Skip processing other directories
|
| 41 |
+
return im # Return the list containing the desired subdirectory
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def load_nii_affine(filename):
|
| 45 |
+
"""
|
| 46 |
+
Load a NIfTI file and return its data and affine matrix.
|
| 47 |
+
If the file does not exist, returns a default array and an identity matrix.
|
| 48 |
+
"""
|
| 49 |
+
if not os.path.exists(filename):
|
| 50 |
+
# FIX: Return a blank 3D tensor so the cropper has all 3 dimensions
|
| 51 |
+
return np.zeros((160, 192, 160), dtype=np.float32), np.eye(4)
|
| 52 |
+
|
| 53 |
+
nii = nib.load(filename) # Load the NIfTI file
|
| 54 |
+
data = nii.get_fdata() # Retrieve the image data as a floating-point array
|
| 55 |
+
affine = nii.affine # Retrieve the affine transformation matrix
|
| 56 |
+
nii.uncache() # Uncache the NIfTI object to free memory
|
| 57 |
+
return data, affine # Return the data and affine matrix
|
| 58 |
+
|
| 59 |
+
def get_rectangle_3d(mask):
|
| 60 |
+
"""
|
| 61 |
+
Determine the bounding box coordinates of the non-zero region in a 3D mask.
|
| 62 |
+
|
| 63 |
+
Parameters:
|
| 64 |
+
- mask (numpy.ndarray): A 3D mask array where non-zero values indicate the region of interest.
|
| 65 |
+
|
| 66 |
+
Returns:
|
| 67 |
+
- min_x, max_x, min_y, max_y, min_z, max_z (int): The minimum and maximum indices along each axis that contain non-zero values.
|
| 68 |
+
"""
|
| 69 |
+
mask_size = mask.shape # Get the shape of the mask
|
| 70 |
+
min_x, min_y, min_z = mask_size[0], mask_size[1], mask_size[2] # Initialize minimum indices
|
| 71 |
+
max_x, max_y, max_z = 0, 0, 0 # Initialize maximum indices
|
| 72 |
+
|
| 73 |
+
# Iterate through each voxel in the mask to find the bounding box
|
| 74 |
+
for index_i in range(mask_size[0]):
|
| 75 |
+
for index_j in range(mask_size[1]):
|
| 76 |
+
for index_k in range(mask_size[2]):
|
| 77 |
+
if mask[index_i][index_j][index_k] > 0: # Check if the voxel is part of the region of interest
|
| 78 |
+
# Update minimum indices
|
| 79 |
+
if min_x > index_i:
|
| 80 |
+
min_x = index_i
|
| 81 |
+
if min_y > index_j:
|
| 82 |
+
min_y = index_j
|
| 83 |
+
if min_z > index_k:
|
| 84 |
+
min_z = index_k
|
| 85 |
+
|
| 86 |
+
# Update maximum indices
|
| 87 |
+
if max_x < index_i:
|
| 88 |
+
max_x = index_i
|
| 89 |
+
if max_y < index_j:
|
| 90 |
+
max_y = index_j
|
| 91 |
+
if max_z < index_k:
|
| 92 |
+
max_z = index_k
|
| 93 |
+
|
| 94 |
+
return min_x, max_x, min_y, max_y, min_z, max_z # Return the bounding box coordinates
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
def Padding3d(data, padding_shape=(160, 192, 160)):
|
| 98 |
+
"""
|
| 99 |
+
Pad a 3D array to the specified shape with zeros, centering the original data.
|
| 100 |
+
|
| 101 |
+
Parameters:
|
| 102 |
+
- data (numpy.ndarray): The 3D array to pad.
|
| 103 |
+
- padding_shape (tuple): The desired output shape after padding. Defaults to (160, 192, 160).
|
| 104 |
+
|
| 105 |
+
Returns:
|
| 106 |
+
- data (numpy.ndarray): The padded 3D array.
|
| 107 |
+
"""
|
| 108 |
+
# Pre-allocate the final padded array to prevent memory fragmentation
|
| 109 |
+
data_padded = np.zeros(padding_shape, dtype=np.float32)
|
| 110 |
+
|
| 111 |
+
# Calculate padding sizes for each dimension
|
| 112 |
+
padding_h, padding_w, padding_d = (np.array(padding_shape) - np.array(data.shape)) // 2
|
| 113 |
+
|
| 114 |
+
# Define end indices
|
| 115 |
+
end_h = padding_h + data.shape[0]
|
| 116 |
+
end_w = padding_w + data.shape[1]
|
| 117 |
+
end_d = padding_d + data.shape[2]
|
| 118 |
+
|
| 119 |
+
# Assign the original data into the center of the padded array directly
|
| 120 |
+
data_padded[padding_h:end_h, padding_w:end_w, padding_d:end_d] = data
|
| 121 |
+
|
| 122 |
+
return data_padded # Return the padded data
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
def random_crop(img_T1C, img_T2W, mask_input_img_T1C, mask_input_img_T2W, mask, force_fg=True):
|
| 126 |
+
"""
|
| 127 |
+
Perform a random crop on the provided 3D images and masks. With a probability of 0.8,
|
| 128 |
+
the function crops the images and masks. If force_fg is True, the crop will include
|
| 129 |
+
the entire region of interest defined by the mask.
|
| 130 |
+
|
| 131 |
+
Parameters:
|
| 132 |
+
- img_T1C (numpy.ndarray): The T1-weighted contrast-enhanced image.
|
| 133 |
+
- img_T2W (numpy.ndarray): The T2-weighted image.
|
| 134 |
+
- mask_input_img_T1C (numpy.ndarray): The mask corresponding to img_T1C.
|
| 135 |
+
- mask_input_img_T2W (numpy.ndarray): The mask corresponding to img_T2W.
|
| 136 |
+
- mask (numpy.ndarray): The primary mask indicating the region of interest (e.g., tumor).
|
| 137 |
+
- force_fg (bool): Whether to force the crop to include the foreground (region of interest). Defaults to True.
|
| 138 |
+
|
| 139 |
+
Returns:
|
| 140 |
+
- tuple: A tuple containing the cropped (and possibly padded) images and masks:
|
| 141 |
+
- crop_img_T1C (numpy.ndarray)
|
| 142 |
+
- crop_img_T2W (numpy.ndarray)
|
| 143 |
+
- mask_input_img_T1C (numpy.ndarray)
|
| 144 |
+
- mask_input_img_T2W (numpy.ndarray)
|
| 145 |
+
- crop_mask (numpy.ndarray)
|
| 146 |
+
|
| 147 |
+
If the random probability check fails (20% chance), the original images and masks are returned.
|
| 148 |
+
"""
|
| 149 |
+
P = np.random.random() # Generate a random float between 0 and 1
|
| 150 |
+
if P < 0.8: # 80% chance to perform cropping
|
| 151 |
+
shape_im = img_T1C.shape # Get the shape of the input images
|
| 152 |
+
crop_size = shape_im # Set the crop size to the entire image size
|
| 153 |
+
|
| 154 |
+
# Calculate lower and upper bounds for cropping along each axis
|
| 155 |
+
lb_x = 0
|
| 156 |
+
ub_x = shape_im[0] - crop_size[0] // 2
|
| 157 |
+
lb_y = 0
|
| 158 |
+
ub_y = shape_im[1] - crop_size[1] // 2
|
| 159 |
+
lb_z = 0
|
| 160 |
+
ub_z = shape_im[2] - crop_size[2] // 2
|
| 161 |
+
|
| 162 |
+
if force_fg:
|
| 163 |
+
# Get the bounding box coordinates of the region of interest from the mask
|
| 164 |
+
P_minx, P_max, P_miny, P_maxy, P_minz, P_maxz = get_rectangle_3d(mask)
|
| 165 |
+
# Randomly choose the lower bound of the crop to ensure it includes the entire tumor region
|
| 166 |
+
bbox_x_lb = np.random.randint(0, P_minx + 1)
|
| 167 |
+
bbox_y_lb = np.random.randint(0, P_miny + 1)
|
| 168 |
+
bbox_z_lb = np.random.randint(0, P_minz + 1)
|
| 169 |
+
else:
|
| 170 |
+
# Otherwise, randomly choose the lower bound within the specified range
|
| 171 |
+
bbox_x_lb = np.random.randint(lb_x, ub_x + 1)
|
| 172 |
+
bbox_y_lb = np.random.randint(lb_y, ub_y + 1)
|
| 173 |
+
bbox_z_lb = np.random.randint(lb_z, ub_z + 1)
|
| 174 |
+
|
| 175 |
+
# Define the upper bounds of the crop based on the lower bounds and crop size
|
| 176 |
+
bbox_x_ub = bbox_x_lb + crop_size[0]
|
| 177 |
+
bbox_y_ub = bbox_y_lb + crop_size[1]
|
| 178 |
+
bbox_z_ub = bbox_z_lb + crop_size[2]
|
| 179 |
+
|
| 180 |
+
# Adjust the crop boundaries to ensure they are within the image dimensions
|
| 181 |
+
valid_bbox_x_lb = max(0, bbox_x_lb)
|
| 182 |
+
valid_bbox_x_ub = min(shape_im[0], bbox_x_ub)
|
| 183 |
+
valid_bbox_y_lb = max(0, bbox_y_lb)
|
| 184 |
+
valid_bbox_y_ub = min(shape_im[1], bbox_y_ub)
|
| 185 |
+
valid_bbox_z_lb = max(0, bbox_z_lb)
|
| 186 |
+
valid_bbox_z_ub = min(shape_im[2], bbox_z_ub)
|
| 187 |
+
|
| 188 |
+
# Crop the T1C image
|
| 189 |
+
crop_img_T1C = np.copy(img_T1C[valid_bbox_x_lb:valid_bbox_x_ub,
|
| 190 |
+
valid_bbox_y_lb:valid_bbox_y_ub,
|
| 191 |
+
valid_bbox_z_lb:valid_bbox_z_ub])
|
| 192 |
+
|
| 193 |
+
# Crop the T2W image
|
| 194 |
+
crop_img_T2W = np.copy(img_T2W[valid_bbox_x_lb:valid_bbox_x_ub,
|
| 195 |
+
valid_bbox_y_lb:valid_bbox_y_ub,
|
| 196 |
+
valid_bbox_z_lb:valid_bbox_z_ub])
|
| 197 |
+
|
| 198 |
+
# Crop the mask corresponding to img_T1C
|
| 199 |
+
mask_input_img_T1C = np.copy(mask_input_img_T1C[valid_bbox_x_lb:valid_bbox_x_ub,
|
| 200 |
+
valid_bbox_y_lb:valid_bbox_y_ub,
|
| 201 |
+
valid_bbox_z_lb:valid_bbox_z_ub])
|
| 202 |
+
|
| 203 |
+
# Crop the mask corresponding to img_T2W
|
| 204 |
+
mask_input_img_T2W = np.copy(mask_input_img_T2W[valid_bbox_x_lb:valid_bbox_x_ub,
|
| 205 |
+
valid_bbox_y_lb:valid_bbox_y_ub,
|
| 206 |
+
valid_bbox_z_lb:valid_bbox_z_ub])
|
| 207 |
+
|
| 208 |
+
# Crop the primary mask
|
| 209 |
+
crop_mask = np.copy(mask[valid_bbox_x_lb:valid_bbox_x_ub,
|
| 210 |
+
valid_bbox_y_lb:valid_bbox_y_ub,
|
| 211 |
+
valid_bbox_z_lb:valid_bbox_z_ub])
|
| 212 |
+
|
| 213 |
+
# Pad the cropped images and masks to restore them to the original shape
|
| 214 |
+
crop_img_T1C = Padding3d(crop_img_T1C, shape_im)
|
| 215 |
+
crop_img_T2W = Padding3d(crop_img_T2W, shape_im)
|
| 216 |
+
mask_input_img_T1C = Padding3d(mask_input_img_T1C, shape_im)
|
| 217 |
+
mask_input_img_T2W = Padding3d(mask_input_img_T2W, shape_im)
|
| 218 |
+
crop_mask = Padding3d(crop_mask, shape_im)
|
| 219 |
+
|
| 220 |
+
# Return the cropped (and padded) images and masks
|
| 221 |
+
return crop_img_T1C, crop_img_T2W, mask_input_img_T1C, mask_input_img_T2W, crop_mask
|
| 222 |
+
else:
|
| 223 |
+
# With 20% probability, return the original images and masks without cropping
|
| 224 |
+
return img_T1C, img_T2W, mask_input_img_T1C, mask_input_img_T2W, mask
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
def load_mask(path):
|
| 228 |
+
"""
|
| 229 |
+
Load the mask image from the specified path.
|
| 230 |
+
|
| 231 |
+
Parameters:
|
| 232 |
+
- path (str): The directory path where 'mask.nii' is located.
|
| 233 |
+
|
| 234 |
+
Returns:
|
| 235 |
+
- mask (numpy.ndarray): The mask data as a floating-point array.
|
| 236 |
+
"""
|
| 237 |
+
mask_img_path = os.path.join(path, 'mask.nii.gz') # Construct the mask file path
|
| 238 |
+
if not os.path.exists(mask_img_path):
|
| 239 |
+
mask_img_path = os.path.join(path, 'mask.nii')
|
| 240 |
+
mask, _ = load_nii_affine(mask_img_path) # Load the mask data and affine matrix
|
| 241 |
+
mask = (mask > 0)
|
| 242 |
+
mask = np.array(mask, dtype=np.float32) # Convert the mask to a float array
|
| 243 |
+
return mask # Return the mask
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
def load_img(path, type):
|
| 247 |
+
"""
|
| 248 |
+
Load and preprocess an image from a NIfTI file.
|
| 249 |
+
|
| 250 |
+
Parameters:
|
| 251 |
+
- path (str): The directory path where the NIfTI file is located.
|
| 252 |
+
- type (str): The base name of the NIfTI file (without the '.nii' extension).
|
| 253 |
+
|
| 254 |
+
Returns:
|
| 255 |
+
- img (numpy.ndarray): The normalized image data.
|
| 256 |
+
- img_mask (numpy.ndarray): A binary mask indicating non-zero regions in the image.
|
| 257 |
+
- affine (numpy.ndarray): The affine transformation matrix of the image.
|
| 258 |
+
"""
|
| 259 |
+
# Construct the full file path by combining the directory path and file type
|
| 260 |
+
full_path = os.path.join(path, f'{type}.nii.gz')
|
| 261 |
+
if not os.path.exists(full_path):
|
| 262 |
+
full_path = os.path.join(path, f'{type}.nii')
|
| 263 |
+
img, affine = load_nii_affine(full_path) # Load the image data and affine matrix
|
| 264 |
+
img = np.array(img, dtype=np.float32) # Ensure the image data is in floating-point format
|
| 265 |
+
|
| 266 |
+
# Create a binary mask where pixels with values greater than 0 are marked as True
|
| 267 |
+
img_mask = (img > 0)
|
| 268 |
+
|
| 269 |
+
# Define a small constant to prevent division by zero during normalization
|
| 270 |
+
smooth = 1e-8
|
| 271 |
+
|
| 272 |
+
# Normalize the image data: subtract the mean and divide by the standard deviation
|
| 273 |
+
img[img_mask] = (img[img_mask] - img[img_mask].mean()) * 1.0 / (img[img_mask].std() + smooth)
|
| 274 |
+
|
| 275 |
+
# Convert the binary mask to a floating-point array
|
| 276 |
+
img_mask = np.array(img_mask, dtype=np.float32) # <--- CHANGED: float to np.float32
|
| 277 |
+
|
| 278 |
+
return img, img_mask, affine # Return the normalized image, mask, and affine matrix
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
def get_transimg(img_T1C_in, img_T2W_in, mask_input_T1C_in, mask_input_T2W_in, mask_seg_in):
|
| 282 |
+
"""
|
| 283 |
+
Perform random cropping and prepare image and mask tensors for training.
|
| 284 |
+
|
| 285 |
+
Args:
|
| 286 |
+
img_T1C_in (numpy.ndarray): T1C modality image.
|
| 287 |
+
img_T2W_in (numpy.ndarray): T2W modality image.
|
| 288 |
+
mask_input_T1C_in (numpy.ndarray): Mask for T1C image.
|
| 289 |
+
mask_input_T2W_in (numpy.ndarray): Mask for T2W image.
|
| 290 |
+
mask_seg_in (numpy.ndarray): Segmentation mask.
|
| 291 |
+
|
| 292 |
+
Returns:
|
| 293 |
+
tuple: Processed images and masks.
|
| 294 |
+
"""
|
| 295 |
+
# Apply random cropping to all inputs
|
| 296 |
+
img_T1C, img_T2W, mask_input_T1C, mask_input_T2W, mask_seg = random_crop(
|
| 297 |
+
img_T1C_in, img_T2W_in,
|
| 298 |
+
mask_input_T1C_in, mask_input_T2W_in,
|
| 299 |
+
mask_seg_in
|
| 300 |
+
)
|
| 301 |
+
# Combine input masks to create a unified mask
|
| 302 |
+
mask_input_combined = (mask_input_T1C + mask_input_T2W) > 0
|
| 303 |
+
mask_input_combined = mask_input_combined.astype(np.float32) # <--- CHANGED: float to np.float32
|
| 304 |
+
|
| 305 |
+
# Create original, positive, and negative masks based on segmentation
|
| 306 |
+
mask_original = np.ones_like(mask_input_combined) * mask_input_combined
|
| 307 |
+
mask_positive = mask_seg * mask_input_combined
|
| 308 |
+
# Force 32-bit to save 50% RAM and prevent the MemoryError
|
| 309 |
+
# --- MEMORY-SAFE IN-PLACE OPERATIONS ---
|
| 310 |
+
# We allocate mask_negative ONCE. We then modify it in-place
|
| 311 |
+
# to avoid creating temporary objects that cause allocation errors.
|
| 312 |
+
|
| 313 |
+
# Force 32-bit
|
| 314 |
+
mask_seg = mask_seg.astype(np.float32)
|
| 315 |
+
mask_input_combined = mask_input_combined.astype(np.float32)
|
| 316 |
+
|
| 317 |
+
# In-place calculation:
|
| 318 |
+
# 1. mask_negative = mask_seg * mask_input_combined
|
| 319 |
+
# 2. mask_negative = mask_input_combined - mask_negative
|
| 320 |
+
# This is mathematically identical to (1 - mask_seg) * input
|
| 321 |
+
mask_negative = np.multiply(mask_seg, mask_input_combined)
|
| 322 |
+
np.subtract(mask_input_combined, mask_negative, out=mask_negative)
|
| 323 |
+
|
| 324 |
+
# Prepare image data as a list of modalities
|
| 325 |
+
images = [img_T1C, img_T2W]
|
| 326 |
+
# Prepare segmentation masks
|
| 327 |
+
masks = [mask_original, mask_positive, mask_negative]
|
| 328 |
+
return images, masks
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
def default_loader(path):
|
| 332 |
+
"""
|
| 333 |
+
Load and process training images and masks from a given path.
|
| 334 |
+
|
| 335 |
+
Args:
|
| 336 |
+
path (str): Path to the image data.
|
| 337 |
+
|
| 338 |
+
Returns:
|
| 339 |
+
tuple: Processed images and masks for training.
|
| 340 |
+
"""
|
| 341 |
+
# Load T1C and T2W images with their masks and affine transformations
|
| 342 |
+
img_T1C, mask_input_T1C, affine = load_img(path, 'T1C')
|
| 343 |
+
img_T2W, mask_input_T2W, _ = load_img(path, 'T2')
|
| 344 |
+
|
| 345 |
+
# Load segmentation mask and convert to binary format
|
| 346 |
+
mask_seg = load_mask(path)
|
| 347 |
+
mask_seg = (mask_seg > 0).astype(np.float32) # <--- CHANGED: float to np.float32
|
| 348 |
+
|
| 349 |
+
# Transform images and masks using the get_transimg function
|
| 350 |
+
imgs_k_img, imgs_k_mask = get_transimg(
|
| 351 |
+
img_T1C, img_T2W,
|
| 352 |
+
mask_input_T1C, mask_input_T2W,
|
| 353 |
+
mask_seg
|
| 354 |
+
)
|
| 355 |
+
return imgs_k_img, imgs_k_mask
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
def default_loader_test(path):
|
| 359 |
+
"""
|
| 360 |
+
Load and process test images and masks from a given path.
|
| 361 |
+
|
| 362 |
+
Args:
|
| 363 |
+
path (str): Path to the image data.
|
| 364 |
+
|
| 365 |
+
Returns:
|
| 366 |
+
tuple: Processed images and masks for testing.
|
| 367 |
+
"""
|
| 368 |
+
# Load T1C and T2W images with their masks and affine transformations
|
| 369 |
+
img_T1C, mask_input_T1C, affine = load_img(path, 'T1C')
|
| 370 |
+
img_T2W, mask_input_T2W, _ = load_img(path, 'T2')
|
| 371 |
+
|
| 372 |
+
# Combine input masks to create a unified mask
|
| 373 |
+
mask_input_combined = (mask_input_T1C + mask_input_T2W) > 0
|
| 374 |
+
mask_input_combined = mask_input_combined.astype(np.float32) # <--- CHANGED: float to np.float32
|
| 375 |
+
|
| 376 |
+
# Create original mask based on the combined input mask
|
| 377 |
+
mask_original = np.ones_like(mask_input_combined) * mask_input_combined
|
| 378 |
+
|
| 379 |
+
# Prepare image data as a list of modalities
|
| 380 |
+
images = [img_T1C, img_T2W]
|
| 381 |
+
# Prepare segmentation masks
|
| 382 |
+
masks = [mask_original]
|
| 383 |
+
return images, masks
|
code/dataLoder/loader_S1.py
ADDED
|
@@ -0,0 +1,477 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import pickle
|
| 3 |
+
import numpy as np
|
| 4 |
+
from torch.utils.data import Dataset
|
| 5 |
+
from typing import Optional, Callable, Tuple
|
| 6 |
+
import random
|
| 7 |
+
# from dataload_utils import (default_loader, default_loader_test)
|
| 8 |
+
from dataLoder.dataload_utils import (default_loader, default_loader_test)
|
| 9 |
+
|
| 10 |
+
np.random.seed(1337)
|
| 11 |
+
random.seed(1337)
|
| 12 |
+
|
| 13 |
+
def get_fold_data(fold_number: int, mode: str, pickle_path: str) -> Tuple[list, list]:
|
| 14 |
+
"""
|
| 15 |
+
Load data for a specific fold and mode from a PKL file.
|
| 16 |
+
|
| 17 |
+
Parameters:
|
| 18 |
+
- mode (str): Either 'train' or 'test'.
|
| 19 |
+
- fold_number (int): An integer between 0 and 4 indicating the fold index.
|
| 20 |
+
- pickle_path (str): The file path to the PKL file.
|
| 21 |
+
|
| 22 |
+
Returns:
|
| 23 |
+
- Tuple containing:
|
| 24 |
+
- paths (list): List of file paths for the specified fold.
|
| 25 |
+
- class_labels (list): List of class labels corresponding to the file paths.
|
| 26 |
+
|
| 27 |
+
Raises:
|
| 28 |
+
- ValueError: If mode is not 'train' or 'test', or if fold_number is out of range.
|
| 29 |
+
- FileNotFoundError: If the PKL file does not exist.
|
| 30 |
+
- ValueError: If the PKL file cannot be unpickled.
|
| 31 |
+
- KeyError: If the expected data structure is not found in the PKL file.
|
| 32 |
+
"""
|
| 33 |
+
# Validate mode
|
| 34 |
+
if mode not in ['train', 'test']:
|
| 35 |
+
raise ValueError("mode must be 'train' or 'test'")
|
| 36 |
+
|
| 37 |
+
# Validate fold_number
|
| 38 |
+
if not isinstance(fold_number, int) or not (0 <= fold_number <= 4):
|
| 39 |
+
raise ValueError("fold_number must be an integer between 0 and 4")
|
| 40 |
+
|
| 41 |
+
# Attempt to load data from the PKL file
|
| 42 |
+
try:
|
| 43 |
+
with open(pickle_path, 'rb') as file:
|
| 44 |
+
data = pickle.load(file)
|
| 45 |
+
except FileNotFoundError:
|
| 46 |
+
raise FileNotFoundError(f"PKL file not found: {pickle_path}")
|
| 47 |
+
except pickle.UnpicklingError:
|
| 48 |
+
raise ValueError(f"Unable to load PKL file: {pickle_path}")
|
| 49 |
+
|
| 50 |
+
# Construct the fold key
|
| 51 |
+
fold_key = f'fold{fold_number}'
|
| 52 |
+
|
| 53 |
+
# Retrieve data for the specified mode and fold
|
| 54 |
+
try:
|
| 55 |
+
fold_data = data[mode][fold_key]
|
| 56 |
+
return fold_data['path'], fold_data['cls_label']
|
| 57 |
+
except KeyError:
|
| 58 |
+
raise KeyError(f"Missing {mode} data for {fold_key} in the data structure")
|
| 59 |
+
|
| 60 |
+
def split_path_by_label(file_paths, file_labels):
|
| 61 |
+
file_paths_0 = []
|
| 62 |
+
file_paths_1 = []
|
| 63 |
+
for i in range(len(file_labels)):
|
| 64 |
+
if file_labels[i]==0:
|
| 65 |
+
file_paths_0.append(file_paths[i])
|
| 66 |
+
elif file_labels[i]==1:
|
| 67 |
+
file_paths_1.append(file_paths[i])
|
| 68 |
+
return file_paths_0, file_paths_1
|
| 69 |
+
|
| 70 |
+
class TrainDataLoader_balance(Dataset):
|
| 71 |
+
def __init__(
|
| 72 |
+
self,
|
| 73 |
+
transform: Optional[Callable] = None,
|
| 74 |
+
mode: str = 'train',
|
| 75 |
+
fold: int = 1,
|
| 76 |
+
random_flag: bool = True,
|
| 77 |
+
pickle_path: str = ''
|
| 78 |
+
):
|
| 79 |
+
"""
|
| 80 |
+
Initialize the training data loader.
|
| 81 |
+
|
| 82 |
+
Parameters:
|
| 83 |
+
- transform (Callable, optional): Transformation to apply to the images and masks.
|
| 84 |
+
- mode (str): Mode of data loading, default is 'train'.
|
| 85 |
+
- fold (int): Fold number to load data from.
|
| 86 |
+
- random_flag (bool): If True, randomly select tensors; otherwise, use all.
|
| 87 |
+
- pickle_path (str): Path to the PKL file containing data.
|
| 88 |
+
"""
|
| 89 |
+
self.random_flag = random_flag
|
| 90 |
+
self.mode = mode
|
| 91 |
+
self.transform = transform
|
| 92 |
+
|
| 93 |
+
# Load file paths and labels for the specified fold and mode
|
| 94 |
+
file_paths, file_labels = get_fold_data(fold, mode, pickle_path)
|
| 95 |
+
self.file_paths_0, self.file_paths_1 = split_path_by_label(file_paths, file_labels)
|
| 96 |
+
|
| 97 |
+
def __len__(self) -> int:
|
| 98 |
+
"""Return the total number of samples."""
|
| 99 |
+
return max(len(self.file_paths_0), len(self.file_paths_1))
|
| 100 |
+
|
| 101 |
+
def get_match_tensor(
|
| 102 |
+
self,
|
| 103 |
+
images: list,
|
| 104 |
+
masks: list
|
| 105 |
+
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 106 |
+
"""
|
| 107 |
+
Generate matched tensors from images and masks.
|
| 108 |
+
|
| 109 |
+
Parameters:
|
| 110 |
+
- images (list): List of image tensors.
|
| 111 |
+
- masks (list): List of mask tensors.
|
| 112 |
+
|
| 113 |
+
Returns:
|
| 114 |
+
- Tuple containing:
|
| 115 |
+
- IT1 (Tensor)
|
| 116 |
+
- IT2 (Tensor)
|
| 117 |
+
- IT3 (Tensor)
|
| 118 |
+
- INT1 (Tensor)
|
| 119 |
+
- INT2 (Tensor)
|
| 120 |
+
"""
|
| 121 |
+
# Apply transformations if provided
|
| 122 |
+
if self.transform is not None:
|
| 123 |
+
images = [self.transform(img) for img in images]
|
| 124 |
+
masks = [self.transform(mask) for mask in masks]
|
| 125 |
+
|
| 126 |
+
# Unpack masks
|
| 127 |
+
mask_original, mask_positive, mask_negative = masks
|
| 128 |
+
|
| 129 |
+
# Apply original mask to images and concatenate along a new dimension
|
| 130 |
+
images_tensor = torch.cat([
|
| 131 |
+
(images[0] * mask_original).unsqueeze(0),
|
| 132 |
+
(images[1] * mask_original).unsqueeze(0)
|
| 133 |
+
], dim=0)
|
| 134 |
+
|
| 135 |
+
# Create various tensor combinations
|
| 136 |
+
IT1 = torch.cat([images_tensor, mask_original.unsqueeze(0)], dim=0)
|
| 137 |
+
IT2 = torch.cat([images_tensor, mask_positive.unsqueeze(0)], dim=0)
|
| 138 |
+
IT3 = torch.cat([images_tensor * mask_positive.unsqueeze(0), mask_original.unsqueeze(0)], dim=0)
|
| 139 |
+
|
| 140 |
+
INT1 = torch.cat([images_tensor * mask_negative.unsqueeze(0), mask_original.unsqueeze(0)], dim=0)
|
| 141 |
+
INT2 = torch.cat([images_tensor, mask_negative.unsqueeze(0)], dim=0)
|
| 142 |
+
|
| 143 |
+
return IT1, IT2, IT3, INT1, INT2
|
| 144 |
+
|
| 145 |
+
def get_match_out(self, IT1, IT2, IT3, INT1, INT2, class_label):
|
| 146 |
+
if self.random_flag:
|
| 147 |
+
# Randomly select one IT tensor
|
| 148 |
+
imgs_IT = random.choice([IT1, IT2, IT3]).unsqueeze(0)
|
| 149 |
+
# Randomly select one INT tensor
|
| 150 |
+
imgs_INT = random.choice([INT1, INT2]).unsqueeze(0)
|
| 151 |
+
# Convert class label to tensor
|
| 152 |
+
class_label_tensor = torch.tensor(class_label, dtype=torch.long).unsqueeze(0)
|
| 153 |
+
else:
|
| 154 |
+
# Concatenate all IT and INT tensors
|
| 155 |
+
imgs_IT = torch.cat([IT1, IT2, IT3], dim=0)
|
| 156 |
+
imgs_INT = torch.cat([INT1, INT2], dim=0)
|
| 157 |
+
# Repeat class labels for each tensor
|
| 158 |
+
class_label_tensor = torch.tensor([class_label, class_label, class_label], dtype=torch.long)
|
| 159 |
+
|
| 160 |
+
# Determine the number of IT and INT samples
|
| 161 |
+
num_IT = imgs_IT.size(0)
|
| 162 |
+
num_INT = imgs_INT.size(0)
|
| 163 |
+
|
| 164 |
+
# Create NT labels: IT samples as 1, INT samples as 0
|
| 165 |
+
label_NT_IT = torch.ones(num_IT, dtype=torch.long) # IT class label
|
| 166 |
+
label_NT_INT = torch.zeros(num_INT, dtype=torch.long) # INT class label
|
| 167 |
+
|
| 168 |
+
# Concatenate NT labels
|
| 169 |
+
label_NT = torch.cat((label_NT_IT, label_NT_INT), dim=0)
|
| 170 |
+
# Concatenate image tensors
|
| 171 |
+
images_combined = torch.cat([imgs_IT, imgs_INT], dim=0)
|
| 172 |
+
# Concatenate class labels with INT labels
|
| 173 |
+
labels_combined = torch.cat([class_label_tensor, label_NT_INT], dim=0)
|
| 174 |
+
return images_combined.float(), label_NT, labels_combined
|
| 175 |
+
|
| 176 |
+
def __getitem__(self, index: int) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 177 |
+
"""
|
| 178 |
+
Retrieve a sample from the dataset.
|
| 179 |
+
|
| 180 |
+
Parameters:
|
| 181 |
+
- index (int): Index of the sample to retrieve.
|
| 182 |
+
|
| 183 |
+
Returns:
|
| 184 |
+
- Tuple containing:
|
| 185 |
+
- images (Tensor): Image tensors.
|
| 186 |
+
- label_NT (Tensor): NT labels.
|
| 187 |
+
- labels (Tensor): Combined labels.
|
| 188 |
+
"""
|
| 189 |
+
|
| 190 |
+
# Safely get index 0
|
| 191 |
+
if len(self.file_paths_0) == 0:
|
| 192 |
+
path_0 = self.file_paths_1[random.randint(0, len(self.file_paths_1) - 1)]
|
| 193 |
+
else:
|
| 194 |
+
path_0 = self.file_paths_0[index % len(self.file_paths_0)]
|
| 195 |
+
|
| 196 |
+
# Safely get index 1
|
| 197 |
+
if len(self.file_paths_1) == 0:
|
| 198 |
+
path_1 = self.file_paths_0[random.randint(0, len(self.file_paths_0) - 1)]
|
| 199 |
+
else:
|
| 200 |
+
path_1 = self.file_paths_1[(index + random.randint(0, len(self.file_paths_1) - 1)) % len(self.file_paths_1)]
|
| 201 |
+
|
| 202 |
+
# Load images and masks using a default loader
|
| 203 |
+
images_0, masks_0 = default_loader(path_0)
|
| 204 |
+
images_1, masks_1 = default_loader(path_1)
|
| 205 |
+
|
| 206 |
+
# Generate matched tensors
|
| 207 |
+
IT1_0, IT2_0, IT3_0, INT1_0, INT2_0 = self.get_match_tensor(images_0, masks_0)
|
| 208 |
+
IT1_1, IT2_1, IT3_1, INT1_1, INT2_1 = self.get_match_tensor(images_1, masks_1)
|
| 209 |
+
|
| 210 |
+
# Adjust class label (shift by 1 for classification)
|
| 211 |
+
class_label = 0
|
| 212 |
+
images_combined_0, label_NT_0, labels_combined_0 = self.get_match_out(IT1_0, IT2_0, IT3_0,
|
| 213 |
+
INT1_0, INT2_0, class_label + 1)
|
| 214 |
+
# Adjust class label (shift by 1 for classification)
|
| 215 |
+
class_label = 1
|
| 216 |
+
images_combined_1, label_NT_1, labels_combined_1 = self.get_match_out(IT1_1, IT2_1, IT3_1,
|
| 217 |
+
INT1_1, INT2_1, class_label + 1)
|
| 218 |
+
|
| 219 |
+
images_combined = torch.cat([images_combined_0, images_combined_1], dim=0)
|
| 220 |
+
label_NT = torch.cat([label_NT_0, label_NT_1], dim=0)
|
| 221 |
+
labels_combined = torch.cat([labels_combined_0, labels_combined_1], dim=0)
|
| 222 |
+
return images_combined, label_NT, labels_combined
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
class TrainDataLoader(Dataset):
|
| 226 |
+
def __init__(
|
| 227 |
+
self,
|
| 228 |
+
transform: Optional[Callable] = None,
|
| 229 |
+
mode: str = 'train',
|
| 230 |
+
fold: int = 1,
|
| 231 |
+
random_flag: bool = True,
|
| 232 |
+
pickle_path: str = ''
|
| 233 |
+
):
|
| 234 |
+
"""
|
| 235 |
+
Initialize the training data loader.
|
| 236 |
+
|
| 237 |
+
Parameters:
|
| 238 |
+
- transform (Callable, optional): Transformation to apply to the images and masks.
|
| 239 |
+
- mode (str): Mode of data loading, default is 'train'.
|
| 240 |
+
- fold (int): Fold number to load data from.
|
| 241 |
+
- random_flag (bool): If True, randomly select tensors; otherwise, use all.
|
| 242 |
+
- pickle_path (str): Path to the PKL file containing data.
|
| 243 |
+
"""
|
| 244 |
+
self.random_flag = random_flag
|
| 245 |
+
self.mode = mode
|
| 246 |
+
self.transform = transform
|
| 247 |
+
|
| 248 |
+
# Load file paths and labels for the specified fold and mode
|
| 249 |
+
self.file_paths, self.file_labels = get_fold_data(fold, mode, pickle_path)
|
| 250 |
+
|
| 251 |
+
def __len__(self) -> int:
|
| 252 |
+
"""Return the total number of samples."""
|
| 253 |
+
return len(self.file_paths)
|
| 254 |
+
|
| 255 |
+
def get_match_tensor(
|
| 256 |
+
self,
|
| 257 |
+
images: list,
|
| 258 |
+
masks: list
|
| 259 |
+
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 260 |
+
"""
|
| 261 |
+
Generate matched tensors from images and masks.
|
| 262 |
+
|
| 263 |
+
Parameters:
|
| 264 |
+
- images (list): List of image tensors.
|
| 265 |
+
- masks (list): List of mask tensors.
|
| 266 |
+
|
| 267 |
+
Returns:
|
| 268 |
+
- Tuple containing:
|
| 269 |
+
- IT1 (Tensor)
|
| 270 |
+
- IT2 (Tensor)
|
| 271 |
+
- IT3 (Tensor)
|
| 272 |
+
- INT1 (Tensor)
|
| 273 |
+
- INT2 (Tensor)
|
| 274 |
+
"""
|
| 275 |
+
# Apply transformations if provided
|
| 276 |
+
if self.transform is not None:
|
| 277 |
+
images = [self.transform(img) for img in images]
|
| 278 |
+
masks = [self.transform(mask) for mask in masks]
|
| 279 |
+
|
| 280 |
+
# Unpack masks
|
| 281 |
+
mask_original, mask_positive, mask_negative = masks
|
| 282 |
+
|
| 283 |
+
# Apply original mask to images and concatenate along a new dimension
|
| 284 |
+
images_tensor = torch.cat([
|
| 285 |
+
(images[0] * mask_original).unsqueeze(0),
|
| 286 |
+
(images[1] * mask_original).unsqueeze(0)
|
| 287 |
+
], dim=0)
|
| 288 |
+
|
| 289 |
+
# Create various tensor combinations
|
| 290 |
+
IT1 = torch.cat([images_tensor, mask_original.unsqueeze(0)], dim=0)
|
| 291 |
+
IT2 = torch.cat([images_tensor, mask_positive.unsqueeze(0)], dim=0)
|
| 292 |
+
IT3 = torch.cat([images_tensor * mask_positive.unsqueeze(0), mask_original.unsqueeze(0)], dim=0)
|
| 293 |
+
|
| 294 |
+
INT1 = torch.cat([images_tensor * mask_negative.unsqueeze(0), mask_original.unsqueeze(0)], dim=0)
|
| 295 |
+
INT2 = torch.cat([images_tensor, mask_negative.unsqueeze(0)], dim=0)
|
| 296 |
+
|
| 297 |
+
return IT1, IT2, IT3, INT1, INT2
|
| 298 |
+
|
| 299 |
+
def get_match_out(self, IT1, IT2, IT3, INT1, INT2, class_label):
|
| 300 |
+
if self.random_flag:
|
| 301 |
+
# Randomly select one IT tensor
|
| 302 |
+
imgs_IT = random.choice([IT1, IT2, IT3]).unsqueeze(0)
|
| 303 |
+
# Randomly select one INT tensor
|
| 304 |
+
imgs_INT = random.choice([INT1, INT2]).unsqueeze(0)
|
| 305 |
+
# Convert class label to tensor
|
| 306 |
+
class_label_tensor = torch.tensor(class_label, dtype=torch.long).unsqueeze(0)
|
| 307 |
+
else:
|
| 308 |
+
# Concatenate all IT and INT tensors
|
| 309 |
+
imgs_IT = torch.cat([IT1, IT2, IT3], dim=0)
|
| 310 |
+
imgs_INT = torch.cat([INT1, INT2], dim=0)
|
| 311 |
+
# Repeat class labels for each tensor
|
| 312 |
+
class_label_tensor = torch.tensor([class_label, class_label, class_label], dtype=torch.long)
|
| 313 |
+
|
| 314 |
+
# Determine the number of IT and INT samples
|
| 315 |
+
num_IT = imgs_IT.size(0)
|
| 316 |
+
num_INT = imgs_INT.size(0)
|
| 317 |
+
|
| 318 |
+
# Create NT labels: IT samples as 1, INT samples as 0
|
| 319 |
+
label_NT_IT = torch.ones(num_IT, dtype=torch.long) # IT class label
|
| 320 |
+
label_NT_INT = torch.zeros(num_INT, dtype=torch.long) # INT class label
|
| 321 |
+
|
| 322 |
+
# Concatenate NT labels
|
| 323 |
+
label_NT = torch.cat((label_NT_IT, label_NT_INT), dim=0)
|
| 324 |
+
# Concatenate image tensors
|
| 325 |
+
images_combined = torch.cat([imgs_IT, imgs_INT], dim=0)
|
| 326 |
+
# Concatenate class labels with INT labels
|
| 327 |
+
labels_combined = torch.cat([class_label_tensor, label_NT_INT], dim=0)
|
| 328 |
+
return images_combined.float(), label_NT, labels_combined
|
| 329 |
+
|
| 330 |
+
def __getitem__(self, index: int) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 331 |
+
"""
|
| 332 |
+
Retrieve a sample from the dataset.
|
| 333 |
+
|
| 334 |
+
Parameters:
|
| 335 |
+
- index (int): Index of the sample to retrieve.
|
| 336 |
+
|
| 337 |
+
Returns:
|
| 338 |
+
- Tuple containing:
|
| 339 |
+
- images (Tensor): Image tensors.
|
| 340 |
+
- label_NT (Tensor): NT labels.
|
| 341 |
+
- labels (Tensor): Combined labels.
|
| 342 |
+
"""
|
| 343 |
+
# Load images and masks using a default loader
|
| 344 |
+
images, masks = default_loader(self.file_paths[index])
|
| 345 |
+
class_label = self.file_labels[index]
|
| 346 |
+
|
| 347 |
+
# Generate matched tensors
|
| 348 |
+
IT1, IT2, IT3, INT1, INT2 = self.get_match_tensor(images, masks)
|
| 349 |
+
|
| 350 |
+
# Adjust class label (shift by 1 for classification)
|
| 351 |
+
images_combined, label_NT, labels_combined = self.get_match_out(IT1, IT2, IT3, INT1, INT2, class_label + 1)
|
| 352 |
+
return images_combined, label_NT, labels_combined
|
| 353 |
+
|
| 354 |
+
class TestDataLoader(Dataset):
|
| 355 |
+
def __init__(
|
| 356 |
+
self,
|
| 357 |
+
transform: Optional[Callable] = None,
|
| 358 |
+
mode: str = 'test',
|
| 359 |
+
fold: int = 1,
|
| 360 |
+
random_flag: bool = False,
|
| 361 |
+
pickle_path: str = ''
|
| 362 |
+
):
|
| 363 |
+
"""
|
| 364 |
+
Initialize the testing data loader.
|
| 365 |
+
|
| 366 |
+
Parameters:
|
| 367 |
+
- transform (Callable, optional): Transformation to apply to the images and masks.
|
| 368 |
+
- mode (str): Mode of data loading, default is 'test'.
|
| 369 |
+
- fold (int): Fold number to load data from.
|
| 370 |
+
- random_flag (bool): If True, randomly select tensors; otherwise, use all.
|
| 371 |
+
- pickle_path (str): Path to the PKL file containing data.
|
| 372 |
+
"""
|
| 373 |
+
self.random_flag = random_flag
|
| 374 |
+
self.mode = mode
|
| 375 |
+
self.transform = transform
|
| 376 |
+
|
| 377 |
+
# Load file paths and labels for the specified fold and mode
|
| 378 |
+
self.file_paths, self.file_labels = get_fold_data(fold, mode, pickle_path)
|
| 379 |
+
|
| 380 |
+
def __len__(self) -> int:
|
| 381 |
+
"""Return the total number of samples."""
|
| 382 |
+
return len(self.file_paths)
|
| 383 |
+
|
| 384 |
+
def get_match_tensor(
|
| 385 |
+
self,
|
| 386 |
+
images: list,
|
| 387 |
+
masks: list
|
| 388 |
+
) -> torch.Tensor:
|
| 389 |
+
"""
|
| 390 |
+
Generate matched tensor from images and masks for testing.
|
| 391 |
+
|
| 392 |
+
Parameters:
|
| 393 |
+
- images (list): List of image tensors.
|
| 394 |
+
- masks (list): List of mask tensors.
|
| 395 |
+
|
| 396 |
+
Returns:
|
| 397 |
+
- IT1 (Tensor)
|
| 398 |
+
"""
|
| 399 |
+
# Apply transformations if provided
|
| 400 |
+
if self.transform is not None:
|
| 401 |
+
images = [self.transform(img) for img in images]
|
| 402 |
+
masks = [self.transform(mask) for mask in masks]
|
| 403 |
+
|
| 404 |
+
# Use only the original mask for testing
|
| 405 |
+
mask_original = masks[0]
|
| 406 |
+
|
| 407 |
+
# Apply original mask to images and concatenate along a new dimension
|
| 408 |
+
images_tensor = torch.cat([
|
| 409 |
+
(images[0] * mask_original).unsqueeze(0),
|
| 410 |
+
(images[1] * mask_original).unsqueeze(0)
|
| 411 |
+
], dim=0)
|
| 412 |
+
|
| 413 |
+
# Create IT1 tensor
|
| 414 |
+
IT1 = torch.cat([images_tensor, mask_original.unsqueeze(0)], dim=0)
|
| 415 |
+
|
| 416 |
+
return IT1
|
| 417 |
+
|
| 418 |
+
def __getitem__(self, index: int) -> Tuple[torch.Tensor, torch.Tensor]:
|
| 419 |
+
"""
|
| 420 |
+
Retrieve a sample from the test dataset.
|
| 421 |
+
|
| 422 |
+
Parameters:
|
| 423 |
+
- index (int): Index of the sample to retrieve.
|
| 424 |
+
|
| 425 |
+
Returns:
|
| 426 |
+
- Tuple containing:
|
| 427 |
+
- images_IT (Tensor): Image IT tensors.
|
| 428 |
+
- class_label (Tensor): Class label.
|
| 429 |
+
"""
|
| 430 |
+
# Load images and masks using a default test loader
|
| 431 |
+
images, masks = default_loader_test(self.file_paths[index])
|
| 432 |
+
class_label = self.file_labels[index]
|
| 433 |
+
|
| 434 |
+
# Generate matched tensor
|
| 435 |
+
images_IT = self.get_match_tensor(images, masks)
|
| 436 |
+
|
| 437 |
+
# Convert class label to tensor
|
| 438 |
+
class_label_tensor = torch.tensor(class_label, dtype=torch.long)
|
| 439 |
+
|
| 440 |
+
return images_IT.float(), class_label_tensor.long()
|
| 441 |
+
|
| 442 |
+
|
| 443 |
+
if __name__ == '__main__':
|
| 444 |
+
import monai
|
| 445 |
+
from torch.utils.data import DataLoader
|
| 446 |
+
|
| 447 |
+
pkl_path = './CMTLNet_Path/1p19q.pkl'
|
| 448 |
+
pkl_path = './CMTLNet_Path/LHG.pkl'
|
| 449 |
+
pkl_path = './CMTLNet_Path/IDH.pkl'
|
| 450 |
+
|
| 451 |
+
# Define the transformation for the validation stage
|
| 452 |
+
validation_transforms = monai.transforms.Compose([
|
| 453 |
+
monai.transforms.ToTensor(),
|
| 454 |
+
])
|
| 455 |
+
|
| 456 |
+
# Initialize the training dataset with transformation and data reading type
|
| 457 |
+
training_dataset = TrainDataLoader_balance(read_type='train', fold=0, transform=validation_transforms,
|
| 458 |
+
random_flag=False, pkl_path=pkl_path)
|
| 459 |
+
|
| 460 |
+
# Create the training data loader
|
| 461 |
+
training_loader = DataLoader(training_dataset,
|
| 462 |
+
batch_size=1, # One sample per batch
|
| 463 |
+
shuffle=True, # Shuffle the data order
|
| 464 |
+
drop_last=True, # Drop the last incomplete batch
|
| 465 |
+
num_workers=1, # Number of worker threads for data loading
|
| 466 |
+
pin_memory=False) # Whether to pin memory for CUDA
|
| 467 |
+
|
| 468 |
+
# Output the size of the training dataset
|
| 469 |
+
print("Number of training samples: {}".format(len(training_dataset)))
|
| 470 |
+
|
| 471 |
+
# Loop through each batch in the data loader
|
| 472 |
+
for batch_data in training_loader:
|
| 473 |
+
# Unpack the data for each batch
|
| 474 |
+
imgs_IT, imgs_INT, cls_label = batch_data
|
| 475 |
+
|
| 476 |
+
|
| 477 |
+
|
code/dataLoder/loader_S2.py
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import torch
|
| 3 |
+
import pickle
|
| 4 |
+
import numpy as np
|
| 5 |
+
from torch.utils.data import Dataset
|
| 6 |
+
from typing import Optional, Callable, Tuple
|
| 7 |
+
import random
|
| 8 |
+
import pandas as pd
|
| 9 |
+
import re
|
| 10 |
+
|
| 11 |
+
# Load clinical data into a dictionary for fast lookup during training
|
| 12 |
+
clinical_dict = {}
|
| 13 |
+
try:
|
| 14 |
+
_base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 15 |
+
_csv_path = os.path.join(_base_dir, 'clinicaldata.csv')
|
| 16 |
+
if not os.path.exists(_csv_path):
|
| 17 |
+
_csv_path = 'clinicaldata.csv'
|
| 18 |
+
clinical_df = pd.read_csv(_csv_path)
|
| 19 |
+
for index, row in clinical_df.iterrows():
|
| 20 |
+
raw_id = str(row['ID']).strip()
|
| 21 |
+
if '-' in raw_id:
|
| 22 |
+
prefix, num_part = raw_id.rsplit("-", 1)
|
| 23 |
+
match = re.match(r"^(\d+)", num_part)
|
| 24 |
+
if match:
|
| 25 |
+
clean_id = f"{prefix}-{int(match.group(1)):04d}{num_part[match.end():]}"
|
| 26 |
+
os_val, event_val = row['OS'], row['1-dead 0-alive']
|
| 27 |
+
if pd.notna(os_val) and pd.notna(event_val):
|
| 28 |
+
clinical_dict[clean_id] = (float(os_val), float(event_val))
|
| 29 |
+
except Exception as e:
|
| 30 |
+
print("Warning: Could not load clinical data.", e)
|
| 31 |
+
|
| 32 |
+
def get_survival_labels(file_path):
|
| 33 |
+
"""Extracts ID from the file path and returns (time, event)"""
|
| 34 |
+
match = re.search(r'(UCSF-PDGM-\w+)', file_path)
|
| 35 |
+
if match:
|
| 36 |
+
pat_id = match.group(1).replace('_nifti', '')
|
| 37 |
+
if pat_id in clinical_dict:
|
| 38 |
+
return clinical_dict[pat_id]
|
| 39 |
+
return (0.0, 0.0) # Default if patient is missing survival data
|
| 40 |
+
# from dataload_utils import (default_loader, default_loader_test)
|
| 41 |
+
from dataLoder.dataload_utils import (default_loader, default_loader_test)
|
| 42 |
+
|
| 43 |
+
np.random.seed(1337)
|
| 44 |
+
random.seed(1337)
|
| 45 |
+
|
| 46 |
+
def get_fold_data(fold_number: int, mode: str, pickle_path: str) -> Tuple[list, list]:
|
| 47 |
+
"""
|
| 48 |
+
Load data for a specific fold and mode from a PKL file.
|
| 49 |
+
|
| 50 |
+
Parameters:
|
| 51 |
+
- mode (str): Either 'train' or 'test'.
|
| 52 |
+
- fold_number (int): An integer between 0 and 4 indicating the fold index.
|
| 53 |
+
- pickle_path (str): The file path to the PKL file.
|
| 54 |
+
|
| 55 |
+
Returns:
|
| 56 |
+
- Tuple containing:
|
| 57 |
+
- paths (list): List of file paths for the specified fold.
|
| 58 |
+
- class_labels (list): List of class labels corresponding to the file paths.
|
| 59 |
+
|
| 60 |
+
Raises:
|
| 61 |
+
- ValueError: If mode is not 'train' or 'test', or if fold_number is out of range.
|
| 62 |
+
- FileNotFoundError: If the PKL file does not exist.
|
| 63 |
+
- ValueError: If the PKL file cannot be unpickled.
|
| 64 |
+
- KeyError: If the expected data structure is not found in the PKL file.
|
| 65 |
+
"""
|
| 66 |
+
# Validate mode
|
| 67 |
+
if mode not in ['train', 'test']:
|
| 68 |
+
raise ValueError("mode must be 'train' or 'test'")
|
| 69 |
+
|
| 70 |
+
# Validate fold_number
|
| 71 |
+
if not isinstance(fold_number, int) or not (0 <= fold_number <= 4):
|
| 72 |
+
raise ValueError("fold_number must be an integer between 0 and 4")
|
| 73 |
+
|
| 74 |
+
# Attempt to load data from the PKL file
|
| 75 |
+
try:
|
| 76 |
+
with open(pickle_path, 'rb') as file:
|
| 77 |
+
data = pickle.load(file)
|
| 78 |
+
except FileNotFoundError:
|
| 79 |
+
raise FileNotFoundError(f"PKL file not found: {pickle_path}")
|
| 80 |
+
except pickle.UnpicklingError:
|
| 81 |
+
raise ValueError(f"Unable to load PKL file: {pickle_path}")
|
| 82 |
+
|
| 83 |
+
# Construct the fold key
|
| 84 |
+
fold_key = f'fold{fold_number}'
|
| 85 |
+
|
| 86 |
+
# Retrieve data for the specified mode and fold
|
| 87 |
+
try:
|
| 88 |
+
fold_data = data[mode][fold_key]
|
| 89 |
+
return fold_data['path'], fold_data['cls_label']
|
| 90 |
+
except KeyError:
|
| 91 |
+
raise KeyError(f"Missing {mode} data for {fold_key} in the data structure")
|
| 92 |
+
|
| 93 |
+
def split_path_by_label(file_paths, file_labels):
|
| 94 |
+
file_paths_0 = []
|
| 95 |
+
file_paths_1 = []
|
| 96 |
+
for i in range(len(file_labels)):
|
| 97 |
+
if file_labels[i]==0:
|
| 98 |
+
file_paths_0.append(file_paths[i])
|
| 99 |
+
elif file_labels[i]==1:
|
| 100 |
+
file_paths_1.append(file_paths[i])
|
| 101 |
+
return file_paths_0, file_paths_1
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
class TrainDataLoader_balance(Dataset):
|
| 105 |
+
def __init__(
|
| 106 |
+
self,
|
| 107 |
+
transform: Optional[Callable] = None,
|
| 108 |
+
mode: str = 'train',
|
| 109 |
+
fold: int = 1,
|
| 110 |
+
pickle_path: str = ''
|
| 111 |
+
):
|
| 112 |
+
"""
|
| 113 |
+
Initialize the training data loader.
|
| 114 |
+
|
| 115 |
+
Parameters:
|
| 116 |
+
- transform (Callable, optional): Transformation to apply to the images and masks.
|
| 117 |
+
- mode (str): Mode of data loading, default is 'train'.
|
| 118 |
+
- fold (int): Fold number to load data from..
|
| 119 |
+
- pickle_path (str): Path to the PKL file containing data.
|
| 120 |
+
"""
|
| 121 |
+
self.mode = mode
|
| 122 |
+
self.transform = transform
|
| 123 |
+
|
| 124 |
+
# Load file paths and labels for the specified fold and mode
|
| 125 |
+
file_paths, file_labels = get_fold_data(fold, mode, pickle_path)
|
| 126 |
+
self.file_paths_0, self.file_paths_1 = split_path_by_label(file_paths, file_labels)
|
| 127 |
+
|
| 128 |
+
def __len__(self) -> int:
|
| 129 |
+
"""Return the total number of samples."""
|
| 130 |
+
return max(len(self.file_paths_0), len(self.file_paths_1))
|
| 131 |
+
|
| 132 |
+
def get_match_tensor(
|
| 133 |
+
self,
|
| 134 |
+
images: list,
|
| 135 |
+
masks: list
|
| 136 |
+
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 137 |
+
"""
|
| 138 |
+
Generate matched tensors from images and masks.
|
| 139 |
+
|
| 140 |
+
Parameters:
|
| 141 |
+
- images (list): List of image tensors.
|
| 142 |
+
- masks (list): List of mask tensors.
|
| 143 |
+
|
| 144 |
+
Returns:
|
| 145 |
+
- Tuple containing:
|
| 146 |
+
- IT1 (Tensor)
|
| 147 |
+
"""
|
| 148 |
+
# Apply transformations if provided
|
| 149 |
+
if self.transform is not None:
|
| 150 |
+
images = [self.transform(img) for img in images]
|
| 151 |
+
masks = [self.transform(mask) for mask in masks]
|
| 152 |
+
|
| 153 |
+
# Unpack masks
|
| 154 |
+
mask_original, mask_positive, mask_negative = masks
|
| 155 |
+
|
| 156 |
+
# Apply original mask to images and concatenate along a new dimension
|
| 157 |
+
images_tensor = torch.cat([
|
| 158 |
+
(images[0] * mask_original).unsqueeze(0),
|
| 159 |
+
(images[1] * mask_original).unsqueeze(0)
|
| 160 |
+
], dim=0)
|
| 161 |
+
|
| 162 |
+
# Create various tensor combinations
|
| 163 |
+
IT1 = torch.cat([images_tensor, mask_original.unsqueeze(0)], dim=0)
|
| 164 |
+
return IT1.float()
|
| 165 |
+
|
| 166 |
+
def __getitem__(self, index: int) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 167 |
+
# Safely get path 0
|
| 168 |
+
if len(self.file_paths_0) == 0:
|
| 169 |
+
path_0 = self.file_paths_1[random.randint(0, len(self.file_paths_1) - 1)]
|
| 170 |
+
else:
|
| 171 |
+
path_0 = self.file_paths_0[index % len(self.file_paths_0)]
|
| 172 |
+
|
| 173 |
+
# Safely get path 1
|
| 174 |
+
if len(self.file_paths_1) == 0:
|
| 175 |
+
path_1 = self.file_paths_0[random.randint(0, len(self.file_paths_0) - 1)]
|
| 176 |
+
else:
|
| 177 |
+
path_1 = self.file_paths_1[(index + random.randint(0, len(self.file_paths_1) - 1)) % len(self.file_paths_1)]
|
| 178 |
+
|
| 179 |
+
images_0, masks_0 = default_loader(path_0)
|
| 180 |
+
images_1, masks_1 = default_loader(path_1)
|
| 181 |
+
|
| 182 |
+
IT1_0 = self.get_match_tensor(images_0, masks_0)
|
| 183 |
+
IT1_1 = self.get_match_tensor(images_1, masks_1)
|
| 184 |
+
|
| 185 |
+
images_combined = torch.cat([IT1_0.unsqueeze(0), IT1_1.unsqueeze(0)], dim=0)
|
| 186 |
+
labels_combined = torch.tensor([0, 1], dtype=torch.long).unsqueeze(0)
|
| 187 |
+
|
| 188 |
+
# Look up survival data
|
| 189 |
+
time_0, event_0 = get_survival_labels(path_0)
|
| 190 |
+
time_1, event_1 = get_survival_labels(path_1)
|
| 191 |
+
times_combined = torch.tensor([time_0, time_1], dtype=torch.float32).unsqueeze(0)
|
| 192 |
+
events_combined = torch.tensor([event_0, event_1], dtype=torch.float32).unsqueeze(0)
|
| 193 |
+
|
| 194 |
+
return images_combined, labels_combined, times_combined, events_combined
|
| 195 |
+
|
| 196 |
+
class TrainDataLoader(Dataset):
|
| 197 |
+
def __init__(
|
| 198 |
+
self,
|
| 199 |
+
transform: Optional[Callable] = None,
|
| 200 |
+
mode: str = 'train',
|
| 201 |
+
fold: int = 1,
|
| 202 |
+
pickle_path: str = ''
|
| 203 |
+
):
|
| 204 |
+
"""
|
| 205 |
+
Initialize the training data loader.
|
| 206 |
+
|
| 207 |
+
Parameters:
|
| 208 |
+
- transform (Callable, optional): Transformation to apply to the images and masks.
|
| 209 |
+
- mode (str): Mode of data loading, default is 'train'.
|
| 210 |
+
- fold (int): Fold number to load data from..
|
| 211 |
+
- pickle_path (str): Path to the PKL file containing data.
|
| 212 |
+
"""
|
| 213 |
+
self.mode = mode
|
| 214 |
+
self.transform = transform
|
| 215 |
+
|
| 216 |
+
# Load file paths and labels for the specified fold and mode
|
| 217 |
+
self.file_paths, self.file_labels = get_fold_data(fold, mode, pickle_path)
|
| 218 |
+
|
| 219 |
+
def __len__(self) -> int:
|
| 220 |
+
"""Return the total number of samples."""
|
| 221 |
+
return len(self.file_paths)
|
| 222 |
+
|
| 223 |
+
def get_match_tensor(
|
| 224 |
+
self,
|
| 225 |
+
images: list,
|
| 226 |
+
masks: list
|
| 227 |
+
) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 228 |
+
"""
|
| 229 |
+
Generate matched tensors from images and masks.
|
| 230 |
+
|
| 231 |
+
Parameters:
|
| 232 |
+
- images (list): List of image tensors.
|
| 233 |
+
- masks (list): List of mask tensors.
|
| 234 |
+
|
| 235 |
+
Returns:
|
| 236 |
+
- Tuple containing:
|
| 237 |
+
- IT1 (Tensor)
|
| 238 |
+
"""
|
| 239 |
+
# Apply transformations if provided
|
| 240 |
+
if self.transform is not None:
|
| 241 |
+
images = [self.transform(img) for img in images]
|
| 242 |
+
masks = [self.transform(mask) for mask in masks]
|
| 243 |
+
|
| 244 |
+
# Unpack masks
|
| 245 |
+
mask_original, mask_positive, mask_negative = masks
|
| 246 |
+
|
| 247 |
+
# Apply original mask to images and concatenate along a new dimension
|
| 248 |
+
images_tensor = torch.cat([
|
| 249 |
+
(images[0] * mask_original).unsqueeze(0),
|
| 250 |
+
(images[1] * mask_original).unsqueeze(0)
|
| 251 |
+
], dim=0)
|
| 252 |
+
|
| 253 |
+
# Create various tensor combinations
|
| 254 |
+
IT1 = torch.cat([images_tensor, mask_original.unsqueeze(0)], dim=0)
|
| 255 |
+
return IT1
|
| 256 |
+
|
| 257 |
+
def __getitem__(self, index: int) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
|
| 258 |
+
"""
|
| 259 |
+
Retrieve a sample from the dataset.
|
| 260 |
+
|
| 261 |
+
Parameters:
|
| 262 |
+
- index (int): Index of the sample to retrieve.
|
| 263 |
+
|
| 264 |
+
Returns:
|
| 265 |
+
- Tuple containing:
|
| 266 |
+
- IT1 (Tensor): Image tensors.
|
| 267 |
+
- class_label_tensor (Tensor): class labels.
|
| 268 |
+
"""
|
| 269 |
+
# Load images and masks using a default loader
|
| 270 |
+
images, masks = default_loader(self.file_paths[index])
|
| 271 |
+
class_label = self.file_labels[index]
|
| 272 |
+
# Generate matched tensors
|
| 273 |
+
IT1 = self.get_match_tensor(images, masks)
|
| 274 |
+
class_label_tensor = torch.tensor(class_label, dtype=torch.long)
|
| 275 |
+
return IT1.float(), class_label_tensor
|
| 276 |
+
|
| 277 |
+
class TestDataLoader(Dataset):
|
| 278 |
+
def __init__(
|
| 279 |
+
self,
|
| 280 |
+
transform: Optional[Callable] = None,
|
| 281 |
+
mode: str = 'test',
|
| 282 |
+
fold: int = 1,
|
| 283 |
+
random_flag: bool = False,
|
| 284 |
+
pickle_path: str = ''
|
| 285 |
+
):
|
| 286 |
+
"""
|
| 287 |
+
Initialize the testing data loader.
|
| 288 |
+
|
| 289 |
+
Parameters:
|
| 290 |
+
- transform (Callable, optional): Transformation to apply to the images and masks.
|
| 291 |
+
- mode (str): Mode of data loading, default is 'test'.
|
| 292 |
+
- fold (int): Fold number to load data from.
|
| 293 |
+
- random_flag (bool): If True, randomly select tensors; otherwise, use all.
|
| 294 |
+
- pickle_path (str): Path to the PKL file containing data.
|
| 295 |
+
"""
|
| 296 |
+
self.random_flag = random_flag
|
| 297 |
+
self.mode = mode
|
| 298 |
+
self.transform = transform
|
| 299 |
+
|
| 300 |
+
# Load file paths and labels for the specified fold and mode
|
| 301 |
+
self.file_paths, self.file_labels = get_fold_data(fold, mode, pickle_path)
|
| 302 |
+
|
| 303 |
+
def __len__(self) -> int:
|
| 304 |
+
"""Return the total number of samples."""
|
| 305 |
+
return len(self.file_paths)
|
| 306 |
+
|
| 307 |
+
def get_match_tensor(
|
| 308 |
+
self,
|
| 309 |
+
images: list,
|
| 310 |
+
masks: list
|
| 311 |
+
) -> torch.Tensor:
|
| 312 |
+
"""
|
| 313 |
+
Generate matched tensor from images and masks for testing.
|
| 314 |
+
|
| 315 |
+
Parameters:
|
| 316 |
+
- images (list): List of image tensors.
|
| 317 |
+
- masks (list): List of mask tensors.
|
| 318 |
+
|
| 319 |
+
Returns:
|
| 320 |
+
- IT1 (Tensor)
|
| 321 |
+
"""
|
| 322 |
+
# Apply transformations if provided
|
| 323 |
+
if self.transform is not None:
|
| 324 |
+
images = [self.transform(img) for img in images]
|
| 325 |
+
masks = [self.transform(mask) for mask in masks]
|
| 326 |
+
|
| 327 |
+
# Use only the original mask for testing
|
| 328 |
+
mask_original = masks[0]
|
| 329 |
+
|
| 330 |
+
# Apply original mask to images and concatenate along a new dimension
|
| 331 |
+
images_tensor = torch.cat([
|
| 332 |
+
(images[0] * mask_original).unsqueeze(0),
|
| 333 |
+
(images[1] * mask_original).unsqueeze(0)
|
| 334 |
+
], dim=0)
|
| 335 |
+
|
| 336 |
+
# Create IT1 tensor
|
| 337 |
+
IT1 = torch.cat([images_tensor, mask_original.unsqueeze(0)], dim=0)
|
| 338 |
+
|
| 339 |
+
return IT1
|
| 340 |
+
|
| 341 |
+
def __getitem__(self, index: int) -> Tuple[torch.Tensor, torch.Tensor]:
|
| 342 |
+
"""
|
| 343 |
+
Retrieve a sample from the test dataset.
|
| 344 |
+
|
| 345 |
+
Parameters:
|
| 346 |
+
- index (int): Index of the sample to retrieve.
|
| 347 |
+
|
| 348 |
+
Returns:
|
| 349 |
+
- Tuple containing:
|
| 350 |
+
- images_IT (Tensor): Image IT tensors.
|
| 351 |
+
- class_label (Tensor): Class label.
|
| 352 |
+
"""
|
| 353 |
+
# Load images and masks using a default test loader
|
| 354 |
+
images, masks = default_loader_test(self.file_paths[index])
|
| 355 |
+
class_label = self.file_labels[index]
|
| 356 |
+
|
| 357 |
+
# Generate matched tensor
|
| 358 |
+
images_IT = self.get_match_tensor(images, masks)
|
| 359 |
+
|
| 360 |
+
# Convert class label to tensor
|
| 361 |
+
class_label_tensor = torch.tensor(class_label, dtype=torch.long)
|
| 362 |
+
|
| 363 |
+
return images_IT.float(), class_label_tensor.long()
|
| 364 |
+
|
| 365 |
+
|
| 366 |
+
if __name__ == '__main__':
|
| 367 |
+
import monai
|
| 368 |
+
from torch.utils.data import DataLoader
|
| 369 |
+
|
| 370 |
+
pkl_path = './CMTLNet_Path/1p19q.pkl'
|
| 371 |
+
pkl_path = './CMTLNet_Path/LHG.pkl'
|
| 372 |
+
pkl_path = './CMTLNet_Path/IDH.pkl'
|
| 373 |
+
|
| 374 |
+
# Define the transformation for the validation stage
|
| 375 |
+
validation_transforms = monai.transforms.Compose([
|
| 376 |
+
monai.transforms.ToTensor(),
|
| 377 |
+
])
|
| 378 |
+
|
| 379 |
+
# Initialize the training dataset with transformation and data reading type
|
| 380 |
+
training_dataset = TrainDataLoader(read_type='train', fold=0, transform=validation_transforms,
|
| 381 |
+
random_flag=False, pkl_path=pkl_path)
|
| 382 |
+
|
| 383 |
+
# Create the training data loader
|
| 384 |
+
training_loader = TrainDataLoader_balance(training_dataset,
|
| 385 |
+
batch_size=1, # One sample per batch
|
| 386 |
+
shuffle=True, # Shuffle the data order
|
| 387 |
+
drop_last=True, # Drop the last incomplete batch
|
| 388 |
+
num_workers=1, # Number of worker threads for data loading
|
| 389 |
+
pin_memory=False) # Whether to pin memory for CUDA
|
| 390 |
+
|
| 391 |
+
# Output the size of the training dataset
|
| 392 |
+
print("Number of training samples: {}".format(len(training_dataset)))
|
| 393 |
+
|
| 394 |
+
# Loop through each batch in the data loader
|
| 395 |
+
for batch_data in training_loader:
|
| 396 |
+
# Unpack the data for each batch
|
| 397 |
+
imgs_IT, imgs_INT, cls_label = batch_data
|
code/mke_pkl.py
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import pickle
|
| 4 |
+
from sklearn.model_selection import KFold
|
| 5 |
+
import re
|
| 6 |
+
|
| 7 |
+
# 1. Absolute Paths (Using Linux paths)
|
| 8 |
+
CSV_PATH = "/home/user10/survivalanalysis/CMTLNet/CMTLNet/clinicaldata.csv"
|
| 9 |
+
DATA_ROOT = "/home/user10/survivalanalysis/data/ucsf_preprocess"
|
| 10 |
+
SAVE_DIR = "/home/user10/survivalanalysis/CMTLNet/CMTLNet"
|
| 11 |
+
|
| 12 |
+
# 2. Load Clinical Data
|
| 13 |
+
try:
|
| 14 |
+
df = pd.read_csv(CSV_PATH)
|
| 15 |
+
except FileNotFoundError:
|
| 16 |
+
print(f"ERROR: Could not find {CSV_PATH}. Please check the path.")
|
| 17 |
+
exit()
|
| 18 |
+
|
| 19 |
+
valid_patients = []
|
| 20 |
+
labels_1p19q = []
|
| 21 |
+
labels_IDH = []
|
| 22 |
+
labels_LHG = []
|
| 23 |
+
|
| 24 |
+
for index, row in df.iterrows():
|
| 25 |
+
raw_id = str(row['ID']).strip()
|
| 26 |
+
|
| 27 |
+
# Process the ID safely
|
| 28 |
+
if '-' in raw_id:
|
| 29 |
+
prefix, num_part = raw_id.rsplit("-", 1)
|
| 30 |
+
match = re.match(r"^(\d+)", num_part)
|
| 31 |
+
if match:
|
| 32 |
+
clean_id = f"{prefix}-{int(match.group(1)):04d}"
|
| 33 |
+
patient_folder = os.path.join(DATA_ROOT, clean_id)
|
| 34 |
+
|
| 35 |
+
# Only process if the preprocessed folder actually exists
|
| 36 |
+
if os.path.exists(patient_folder):
|
| 37 |
+
|
| 38 |
+
# --- ROBUST STRING TO INT MAPPING LOGIC ---
|
| 39 |
+
# 1. IDH: Map 'wildtype' -> 0, anything else (mutated) -> 1
|
| 40 |
+
val_idh = str(row.get('IDH', 'wildtype')).lower()
|
| 41 |
+
idh_val = 0 if ('wildtype' in val_idh or 'unknown' in val_idh) else 1
|
| 42 |
+
|
| 43 |
+
# 2. Grade (LHG): HGG (Grade 4) -> 1, LGG (Grade 2/3) -> 0
|
| 44 |
+
val_grade = str(row.get('WHO CNS Grade', '2')).strip()
|
| 45 |
+
lhg_val = 1 if ('4' in val_grade or 'IV' in val_grade.upper()) else 0
|
| 46 |
+
|
| 47 |
+
# 3. 1p19q: 'co-deletion' -> 1, 'intact' -> 0
|
| 48 |
+
val_1p19q = str(row.get('1p/19q', 'intact')).lower()
|
| 49 |
+
p19q_val = 1 if 'deletion' in val_1p19q else 0
|
| 50 |
+
# ------------------------------------------
|
| 51 |
+
|
| 52 |
+
valid_patients.append(patient_folder)
|
| 53 |
+
labels_IDH.append(idh_val)
|
| 54 |
+
labels_LHG.append(lhg_val)
|
| 55 |
+
labels_1p19q.append(p19q_val)
|
| 56 |
+
|
| 57 |
+
print(f"Found {len(valid_patients)} completely preprocessed patients.")
|
| 58 |
+
|
| 59 |
+
if len(valid_patients) == 0:
|
| 60 |
+
print(f"ERROR: Found 0 patients. Check if {DATA_ROOT} has the folders.")
|
| 61 |
+
exit()
|
| 62 |
+
|
| 63 |
+
# 3. Create 5-Fold Splits
|
| 64 |
+
kf = KFold(n_splits=5, shuffle=True, random_state=1337)
|
| 65 |
+
|
| 66 |
+
def create_pkl_structure(paths, labels):
|
| 67 |
+
data_struct = {'train': {}, 'test': {}}
|
| 68 |
+
for fold, (train_idx, test_idx) in enumerate(kf.split(paths)):
|
| 69 |
+
train_paths = [paths[i] for i in train_idx]
|
| 70 |
+
train_labels = [labels[i] for i in train_idx]
|
| 71 |
+
test_paths = [paths[i] for i in test_idx]
|
| 72 |
+
test_labels = [labels[i] for i in test_idx]
|
| 73 |
+
|
| 74 |
+
data_struct['train'][f'fold{fold}'] = {'path': train_paths, 'cls_label': train_labels}
|
| 75 |
+
data_struct['test'][f'fold{fold}'] = {'path': test_paths, 'cls_label': test_labels}
|
| 76 |
+
return data_struct
|
| 77 |
+
|
| 78 |
+
# 4. Save to .pkl in the main directory
|
| 79 |
+
print("Generating PKL files...")
|
| 80 |
+
with open(os.path.join(SAVE_DIR, 'IDH.pkl'), 'wb') as f:
|
| 81 |
+
pickle.dump(create_pkl_structure(valid_patients, labels_IDH), f)
|
| 82 |
+
|
| 83 |
+
with open(os.path.join(SAVE_DIR, 'LHG.pkl'), 'wb') as f:
|
| 84 |
+
pickle.dump(create_pkl_structure(valid_patients, labels_LHG), f)
|
| 85 |
+
|
| 86 |
+
with open(os.path.join(SAVE_DIR, '1p19q.pkl'), 'wb') as f:
|
| 87 |
+
pickle.dump(create_pkl_structure(valid_patients, labels_1p19q), f)
|
| 88 |
+
|
| 89 |
+
print(f"Done! IDH.pkl, LHG.pkl, and 1p19q.pkl successfully saved in {SAVE_DIR}")
|
code/model/CMTLNet.py
ADDED
|
@@ -0,0 +1,481 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
# Import densenet as backbone
|
| 5 |
+
import model.densenet as backbone
|
| 6 |
+
from model.utils import MarginLoss, CFE_refine, UFE_E2, UCFCFusion
|
| 7 |
+
|
| 8 |
+
# Task-Common Feature Extraction module
|
| 9 |
+
class CFE(nn.Module):
|
| 10 |
+
def __init__(self, in_channels=3, num_classes=3, Arcm=0.5, multi=3, factor=1):
|
| 11 |
+
super(CFE, self).__init__()
|
| 12 |
+
dim_mlp = 1024
|
| 13 |
+
self.name = 'CFE'
|
| 14 |
+
|
| 15 |
+
# Initialize DenseNet backbone with specified input channels
|
| 16 |
+
self.E1 = backbone.maskdense121(in_channels=in_channels)
|
| 17 |
+
|
| 18 |
+
# Initialize refinement module with specified input channels and factor
|
| 19 |
+
self.refine = CFE_refine(in_channels=[64, 128, 256, 512, 1024, 1024], factor=factor)
|
| 20 |
+
|
| 21 |
+
# Initialize margin loss for SFTFPPredict with specified parameters
|
| 22 |
+
self.SFTFPPredict = MarginLoss(in_features=dim_mlp, out_features=2, s=64.0, m=Arcm)
|
| 23 |
+
|
| 24 |
+
# Initialize ModuleLists for normal vs tumour classification and tumour classification
|
| 25 |
+
self.S1Predict = nn.ModuleList([])
|
| 26 |
+
self.S2Predict = nn.ModuleList([])
|
| 27 |
+
|
| 28 |
+
# Populate the ModuleLists with MarginLoss modules
|
| 29 |
+
for i in range(multi):
|
| 30 |
+
self.S1Predict.append(MarginLoss(in_features=dim_mlp, out_features=num_classes + 1, s=64.0, m=Arcm))
|
| 31 |
+
self.S2Predict.append(MarginLoss(in_features=dim_mlp // factor, out_features=num_classes, s=64.0, m=Arcm))
|
| 32 |
+
|
| 33 |
+
# Adaptive average pooling layer for 3D inputs
|
| 34 |
+
self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
|
| 35 |
+
|
| 36 |
+
def GetS1Predict(self, features_all, label_list):
|
| 37 |
+
size_img = label_list[0].size(0)
|
| 38 |
+
out_cls_list_NG = []
|
| 39 |
+
# Iterate over the first three classification tasks
|
| 40 |
+
for ssl_index in range(0, 3):
|
| 41 |
+
# Extract features for the current task
|
| 42 |
+
features_cls = features_all[size_img * ssl_index:size_img + size_img * ssl_index, :]
|
| 43 |
+
# Apply the S1Predict margin loss
|
| 44 |
+
out_cls_NG = self.S1Predict[ssl_index](features_cls, label_list[ssl_index])
|
| 45 |
+
out_cls_list_NG.append(out_cls_NG)
|
| 46 |
+
return out_cls_list_NG
|
| 47 |
+
|
| 48 |
+
# Binary classification: returns true class labels for loss computation
|
| 49 |
+
def GetS2Predict(self, features_all, label_list):
|
| 50 |
+
size_img = label_list[0].size(0)
|
| 51 |
+
out_cls_labels = []
|
| 52 |
+
out_cls_list = []
|
| 53 |
+
# Iterate over the first three classification tasks
|
| 54 |
+
for ssl_index in range(0, 3):
|
| 55 |
+
# Extract features for the current task
|
| 56 |
+
features_cls = features_all[size_img * ssl_index:size_img + size_img * ssl_index, :]
|
| 57 |
+
# Select features where label indicates glioma (label > 0)
|
| 58 |
+
index_glioma = label_list[ssl_index] > 0
|
| 59 |
+
features_cls_glioma = features_cls[index_glioma, :]
|
| 60 |
+
# Adjust labels by subtracting 1 for binary classification
|
| 61 |
+
features_cls_labels = label_list[ssl_index][index_glioma] - 1
|
| 62 |
+
# Apply the S2Predict margin loss
|
| 63 |
+
out_cls = self.S2Predict[ssl_index](features_cls_glioma, features_cls_labels)
|
| 64 |
+
out_cls_list.append(out_cls)
|
| 65 |
+
out_cls_labels.append(features_cls_labels)
|
| 66 |
+
return out_cls_list, out_cls_labels
|
| 67 |
+
|
| 68 |
+
# Forward pass with three-class labels
|
| 69 |
+
# Labels: 0 = no tumor, 1 & 2 = two classes for normal binary classification
|
| 70 |
+
def forward(self, input, labels_NG, label_list):
|
| 71 |
+
from torch.utils.checkpoint import checkpoint
|
| 72 |
+
# --- SURGICAL VRAM OPTIMIZATION: Process heavy 3D volumes in chunks of 2 ---
|
| 73 |
+
chunk_size = 1
|
| 74 |
+
t1_l, t2_list, t3_list, t4_list, t5_list = [], [], [], [], []
|
| 75 |
+
|
| 76 |
+
for i in range(0, input.size(0), chunk_size):
|
| 77 |
+
chunk = input[i : i + chunk_size]
|
| 78 |
+
chunk.requires_grad_() # Required for checkpointing to trigger backward pass
|
| 79 |
+
t1, t2, t3, t4, t5 = checkpoint(self.E1, chunk, use_reentrant=False)
|
| 80 |
+
t1_l.append(t1)
|
| 81 |
+
t2_list.append(t2)
|
| 82 |
+
t3_list.append(t3)
|
| 83 |
+
t4_list.append(t4)
|
| 84 |
+
t5_list.append(t5)
|
| 85 |
+
|
| 86 |
+
features_t1 = torch.cat(t1_l, dim=0)
|
| 87 |
+
features_t2 = torch.cat(t2_list, dim=0)
|
| 88 |
+
features_t3 = torch.cat(t3_list, dim=0)
|
| 89 |
+
features_t4 = torch.cat(t4_list, dim=0)
|
| 90 |
+
features_t5 = torch.cat(t5_list, dim=0)
|
| 91 |
+
# --------------------------------------------------------------------------
|
| 92 |
+
|
| 93 |
+
# Apply average pooling and flatten the features
|
| 94 |
+
Fi = self.avgpool(features_t5)
|
| 95 |
+
Fi = torch.flatten(Fi, 1)
|
| 96 |
+
|
| 97 |
+
# Concatenate all normal vs tumour labels
|
| 98 |
+
labels_NG_all = torch.cat(labels_NG, 0)
|
| 99 |
+
|
| 100 |
+
# Predict normal vs tumour logits
|
| 101 |
+
logits_NG = self.SFTFPPredict(Fi, labels_NG_all)
|
| 102 |
+
|
| 103 |
+
# Refine features using the CFE_refine module
|
| 104 |
+
Fs1, Fs2 = self.refine(features_t1, features_t2, features_t3, features_t4, features_t5)
|
| 105 |
+
|
| 106 |
+
# Apply average pooling and flatten Fs1
|
| 107 |
+
Fs1 = self.avgpool(Fs1)
|
| 108 |
+
Fs1 = torch.flatten(Fs1, 1)
|
| 109 |
+
|
| 110 |
+
# Apply average pooling and flatten Fs2
|
| 111 |
+
Fs2 = self.avgpool(Fs2)
|
| 112 |
+
Fs2 = torch.flatten(Fs2, 1)
|
| 113 |
+
|
| 114 |
+
# Get predictions for normal vs tumour classification
|
| 115 |
+
out_cls_list_NG = self.GetS1Predict(Fs1, label_list)
|
| 116 |
+
|
| 117 |
+
# Get predictions for tumour classification
|
| 118 |
+
out_cls_list, out_cls_labels = self.GetS2Predict(Fs2, label_list)
|
| 119 |
+
|
| 120 |
+
return logits_NG, labels_NG_all, out_cls_list_NG, out_cls_list, out_cls_labels
|
| 121 |
+
|
| 122 |
+
def predict(self, inputs, ssl_index):
|
| 123 |
+
with torch.no_grad():
|
| 124 |
+
# --- SURGICAL VRAM OPTIMIZATION: Process heavy 3D volumes in chunks of 2 ---
|
| 125 |
+
chunk_size = 1
|
| 126 |
+
t1_l, t2_list, t3_list, t4_list, t5_list = [], [], [], [], []
|
| 127 |
+
|
| 128 |
+
for i in range(0, inputs.size(0), chunk_size):
|
| 129 |
+
chunk = inputs[i : i + chunk_size]
|
| 130 |
+
t1, t2, t3, t4, t5 = self.E1(chunk)
|
| 131 |
+
t1_l.append(t1)
|
| 132 |
+
t2_list.append(t2)
|
| 133 |
+
t3_list.append(t3)
|
| 134 |
+
t4_list.append(t4)
|
| 135 |
+
t5_list.append(t5)
|
| 136 |
+
|
| 137 |
+
features_t1 = torch.cat(t1_l, dim=0)
|
| 138 |
+
features_t2 = torch.cat(t2_list, dim=0)
|
| 139 |
+
features_t3 = torch.cat(t3_list, dim=0)
|
| 140 |
+
features_t4 = torch.cat(t4_list, dim=0)
|
| 141 |
+
features_t5 = torch.cat(t5_list, dim=0)
|
| 142 |
+
# --------------------------------------------------------------------------
|
| 143 |
+
|
| 144 |
+
# Refine features
|
| 145 |
+
Fs1, Fs2 = self.refine(features_t1, features_t2, features_t3, features_t4, features_t5)
|
| 146 |
+
|
| 147 |
+
# Apply average pooling and flatten Fs2
|
| 148 |
+
Fs2 = self.avgpool(Fs2)
|
| 149 |
+
Fs2 = torch.flatten(Fs2, 1)
|
| 150 |
+
|
| 151 |
+
# Get prediction from the S2Predict module
|
| 152 |
+
out = self.S2Predict[ssl_index].predict(Fs2)
|
| 153 |
+
return out
|
| 154 |
+
|
| 155 |
+
def get_Sharefeatures(self, inputs):
|
| 156 |
+
with torch.no_grad():
|
| 157 |
+
# --- SURGICAL VRAM OPTIMIZATION: Process heavy 3D volumes in chunks of 2 ---
|
| 158 |
+
chunk_size = 1
|
| 159 |
+
t1_l, t2_list, t3_list, t4_list, t5_list = [], [], [], [], []
|
| 160 |
+
|
| 161 |
+
for i in range(0, inputs.size(0), chunk_size):
|
| 162 |
+
chunk = inputs[i : i + chunk_size]
|
| 163 |
+
t1, t2, t3, t4, t5 = self.E1(chunk)
|
| 164 |
+
t1_l.append(t1)
|
| 165 |
+
t2_list.append(t2)
|
| 166 |
+
t3_list.append(t3)
|
| 167 |
+
t4_list.append(t4)
|
| 168 |
+
t5_list.append(t5)
|
| 169 |
+
|
| 170 |
+
features_t1 = torch.cat(t1_l, dim=0)
|
| 171 |
+
features_t2 = torch.cat(t2_list, dim=0)
|
| 172 |
+
features_t3 = torch.cat(t3_list, dim=0)
|
| 173 |
+
features_t4 = torch.cat(t4_list, dim=0)
|
| 174 |
+
features_t5 = torch.cat(t5_list, dim=0)
|
| 175 |
+
# --------------------------------------------------------------------------
|
| 176 |
+
|
| 177 |
+
# Get shared features using the refine module
|
| 178 |
+
Fc = self.refine.getFc(features_t1, features_t2, features_t3, features_t4, features_t5)
|
| 179 |
+
return features_t1, Fc
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
# Task-Specific Unique Feature Extraction module
|
| 183 |
+
class UFE(nn.Module):
|
| 184 |
+
def __init__(self, num_classes=3, Arcm=0.5, multi=3, factor=1):
|
| 185 |
+
super(UFE, self).__init__()
|
| 186 |
+
dim_mlp = 1024
|
| 187 |
+
self.name = 'UFE'
|
| 188 |
+
|
| 189 |
+
# Initialize UFE_E2 module with specified input channels and factor
|
| 190 |
+
self.E2 = UFE_E2(in_channels=[3, 64, 128, 256, 512, 1024, 1024], factor=factor)
|
| 191 |
+
|
| 192 |
+
# Initialize Classifier ModuleList with MarginLoss modules
|
| 193 |
+
self.Classifer = nn.ModuleList([])
|
| 194 |
+
for i in range(multi):
|
| 195 |
+
self.Classifer.append(MarginLoss(in_features=dim_mlp, out_features=num_classes, s=64.0, m=Arcm))
|
| 196 |
+
|
| 197 |
+
# Adaptive average pooling layer for 3D inputs
|
| 198 |
+
self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
|
| 199 |
+
|
| 200 |
+
# Binary classification: returns true class labels for loss computation
|
| 201 |
+
def class_glioma(self, features_all, label_list):
|
| 202 |
+
size_img = label_list[0].size(0)
|
| 203 |
+
out_cls_labels = []
|
| 204 |
+
out_cls_list = []
|
| 205 |
+
# Iterate over the first three classification tasks
|
| 206 |
+
for ssl_index in range(0, 3):
|
| 207 |
+
# Extract features for the current task
|
| 208 |
+
features_cls = features_all[size_img * ssl_index:size_img + size_img * ssl_index, :]
|
| 209 |
+
# Get the labels for the current task
|
| 210 |
+
features_cls_labels = label_list[ssl_index]
|
| 211 |
+
# Apply the classifier margin loss
|
| 212 |
+
out_cls = self.Classifer[ssl_index](features_cls, features_cls_labels)
|
| 213 |
+
out_cls_list.append(out_cls)
|
| 214 |
+
out_cls_labels.append(features_cls_labels)
|
| 215 |
+
return out_cls_list, out_cls_labels
|
| 216 |
+
|
| 217 |
+
def forward(self, input, label_list, condition, Fl):
|
| 218 |
+
# Learn unique features by removing shared features through non-linear projection
|
| 219 |
+
Fuhc_prime = self.E2(input, Fl, condition)
|
| 220 |
+
|
| 221 |
+
# Apply average pooling and flatten the features
|
| 222 |
+
Fuhc_prime_avg = self.avgpool(Fuhc_prime)
|
| 223 |
+
Fuhc_prime_avg = torch.flatten(Fuhc_prime_avg, 1)
|
| 224 |
+
|
| 225 |
+
# Get classification outputs and labels for glioma classification
|
| 226 |
+
out_cls_list, out_cls_labels = self.class_glioma(Fuhc_prime_avg, label_list)
|
| 227 |
+
return Fuhc_prime, out_cls_list, out_cls_labels
|
| 228 |
+
|
| 229 |
+
def get_Uniquefeatures(self, input, condition, Fl):
|
| 230 |
+
# Learn unique features by removing shared features through non-linear projection
|
| 231 |
+
Fuhc_prime = self.E2(input, Fl, condition)
|
| 232 |
+
return Fuhc_prime
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
# Unique-Common Feature Collaborative Classification module
|
| 236 |
+
class UCFC(nn.Module):
|
| 237 |
+
def __init__(self, num_classes=2, multi=3, factor=1):
|
| 238 |
+
super(UCFC, self).__init__()
|
| 239 |
+
dim_mlp = 1024
|
| 240 |
+
|
| 241 |
+
# Define the final fusion block with UCFCFusion, BatchNorm, and ReLU
|
| 242 |
+
self.block_final = nn.Sequential(
|
| 243 |
+
UCFCFusion(channel=dim_mlp,
|
| 244 |
+
ochannel=dim_mlp // factor,
|
| 245 |
+
img_size=[5, 6, 5],
|
| 246 |
+
fusion_num=2),
|
| 247 |
+
nn.BatchNorm3d(dim_mlp),
|
| 248 |
+
nn.ReLU()
|
| 249 |
+
)
|
| 250 |
+
|
| 251 |
+
# Define the fully connected block with Conv3d, BatchNorm, and ReLU
|
| 252 |
+
self.block_fc = nn.Sequential(
|
| 253 |
+
nn.Conv3d(in_channels=dim_mlp * 2,
|
| 254 |
+
out_channels=dim_mlp,
|
| 255 |
+
kernel_size=3,
|
| 256 |
+
padding=1,
|
| 257 |
+
stride=1,
|
| 258 |
+
bias=False),
|
| 259 |
+
nn.BatchNorm3d(dim_mlp // factor),
|
| 260 |
+
nn.ReLU()
|
| 261 |
+
)
|
| 262 |
+
|
| 263 |
+
# Initialize Classifier ModuleList with Linear layers
|
| 264 |
+
self.Classifer = nn.ModuleList([])
|
| 265 |
+
for i in range(multi):
|
| 266 |
+
self.Classifer.append(nn.Linear(dim_mlp // factor, num_classes))
|
| 267 |
+
|
| 268 |
+
# Adaptive average pooling layer for 3D inputs
|
| 269 |
+
self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
|
| 270 |
+
|
| 271 |
+
# Binary classification: returns true class labels for loss computation
|
| 272 |
+
def class_glioma(self, features_all, label_list):
|
| 273 |
+
size_img = label_list[0].size(0)
|
| 274 |
+
out_cls_labels = []
|
| 275 |
+
out_cls_list = []
|
| 276 |
+
# Iterate over the first three classification tasks
|
| 277 |
+
for ssl_index in range(0, 3):
|
| 278 |
+
# Extract features for the current task
|
| 279 |
+
features_cls = features_all[size_img * ssl_index:size_img + size_img * ssl_index, :]
|
| 280 |
+
# Get the labels for the current task
|
| 281 |
+
features_cls_labels = label_list[ssl_index]
|
| 282 |
+
# Apply the classifier linear layer
|
| 283 |
+
out_cls = self.Classifer[ssl_index](features_cls)
|
| 284 |
+
out_cls_list.append(out_cls)
|
| 285 |
+
out_cls_labels.append(features_cls_labels)
|
| 286 |
+
return out_cls_list, out_cls_labels
|
| 287 |
+
|
| 288 |
+
def forward(self, Fuhc_prime, Fc, label_list):
|
| 289 |
+
# Apply the fully connected block to Fc
|
| 290 |
+
Fc = self.block_fc(Fc)
|
| 291 |
+
|
| 292 |
+
# Concatenate unique and shared features
|
| 293 |
+
featuresF = torch.cat((Fuhc_prime, Fc), 1)
|
| 294 |
+
|
| 295 |
+
# Apply the final fusion block
|
| 296 |
+
featuresF = self.block_final(featuresF)
|
| 297 |
+
|
| 298 |
+
# Apply average pooling and flatten the features
|
| 299 |
+
featuresF = self.avgpool(featuresF)
|
| 300 |
+
featuresF = torch.flatten(featuresF, 1)
|
| 301 |
+
|
| 302 |
+
# Get classification outputs and labels for glioma classification
|
| 303 |
+
out_cls_list, out_cls_labels = self.class_glioma(featuresF, label_list)
|
| 304 |
+
return out_cls_list, out_cls_labels
|
| 305 |
+
|
| 306 |
+
def predict(self, Fuhc_prime, Fc, ssl_index):
|
| 307 |
+
with torch.no_grad():
|
| 308 |
+
# Apply the fully connected block to Fc
|
| 309 |
+
Fc = self.block_fc(Fc)
|
| 310 |
+
|
| 311 |
+
# Concatenate unique and shared features
|
| 312 |
+
featuresF = torch.cat((Fuhc_prime, Fc), 1)
|
| 313 |
+
|
| 314 |
+
# Apply the final fusion block
|
| 315 |
+
featuresF = self.block_final(featuresF)
|
| 316 |
+
|
| 317 |
+
# Apply average pooling and flatten the features
|
| 318 |
+
featuresF = self.avgpool(featuresF)
|
| 319 |
+
featuresF = torch.flatten(featuresF, 1)
|
| 320 |
+
|
| 321 |
+
# Get prediction from the classifier linear layer
|
| 322 |
+
out = self.Classifer[ssl_index](featuresF)
|
| 323 |
+
return out
|
| 324 |
+
|
| 325 |
+
|
| 326 |
+
# Cooperative Multi-Task Learning Network
|
| 327 |
+
class CMTLNet(nn.Module):
|
| 328 |
+
def __init__(self, in_channels=3, num_classes=2, Arcm=0.5, multi=3, factor=1):
|
| 329 |
+
super(CMTLNet, self).__init__()
|
| 330 |
+
self.ShareTask = CFE(in_channels=in_channels, num_classes=num_classes, Arcm=Arcm, multi=multi, factor=factor)
|
| 331 |
+
self.UniqueTask = UFE(num_classes=num_classes, Arcm=Arcm, multi=multi, factor=factor)
|
| 332 |
+
self.UCFC = UCFC(num_classes=num_classes, multi=multi, factor=factor)
|
| 333 |
+
self.name = 'CMTLNet'
|
| 334 |
+
|
| 335 |
+
# --- NEW SURVIVAL HEAD ---
|
| 336 |
+
self.avgpool = nn.AdaptiveAvgPool3d((1, 1, 1))
|
| 337 |
+
self.survival_head = nn.Linear(2048, 1) # 2048 is the actual dim from the shared Fc feature
|
| 338 |
+
|
| 339 |
+
def _set_requires_grad(self, nets, requires_grad):
|
| 340 |
+
# Helper function to set the requires_grad attribute for networks
|
| 341 |
+
if not isinstance(nets, list):
|
| 342 |
+
nets = [nets]
|
| 343 |
+
for net in nets:
|
| 344 |
+
if net is not None:
|
| 345 |
+
for param in net.parameters():
|
| 346 |
+
param.requires_grad = requires_grad
|
| 347 |
+
|
| 348 |
+
def forward(self, input, label_list, condition):
|
| 349 |
+
self._set_requires_grad(self.ShareTask, False)
|
| 350 |
+
|
| 351 |
+
with torch.no_grad():
|
| 352 |
+
Fl, Fc = self.ShareTask.get_Sharefeatures(input)
|
| 353 |
+
|
| 354 |
+
Fuhc_prime, out_cls_list_UFE, out_cls_labels_UFE = self.UniqueTask(input, label_list, condition, Fl)
|
| 355 |
+
out_cls_list_UCFC, out_cls_labels_UCFC = self.UCFC(Fuhc_prime, Fc, label_list)
|
| 356 |
+
|
| 357 |
+
# --- PREDICT RISK SCORE ---
|
| 358 |
+
risk_features = self.avgpool(Fc)
|
| 359 |
+
risk_features = torch.flatten(risk_features, 1)
|
| 360 |
+
assert risk_features.shape[-1] == self.survival_head.in_features, (
|
| 361 |
+
f"risk_features={risk_features.shape}, "
|
| 362 |
+
f"expected last dim={self.survival_head.in_features}"
|
| 363 |
+
)
|
| 364 |
+
risk_scores = self.survival_head(risk_features)
|
| 365 |
+
|
| 366 |
+
# Return risk_scores as the final output
|
| 367 |
+
return out_cls_list_UFE, out_cls_labels_UFE, out_cls_list_UCFC, out_cls_labels_UCFC, risk_scores
|
| 368 |
+
|
| 369 |
+
def predict(self, inputs, ssl_index):
|
| 370 |
+
with torch.no_grad():
|
| 371 |
+
# Create a condition tensor based on the ssl_index
|
| 372 |
+
ssl_index_condition = \
|
| 373 |
+
torch.tensor(ssl_index, dtype=torch.long, device=inputs.device).repeat(1, inputs.size(0))[0]
|
| 374 |
+
|
| 375 |
+
# Get shared features from the ShareTask
|
| 376 |
+
Fl, Fc = self.ShareTask.get_Sharefeatures(inputs)
|
| 377 |
+
|
| 378 |
+
# Get unique features from the UniqueTask
|
| 379 |
+
Fuhc_prime = self.UniqueTask.get_Uniquefeatures(inputs, ssl_index_condition, Fl)
|
| 380 |
+
|
| 381 |
+
# Get prediction from the UCFC fusion module
|
| 382 |
+
out = self.UCFC.predict(Fuhc_prime, Fc, ssl_index)
|
| 383 |
+
return out
|
| 384 |
+
|
| 385 |
+
|
| 386 |
+
if __name__ == "__main__":
|
| 387 |
+
# First stage: Train CFE module.
|
| 388 |
+
# In this stage, the first batch simulates data without tumors, labeled as 0 (INT in Fig. 2 of the original paper).
|
| 389 |
+
# The second and third batches simulate data with tumors, labeled as 1 and 2 respectively.
|
| 390 |
+
# Label 1 corresponds to IDH WildType, LGG, or 1p/19g Intact.
|
| 391 |
+
# Label 2 corresponds to IDH Mutated, HGG, or lp/19g Co-deleted.
|
| 392 |
+
|
| 393 |
+
# Generate random input tensors for the 1p19q, IDH, and LHG tasks
|
| 394 |
+
input_1p19q = torch.randn(3, 3, 160, 192, 160)
|
| 395 |
+
input_IDH = torch.randn(3, 3, 160, 192, 160)
|
| 396 |
+
input_LHG = torch.randn(3, 3, 160, 192, 160)
|
| 397 |
+
|
| 398 |
+
# Define labels for each task
|
| 399 |
+
label_1p19q = torch.tensor([0, 1, 2], dtype=torch.long)
|
| 400 |
+
label_IDH = torch.tensor([0, 1, 2], dtype=torch.long)
|
| 401 |
+
label_LHG = torch.tensor([0, 1, 2], dtype=torch.long)
|
| 402 |
+
|
| 403 |
+
# Combine labels into a list
|
| 404 |
+
label_list = [label_1p19q, label_IDH, label_LHG]
|
| 405 |
+
|
| 406 |
+
# Concatenate inputs from different tasks along the batch dimension
|
| 407 |
+
input = torch.cat((input_1p19q, input_IDH, input_LHG), 0)
|
| 408 |
+
|
| 409 |
+
# Define normal vs tumor labels for each task
|
| 410 |
+
labels_NG_1p19q = torch.tensor([0, 1, 1], dtype=torch.long)
|
| 411 |
+
labels_NG_IDH = torch.tensor([0, 1, 1], dtype=torch.long)
|
| 412 |
+
labels_NG_LHG = torch.tensor([0, 1, 1], dtype=torch.long)
|
| 413 |
+
|
| 414 |
+
# Combine normal vs tumor labels into a list
|
| 415 |
+
labels_NG_list = [labels_NG_1p19q, labels_NG_IDH, labels_NG_LHG]
|
| 416 |
+
|
| 417 |
+
# Initialize the CFE model with specified parameters
|
| 418 |
+
model = CFE(in_channels=3, num_classes=2, Arcm=0.5, multi=3)
|
| 419 |
+
|
| 420 |
+
# Perform a forward pass through the CFE model
|
| 421 |
+
(logits_NG, labels_NG_all,
|
| 422 |
+
out_cls_list_NG,
|
| 423 |
+
out_cls_list, out_cls_labels) = model(input, labels_NG_list, label_list)
|
| 424 |
+
|
| 425 |
+
# Print the outputs from the CFE model
|
| 426 |
+
print(logits_NG.size())
|
| 427 |
+
print(labels_NG_all.size())
|
| 428 |
+
print(out_cls_list_NG[0].size())
|
| 429 |
+
print(out_cls_list[0].size())
|
| 430 |
+
print(out_cls_labels[0].size())
|
| 431 |
+
|
| 432 |
+
# -------------------------------------------------------------------
|
| 433 |
+
# Second stage: Train CMTLNet.
|
| 434 |
+
# In this stage, all inputs contain tumors (IT in Fig. 2 of the original paper).
|
| 435 |
+
# The labels correspond to 0 and 1.
|
| 436 |
+
# Label 0 corresponds to IDH WildType, LGG, or 1p/19g Intact.
|
| 437 |
+
# Label 1 corresponds to IDH Mutated, HGG, or lp/19g Co-deleted.
|
| 438 |
+
|
| 439 |
+
# Generate random input tensors for the 1p19q, IDH, and LHG tasks
|
| 440 |
+
input_1p19q = torch.randn(2, 3, 160, 192, 160)
|
| 441 |
+
input_IDH = torch.randn(2, 3, 160, 192, 160)
|
| 442 |
+
input_LHG = torch.randn(2, 3, 160, 192, 160)
|
| 443 |
+
|
| 444 |
+
# Define labels for each task
|
| 445 |
+
label_1p19q = torch.tensor([0, 1], dtype=torch.long)
|
| 446 |
+
label_IDH = torch.tensor([0, 1], dtype=torch.long)
|
| 447 |
+
label_LHG = torch.tensor([0, 1], dtype=torch.long)
|
| 448 |
+
|
| 449 |
+
# Combine labels into a list
|
| 450 |
+
label_list = [label_1p19q, label_IDH, label_LHG]
|
| 451 |
+
|
| 452 |
+
# Concatenate inputs from different tasks along the batch dimension
|
| 453 |
+
input = torch.cat((input_1p19q, input_IDH, input_LHG), 0)
|
| 454 |
+
|
| 455 |
+
# Define condition tensor indicating the task for each input
|
| 456 |
+
# Condition 0 for 1p19q prediction task, 1 for IDH prediction task, and 2 for LHG prediction task
|
| 457 |
+
condition = torch.tensor([0, 0, 1, 1, 2, 2], dtype=torch.long, device=input.device)
|
| 458 |
+
|
| 459 |
+
# Initialize the CMTLNet model with specified parameters
|
| 460 |
+
model = CMTLNet(in_channels=3, num_classes=2, Arcm=0.5, multi=3)
|
| 461 |
+
|
| 462 |
+
# Perform a forward pass through the CMTLNet model (UPDATED TO EXPECT 5 OUTPUTS)
|
| 463 |
+
out_cls_list_UFE, out_cls_labels_UFE, out_cls_list_UCFC, out_cls_labels_UCFC, risk_scores = model(input, label_list, condition)
|
| 464 |
+
|
| 465 |
+
# Print the lengths of the classification output lists and label lists
|
| 466 |
+
print(out_cls_list_UFE[0].size())
|
| 467 |
+
print(out_cls_labels_UFE[0].size())
|
| 468 |
+
print(out_cls_list_UCFC[0].size())
|
| 469 |
+
print(out_cls_labels_UCFC[0].size())
|
| 470 |
+
|
| 471 |
+
# -------------------------------------------------------------------
|
| 472 |
+
# Final model inference:
|
| 473 |
+
# For the 1p19q prediction task, set ssl_index to 0.
|
| 474 |
+
# For the IDH prediction task, set ssl_index to 1.
|
| 475 |
+
# For the LHG prediction task, set ssl_index to 2.
|
| 476 |
+
|
| 477 |
+
# Perform prediction using the CMTLNet model for the IDH prediction task (ssl_index=1)
|
| 478 |
+
logits = model.predict(input, ssl_index=1)
|
| 479 |
+
|
| 480 |
+
# Print the size of the prediction logits
|
| 481 |
+
print(logits.size())
|
code/model/densenet.py
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import torch
|
| 3 |
+
import torch.nn as nn
|
| 4 |
+
import torch.nn.functional as F
|
| 5 |
+
import torch.utils.checkpoint as cp
|
| 6 |
+
from collections import OrderedDict
|
| 7 |
+
from torch import Tensor
|
| 8 |
+
from typing import Any, List, Tuple
|
| 9 |
+
|
| 10 |
+
__all__ = ['DenseNet', 'densenet121', 'densenet169', 'densenet201', 'densenet161']
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class _DenseLayer(nn.Module):
|
| 14 |
+
def __init__(
|
| 15 |
+
self,
|
| 16 |
+
num_input_features: int,
|
| 17 |
+
growth_rate: int,
|
| 18 |
+
bn_size: int,
|
| 19 |
+
drop_rate: float,
|
| 20 |
+
memory_efficient: bool = False
|
| 21 |
+
) -> None:
|
| 22 |
+
super(_DenseLayer, self).__init__()
|
| 23 |
+
self.norm1: nn.BatchNorm3d
|
| 24 |
+
self.add_module('norm1', nn.BatchNorm3d(num_input_features))
|
| 25 |
+
self.relu1: nn.ReLU
|
| 26 |
+
self.add_module('relu1', nn.ReLU(inplace=True))
|
| 27 |
+
self.conv1: nn.Conv3d
|
| 28 |
+
self.add_module('conv1', nn.Conv3d(num_input_features, bn_size *
|
| 29 |
+
growth_rate, kernel_size=1, stride=1,
|
| 30 |
+
bias=False))
|
| 31 |
+
self.norm2: nn.BatchNorm3d
|
| 32 |
+
self.add_module('norm2', nn.BatchNorm3d(bn_size * growth_rate))
|
| 33 |
+
self.relu2: nn.ReLU
|
| 34 |
+
self.add_module('relu2', nn.ReLU(inplace=True))
|
| 35 |
+
self.conv2: nn.Conv3d
|
| 36 |
+
self.add_module('conv2', nn.Conv3d(bn_size * growth_rate, growth_rate,
|
| 37 |
+
kernel_size=3, stride=1, padding=1,
|
| 38 |
+
bias=False))
|
| 39 |
+
self.drop_rate = float(drop_rate)
|
| 40 |
+
self.memory_efficient = memory_efficient
|
| 41 |
+
|
| 42 |
+
def bn_function(self, inputs: List[Tensor]) -> Tensor:
|
| 43 |
+
concated_features = torch.cat(inputs, 1)
|
| 44 |
+
bottleneck_output = self.conv1(self.relu1(self.norm1(concated_features))) # noqa: T484
|
| 45 |
+
return bottleneck_output
|
| 46 |
+
|
| 47 |
+
# todo: rewrite when torchscript supports any
|
| 48 |
+
def any_requires_grad(self, input: List[Tensor]) -> bool:
|
| 49 |
+
for tensor in input:
|
| 50 |
+
if tensor.requires_grad:
|
| 51 |
+
return True
|
| 52 |
+
return False
|
| 53 |
+
|
| 54 |
+
@torch.jit.unused # noqa: T484
|
| 55 |
+
def call_checkpoint_bottleneck(self, input: List[Tensor]) -> Tensor:
|
| 56 |
+
def closure(*inputs):
|
| 57 |
+
return self.bn_function(inputs)
|
| 58 |
+
|
| 59 |
+
return cp.checkpoint(closure, *input)
|
| 60 |
+
|
| 61 |
+
@torch.jit._overload_method # noqa: F811
|
| 62 |
+
def forward(self, input: List[Tensor]) -> Tensor:
|
| 63 |
+
pass
|
| 64 |
+
|
| 65 |
+
@torch.jit._overload_method # noqa: F811
|
| 66 |
+
def forward(self, input: Tensor) -> Tensor:
|
| 67 |
+
pass
|
| 68 |
+
|
| 69 |
+
# torchscript does not yet support *args, so we overload method
|
| 70 |
+
# allowing it to take either a List[Tensor] or single Tensor
|
| 71 |
+
def forward(self, input: Tensor) -> Tensor: # noqa: F811
|
| 72 |
+
if isinstance(input, Tensor):
|
| 73 |
+
prev_features = [input]
|
| 74 |
+
else:
|
| 75 |
+
prev_features = input
|
| 76 |
+
|
| 77 |
+
if self.memory_efficient and self.any_requires_grad(prev_features):
|
| 78 |
+
if torch.jit.is_scripting():
|
| 79 |
+
raise Exception("Memory Efficient not supported in JIT")
|
| 80 |
+
|
| 81 |
+
bottleneck_output = self.call_checkpoint_bottleneck(prev_features)
|
| 82 |
+
else:
|
| 83 |
+
bottleneck_output = self.bn_function(prev_features)
|
| 84 |
+
|
| 85 |
+
new_features = self.conv2(self.relu2(self.norm2(bottleneck_output)))
|
| 86 |
+
if self.drop_rate > 0:
|
| 87 |
+
new_features = F.dropout(new_features, p=self.drop_rate,
|
| 88 |
+
training=self.training)
|
| 89 |
+
return new_features
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
class _DenseBlock(nn.ModuleDict):
|
| 93 |
+
_version = 2
|
| 94 |
+
|
| 95 |
+
def __init__(
|
| 96 |
+
self,
|
| 97 |
+
num_layers: int,
|
| 98 |
+
num_input_features: int,
|
| 99 |
+
bn_size: int,
|
| 100 |
+
growth_rate: int,
|
| 101 |
+
drop_rate: float,
|
| 102 |
+
memory_efficient: bool = False
|
| 103 |
+
) -> None:
|
| 104 |
+
super(_DenseBlock, self).__init__()
|
| 105 |
+
for i in range(num_layers):
|
| 106 |
+
layer = _DenseLayer(
|
| 107 |
+
num_input_features + i * growth_rate,
|
| 108 |
+
growth_rate=growth_rate,
|
| 109 |
+
bn_size=bn_size,
|
| 110 |
+
drop_rate=drop_rate,
|
| 111 |
+
memory_efficient=memory_efficient,
|
| 112 |
+
)
|
| 113 |
+
self.add_module('denselayer%d' % (i + 1), layer)
|
| 114 |
+
|
| 115 |
+
def forward(self, init_features: Tensor) -> Tensor:
|
| 116 |
+
features = [init_features]
|
| 117 |
+
for name, layer in self.items():
|
| 118 |
+
new_features = layer(features)
|
| 119 |
+
features.append(new_features)
|
| 120 |
+
return torch.cat(features, 1)
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
class _Transition(nn.Sequential):
|
| 124 |
+
def __init__(self, num_input_features: int, num_output_features: int) -> None:
|
| 125 |
+
super(_Transition, self).__init__()
|
| 126 |
+
self.add_module('norm', nn.BatchNorm3d(num_input_features))
|
| 127 |
+
self.add_module('relu', nn.ReLU(inplace=True))
|
| 128 |
+
self.add_module('conv', nn.Conv3d(num_input_features, num_output_features,
|
| 129 |
+
kernel_size=1, stride=1, bias=False))
|
| 130 |
+
self.add_module('pool', nn.AvgPool3d(kernel_size=2, stride=2))
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
class DenseNet(nn.Module):
|
| 134 |
+
r"""Densenet-BC model class, based on
|
| 135 |
+
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
|
| 136 |
+
|
| 137 |
+
Args:
|
| 138 |
+
growth_rate (int) - how many filters to add each layer (`k` in paper)
|
| 139 |
+
block_config (list of 4 ints) - how many layers in each pooling block
|
| 140 |
+
num_init_features (int) - the number of filters to learn in the first convolution layer
|
| 141 |
+
bn_size (int) - multiplicative factor for number of bottle neck layers
|
| 142 |
+
(i.e. bn_size * k features in the bottleneck layer)
|
| 143 |
+
drop_rate (float) - dropout rate after each dense layer
|
| 144 |
+
num_classes (int) - number of classification classes
|
| 145 |
+
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
|
| 146 |
+
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
|
| 147 |
+
"""
|
| 148 |
+
|
| 149 |
+
def __init__(
|
| 150 |
+
self,
|
| 151 |
+
growth_rate: int = 32,
|
| 152 |
+
block_config: Tuple[int, int, int, int] = (6, 12, 24, 16),
|
| 153 |
+
num_init_features: int = 64,
|
| 154 |
+
bn_size: int = 4,
|
| 155 |
+
drop_rate: float = 0,
|
| 156 |
+
num_classes: int = 1000,
|
| 157 |
+
memory_efficient: bool = False,
|
| 158 |
+
in_channels: int = 3
|
| 159 |
+
) -> None:
|
| 160 |
+
|
| 161 |
+
super(DenseNet, self).__init__()
|
| 162 |
+
|
| 163 |
+
# First convolution
|
| 164 |
+
self.features = nn.Sequential(OrderedDict([
|
| 165 |
+
('conv0', nn.Conv3d(in_channels, num_init_features, kernel_size=7, stride=2,
|
| 166 |
+
padding=3, bias=False)),
|
| 167 |
+
('norm0', nn.BatchNorm3d(num_init_features)),
|
| 168 |
+
('relu0', nn.ReLU(inplace=True)),
|
| 169 |
+
('pool0', nn.MaxPool3d(kernel_size=3, stride=2, padding=1)),
|
| 170 |
+
]))
|
| 171 |
+
|
| 172 |
+
# Each denseblock
|
| 173 |
+
num_features = num_init_features
|
| 174 |
+
for i, num_layers in enumerate(block_config):
|
| 175 |
+
block = _DenseBlock(
|
| 176 |
+
num_layers=num_layers,
|
| 177 |
+
num_input_features=num_features,
|
| 178 |
+
bn_size=bn_size,
|
| 179 |
+
growth_rate=growth_rate,
|
| 180 |
+
drop_rate=drop_rate,
|
| 181 |
+
memory_efficient=memory_efficient
|
| 182 |
+
)
|
| 183 |
+
self.features.add_module('denseblock%d' % (i + 1), block)
|
| 184 |
+
num_features = num_features + num_layers * growth_rate
|
| 185 |
+
if i != len(block_config) - 1:
|
| 186 |
+
trans = _Transition(num_input_features=num_features,
|
| 187 |
+
num_output_features=num_features // 2)
|
| 188 |
+
self.features.add_module('transition%d' % (i + 1), trans)
|
| 189 |
+
num_features = num_features // 2
|
| 190 |
+
|
| 191 |
+
# Final batch norm
|
| 192 |
+
self.features.add_module('norm5', nn.BatchNorm3d(num_features))
|
| 193 |
+
|
| 194 |
+
# Official init from torch repo.
|
| 195 |
+
for m in self.modules():
|
| 196 |
+
if isinstance(m, nn.Conv3d):
|
| 197 |
+
nn.init.kaiming_normal_(m.weight)
|
| 198 |
+
elif isinstance(m, nn.BatchNorm3d):
|
| 199 |
+
nn.init.constant_(m.weight, 1)
|
| 200 |
+
nn.init.constant_(m.bias, 0)
|
| 201 |
+
elif isinstance(m, nn.Linear):
|
| 202 |
+
nn.init.constant_(m.bias, 0)
|
| 203 |
+
|
| 204 |
+
def forward(self, x: Tensor) -> Tensor:
|
| 205 |
+
features = self.features(x)
|
| 206 |
+
return features
|
| 207 |
+
|
| 208 |
+
def _densenet(
|
| 209 |
+
arch: str,
|
| 210 |
+
growth_rate: int,
|
| 211 |
+
block_config: Tuple[int, int, int, int],
|
| 212 |
+
num_init_features: int,
|
| 213 |
+
pretrained: bool,
|
| 214 |
+
progress: bool,
|
| 215 |
+
**kwargs: Any
|
| 216 |
+
) -> DenseNet:
|
| 217 |
+
model = DenseNet(growth_rate, block_config, num_init_features, **kwargs)
|
| 218 |
+
return model
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
def densenet121(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet:
|
| 222 |
+
r"""Densenet-121 model from
|
| 223 |
+
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
|
| 224 |
+
The required minimum input size of the model is 29x29.
|
| 225 |
+
|
| 226 |
+
Args:
|
| 227 |
+
pretrained (bool): If True, returns a model pre-trained on ImageNet
|
| 228 |
+
progress (bool): If True, displays a progress bar of the download to stderr
|
| 229 |
+
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
|
| 230 |
+
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
|
| 231 |
+
"""
|
| 232 |
+
return _densenet('densenet121', 32, (6, 12, 24, 16), 64, pretrained, progress,
|
| 233 |
+
**kwargs)
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
def densenet161(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet:
|
| 237 |
+
r"""Densenet-161 model from
|
| 238 |
+
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
|
| 239 |
+
The required minimum input size of the model is 29x29.
|
| 240 |
+
|
| 241 |
+
Args:
|
| 242 |
+
pretrained (bool): If True, returns a model pre-trained on ImageNet
|
| 243 |
+
progress (bool): If True, displays a progress bar of the download to stderr
|
| 244 |
+
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
|
| 245 |
+
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
|
| 246 |
+
"""
|
| 247 |
+
return _densenet('densenet161', 48, (6, 12, 36, 24), 96, pretrained, progress,
|
| 248 |
+
**kwargs)
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
def densenet169(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet:
|
| 252 |
+
r"""Densenet-169 model from
|
| 253 |
+
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
|
| 254 |
+
The required minimum input size of the model is 29x29.
|
| 255 |
+
|
| 256 |
+
Args:
|
| 257 |
+
pretrained (bool): If True, returns a model pre-trained on ImageNet
|
| 258 |
+
progress (bool): If True, displays a progress bar of the download to stderr
|
| 259 |
+
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
|
| 260 |
+
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
|
| 261 |
+
"""
|
| 262 |
+
return _densenet('densenet169', 32, (6, 12, 32, 32), 64, pretrained, progress,
|
| 263 |
+
**kwargs)
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
def densenet201(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet:
|
| 267 |
+
r"""Densenet-201 model from
|
| 268 |
+
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
|
| 269 |
+
The required minimum input size of the model is 29x29.
|
| 270 |
+
|
| 271 |
+
Args:
|
| 272 |
+
pretrained (bool): If True, returns a model pre-trained on ImageNet
|
| 273 |
+
progress (bool): If True, displays a progress bar of the download to stderr
|
| 274 |
+
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
|
| 275 |
+
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
|
| 276 |
+
"""
|
| 277 |
+
return _densenet('densenet201', 32, (6, 12, 48, 32), 64, pretrained, progress,
|
| 278 |
+
**kwargs)
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
class maskdense(nn.Module):
|
| 282 |
+
def __init__(self, in_channels=3, name='densenet121'):
|
| 283 |
+
super(maskdense, self).__init__()
|
| 284 |
+
if name == 'densenet121':
|
| 285 |
+
self.densnet_model = densenet121(in_channels=in_channels)
|
| 286 |
+
elif name == 'densenet161':
|
| 287 |
+
self.densnet_model = densenet161(in_channels=in_channels)
|
| 288 |
+
else:
|
| 289 |
+
self.densnet_model = None
|
| 290 |
+
|
| 291 |
+
self.sigmoid = nn.Sigmoid()
|
| 292 |
+
|
| 293 |
+
densnet = list(self.densnet_model.children())
|
| 294 |
+
self.First_convolution = nn.Sequential(*densnet[0][0:1])
|
| 295 |
+
self.First_BN = nn.Sequential(*densnet[0][1:2])
|
| 296 |
+
self.Second_convolution = nn.Sequential(*densnet[0][2:4])
|
| 297 |
+
self.denseblock1 = nn.Sequential(*densnet[0][4:5])
|
| 298 |
+
self.transition1 = nn.Sequential(*densnet[0][5:6])
|
| 299 |
+
self.denseblock2 = nn.Sequential(*densnet[0][6:7])
|
| 300 |
+
self.transition2 = nn.Sequential(*densnet[0][7:8])
|
| 301 |
+
self.denseblock3 = nn.Sequential(*densnet[0][8:9])
|
| 302 |
+
self.transition3 = nn.Sequential(*densnet[0][9:10])
|
| 303 |
+
self.denseblock4 = nn.Sequential(*densnet[0][10:11])
|
| 304 |
+
self.norm5 = nn.Sequential(*densnet[0][11:12])
|
| 305 |
+
|
| 306 |
+
def forward(self, x):
|
| 307 |
+
x = self.First_convolution(x)
|
| 308 |
+
x = self.First_BN(x)
|
| 309 |
+
x_t1 = self.Second_convolution(x)
|
| 310 |
+
|
| 311 |
+
x = self.denseblock1(x_t1)
|
| 312 |
+
x_t2 = self.transition1(x)
|
| 313 |
+
|
| 314 |
+
x = self.denseblock2(x_t2)
|
| 315 |
+
x_t3 = self.transition2(x)
|
| 316 |
+
|
| 317 |
+
x = self.denseblock3(x_t3)
|
| 318 |
+
x_t4 = self.transition3(x)
|
| 319 |
+
|
| 320 |
+
x = self.denseblock4(x_t4)
|
| 321 |
+
x = self.norm5(x)
|
| 322 |
+
x = F.relu(x, inplace=True)
|
| 323 |
+
return x_t1, x_t2, x_t3, x_t4, x
|
| 324 |
+
|
| 325 |
+
|
| 326 |
+
def maskdense121(in_channels) -> DenseNet:
|
| 327 |
+
return maskdense(in_channels=in_channels,name='densenet121')
|
| 328 |
+
|
| 329 |
+
|
| 330 |
+
def maskdense161(in_channels) -> DenseNet:
|
| 331 |
+
return maskdense(in_channels=in_channels, name='densenet161')
|
| 332 |
+
|
| 333 |
+
|
| 334 |
+
if __name__ == '__main__':
|
| 335 |
+
import os
|
| 336 |
+
os.environ['CUDA_LAUNCH_BLOCKING'] = '0'
|
| 337 |
+
|
| 338 |
+
img = torch.randn(4, 3, 160, 192, 160)
|
| 339 |
+
net = maskdense121(in_channels=2, name='densenet121')
|
| 340 |
+
|
| 341 |
+
net.cuda()
|
| 342 |
+
im = img.cuda()
|
| 343 |
+
|
| 344 |
+
out = net(img)
|
| 345 |
+
print(out.shape)
|
code/model/utils.py
ADDED
|
@@ -0,0 +1,488 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
from torch.nn import functional as F
|
| 4 |
+
|
| 5 |
+
# LMCL [CosFace: Large Margin Cosine Loss for Deep Face Recognition]
|
| 6 |
+
class MarginLoss(nn.Module):
|
| 7 |
+
def __init__(self, in_features, out_features, s=64.0, m=0.50):
|
| 8 |
+
super(MarginLoss, self).__init__()
|
| 9 |
+
self.embedding_size = in_features
|
| 10 |
+
self.num_classes = out_features
|
| 11 |
+
self.s = s
|
| 12 |
+
self.m = m
|
| 13 |
+
self.weights = nn.Parameter(torch.Tensor(out_features, in_features))
|
| 14 |
+
nn.init.kaiming_normal_(self.weights)
|
| 15 |
+
|
| 16 |
+
def forward(self, embedding, label):
|
| 17 |
+
assert embedding.size(1) == self.embedding_size, 'embedding size wrong'
|
| 18 |
+
logits = F.linear(F.normalize(embedding), F.normalize(self.weights))
|
| 19 |
+
margin = torch.zeros_like(logits)
|
| 20 |
+
margin.scatter_(1, label.view(-1, 1), self.m)
|
| 21 |
+
m_logits = self.s * (logits - margin)
|
| 22 |
+
return m_logits
|
| 23 |
+
|
| 24 |
+
def predict(self, input):
|
| 25 |
+
with torch.no_grad():
|
| 26 |
+
return F.linear(F.normalize(input), F.normalize(self.weights))
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
class ChannelAttention_3D(nn.Module):
|
| 30 |
+
"""
|
| 31 |
+
Implements channel-wise attention for 3D feature maps.
|
| 32 |
+
"""
|
| 33 |
+
def __init__(self, channel, reduction=4, min_channel=32, unsqueeze=True):
|
| 34 |
+
"""
|
| 35 |
+
Initializes the ChannelAttention_3D module.
|
| 36 |
+
|
| 37 |
+
Args:
|
| 38 |
+
channel (int): Number of input channels.
|
| 39 |
+
reduction (int, optional): Reduction ratio for channel dimensions. Default is 4.
|
| 40 |
+
min_channel (int, optional): Minimum number of channels after reduction. Default is 32.
|
| 41 |
+
unsqueeze (bool, optional): Whether to expand the output to match input dimensions. Default is True.
|
| 42 |
+
"""
|
| 43 |
+
super().__init__()
|
| 44 |
+
# Calculate the number of channels after reduction, ensuring it doesn't go below min_channel
|
| 45 |
+
attention_channel = max(int(channel // reduction), min_channel)
|
| 46 |
+
|
| 47 |
+
self.unsqueeze = unsqueeze
|
| 48 |
+
# Adaptive pooling to generate a single value per channel (global pooling)
|
| 49 |
+
self.maxpool = nn.AdaptiveMaxPool3d(1)
|
| 50 |
+
self.avgpool = nn.AdaptiveAvgPool3d(1)
|
| 51 |
+
# Sequential layers for channel attention mechanism
|
| 52 |
+
self.se = nn.Sequential(
|
| 53 |
+
nn.Conv3d(channel, attention_channel, kernel_size=1, bias=False),
|
| 54 |
+
nn.BatchNorm3d(attention_channel),
|
| 55 |
+
nn.ReLU(),
|
| 56 |
+
nn.Conv3d(attention_channel, channel, kernel_size=1, bias=False)
|
| 57 |
+
)
|
| 58 |
+
# Sigmoid activation to obtain attention weights between 0 and 1
|
| 59 |
+
self.sigmoid = nn.Sigmoid()
|
| 60 |
+
|
| 61 |
+
def forward(self, x):
|
| 62 |
+
"""
|
| 63 |
+
Forward pass for channel attention.
|
| 64 |
+
|
| 65 |
+
Args:
|
| 66 |
+
x (torch.Tensor): Input tensor of shape (batch, channel, D, H, W).
|
| 67 |
+
|
| 68 |
+
Returns:
|
| 69 |
+
torch.Tensor: Attention weights of shape (batch, channel, D, H, W) if unsqueeze is True,
|
| 70 |
+
else (batch, channel, 1, 1, 1).
|
| 71 |
+
"""
|
| 72 |
+
# Apply max and average pooling
|
| 73 |
+
max_result = self.maxpool(x)
|
| 74 |
+
avg_result = self.avgpool(x)
|
| 75 |
+
# Pass pooled results through the attention network
|
| 76 |
+
max_out = self.se(max_result)
|
| 77 |
+
avg_out = self.se(avg_result)
|
| 78 |
+
# Combine the outputs and apply sigmoid activation
|
| 79 |
+
output = self.sigmoid(max_out + avg_out)
|
| 80 |
+
# Optionally expand the attention weights to match the input dimensions
|
| 81 |
+
if self.unsqueeze:
|
| 82 |
+
output = output.expand_as(x)
|
| 83 |
+
# Ensure contiguous memory layout
|
| 84 |
+
return output.contiguous()
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
class SpatialAttention_3D(nn.Module):
|
| 88 |
+
"""
|
| 89 |
+
Implements spatial attention for 3D feature maps.
|
| 90 |
+
"""
|
| 91 |
+
def __init__(self, kernel_size=7, unsqueeze=True):
|
| 92 |
+
"""
|
| 93 |
+
Initializes the SpatialAttention_3D module.
|
| 94 |
+
|
| 95 |
+
Args:
|
| 96 |
+
kernel_size (int, optional): Kernel size for the convolutional layer. Default is 7.
|
| 97 |
+
unsqueeze (bool, optional): Whether to expand the output to match input dimensions. Default is True.
|
| 98 |
+
"""
|
| 99 |
+
super().__init__()
|
| 100 |
+
self.unsqueeze = unsqueeze
|
| 101 |
+
# Convolution to compute spatial attention; input has 2 channels (max and avg), output has 1 channel
|
| 102 |
+
self.conv = nn.Conv3d(2, 1, kernel_size=kernel_size, padding=kernel_size // 2)
|
| 103 |
+
# Sigmoid activation to obtain attention weights between 0 and 1
|
| 104 |
+
self.sigmoid = nn.Sigmoid()
|
| 105 |
+
|
| 106 |
+
def forward(self, x):
|
| 107 |
+
"""
|
| 108 |
+
Forward pass for spatial attention.
|
| 109 |
+
|
| 110 |
+
Args:
|
| 111 |
+
x (torch.Tensor): Input tensor of shape (batch, channels, D, H, W).
|
| 112 |
+
|
| 113 |
+
Returns:
|
| 114 |
+
torch.Tensor: Attention weights of shape (batch, channels, D, H, W) if unsqueeze is True,
|
| 115 |
+
else (batch, 1, D, H, W).
|
| 116 |
+
"""
|
| 117 |
+
# Compute the maximum value across the channel dimension
|
| 118 |
+
max_result, _ = torch.max(x, dim=1, keepdim=True)
|
| 119 |
+
# Compute the average value across the channel dimension
|
| 120 |
+
avg_result = torch.mean(x, dim=1, keepdim=True)
|
| 121 |
+
# Concatenate along the channel dimension to form a 2-channel tensor
|
| 122 |
+
result = torch.cat([max_result, avg_result], dim=1)
|
| 123 |
+
# Apply convolution and sigmoid activation to obtain spatial attention
|
| 124 |
+
output = self.conv(result)
|
| 125 |
+
output = self.sigmoid(output)
|
| 126 |
+
# Optionally expand the attention weights to match the input dimensions
|
| 127 |
+
if self.unsqueeze:
|
| 128 |
+
output = output.expand_as(x)
|
| 129 |
+
# Ensure contiguous memory layout
|
| 130 |
+
return output.contiguous()
|
| 131 |
+
|
| 132 |
+
class UCFCFusion(nn.Module):
|
| 133 |
+
"""
|
| 134 |
+
Implements a fusion module that integrates multiple feature maps using channel and spatial attention.
|
| 135 |
+
"""
|
| 136 |
+
def __init__(self, channel, ochannel, fusion_num, img_size=[4, 4, 4], L=32, reduction_ca=4, reduction_sa=64):
|
| 137 |
+
"""
|
| 138 |
+
Initializes the UCFCFusion module.
|
| 139 |
+
|
| 140 |
+
Args:
|
| 141 |
+
channel (int): Number of input channels per feature map.
|
| 142 |
+
ochannel (int): Number of output channels after fusion.
|
| 143 |
+
fusion_num (int): Number of feature maps to fuse.
|
| 144 |
+
img_size (list, optional): Spatial dimensions [D, H, W] of the input feature maps. Default is [4, 4, 4].
|
| 145 |
+
L (int, optional): Base dimension for linear layers. Default is 32.
|
| 146 |
+
reduction_ca (int, optional): Reduction ratio for channel attention. Default is 4.
|
| 147 |
+
reduction_sa (int, optional): Reduction ratio for spatial attention. Default is 64.
|
| 148 |
+
"""
|
| 149 |
+
super(UCFCFusion, self).__init__()
|
| 150 |
+
|
| 151 |
+
self.img_size = img_size
|
| 152 |
+
|
| 153 |
+
in_planes = channel * fusion_num # Total input channels after concatenation
|
| 154 |
+
out_planes = channel # Desired output channels
|
| 155 |
+
|
| 156 |
+
# Convolution layers for projecting input and fused features
|
| 157 |
+
self.proj = nn.Conv3d(in_planes, ochannel, kernel_size=3, stride=1, padding=1, bias=False)
|
| 158 |
+
self.projf = nn.Conv3d(out_planes, ochannel, kernel_size=3, stride=1, padding=1, bias=False)
|
| 159 |
+
|
| 160 |
+
# Channel and Spatial attention mechanisms applied to the summed feature maps
|
| 161 |
+
self.channel_F_W = ChannelAttention_3D(out_planes, unsqueeze=False)
|
| 162 |
+
self.spatial_F_W = SpatialAttention_3D(unsqueeze=False)
|
| 163 |
+
|
| 164 |
+
self.fusion_num = fusion_num
|
| 165 |
+
# Dimension for channel attention processing
|
| 166 |
+
self.d = max(L, in_planes // reduction_ca)
|
| 167 |
+
# Dimension for spatial attention processing
|
| 168 |
+
self.dsa = max(L * 2,
|
| 169 |
+
(self.img_size[0] * self.img_size[1] * self.img_size[2]) // reduction_sa)
|
| 170 |
+
|
| 171 |
+
# Fully connected layers for processing attention outputs
|
| 172 |
+
self.fc = nn.Linear(out_planes, self.d)
|
| 173 |
+
self.fc2 = nn.Linear(self.img_size[0] * self.img_size[1] * self.img_size[2], self.dsa)
|
| 174 |
+
|
| 175 |
+
# Lists of linear layers for each fusion path
|
| 176 |
+
self.fcas = nn.ModuleList([])
|
| 177 |
+
self.fsas = nn.ModuleList([])
|
| 178 |
+
for _ in range(fusion_num):
|
| 179 |
+
self.fcas.append(nn.Linear(self.d, out_planes))
|
| 180 |
+
self.fsas.append(nn.Linear(self.dsa, self.img_size[0] * self.img_size[1] * self.img_size[2]))
|
| 181 |
+
|
| 182 |
+
# Softmax layer to normalize fusion weights across different fusion paths
|
| 183 |
+
self.softmax = nn.Softmax(dim=0)
|
| 184 |
+
# Initialize weights of convolutional and batch normalization layers
|
| 185 |
+
self._initialize_weights()
|
| 186 |
+
|
| 187 |
+
def _initialize_weights(self):
|
| 188 |
+
"""
|
| 189 |
+
Initializes the weights of convolutional and batch normalization layers.
|
| 190 |
+
"""
|
| 191 |
+
for m in self.modules():
|
| 192 |
+
if isinstance(m, nn.Conv3d):
|
| 193 |
+
# Initialize Conv3d weights with Kaiming Normal and biases to zero if present
|
| 194 |
+
nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
|
| 195 |
+
if m.bias is not None:
|
| 196 |
+
nn.init.constant_(m.bias, 0)
|
| 197 |
+
elif isinstance(m, nn.BatchNorm3d):
|
| 198 |
+
# Initialize BatchNorm3d weights to 1 and biases to zero
|
| 199 |
+
nn.init.constant_(m.weight, 1)
|
| 200 |
+
nn.init.constant_(m.bias, 0)
|
| 201 |
+
|
| 202 |
+
def get_fusion_w(self, x_F, ca_out, sa_out):
|
| 203 |
+
"""
|
| 204 |
+
Computes fusion weights based on channel and spatial attention outputs.
|
| 205 |
+
|
| 206 |
+
Args:
|
| 207 |
+
x_F (torch.Tensor): Summed feature maps of shape (batch, channels, D, H, W).
|
| 208 |
+
ca_out (torch.Tensor): Channel attention output of shape (batch, channels, 1, 1, 1).
|
| 209 |
+
sa_out (torch.Tensor): Spatial attention output of shape (batch, 1, D, H, W).
|
| 210 |
+
|
| 211 |
+
Returns:
|
| 212 |
+
tuple:
|
| 213 |
+
- weights_ca (torch.Tensor): Channel-wise weights for each fusion path.
|
| 214 |
+
- weights_sa (torch.Tensor): Spatial-wise weights for each fusion path.
|
| 215 |
+
"""
|
| 216 |
+
b, c, w, h, l = x_F.size()
|
| 217 |
+
weights_ca = []
|
| 218 |
+
# Process channel attention output through a fully connected layer
|
| 219 |
+
ca_out_p = self.fc(ca_out.view(b, c)) # Shape: (batch, d)
|
| 220 |
+
for fca in self.fcas:
|
| 221 |
+
# Compute channel weights for each fusion path
|
| 222 |
+
weight = fca(ca_out_p) # Shape: (batch, out_planes)
|
| 223 |
+
weights_ca.append(weight.view(b, c, 1, 1, 1)) # Reshape for broadcasting
|
| 224 |
+
|
| 225 |
+
# Stack channel weights across fusion paths
|
| 226 |
+
weights_ca = torch.stack(weights_ca, dim=0) # Shape: (fusion_num, batch, channels, 1, 1, 1)
|
| 227 |
+
|
| 228 |
+
# Process spatial attention output through a fully connected layer
|
| 229 |
+
sa_out_fc = self.fc2(sa_out.view(b, w * h * l)) # Shape: (batch, dsa)
|
| 230 |
+
weights_sa = []
|
| 231 |
+
for fsa in self.fsas:
|
| 232 |
+
# Compute spatial weights for each fusion path
|
| 233 |
+
weight = fsa(sa_out_fc) # Shape: (batch, D*H*W)
|
| 234 |
+
weights_sa.append(weight.view(b, 1, w, h, l)) # Reshape for broadcasting
|
| 235 |
+
|
| 236 |
+
# Stack spatial weights across fusion paths
|
| 237 |
+
weights_sa = torch.stack(weights_sa, dim=0) # Shape: (fusion_num, batch, 1, D, H, W)
|
| 238 |
+
return weights_ca, weights_sa
|
| 239 |
+
|
| 240 |
+
def forward(self, I_IN):
|
| 241 |
+
"""
|
| 242 |
+
Forward pass for the UCFCFusion module.
|
| 243 |
+
|
| 244 |
+
Args:
|
| 245 |
+
I_IN (torch.Tensor): Input tensor of shape (batch, channel * fusion_num, D, H, W).
|
| 246 |
+
|
| 247 |
+
Returns:
|
| 248 |
+
torch.Tensor: Fused output tensor of shape (batch, ochannel, D, H, W).
|
| 249 |
+
"""
|
| 250 |
+
# Split the input tensor into 'fusion_num' parts along the channel dimension
|
| 251 |
+
split_I_IN_F = torch.chunk(I_IN, self.fusion_num, dim=1) # Tuple of tensors
|
| 252 |
+
# Stack the split tensors to form a new dimension for fusion paths
|
| 253 |
+
split_I_IN_F = torch.stack(split_I_IN_F, dim=0) # Shape: (fusion_num, batch, channel, D, H, W)
|
| 254 |
+
|
| 255 |
+
# Sum the feature maps across all fusion paths
|
| 256 |
+
Sum_I_IN_F = split_I_IN_F.sum(dim=0) # Shape: (batch, channel, D, H, W)
|
| 257 |
+
|
| 258 |
+
# Apply channel and spatial attention to the summed feature maps
|
| 259 |
+
channel_F_W = self.channel_F_W(Sum_I_IN_F) # Shape: (batch, channel, 1, 1, 1)
|
| 260 |
+
spatial_F_W = self.spatial_F_W(Sum_I_IN_F) # Shape: (batch, 1, D, H, W)
|
| 261 |
+
|
| 262 |
+
# Compute fusion weights based on attention outputs
|
| 263 |
+
weights_ca, weights_sa = self.get_fusion_w(Sum_I_IN_F, channel_F_W, spatial_F_W)
|
| 264 |
+
|
| 265 |
+
# Combine channel and spatial weights multiplicatively
|
| 266 |
+
weights_all_model = weights_ca * weights_sa # Shape: (fusion_num, batch, channel, D, H, W)
|
| 267 |
+
# Apply softmax across the fusion paths to normalize the weights
|
| 268 |
+
weights_all_model = self.softmax(weights_all_model) # Shape: (fusion_num, batch, channel, D, H, W)
|
| 269 |
+
|
| 270 |
+
# Apply the weights to each split feature map and sum them
|
| 271 |
+
weighted_sum = (split_I_IN_F * weights_all_model).sum(dim=0) # Shape: (batch, channel, D, H, W)
|
| 272 |
+
# Project the original input and the weighted sum, then add them together
|
| 273 |
+
F_OUT = self.proj(I_IN) + self.projf(weighted_sum) # Shape: (batch, ochannel, D, H, W)
|
| 274 |
+
|
| 275 |
+
# Ensure contiguous memory layout
|
| 276 |
+
return F_OUT.contiguous()
|
| 277 |
+
|
| 278 |
+
# 渐进分类
|
| 279 |
+
class CFE_refine(nn.Module):
|
| 280 |
+
def __init__(self, in_channels=[64, 128, 256, 512, 1024, 1024], factor=1):
|
| 281 |
+
super(CFE_refine, self).__init__()
|
| 282 |
+
|
| 283 |
+
self.block_1 = nn.Sequential(
|
| 284 |
+
nn.Conv3d(in_channels=in_channels[0],
|
| 285 |
+
out_channels=in_channels[1],
|
| 286 |
+
kernel_size=3,
|
| 287 |
+
padding=1,
|
| 288 |
+
stride=1,
|
| 289 |
+
bias=False),
|
| 290 |
+
nn.BatchNorm3d(in_channels[1]),
|
| 291 |
+
nn.ReLU(),
|
| 292 |
+
nn.MaxPool3d(kernel_size=3, stride=2, padding=1)
|
| 293 |
+
)
|
| 294 |
+
|
| 295 |
+
self.block_2 = nn.Sequential(
|
| 296 |
+
nn.Conv3d(in_channels=in_channels[1] * 2,
|
| 297 |
+
out_channels=in_channels[2],
|
| 298 |
+
kernel_size=3,
|
| 299 |
+
padding=1,
|
| 300 |
+
stride=1,
|
| 301 |
+
bias=False),
|
| 302 |
+
nn.BatchNorm3d(in_channels[2]),
|
| 303 |
+
nn.ReLU(),
|
| 304 |
+
nn.MaxPool3d(kernel_size=3,stride=2,padding=1)
|
| 305 |
+
)
|
| 306 |
+
|
| 307 |
+
self.block_3 = nn.Sequential(
|
| 308 |
+
nn.Conv3d(in_channels=in_channels[2] * 2,
|
| 309 |
+
out_channels=in_channels[3],
|
| 310 |
+
kernel_size=3,
|
| 311 |
+
padding=1,
|
| 312 |
+
stride=1,
|
| 313 |
+
bias=False),
|
| 314 |
+
nn.BatchNorm3d(in_channels[3]),
|
| 315 |
+
nn.ReLU(),
|
| 316 |
+
nn.MaxPool3d(kernel_size=3,stride=2, padding=1)
|
| 317 |
+
)
|
| 318 |
+
|
| 319 |
+
self.block_4 = nn.Sequential(
|
| 320 |
+
nn.Conv3d(in_channels=in_channels[3] * 2,
|
| 321 |
+
out_channels=in_channels[4],
|
| 322 |
+
kernel_size=3,
|
| 323 |
+
padding=1,
|
| 324 |
+
stride=1,
|
| 325 |
+
bias=False),
|
| 326 |
+
nn.BatchNorm3d(in_channels[4]),
|
| 327 |
+
nn.ReLU()
|
| 328 |
+
)
|
| 329 |
+
|
| 330 |
+
self.block_5 = nn.Sequential(
|
| 331 |
+
nn.Conv3d(in_channels=in_channels[4] * 2,
|
| 332 |
+
out_channels=in_channels[5]//factor,
|
| 333 |
+
kernel_size=3,
|
| 334 |
+
padding=1,
|
| 335 |
+
stride=1,
|
| 336 |
+
bias=False),
|
| 337 |
+
nn.BatchNorm3d(in_channels[5]),
|
| 338 |
+
nn.ReLU()
|
| 339 |
+
)
|
| 340 |
+
|
| 341 |
+
self.block_6 = nn.Sequential(
|
| 342 |
+
nn.Conv3d(in_channels=in_channels[4] * 2,
|
| 343 |
+
out_channels=in_channels[5],
|
| 344 |
+
kernel_size=3,
|
| 345 |
+
padding=1,
|
| 346 |
+
stride=1,
|
| 347 |
+
bias=False),
|
| 348 |
+
nn.BatchNorm3d(in_channels[5]//factor),
|
| 349 |
+
nn.ReLU()
|
| 350 |
+
)
|
| 351 |
+
|
| 352 |
+
def forward(self, features_t1, features_t2, features_t3, features_t4, features_t5):
|
| 353 |
+
x_t1 = features_t1
|
| 354 |
+
x_t1 = self.block_1(x_t1)
|
| 355 |
+
|
| 356 |
+
x_t2 = torch.cat((x_t1, features_t2), 1)
|
| 357 |
+
x_t2 = self.block_2(x_t2)
|
| 358 |
+
|
| 359 |
+
x_t3 = torch.cat((x_t2, features_t3), 1)
|
| 360 |
+
x_t3 = self.block_3(x_t3)
|
| 361 |
+
|
| 362 |
+
x_t4 = torch.cat((x_t3, features_t4), 1)
|
| 363 |
+
x_t4 = self.block_4(x_t4)
|
| 364 |
+
|
| 365 |
+
Fc = torch.cat((x_t4, features_t5), 1)
|
| 366 |
+
|
| 367 |
+
Fs1 = self.block_5(Fc)
|
| 368 |
+
Fs2 = self.block_6(Fc)
|
| 369 |
+
return Fs1, Fs2
|
| 370 |
+
|
| 371 |
+
def getFc(self, features_t1, features_t2, features_t3, features_t4, features_t5):
|
| 372 |
+
x_t1 = features_t1
|
| 373 |
+
x_t1 = self.block_1(x_t1)
|
| 374 |
+
|
| 375 |
+
x_t2 = torch.cat((x_t1, features_t2), 1)
|
| 376 |
+
x_t2 = self.block_2(x_t2)
|
| 377 |
+
|
| 378 |
+
x_t3 = torch.cat((x_t2, features_t3), 1)
|
| 379 |
+
x_t3 = self.block_3(x_t3)
|
| 380 |
+
|
| 381 |
+
x_t4 = torch.cat((x_t3, features_t4), 1)
|
| 382 |
+
x_t4 = self.block_4(x_t4)
|
| 383 |
+
|
| 384 |
+
Fc = torch.cat((x_t4, features_t5), 1)
|
| 385 |
+
return Fc
|
| 386 |
+
|
| 387 |
+
class UFE_E2(nn.Module):
|
| 388 |
+
def __init__(self, in_channels=[3, 64, 128, 256, 512, 1024], factor=1):
|
| 389 |
+
super(UFE_E2, self).__init__()
|
| 390 |
+
|
| 391 |
+
# 160, 192, 160
|
| 392 |
+
# 和E1中的第一个卷积一样
|
| 393 |
+
self.block_1 = nn.Sequential(
|
| 394 |
+
nn.Conv3d(in_channels[0],
|
| 395 |
+
in_channels[1],
|
| 396 |
+
kernel_size=7, stride=2,
|
| 397 |
+
padding=3, bias=False),
|
| 398 |
+
nn.BatchNorm3d(in_channels[1]),
|
| 399 |
+
nn.ReLU(),
|
| 400 |
+
nn.MaxPool3d(kernel_size=3, stride=2, padding=1)
|
| 401 |
+
)
|
| 402 |
+
|
| 403 |
+
# 40, 46, 40
|
| 404 |
+
self.block_2 = nn.Sequential(
|
| 405 |
+
nn.Conv3d(in_channels=in_channels[1] + 3,
|
| 406 |
+
out_channels=in_channels[2],
|
| 407 |
+
kernel_size=3,
|
| 408 |
+
padding=1,
|
| 409 |
+
stride=1,
|
| 410 |
+
bias=False),
|
| 411 |
+
nn.BatchNorm3d(in_channels[2]),
|
| 412 |
+
nn.ReLU(),
|
| 413 |
+
nn.MaxPool3d(kernel_size=3, stride=2, padding=1)
|
| 414 |
+
)
|
| 415 |
+
|
| 416 |
+
# 20, 24, 20
|
| 417 |
+
self.block_3 = nn.Sequential(
|
| 418 |
+
nn.Conv3d(in_channels=in_channels[2],
|
| 419 |
+
out_channels=in_channels[3],
|
| 420 |
+
kernel_size=3,
|
| 421 |
+
padding=1,
|
| 422 |
+
stride=1,
|
| 423 |
+
bias=False),
|
| 424 |
+
nn.BatchNorm3d(in_channels[3]),
|
| 425 |
+
nn.ReLU(),
|
| 426 |
+
nn.MaxPool3d(kernel_size=3, stride=2, padding=1)
|
| 427 |
+
)
|
| 428 |
+
# 10, 12, 10
|
| 429 |
+
self.block_4 = nn.Sequential(
|
| 430 |
+
nn.Conv3d(in_channels=in_channels[3],
|
| 431 |
+
out_channels=in_channels[4],
|
| 432 |
+
kernel_size=3,
|
| 433 |
+
padding=1,
|
| 434 |
+
stride=1,
|
| 435 |
+
bias=False),
|
| 436 |
+
nn.BatchNorm3d(in_channels[4]),
|
| 437 |
+
nn.ReLU(),
|
| 438 |
+
nn.MaxPool3d(kernel_size=3, stride=2, padding=1)
|
| 439 |
+
)
|
| 440 |
+
|
| 441 |
+
# 5, 6, 5
|
| 442 |
+
self.block_5 = nn.Sequential(
|
| 443 |
+
nn.Conv3d(in_channels=in_channels[4],
|
| 444 |
+
out_channels=in_channels[5]//factor,
|
| 445 |
+
kernel_size=3,
|
| 446 |
+
padding=1,
|
| 447 |
+
stride=1,
|
| 448 |
+
bias=False),
|
| 449 |
+
nn.BatchNorm3d(in_channels[5]//factor),
|
| 450 |
+
nn.ReLU()
|
| 451 |
+
)
|
| 452 |
+
self.activation = nn.ReLU()
|
| 453 |
+
|
| 454 |
+
def _Projection3D(self, Fl_prime, Fl):
|
| 455 |
+
# Get dimensions: batch size (b), channels (c), width (w), height (h), depth (l)
|
| 456 |
+
b, c, w, h, l = Fl.size()
|
| 457 |
+
# Flatten the spatial dimensions for both features: [b, c, w*h*l]
|
| 458 |
+
Fl_prime = Fl_prime.view(b, c, w * h * l)
|
| 459 |
+
Fl = Fl.view(b, c, w * h * l)
|
| 460 |
+
# Compute the dot product between Fl' and Fl for each batch and channel: numerator of the projection scalar
|
| 461 |
+
numerator = torch.sum(Fl_prime * Fl, dim=-1, keepdim=True)
|
| 462 |
+
# Compute the dot product of Fl with itself: denominator of the projection scalar
|
| 463 |
+
denominator = torch.sum(Fl * Fl, dim=-1, keepdim=True) + 1e-6 # Add epsilon to prevent division by zero
|
| 464 |
+
# Calculate the projection scalar and multiply by Fl to get the projection vector
|
| 465 |
+
projection = (numerator / denominator) * Fl
|
| 466 |
+
# Subtract the projection from Fl' to obtain the component of Fl' orthogonal to Fl
|
| 467 |
+
out = Fl_prime - projection
|
| 468 |
+
# Reshape the output back to the original spatial dimensions
|
| 469 |
+
out = out.view(b, c, w, h, l)
|
| 470 |
+
# Apply any additional processing (e.g., activation function)
|
| 471 |
+
out = self.activation(out)
|
| 472 |
+
return out
|
| 473 |
+
|
| 474 |
+
def forward(self, input, Fl, condition):
|
| 475 |
+
x_t1 = self.block_1(input)
|
| 476 |
+
x_t1_proj = self._Projection3D(x_t1, Fl)
|
| 477 |
+
|
| 478 |
+
condition = F.one_hot(condition.long(), 3)
|
| 479 |
+
conditionAdd1 = condition.unsqueeze(-1).unsqueeze(-1).unsqueeze(-1). \
|
| 480 |
+
repeat(1, 1, x_t1_proj.size(2), x_t1_proj.size(3), x_t1_proj.size(4))
|
| 481 |
+
x_t1 = torch.cat((x_t1_proj, conditionAdd1), 1)
|
| 482 |
+
|
| 483 |
+
x_t2 = self.block_2(x_t1)
|
| 484 |
+
x_t3 = self.block_3(x_t2)
|
| 485 |
+
x_t4 = self.block_4(x_t3)
|
| 486 |
+
Fuhc_prime = self.block_5(x_t4)
|
| 487 |
+
return Fuhc_prime
|
| 488 |
+
|
code/survivalstandalone/dataset.py
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
survivalstandalone/dataset.py
|
| 3 |
+
|
| 4 |
+
Reads clinicaldata.csv (UCSF-PDGM format: ID, OS, '1-dead 0-alive', ...)
|
| 5 |
+
and loads the corresponding T1c volume for Cox survival training.
|
| 6 |
+
|
| 7 |
+
CSV columns used:
|
| 8 |
+
ID -> e.g. 'UCSF-PDGM-004' -> folder/file naming
|
| 9 |
+
OS -> survival time in DAYS (confirm this against the
|
| 10 |
+
UCSF-PDGM data dictionary before trusting units)
|
| 11 |
+
'1-dead 0-alive' -> event indicator (1 = death observed, 0 = censored)
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
import os
|
| 15 |
+
import csv
|
| 16 |
+
import numpy as np
|
| 17 |
+
import nibabel as nib
|
| 18 |
+
import torch
|
| 19 |
+
from torch.utils.data import Dataset
|
| 20 |
+
import re
|
| 21 |
+
|
| 22 |
+
TARGET_SHAPE = (160, 192, 160) # same as CMTLNet preprocessing
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def crop_or_pad(vol: np.ndarray, target_shape=TARGET_SHAPE) -> np.ndarray:
|
| 26 |
+
out = np.zeros(target_shape, dtype=vol.dtype)
|
| 27 |
+
src_slices, dst_slices = [], []
|
| 28 |
+
for s, t in zip(vol.shape, target_shape):
|
| 29 |
+
if s >= t:
|
| 30 |
+
start = (s - t) // 2
|
| 31 |
+
src_slices.append(slice(start, start + t))
|
| 32 |
+
dst_slices.append(slice(0, t))
|
| 33 |
+
else:
|
| 34 |
+
pad_start = (t - s) // 2
|
| 35 |
+
src_slices.append(slice(0, s))
|
| 36 |
+
dst_slices.append(slice(pad_start, pad_start + s))
|
| 37 |
+
out[tuple(dst_slices)] = vol[tuple(src_slices)]
|
| 38 |
+
return out
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def load_volume(path: str) -> np.ndarray:
|
| 42 |
+
img = nib.load(path).get_fdata().astype(np.float32)
|
| 43 |
+
img = crop_or_pad(img)
|
| 44 |
+
mean, std = img.mean(), img.std() + 1e-8
|
| 45 |
+
img = (img - mean) / std
|
| 46 |
+
return img
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def normalize_id(csv_id: str) -> str:
|
| 50 |
+
"""
|
| 51 |
+
clinicaldata.csv uses IDs like 'UCSF-PDGM-004' or 'UCSF-PDGM-0429_FU003d'.
|
| 52 |
+
The HuggingFace upload uses 4-digit zero-padded IDs like 'UCSF-PDGM-0004'.
|
| 53 |
+
This handles non-standard characters safely.
|
| 54 |
+
"""
|
| 55 |
+
prefix, num_part = csv_id.rsplit("-", 1)
|
| 56 |
+
|
| 57 |
+
# Extract only the leading digits from the numeric block
|
| 58 |
+
match = re.match(r"^(\d+)", num_part)
|
| 59 |
+
if match:
|
| 60 |
+
num = int(match.group(1))
|
| 61 |
+
suffix = num_part[match.end():]
|
| 62 |
+
return f"{prefix}-{num:04d}{suffix}"
|
| 63 |
+
else:
|
| 64 |
+
# Fallback if no digits match at all
|
| 65 |
+
return csv_id
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def build_records(csv_path: str, data_root: str, modality: str = "T1c", preprocessed: bool = False):
|
| 69 |
+
"""
|
| 70 |
+
preprocessed=False -> reads raw HF download layout:
|
| 71 |
+
<data_root>/UCSF-PDGM-0004_nifti/UCSF-PDGM-0004_T1c.nii.gz
|
| 72 |
+
preprocessed=True -> reads output of preprocess_ucsf.py:
|
| 73 |
+
<data_root>/UCSF-PDGM-0004/T1C.nii.gz (always T1C.nii.gz regardless of `modality`)
|
| 74 |
+
"""
|
| 75 |
+
records = []
|
| 76 |
+
skipped_no_os = 0
|
| 77 |
+
skipped_missing_file = 0
|
| 78 |
+
|
| 79 |
+
with open(csv_path, newline="") as f:
|
| 80 |
+
for row in csv.DictReader(f):
|
| 81 |
+
raw_id = row["ID"].strip()
|
| 82 |
+
os_val = row["OS"].strip()
|
| 83 |
+
event_val = row["1-dead 0-alive"].strip()
|
| 84 |
+
|
| 85 |
+
if not os_val or not event_val:
|
| 86 |
+
skipped_no_os += 1
|
| 87 |
+
continue
|
| 88 |
+
|
| 89 |
+
sid = normalize_id(raw_id) # e.g. 'UCSF-PDGM-0004'
|
| 90 |
+
|
| 91 |
+
if preprocessed:
|
| 92 |
+
img_path = os.path.join(data_root, sid, "T1C.nii.gz")
|
| 93 |
+
else:
|
| 94 |
+
folder = f"{sid}_nifti"
|
| 95 |
+
img_path = os.path.join(data_root, folder, f"{sid}_{modality}.nii.gz")
|
| 96 |
+
|
| 97 |
+
if not os.path.exists(img_path):
|
| 98 |
+
skipped_missing_file += 1
|
| 99 |
+
continue
|
| 100 |
+
|
| 101 |
+
records.append({
|
| 102 |
+
"id": raw_id,
|
| 103 |
+
"path": img_path,
|
| 104 |
+
"time": float(os_val),
|
| 105 |
+
"event": int(event_val),
|
| 106 |
+
})
|
| 107 |
+
|
| 108 |
+
print(f"[build_records] usable={len(records)} "
|
| 109 |
+
f"skipped_no_survival_label={skipped_no_os} "
|
| 110 |
+
f"skipped_missing_file={skipped_missing_file}")
|
| 111 |
+
return records
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
class SurvivalDataset(Dataset):
|
| 115 |
+
def __init__(self, records):
|
| 116 |
+
self.records = records
|
| 117 |
+
|
| 118 |
+
def __len__(self):
|
| 119 |
+
return len(self.records)
|
| 120 |
+
|
| 121 |
+
def __getitem__(self, idx):
|
| 122 |
+
r = self.records[idx]
|
| 123 |
+
vol = load_volume(r["path"])
|
| 124 |
+
vol = torch.from_numpy(vol).unsqueeze(0) # (1, D, H, W)
|
| 125 |
+
return {
|
| 126 |
+
"id": r["id"],
|
| 127 |
+
"image": vol,
|
| 128 |
+
"time": torch.tensor(r["time"], dtype=torch.float32),
|
| 129 |
+
"event": torch.tensor(r["event"], dtype=torch.float32),
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
if __name__ == "__main__":
|
| 134 |
+
# quick manual test — adjust paths to your machine
|
| 135 |
+
CSV_PATH = "clinicaldata.csv"
|
| 136 |
+
DATA_ROOT = r"D:\jainam\UCSF-PDGM-v5" # <-- change to your actual root
|
| 137 |
+
|
| 138 |
+
records = build_records(CSV_PATH, DATA_ROOT)
|
| 139 |
+
if records:
|
| 140 |
+
ds = SurvivalDataset(records)
|
| 141 |
+
sample = ds[0]
|
| 142 |
+
print(sample["id"], sample["image"].shape, sample["time"], sample["event"])
|
code/survivalstandalone/losses.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Cox partial likelihood loss (Breslow approximation for ties).
|
| 3 |
+
|
| 4 |
+
Usage:
|
| 5 |
+
risk = model(x) # shape (B,), higher = higher risk
|
| 6 |
+
loss = cox_ph_loss(risk, time, event)
|
| 7 |
+
|
| 8 |
+
Notes:
|
| 9 |
+
- Needs a reasonably large batch (16-32+) so the risk set at each event
|
| 10 |
+
time actually contains multiple samples. Tiny batches (2-4) make this
|
| 11 |
+
loss nearly meaningless.
|
| 12 |
+
- `time` should be a float tensor, `event` a 0/1 float or long tensor.
|
| 13 |
+
- This computes loss over the WHOLE batch as one risk set ordering, which
|
| 14 |
+
is the standard DeepSurv-style approximation (not exact per-stratum Cox,
|
| 15 |
+
but works fine in practice for this use case).
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
import torch
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def cox_ph_loss(risk: torch.Tensor, time: torch.Tensor, event: torch.Tensor, eps: float = 1e-7):
|
| 22 |
+
"""
|
| 23 |
+
risk: (B,) raw model output (log-risk score), unbounded
|
| 24 |
+
time: (B,) survival/censoring time
|
| 25 |
+
event: (B,) 1 if event observed, 0 if censored
|
| 26 |
+
"""
|
| 27 |
+
# sort by descending time so that risk set for sample i is samples 0..i
|
| 28 |
+
order = torch.argsort(time, descending=True)
|
| 29 |
+
risk = risk[order]
|
| 30 |
+
event = event[order].float()
|
| 31 |
+
|
| 32 |
+
# log-sum-exp of risk over the risk set (cumulative from the top since sorted desc)
|
| 33 |
+
log_cumsum = torch.logcumsumexp(risk, dim=0)
|
| 34 |
+
|
| 35 |
+
# only events contribute to the likelihood (censored samples just stay in risk sets)
|
| 36 |
+
diff = risk - log_cumsum
|
| 37 |
+
loss = -(diff * event).sum() / (event.sum() + eps)
|
| 38 |
+
return loss
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def concordance_index(risk: torch.Tensor, time: torch.Tensor, event: torch.Tensor) -> float:
|
| 42 |
+
"""
|
| 43 |
+
Simple O(n^2) C-index, fine for val-set sizes in the hundreds.
|
| 44 |
+
For large datasets, swap for lifelines.utils.concordance_index.
|
| 45 |
+
"""
|
| 46 |
+
risk = risk.detach().cpu().numpy()
|
| 47 |
+
time = time.detach().cpu().numpy()
|
| 48 |
+
event = event.detach().cpu().numpy()
|
| 49 |
+
|
| 50 |
+
n = len(time)
|
| 51 |
+
concordant = 0
|
| 52 |
+
permissible = 0
|
| 53 |
+
for i in range(n):
|
| 54 |
+
for j in range(n):
|
| 55 |
+
if i == j:
|
| 56 |
+
continue
|
| 57 |
+
# pair is comparable only if i has an earlier event time than j
|
| 58 |
+
if time[i] < time[j] and event[i] == 1:
|
| 59 |
+
permissible += 1
|
| 60 |
+
if risk[i] > risk[j]:
|
| 61 |
+
concordant += 1
|
| 62 |
+
elif risk[i] == risk[j]:
|
| 63 |
+
concordant += 0.5
|
| 64 |
+
return concordant / permissible if permissible > 0 else float("nan")
|
code/survivalstandalone/model.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Minimal 3D CNN for survival risk prediction — deliberately small/simple
|
| 3 |
+
so you can sanity-check the Cox loss pipeline before touching CMTLNet's
|
| 4 |
+
SFTFP/CFE/UFE/UCFC modules.
|
| 5 |
+
|
| 6 |
+
Input: single-channel (T1c) or multi-channel (e.g. T1c+T2) 3D volume,
|
| 7 |
+
same preprocessing/size as the rest of your CMTLNet pipeline.
|
| 8 |
+
Output: scalar risk score per sample (B,)
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
import torch
|
| 12 |
+
import torch.nn as nn
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def conv_block(in_ch, out_ch, stride=2):
|
| 16 |
+
return nn.Sequential(
|
| 17 |
+
nn.Conv3d(in_ch, out_ch, kernel_size=3, stride=stride, padding=1),
|
| 18 |
+
nn.BatchNorm3d(out_ch),
|
| 19 |
+
nn.ReLU(inplace=True),
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
class SurvivalNet3D(nn.Module):
|
| 24 |
+
def __init__(self, in_channels: int = 1, base_ch: int = 16):
|
| 25 |
+
super().__init__()
|
| 26 |
+
self.encoder = nn.Sequential(
|
| 27 |
+
conv_block(in_channels, base_ch), # /2
|
| 28 |
+
conv_block(base_ch, base_ch * 2), # /4
|
| 29 |
+
conv_block(base_ch * 2, base_ch * 4), # /8
|
| 30 |
+
conv_block(base_ch * 4, base_ch * 8), # /16
|
| 31 |
+
conv_block(base_ch * 8, base_ch * 8), # /32
|
| 32 |
+
)
|
| 33 |
+
self.gap = nn.AdaptiveAvgPool3d(1)
|
| 34 |
+
self.head = nn.Sequential(
|
| 35 |
+
nn.Linear(base_ch * 8, 64),
|
| 36 |
+
nn.ReLU(inplace=True),
|
| 37 |
+
nn.Dropout(0.3),
|
| 38 |
+
nn.Linear(64, 1),
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
def forward(self, x):
|
| 42 |
+
# x: (B, C, D, H, W)
|
| 43 |
+
feat = self.encoder(x)
|
| 44 |
+
feat = self.gap(feat).flatten(1)
|
| 45 |
+
risk = self.head(feat).squeeze(-1) # (B,)
|
| 46 |
+
return risk
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
if __name__ == "__main__":
|
| 50 |
+
# quick shape sanity check
|
| 51 |
+
model = SurvivalNet3D(in_channels=1)
|
| 52 |
+
x = torch.randn(2, 1, 160, 192, 160)
|
| 53 |
+
out = model(x)
|
| 54 |
+
print("output shape:", out.shape) # expect (2,)
|
code/survivalstandalone/train.py
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
survivalstandalone/train.py
|
| 3 |
+
|
| 4 |
+
Run this file directly:
|
| 5 |
+
cd CMTLNet/CMTLNet/survivalstandalone
|
| 6 |
+
python train.py
|
| 7 |
+
|
| 8 |
+
Step 1 (sanity check): overfits ~10 samples, C-index should climb near 1.0.
|
| 9 |
+
Step 2 (real run): proper train/val split, reports val C-index per epoch.
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
import torch
|
| 13 |
+
from torch.utils.data import DataLoader, random_split
|
| 14 |
+
|
| 15 |
+
from dataset import build_records, SurvivalDataset
|
| 16 |
+
from model import SurvivalNet3D
|
| 17 |
+
from losses import cox_ph_loss, concordance_index
|
| 18 |
+
|
| 19 |
+
# ---- EDIT THESE FOR YOUR MACHINE ----
|
| 20 |
+
CSV_PATH = "clinicaldata.csv"
|
| 21 |
+
|
| 22 |
+
USE_PREPROCESSED = True # False = raw HF download (fast path, step 2)
|
| 23 |
+
# True = output of preprocess_ucsf.py (paper-matched, step 6)
|
| 24 |
+
|
| 25 |
+
RAW_DATA_ROOT = r"D:\jainam\UCSF-PDGM-v5"
|
| 26 |
+
PREPROCESSED_DATA_ROOT = r"D:\jainam\UCSF-PDGM-v5-preprocessed"
|
| 27 |
+
# ------------------------------------------------
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def sanity_check_overfit(model, loader, device, steps=200, lr=1e-3):
|
| 31 |
+
model.train()
|
| 32 |
+
opt = torch.optim.Adam(model.parameters(), lr=lr)
|
| 33 |
+
batch = next(iter(loader))
|
| 34 |
+
x, t, e = batch["image"].to(device), batch["time"].to(device), batch["event"].to(device)
|
| 35 |
+
|
| 36 |
+
for step in range(steps):
|
| 37 |
+
opt.zero_grad()
|
| 38 |
+
risk = model(x)
|
| 39 |
+
loss = cox_ph_loss(risk, t, e)
|
| 40 |
+
loss.backward()
|
| 41 |
+
opt.step()
|
| 42 |
+
if step % 20 == 0 or step == steps - 1:
|
| 43 |
+
with torch.no_grad():
|
| 44 |
+
c_idx = concordance_index(risk, t, e)
|
| 45 |
+
print(f"[sanity check] step {step:3d} loss={loss.item():.4f} C-index={c_idx:.3f}")
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def train_real(model, train_loader, val_loader, device, epochs=30, lr=1e-4):
|
| 49 |
+
opt = torch.optim.Adam(model.parameters(), lr=lr, weight_decay=1e-5)
|
| 50 |
+
scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(opt, mode="max", patience=5, factor=0.5)
|
| 51 |
+
|
| 52 |
+
for epoch in range(epochs):
|
| 53 |
+
model.train()
|
| 54 |
+
total_loss = 0.0
|
| 55 |
+
for batch in train_loader:
|
| 56 |
+
x, t, e = batch["image"].to(device), batch["time"].to(device), batch["event"].to(device)
|
| 57 |
+
opt.zero_grad()
|
| 58 |
+
risk = model(x)
|
| 59 |
+
loss = cox_ph_loss(risk, t, e)
|
| 60 |
+
loss.backward()
|
| 61 |
+
opt.step()
|
| 62 |
+
total_loss += loss.item() * x.size(0)
|
| 63 |
+
|
| 64 |
+
model.eval()
|
| 65 |
+
risks, times, events = [], [], []
|
| 66 |
+
with torch.no_grad():
|
| 67 |
+
for batch in val_loader:
|
| 68 |
+
x = batch["image"].to(device)
|
| 69 |
+
risks.append(model(x).cpu())
|
| 70 |
+
times.append(batch["time"])
|
| 71 |
+
events.append(batch["event"])
|
| 72 |
+
risks, times, events = torch.cat(risks), torch.cat(times), torch.cat(events)
|
| 73 |
+
val_c = concordance_index(risks, times, events)
|
| 74 |
+
scheduler.step(val_c)
|
| 75 |
+
print(f"epoch {epoch+1:3d} train_loss={total_loss/len(train_loader.dataset):.4f} val_C-index={val_c:.3f}")
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
if __name__ == "__main__":
|
| 79 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 80 |
+
print("device:", device)
|
| 81 |
+
|
| 82 |
+
records = build_records(
|
| 83 |
+
CSV_PATH,
|
| 84 |
+
PREPROCESSED_DATA_ROOT if USE_PREPROCESSED else RAW_DATA_ROOT,
|
| 85 |
+
modality="T1c",
|
| 86 |
+
preprocessed=USE_PREPROCESSED,
|
| 87 |
+
)
|
| 88 |
+
if len(records) < 10:
|
| 89 |
+
print("Too few usable records — check DATA_ROOT path / file naming and rerun.")
|
| 90 |
+
raise SystemExit
|
| 91 |
+
|
| 92 |
+
dataset = SurvivalDataset(records)
|
| 93 |
+
|
| 94 |
+
# ---- Step 1: overfit sanity check ----
|
| 95 |
+
model = SurvivalNet3D(in_channels=1).to(device)
|
| 96 |
+
tiny_loader = DataLoader(dataset, batch_size=min(10, len(dataset)), shuffle=True)
|
| 97 |
+
sanity_check_overfit(model, tiny_loader, device)
|
| 98 |
+
|
| 99 |
+
# ---- Step 2: real train/val ----
|
| 100 |
+
n_val = max(1, int(0.2 * len(dataset)))
|
| 101 |
+
n_train = len(dataset) - n_val
|
| 102 |
+
train_set, val_set = random_split(dataset, [n_train, n_val])
|
| 103 |
+
|
| 104 |
+
train_loader = DataLoader(train_set, batch_size=8, shuffle=True, num_workers=4)
|
| 105 |
+
val_loader = DataLoader(val_set, batch_size=8, shuffle=False, num_workers=4)
|
| 106 |
+
|
| 107 |
+
model = SurvivalNet3D(in_channels=1).to(device) # fresh weights for the real run
|
| 108 |
+
train_real(model, train_loader, val_loader, device)
|
code/utiles.py
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import torch
|
| 3 |
+
import wandb
|
| 4 |
+
from sklearn.metrics import f1_score, precision_score, recall_score, accuracy_score, confusion_matrix
|
| 5 |
+
|
| 6 |
+
def save_model(model, config):
|
| 7 |
+
"""
|
| 8 |
+
Saves the given model to the specified directory with a filename that includes
|
| 9 |
+
the model's name, F1 score, and training step.
|
| 10 |
+
|
| 11 |
+
Args:
|
| 12 |
+
model (torch.nn.Module): The model to be saved.
|
| 13 |
+
config (dict): Configuration dictionary containing:
|
| 14 |
+
- 'Test_F1' (float): The F1 score from testing.
|
| 15 |
+
- 'name' (str): The base name for the model file.
|
| 16 |
+
- 'global_step' (int): The current training step.
|
| 17 |
+
- 'save_dir' (str): Directory where the model will be saved.
|
| 18 |
+
"""
|
| 19 |
+
# Convert F1 score to percentage
|
| 20 |
+
f1_percentage = config['Test_F1'] * 100
|
| 21 |
+
|
| 22 |
+
# Create a filename with model name, F1 score, and training step
|
| 23 |
+
filename = "{}_F1_{:.2f}_step_{}.pkl".format(
|
| 24 |
+
config['name'],
|
| 25 |
+
f1_percentage,
|
| 26 |
+
config['global_step']
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
# Construct the full path for saving the model
|
| 30 |
+
model_save_path = os.path.join(config['save_dir'], filename)
|
| 31 |
+
|
| 32 |
+
# Save the model state_dict using PyTorch's save function
|
| 33 |
+
torch.save({
|
| 34 |
+
'global_step': config['global_step'],
|
| 35 |
+
'model_state_dict': model.state_dict(),
|
| 36 |
+
'Test_F1': config['Test_F1']
|
| 37 |
+
}, model_save_path)
|
| 38 |
+
print("Saved model to {}".format(model_save_path))
|
| 39 |
+
|
| 40 |
+
if wandb.run is not None:
|
| 41 |
+
wandb.save(model_save_path)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def get_learning_rate(optimizer):
|
| 45 |
+
"""
|
| 46 |
+
Retrieves the current learning rate from the optimizer.
|
| 47 |
+
|
| 48 |
+
Args:
|
| 49 |
+
optimizer (torch.optim.Optimizer): The optimizer from which to extract the learning rate.
|
| 50 |
+
|
| 51 |
+
Returns:
|
| 52 |
+
float: The current learning rate.
|
| 53 |
+
|
| 54 |
+
Raises:
|
| 55 |
+
ValueError: If the optimizer has no parameter groups.
|
| 56 |
+
"""
|
| 57 |
+
if len(optimizer.param_groups) > 0:
|
| 58 |
+
# Return the learning rate of the first parameter group
|
| 59 |
+
return optimizer.param_groups[0]['lr']
|
| 60 |
+
else:
|
| 61 |
+
raise ValueError('No trainable parameters found in the optimizer.')
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def move_tensor_to_device(tensor, use_gpu=False):
|
| 65 |
+
"""
|
| 66 |
+
Moves a tensor to GPU or CPU based on the specified flag.
|
| 67 |
+
|
| 68 |
+
Args:
|
| 69 |
+
tensor (torch.Tensor): The tensor to move.
|
| 70 |
+
use_gpu (bool, optional): If True, move the tensor to GPU. Otherwise, move to CPU. Defaults to False.
|
| 71 |
+
|
| 72 |
+
Returns:
|
| 73 |
+
torch.Tensor: The tensor on the specified device.
|
| 74 |
+
"""
|
| 75 |
+
if use_gpu:
|
| 76 |
+
# Move tensor to GPU asynchronously
|
| 77 |
+
return tensor.cuda(non_blocking=True)
|
| 78 |
+
else:
|
| 79 |
+
# Move tensor to CPU
|
| 80 |
+
return tensor.cpu()
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
def calculate_classification_metrics(predictions, targets, average_method='macro'):
|
| 84 |
+
"""
|
| 85 |
+
Calculates various classification metrics based on predictions and true targets.
|
| 86 |
+
|
| 87 |
+
Args:
|
| 88 |
+
predictions (array-like): Predicted class labels.
|
| 89 |
+
targets (array-like): True class labels.
|
| 90 |
+
average_method (str, optional): Method to average the metrics. Defaults to 'macro'.
|
| 91 |
+
|
| 92 |
+
Returns:
|
| 93 |
+
tuple: A tuple containing:
|
| 94 |
+
- accuracy (float): Accuracy score.
|
| 95 |
+
- f1 (float): F1 score.
|
| 96 |
+
- precision (float): Precision score.
|
| 97 |
+
- recall (float): Recall score.
|
| 98 |
+
- confusion_mat (numpy.ndarray): Confusion matrix.
|
| 99 |
+
"""
|
| 100 |
+
# Compute the confusion matrix
|
| 101 |
+
confusion_mat = confusion_matrix(targets, predictions)
|
| 102 |
+
confusion_mat = confusion_mat.astype('int')
|
| 103 |
+
|
| 104 |
+
# Calculate F1 score
|
| 105 |
+
f1 = f1_score(targets, predictions, average=average_method)
|
| 106 |
+
|
| 107 |
+
# Calculate precision score
|
| 108 |
+
precision = precision_score(targets, predictions, average=average_method)
|
| 109 |
+
|
| 110 |
+
# Calculate recall score
|
| 111 |
+
recall = recall_score(targets, predictions, average=average_method)
|
| 112 |
+
|
| 113 |
+
# Calculate accuracy score
|
| 114 |
+
accuracy = accuracy_score(targets, predictions)
|
| 115 |
+
|
| 116 |
+
return accuracy, f1, precision, recall, confusion_mat
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
class AverageMeter:
|
| 120 |
+
"""
|
| 121 |
+
Computes and stores the average and current value of a metric.
|
| 122 |
+
Useful for tracking metrics like loss or accuracy during training.
|
| 123 |
+
"""
|
| 124 |
+
|
| 125 |
+
def __init__(self):
|
| 126 |
+
"""
|
| 127 |
+
Initializes the AverageMeter by resetting all metrics.
|
| 128 |
+
"""
|
| 129 |
+
self.reset()
|
| 130 |
+
|
| 131 |
+
def reset(self):
|
| 132 |
+
"""
|
| 133 |
+
Resets all metrics to their initial state.
|
| 134 |
+
"""
|
| 135 |
+
self.current = 0
|
| 136 |
+
self.average = 0
|
| 137 |
+
self.total = 0
|
| 138 |
+
self.count = 0
|
| 139 |
+
|
| 140 |
+
def update(self, value, n=1):
|
| 141 |
+
"""
|
| 142 |
+
Updates the metrics with a new value.
|
| 143 |
+
|
| 144 |
+
Args:
|
| 145 |
+
value (float): The new value to incorporate.
|
| 146 |
+
n (int, optional): The number of occurrences of the value. Defaults to 1.
|
| 147 |
+
"""
|
| 148 |
+
self.current = value
|
| 149 |
+
self.total += value * n
|
| 150 |
+
self.count += n
|
| 151 |
+
self.average = self.total / self.count
|
logs/step1_nohup.log
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
results/CFE/Fold_0/log_1p19q.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.999063383191824,0.0375,0.03648228441291114,1.0229394108352095,0.009900990099009901,0.00980392156862745
|
| 3 |
+
1.0,0.5769302394241095,0.7425,0.5298896609956755,0.5685801078187357,0.7524752475247525,0.4656084656084656
|
| 4 |
+
2.0,0.4741080003976822,0.8925,0.6065783755346645,0.4859378169668783,0.8514851485148515,0.5182829888712241
|
| 5 |
+
3.0,0.44223463654518125,0.8675,0.5796903189991871,0.4345394786041562,0.8712871287128713,0.5319073083778967
|
| 6 |
+
4.0,0.4019246914982796,0.9675,0.5583864118895966,0.38913076171780575,0.9900990099009901,0.4975124378109453
|
| 7 |
+
5.0,0.6711292313039303,0.5525,0.41670536288910065,0.6788338511297018,0.5247524752475248,0.36210526315789476
|
| 8 |
+
6.0,0.47446108639240264,0.835,0.6021939605810379,0.47125472969347887,0.8118811881188119,0.49513285977374377
|
| 9 |
+
7.0,0.4058254265785217,0.9475,0.6476362263517765,0.3999685990338278,0.9702970297029703,0.6923857868020304
|
| 10 |
+
8.0,0.375984280705452,0.965,0.721725303120652,0.3681226501075348,0.9801980198019802,0.744949494949495
|
| 11 |
+
9.0,0.4317929781973362,0.8875,0.6522343940184315,0.4332561546032972,0.8712871287128713,0.5319073083778967
|
| 12 |
+
10.0,0.43877034045755864,0.9025,0.6640175744653356,0.4261717670919872,0.900990099009901,0.5570175438596491
|
| 13 |
+
11.0,0.3968836256861687,0.9625,0.6642605338257512,0.3954446295110306,0.9900990099009901,0.830820770519263
|
| 14 |
+
12.0,0.37346259370446205,0.96,0.7673065735892961,0.3836610187398325,0.9207920792079208,0.5791666666666667
|
| 15 |
+
13.0,0.3556475918740034,0.97,0.7779422649888971,0.3480237610269301,0.9603960396039604,0.4898989898989899
|
| 16 |
+
14.0,0.3288566398248076,0.9375,0.6049148591521473,0.31924927883809157,0.9504950495049505,0.4873096446700508
|
| 17 |
+
15.0,0.35156559620052574,0.945,0.6621102749193672,0.3464537094725241,0.9405940594059405,0.4846938775510204
|
| 18 |
+
16.0,0.31331249821931123,0.965,0.4910941475826972,0.29123316129835525,0.9900990099009901,0.4975124378109453
|
| 19 |
+
17.0,0.3935191798955202,0.9875,0.9105505612952278,0.4040683416446837,0.9900990099009901,0.830820770519263
|
| 20 |
+
18.0,0.3339141606166959,0.9825,0.8433215824520173,0.33659365286331366,0.9801980198019802,0.495
|
| 21 |
+
19.0,0.307485863044858,0.965,0.4910941475826972,0.289372458316312,0.9900990099009901,0.4975124378109453
|
| 22 |
+
20.0,0.3250059923157096,0.97,0.6173469387755102,0.31650941295198876,0.9900990099009901,0.4975124378109453
|
| 23 |
+
21.0,0.3500377866253257,0.9775,0.7573960509468293,0.34835437441816425,0.9900990099009901,0.4975124378109453
|
| 24 |
+
22.0,0.31024428613483906,0.975,0.7158283603296391,0.3006292069607442,0.9900990099009901,0.4975124378109453
|
| 25 |
+
23.0,0.3140456553921103,0.965,0.4910941475826972,0.2931398601815252,0.9900990099009901,0.4975124378109453
|
| 26 |
+
24.0,0.33052845746278764,0.9725,0.7034840622683469,0.3196542668755692,0.9801980198019802,0.495
|
| 27 |
+
25.0,0.3272296066582203,0.975,0.7663005375087637,0.3237187030291793,1.0,1.0
|
| 28 |
+
26.0,0.3034480682760477,0.97,0.6173469387755102,0.29495325861590926,0.9900990099009901,0.4975124378109453
|
| 29 |
+
27.0,0.3353247676044703,0.9675,0.5583864118895966,0.32019755450805815,0.9900990099009901,0.4975124378109453
|
| 30 |
+
28.0,0.3252758898213506,0.975,0.7158283603296391,0.3205467630730997,0.9900990099009901,0.4975124378109453
|
| 31 |
+
29.0,0.33396670609712603,0.97,0.6173469387755102,0.31950901640523777,0.9900990099009901,0.4975124378109453
|
| 32 |
+
30.0,0.35280895233154297,0.9775,0.7573960509468293,0.3419496027549895,0.9900990099009901,0.4975124378109453
|
| 33 |
+
31.0,0.3496198259666562,0.975,0.7435897435897436,0.3445134514039106,0.9801980198019802,0.495
|
| 34 |
+
32.0,0.3491572194546461,0.985,0.8597803225052583,0.34201963673723806,1.0,1.0
|
| 35 |
+
33.0,0.35796929337084293,0.9775,0.7799376490005501,0.3526039988097578,0.9900990099009901,0.4975124378109453
|
| 36 |
+
34.0,0.37025320522487165,0.9825,0.8658425566575632,0.3750859560942886,0.9900990099009901,0.830820770519263
|
| 37 |
+
35.0,0.34858942922204733,0.98,0.7948717948717949,0.34226264221833486,0.9900990099009901,0.4975124378109453
|
| 38 |
+
36.0,0.3588892154768109,0.9775,0.7573960509468293,0.34954742556161217,0.9900990099009901,0.4975124378109453
|
| 39 |
+
37.0,0.38170741103589534,0.975,0.7158283603296391,0.3721986728729588,0.9900990099009901,0.4975124378109453
|
| 40 |
+
38.0,0.3602838870882988,0.9825,0.8288403936670945,0.3600462326909056,0.9801980198019802,0.495
|
| 41 |
+
39.0,0.3552329629659653,0.9775,0.8141935483870968,0.3554619426774506,0.9801980198019802,0.495
|
| 42 |
+
40.0,0.3754223528504372,0.9625,0.6332294150009169,0.3706553408710083,0.9801980198019802,0.495
|
| 43 |
+
41.0,0.37410053435713053,0.9775,0.7573960509468293,0.3688002152018028,0.9900990099009901,0.4975124378109453
|
| 44 |
+
42.0,0.39001080572605135,0.9825,0.8288403936670945,0.38425219885193473,0.9900990099009901,0.4975124378109453
|
| 45 |
+
43.0,0.3702263348549604,0.985,0.8597803225052583,0.3634661117402634,0.9801980198019802,0.495
|
| 46 |
+
44.0,0.37498988658189775,0.98,0.813040430007011,0.3703868825836937,0.9900990099009901,0.4975124378109453
|
| 47 |
+
45.0,0.3766569449752569,0.9825,0.8288403936670945,0.3766522130163589,0.9801980198019802,0.495
|
| 48 |
+
46.0,0.3883292506635189,0.99,0.9140893470790379,0.39250765873654053,0.9801980198019802,0.495
|
| 49 |
+
47.0,0.389414926841855,0.9875,0.8880868446085838,0.39360103955363285,0.9801980198019802,0.495
|
| 50 |
+
48.0,0.3922994114458561,0.975,0.7435897435897436,0.38872306801304957,0.9801980198019802,0.495
|
| 51 |
+
49.0,0.40316656827926634,0.98,0.813040430007011,0.40329310002893504,0.9801980198019802,0.495
|
| 52 |
+
50.0,0.3994811753183603,0.9775,0.8389910103314102,0.40056297124022305,0.9801980198019802,0.495
|
| 53 |
+
51.0,0.3864415977150202,0.995,0.9602464718743788,0.38643667544468796,0.9900990099009901,0.4975124378109453
|
| 54 |
+
52.0,0.3909499244391918,0.9925,0.9380645161290322,0.395352704395162,0.9900990099009901,0.4975124378109453
|
| 55 |
+
53.0,0.39809130273759363,0.9775,0.7573960509468293,0.3926129946024111,0.9900990099009901,0.4975124378109453
|
| 56 |
+
54.0,0.40013119831681254,0.99,0.9140893470790379,0.40554210750183256,0.9801980198019802,0.495
|
| 57 |
+
55.0,0.40175558663904665,0.9925,0.9380645161290322,0.4049622564032526,0.9801980198019802,0.495
|
| 58 |
+
56.0,0.3870487441122532,0.98,0.7948717948717949,0.3856232237107683,0.9900990099009901,0.4975124378109453
|
| 59 |
+
57.0,0.3853371550887823,0.9825,0.8288403936670945,0.38067458260177384,0.9801980198019802,0.495
|
| 60 |
+
58.0,0.4121273900568485,0.9825,0.8288403936670945,0.41354705791662233,0.9801980198019802,0.495
|
| 61 |
+
59.0,0.3953451108187437,0.98,0.8281786941580755,0.3913841176741194,0.9801980198019802,0.495
|
results/CFE/Fold_0/log_IDH.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.8562873266637325,0.215,0.1787843916727691,0.8812447113565879,0.1782178217821782,0.15126050420168066
|
| 3 |
+
1.0,0.6473624355345965,0.6675,0.641873834575331,0.636958381917217,0.6831683168316832,0.6399286987522281
|
| 4 |
+
2.0,0.533017813116312,0.9025,0.8607627701068378,0.5291002661284834,0.8811881188118812,0.8311036789297659
|
| 5 |
+
3.0,0.5592098202556371,0.86,0.8094654826307373,0.5491899614877039,0.8712871287128713,0.8141542816702052
|
| 6 |
+
4.0,0.5501386643946171,0.8325,0.6692950307876455,0.5361895673345811,0.8712871287128713,0.7382898146302571
|
| 7 |
+
5.0,0.749491598457098,0.32,0.3124194241512677,0.7642803254103897,0.26732673267326734,0.26146245059288536
|
| 8 |
+
6.0,0.6134806621074677,0.7025,0.67767929089444,0.6168947408695032,0.7029702970297029,0.6624331550802138
|
| 9 |
+
7.0,0.5689478356391191,0.8375,0.7895060678923891,0.5651250770776579,0.8514851485148515,0.7784115840280825
|
| 10 |
+
8.0,0.6518271455913782,0.6325,0.6151202749140894,0.6495457341765413,0.6237623762376238,0.5948057432432432
|
| 11 |
+
9.0,0.5504573309421539,0.8225,0.7828065372173235,0.548571514021052,0.8118811881188119,0.7569963277193871
|
| 12 |
+
10.0,0.5871957146376371,0.7525,0.7206841826838299,0.5845733394127081,0.7821782178217822,0.733955938697318
|
| 13 |
+
11.0,0.5664035578072071,0.8525,0.8145222769748268,0.5664592382341328,0.8613861386138614,0.7966052934407364
|
| 14 |
+
12.0,0.5394970432668924,0.88,0.8459761262995764,0.5507050180199122,0.8514851485148515,0.7979191676670668
|
| 15 |
+
13.0,0.6498527227342129,0.57,0.5607650859317143,0.6530786475332657,0.6138613861386139,0.5864566929133859
|
| 16 |
+
14.0,0.5900823856145143,0.83,0.7880233174350821,0.57482115466996,0.8316831683168316,0.7825756616436621
|
| 17 |
+
15.0,0.5721367691457272,0.7575,0.7273576884429173,0.5834352772424717,0.7722772277227723,0.7189352692075015
|
| 18 |
+
16.0,0.47531997695565226,0.855,0.7156862745098039,0.47191487975639873,0.8613861386138614,0.6909965034965035
|
| 19 |
+
17.0,0.604491654485464,0.785,0.7508979260804078,0.6244598208087506,0.7227722772277227,0.6741935483870968
|
| 20 |
+
18.0,0.5704524562507868,0.7925,0.760100006503313,0.5834236062399232,0.801980198019802,0.7472472472472473
|
| 21 |
+
19.0,0.5163937475532293,0.8825,0.7800423535468171,0.5184263846661785,0.8712871287128713,0.7221164021164022
|
| 22 |
+
20.0,0.4727585284411907,0.925,0.8769230769230769,0.4805489569017203,0.900990099009901,0.8143382352941176
|
| 23 |
+
21.0,0.4652253691852093,0.945,0.9148573861217539,0.47166902505525266,0.900990099009901,0.8231792717086834
|
| 24 |
+
22.0,0.5479085709154606,0.84,0.8057309373482273,0.5614539452708593,0.7722772277227723,0.7246651653431315
|
| 25 |
+
23.0,0.4567669277638197,0.9425,0.9113944775645039,0.4616260599381853,0.900990099009901,0.8231792717086834
|
| 26 |
+
24.0,0.48955528348684313,0.9225,0.8933966076049484,0.5146599196561492,0.8514851485148515,0.7784115840280825
|
| 27 |
+
25.0,0.5159314895421266,0.91,0.8815633636004737,0.538979432370403,0.8415841584158416,0.7813852813852813
|
| 28 |
+
26.0,0.4775351259857416,0.955,0.937421777221527,0.5074855800312345,0.8910891089108911,0.8427459306440198
|
| 29 |
+
27.0,0.47103670477867127,0.8225,0.5907722013285494,0.4697147035362697,0.8415841584158416,0.591919191919192
|
| 30 |
+
28.0,0.42495609432458875,0.95,0.9253034547152195,0.4491169493977386,0.8811881188118812,0.7971887550200802
|
| 31 |
+
29.0,0.4817602441459894,0.945,0.9185305880610279,0.516608997146682,0.8217821782178217,0.7194444444444444
|
| 32 |
+
30.0,0.4407986767590046,0.9625,0.9455885953695895,0.46211618096521584,0.9306930693069307,0.8841932841932842
|
| 33 |
+
31.0,0.4363872741162777,0.885,0.7938236744206894,0.44255646089516065,0.900990099009901,0.8143382352941176
|
| 34 |
+
32.0,0.4848265498131514,0.87,0.8331408034912078,0.47638319624532566,0.8811881188118812,0.8256616800920599
|
| 35 |
+
33.0,0.4204682819545269,0.885,0.8186048345754959,0.43121516704559326,0.8811881188118812,0.7971887550200802
|
| 36 |
+
34.0,0.4243210533261299,0.915,0.877163192311861,0.4231582219057744,0.9108910891089109,0.8570080226521944
|
| 37 |
+
35.0,0.5461360558122397,0.7875,0.7553516819571866,0.5859165067719941,0.7524752475247525,0.7064294849436112
|
| 38 |
+
36.0,0.43647982433438304,0.925,0.8979279371236093,0.45479972852338657,0.8910891089108911,0.8375018282872605
|
| 39 |
+
37.0,0.4666815107315779,0.89,0.8136856368563685,0.477224332861381,0.8712871287128713,0.7382898146302571
|
| 40 |
+
38.0,0.4465074164420366,0.925,0.8993254807208295,0.4674647547821007,0.8712871287128713,0.8141542816702052
|
| 41 |
+
39.0,0.47544194377958776,0.8925,0.8624341163391479,0.5041388515198585,0.8415841584158416,0.7873684210526316
|
| 42 |
+
40.0,0.4455978512763977,0.9425,0.9203318352254521,0.465588520954151,0.900990099009901,0.8547180667433831
|
| 43 |
+
41.0,0.43104615293443205,0.96,0.9430989722251858,0.44450353100748347,0.9207920792079208,0.8797619047619047
|
| 44 |
+
42.0,0.4004282098263502,0.9325,0.9043494433668995,0.40492470724747914,0.9108910891089109,0.8570080226521944
|
| 45 |
+
43.0,0.4318793760985136,0.9425,0.9197424780382271,0.46152069161433984,0.8811881188118812,0.8256616800920599
|
| 46 |
+
44.0,0.439170540869236,0.905,0.8765592515592515,0.4816774247896553,0.8712871287128713,0.8248632786447913
|
| 47 |
+
45.0,0.448685839548707,0.9575,0.9397755754532331,0.48992865333462704,0.8811881188118812,0.8256616800920599
|
| 48 |
+
46.0,0.4111885231733322,0.96,0.9439599313509159,0.4744472875453458,0.8712871287128713,0.8141542816702052
|
| 49 |
+
47.0,0.38593519568443296,0.9575,0.9350990217131949,0.42385488453477915,0.9207920792079208,0.8585434173669467
|
| 50 |
+
48.0,0.4214303517341614,0.96,0.9402427637721755,0.46837501862261555,0.8712871287128713,0.784930384930385
|
| 51 |
+
49.0,0.43156489960849287,0.9575,0.9367788841473053,0.47158878894135503,0.8613861386138614,0.7817901234567901
|
| 52 |
+
50.0,0.43596620291471483,0.9025,0.8737036407354335,0.46254759082699765,0.8712871287128713,0.8197666437886068
|
| 53 |
+
51.0,0.41487106069922447,0.915,0.8859022114836068,0.4385138938922693,0.8910891089108911,0.8316921678533555
|
| 54 |
+
52.0,0.420325266122818,0.9325,0.9090840215167816,0.4628760625820349,0.8811881188118812,0.8311036789297659
|
| 55 |
+
53.0,0.41386477306485175,0.9775,0.9662412438226164,0.45060088699406914,0.900990099009901,0.8497023809523809
|
| 56 |
+
54.0,0.3721659515053034,0.98,0.9698613622664256,0.4083097019408009,0.9306930693069307,0.8790419161676647
|
| 57 |
+
55.0,0.38640193969011305,0.9525,0.9310788874681466,0.425348832760707,0.8910891089108911,0.8180180180180181
|
| 58 |
+
56.0,0.4258790957182646,0.95,0.9283154121863799,0.4617271258099244,0.8811881188118812,0.8256616800920599
|
| 59 |
+
57.0,0.43140519253909587,0.915,0.8881431767337808,0.4767551590310465,0.8613861386138614,0.8139473684210526
|
| 60 |
+
58.0,0.5304203533381223,0.87,0.8379001839209451,0.5606489264138854,0.8217821782178217,0.7725225225225225
|
| 61 |
+
59.0,0.43635788425803185,0.9125,0.884479870617455,0.4590808970503288,0.8910891089108911,0.8427459306440198
|
results/CFE/Fold_0/log_LHG.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.8701460772007704,0.21,0.17708333333333334,0.8938728927975834,0.16831683168316833,0.1440677966101695
|
| 3 |
+
1.0,0.7427182811498642,0.395,0.393483709273183,0.7305139704505996,0.38613861386138615,0.38122529644268777
|
| 4 |
+
2.0,0.5815278322249651,0.7925,0.7405418923248853,0.5764278076072731,0.7920792079207921,0.731416993795112
|
| 5 |
+
3.0,0.6525434946268797,0.6275,0.5779963322500018,0.6231402979038729,0.7029702970297029,0.6372126436781609
|
| 6 |
+
4.0,0.554497776851058,0.85,0.7017744420696854,0.5226238487970711,0.8712871287128713,0.703276836158192
|
| 7 |
+
5.0,0.9445620661228895,0.205,0.17012448132780084,0.9659222948669207,0.16831683168316833,0.1440677966101695
|
| 8 |
+
6.0,0.7654413847625255,0.3325,0.32846660253145454,0.7808921956779933,0.27722772277227725,0.2746679783571077
|
| 9 |
+
7.0,0.5450511724501849,0.865,0.7947626468017179,0.522409602852151,0.9207920792079208,0.8703465982028241
|
| 10 |
+
8.0,0.6064824724197387,0.7325,0.701448810329313,0.5906631707554997,0.7722772277227723,0.7189352692075015
|
| 11 |
+
9.0,0.5336868809908628,0.8775,0.8350043353452703,0.5123613940017058,0.900990099009901,0.8547180667433831
|
| 12 |
+
10.0,0.664623421356082,0.5625,0.5490823826486901,0.6439324393130765,0.6039603960396039,0.5683760683760684
|
| 13 |
+
11.0,0.8381390523910522,0.305,0.29994208153912016,0.8372313406797919,0.297029702970297,0.2967539472393841
|
| 14 |
+
12.0,0.7791913044452667,0.3775,0.3754350320747973,0.7798041633450159,0.36633663366336633,0.3612648221343874
|
| 15 |
+
13.0,0.836290979385376,0.2825,0.2706433967178953,0.8412098303289697,0.26732673267326734,0.2637903861308117
|
| 16 |
+
14.0,0.5998246392607689,0.8075,0.7702846829108212,0.6040148755701462,0.801980198019802,0.7410256410256411
|
| 17 |
+
15.0,0.6469199400395155,0.6025,0.5797847387860007,0.6326514057593771,0.6039603960396039,0.5683760683760684
|
| 18 |
+
16.0,0.641018765643239,0.6575,0.6331773667757763,0.6502056295918947,0.6336633663366337,0.5982152456725083
|
| 19 |
+
17.0,0.9753831080347299,0.205,0.17012448132780084,0.9956380099353224,0.16831683168316833,0.1440677966101695
|
| 20 |
+
18.0,0.8347587636858225,0.3325,0.3294447827915942,0.8403759309560945,0.37623762376237624,0.3752577319587629
|
| 21 |
+
19.0,0.732984219044447,0.375,0.375,0.7466023393196635,0.3465346534653465,0.341304347826087
|
| 22 |
+
20.0,0.7515894874930382,0.3575,0.35572421486722783,0.7689566476510303,0.33663366336633666,0.33663366336633666
|
| 23 |
+
21.0,0.6358758865296841,0.6575,0.5507276081164173,0.6433654648832755,0.6138613861386139,0.5128014842300557
|
| 24 |
+
22.0,0.6889994210749865,0.5175,0.5107452262803329,0.6993958551694851,0.5148514851485149,0.49893692416725727
|
| 25 |
+
23.0,0.7858187363296747,0.28,0.26762282575526397,0.8019499557443185,0.2871287128712871,0.285377358490566
|
| 26 |
+
24.0,0.5514542139321565,0.7725,0.5011990407673861,0.5472975438184077,0.7920792079207921,0.48481904299247025
|
| 27 |
+
25.0,0.6557506059110164,0.615,0.5695317959468903,0.6651503496831006,0.594059405940594,0.5421779988944169
|
| 28 |
+
26.0,0.6605206864327192,0.57,0.5290122949697418,0.6784304046984946,0.5643564356435643,0.5122914837576822
|
| 29 |
+
27.0,0.6955427204817534,0.505,0.49281487743026203,0.7230498681564143,0.4752475247524752,0.458033815936013
|
| 30 |
+
28.0,0.6602391864359379,0.575,0.5415812749433718,0.6873826378642922,0.5148514851485149,0.4906864258516003
|
| 31 |
+
29.0,0.6247154404968023,0.715,0.6363752352397053,0.6351831142265018,0.6534653465346535,0.5810122081308522
|
| 32 |
+
30.0,0.8672924536466599,0.2825,0.2706433967178953,0.897457498134953,0.25742574257425743,0.25273749630068065
|
| 33 |
+
31.0,0.6925642628222703,0.505,0.4504732036302073,0.7169130482886097,0.40594059405940597,0.35256410256410253
|
| 34 |
+
32.0,0.645998300909996,0.62,0.5497496963772623,0.6907699538929628,0.48514851485148514,0.4148841354723708
|
| 35 |
+
33.0,0.6900497218966484,0.52,0.508184123568739,0.7298685869958141,0.48514851485148514,0.470137207425343
|
| 36 |
+
34.0,0.6935195866972208,0.495,0.4654811992273293,0.7094028211466157,0.504950495049505,0.4604700854700855
|
| 37 |
+
35.0,0.7520523505657911,0.41,0.363606946391975,0.7682103915969924,0.36633663366336633,0.31756756756756754
|
| 38 |
+
36.0,0.6935537571460009,0.525,0.48138443061469594,0.7230226285386794,0.49504950495049505,0.4592125984251969
|
| 39 |
+
37.0,0.9476908695697784,0.2075,0.17533282604595504,0.9879879060358104,0.16831683168316833,0.1440677966101695
|
| 40 |
+
38.0,0.7350840674340725,0.46,0.4375,0.7787029023217683,0.43564356435643564,0.4126109580655035
|
| 41 |
+
39.0,0.6757565519213676,0.5675,0.5525987418455949,0.7207889952281914,0.4752475247524752,0.46496751624187904
|
| 42 |
+
40.0,0.7376101686805486,0.45,0.416383701188455,0.7823053297429982,0.33663366336633666,0.29693506493506494
|
| 43 |
+
41.0,0.7330256593972444,0.4625,0.42891673473182335,0.771904586270304,0.37623762376237624,0.33890909090909094
|
| 44 |
+
42.0,0.7405845430493355,0.4025,0.3683556765399634,0.7586268818024362,0.40594059405940597,0.36716791979949875
|
| 45 |
+
43.0,0.5465780377388001,0.8425,0.740203507252652,0.5775849943113799,0.7623762376237624,0.6110397946084724
|
| 46 |
+
44.0,0.5819213496148586,0.75,0.6357808857808858,0.6181330359218145,0.6633663366336634,0.535443722943723
|
| 47 |
+
45.0,0.5687912765145302,0.78,0.6713352007469655,0.5995373300986715,0.7029702970297029,0.5900974025974026
|
| 48 |
+
46.0,0.5867574317008257,0.7375,0.6362975086379341,0.6263038586862016,0.6732673267326733,0.5424845573095401
|
| 49 |
+
47.0,0.8164812575280667,0.33,0.32993299329932996,0.8724807627720408,0.297029702970297,0.29592538046146294
|
| 50 |
+
48.0,0.6450323405116797,0.645,0.4988706945228684,0.6859986348317402,0.5841584158415841,0.45615384615384613
|
| 51 |
+
49.0,0.5882457920163869,0.725,0.4884672619047619,0.6122215643967732,0.693069306930693,0.48714168714168715
|
| 52 |
+
50.0,0.7494811958819628,0.41,0.3879033094719369,0.7840621663202153,0.33663366336633666,0.31487293712665787
|
| 53 |
+
51.0,0.805176735073328,0.3575,0.3530970165690229,0.8439117065160582,0.33663366336633666,0.3271353286268271
|
| 54 |
+
52.0,0.8048955652862787,0.3525,0.3390791765283794,0.8357916220579997,0.3465346534653465,0.31079404466501237
|
| 55 |
+
53.0,0.8015534242987633,0.325,0.31673246279987854,0.8517821773444072,0.32673267326732675,0.3153907496012759
|
| 56 |
+
54.0,0.8371765869110823,0.32,0.3199829995749894,0.8850333357211386,0.3069306930693069,0.303585500394011
|
| 57 |
+
55.0,0.7798654995858669,0.38,0.36041263700838166,0.805130538078818,0.33663366336633666,0.31487293712665787
|
| 58 |
+
56.0,0.8689993080496788,0.2775,0.2712647590950067,0.9112478701194914,0.2079207920792079,0.2059748427672956
|
| 59 |
+
57.0,0.7931657297164202,0.3575,0.33408906882591094,0.792347387217059,0.40594059405940597,0.3602195945945946
|
| 60 |
+
58.0,1.0329070676118135,0.2375,0.21548957951527545,1.0881498936969456,0.1782178217821782,0.15706385118149824
|
| 61 |
+
59.0,0.8996286098659039,0.2725,0.27249545309658185,0.9468711889026189,0.2079207920792079,0.20784313725490197
|
results/CFE/Fold_0/log_mean.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.9084989290187756,0.15416666666666667,0.13078333647300452,0.932685671663127,0.1188118811881188,0.10171074079349253
|
| 3 |
+
1.0,0.6556703187028567,0.6016666666666667,0.5217490682813964,0.6453508200621841,0.6072607260726072,0.4955874869344605
|
| 4 |
+
2.0,0.5295512152463198,0.8624999999999999,0.7359610126554625,0.5304886302342117,0.8415841584158416,0.693601220532034
|
| 5 |
+
3.0,0.5513293171425659,0.785,0.6557173779599754,0.5356232459985777,0.8151815181518152,0.6610914112420876
|
| 6 |
+
4.0,0.5021870442479849,0.8833333333333333,0.6431519615823091,0.48264805928315263,0.9108910891089108,0.6463596961997982
|
| 7 |
+
5.0,0.7883942986279727,0.3591666666666667,0.2997497561227231,0.8030121571356706,0.3201320132013202,0.2558785034536499
|
| 8 |
+
6.0,0.6177943777541319,0.6233333333333334,0.5361132846689776,0.6230138887469918,0.5973597359735974,0.47741133107035516
|
| 9 |
+
7.0,0.5066081448892752,0.8833333333333334,0.7439683136819611,0.4958344263212122,0.9141914191419142,0.7803813230109791
|
| 10 |
+
8.0,0.5447646329055229,0.7766666666666667,0.6794314627880181,0.5361105183465252,0.7920792079207922,0.6862301691334132
|
| 11 |
+
9.0,0.5053123967101176,0.8624999999999999,0.7566817555270084,0.49806302087535165,0.8613861386138614,0.7145405676135557
|
| 12 |
+
10.0,0.5635298254837592,0.7391666666666666,0.6445947132659519,0.5515591819392572,0.7623762376237625,0.6197831836443451
|
| 13 |
+
11.0,0.600475411961476,0.7066666666666667,0.592908297446566,0.5997117361416517,0.7161716171617161,0.6413933370664612
|
| 14 |
+
12.0,0.5640503138055404,0.7391666666666666,0.6629059106545566,0.5713900667015869,0.712871287128713,0.579450218822707
|
| 15 |
+
13.0,0.6139304313311974,0.6075,0.5364502492128356,0.6141040796297218,0.6138613861386139,0.4467153563143958
|
| 16 |
+
14.0,0.5062545549000302,0.8583333333333334,0.7210742864993502,0.4993617696927326,0.8613861386138613,0.670303649113118
|
| 17 |
+
15.0,0.5235407684619228,0.7683333333333332,0.6564175673827617,0.5208467974914576,0.7722772277227722,0.5906684050448634
|
| 18 |
+
16.0,0.4765504136060675,0.8258333333333333,0.6133192629560925,0.47111789021554956,0.8283828382838284,0.595574728993319
|
| 19 |
+
17.0,0.657797980805238,0.6591666666666667,0.6105243229011456,0.6747220574629189,0.627062706270627,0.5496940385055097
|
| 20 |
+
18.0,0.579708460184435,0.7025,0.6442887905823081,0.5867977300197772,0.7194719471947195,0.5391683264020034
|
| 21 |
+
19.0,0.5189546098808447,0.7408333333333333,0.5487121670431714,0.5181337274340513,0.7359735973597359,0.5203110625844781
|
| 22 |
+
20.0,0.5164513360833128,0.7508333333333334,0.6166647435219383,0.5220050058349132,0.7425742574257425,0.5494947788237999
|
| 23 |
+
21.0,0.48371301411340634,0.86,0.7409936817283335,0.4877962881188975,0.834983498349835,0.6111643979165614
|
| 24 |
+
22.0,0.515717426041762,0.7775,0.6774348413193998,0.5204930024670295,0.7590759075907592,0.5737048424404446
|
| 25 |
+
23.0,0.5188771064952016,0.7291666666666666,0.5567038169674884,0.5189052919546763,0.726072607260726,0.5353563560033981
|
| 26 |
+
24.0,0.45717931829392916,0.8891666666666667,0.6993599035468939,0.46053724345004204,0.8745874587458745,0.5860768756735176
|
| 27 |
+
25.0,0.4996372340371211,0.8333333333333334,0.7391318990187092,0.5092828283608943,0.8118811881188118,0.774521093426566
|
| 28 |
+
26.0,0.4805012935648361,0.8316666666666666,0.6945936703222596,0.49362308111521275,0.8151815181518152,0.6175166174042158
|
| 29 |
+
27.0,0.5006347309549649,0.765,0.5473244968828027,0.5043207087335807,0.768976897689769,0.5158218152220501
|
| 30 |
+
28.0,0.47015705686062575,0.8333333333333334,0.7275710299960768,0.48568211677837686,0.7953795379537953,0.595129206227542
|
| 31 |
+
29.0,0.48014746357997257,0.8766666666666666,0.7240842540254144,0.4904337092594739,0.8217821782178217,0.5993230301287473
|
| 32 |
+
30.0,0.5536333609124026,0.7408333333333333,0.6578760143447714,0.5671744272850527,0.7260726072607261,0.5448144061016368
|
| 33 |
+
31.0,0.4928571209684014,0.7883333333333332,0.6626288738802134,0.5013276535292269,0.7623762376237623,0.5539674459527401
|
| 34 |
+
32.0,0.49332735672593114,0.8250000000000001,0.7475569407912429,0.5030575956251755,0.7887788778877888,0.7468486051881436
|
| 35 |
+
33.0,0.4894957657406727,0.7941666666666668,0.7022422023815951,0.5045625842837217,0.7854785478547854,0.5882794667521228
|
| 36 |
+
34.0,0.49603128174940747,0.7975,0.7361623160655845,0.5025489997155596,0.8019801980198019,0.7160996262138477
|
| 37 |
+
35.0,0.548925945200026,0.7258333333333334,0.6379434744069855,0.5654631801957738,0.702970297029703,0.5071698301073747
|
| 38 |
+
36.0,0.49630759898573157,0.8091666666666667,0.7122361395617114,0.5091232608745594,0.792079207920792,0.5980756215078009
|
| 39 |
+
37.0,0.5986932637790838,0.6908333333333333,0.5682822744106543,0.6124703039233834,0.6765676567656765,0.459956683017124
|
| 40 |
+
38.0,0.5139584569881359,0.7891666666666667,0.7218886247959747,0.5354046299315915,0.7623762376237623,0.5739217465785696
|
| 41 |
+
39.0,0.5021438195556401,0.8125,0.7430754688572798,0.5267965964751669,0.7656765676567656,0.5824453124315035
|
| 42 |
+
40.0,0.5195434576024612,0.785,0.6566483171382748,0.5395163971893858,0.7392739273927392,0.5488843772261492
|
| 43 |
+
41.0,0.5127241155629356,0.7999999999999999,0.7098039193012795,0.5284027774931968,0.7623762376237623,0.5720611444939804
|
| 44 |
+
42.0,0.510341186200579,0.7725,0.7005151711913191,0.5159345959672833,0.768976897689769,0.5738961267542129
|
| 45 |
+
43.0,0.44956124956409144,0.9233333333333333,0.8399087692653792,0.4675239325553277,0.8745874587458745,0.643900491566844
|
| 46 |
+
44.0,0.46536059235533084,0.8783333333333333,0.7751268557823826,0.4900657810983878,0.8415841584158416,0.6192731464664866
|
| 47 |
+
45.0,0.464711353679498,0.9066666666666666,0.8133170566224311,0.48870606548321915,0.8547854785478547,0.6369196942298209
|
| 48 |
+
46.0,0.4620917351792256,0.8958333333333334,0.8314489290226293,0.49775293498936274,0.8415841584158416,0.6172129463265819
|
| 49 |
+
47.0,0.5306104600181182,0.7583333333333333,0.7177062865403695,0.5633122289534843,0.7326732673267325,0.5498229326094699
|
| 50 |
+
48.0,0.48625403456389904,0.86,0.7275677339615959,0.5143655738224684,0.8118811881188118,0.5786947436947437
|
| 51 |
+
49.0,0.47432575330138205,0.8875000000000001,0.746095525353026,0.4957011511223544,0.8448844884488448,0.5879772701994924
|
| 52 |
+
50.0,0.5283095247050126,0.7633333333333333,0.7001993201795935,0.5490575761291453,0.7293729372937293,0.5432131936384216
|
| 53 |
+
51.0,0.5354964644958575,0.7558333333333334,0.7330818999756695,0.5562874252843385,0.7392739273927392,0.5521133114303759
|
| 54 |
+
52.0,0.5387235852827629,0.7591666666666667,0.7287425713913978,0.5646734630117322,0.7392739273927392,0.5464700538019078
|
| 55 |
+
53.0,0.5378365000337362,0.7600000000000001,0.6801232525231081,0.5649986863136292,0.7392739273927392,0.554201856121534
|
| 56 |
+
54.0,0.5364912455777328,0.7633333333333333,0.7346445696401509,0.566295048387924,0.7392739273927392,0.5592091388538919
|
| 57 |
+
55.0,0.5226743419716756,0.775,0.7431853468685201,0.5451472090809258,0.7359735973597359,0.5426303183815587
|
| 58 |
+
56.0,0.5606423826267322,0.7358333333333333,0.6648173220510606,0.586199406546728,0.6930693069306931,0.5097163202234336
|
| 59 |
+
57.0,0.5366360257814328,0.7516666666666666,0.6836908797422621,0.5499257096166265,0.7491749174917491,0.5563889876718825
|
| 60 |
+
58.0,0.6584849370022615,0.6966666666666667,0.6274100523677716,0.687448626009151,0.66006600660066,0.4748621245680069
|
| 61 |
+
59.0,0.5771105349808932,0.7216666666666667,0.6617180059573707,0.599112067875689,0.6930693069306931,0.5151963559663072
|
results/CFE/Fold_1/log_1p19q.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.8299683420140844,0.1895261845386533,0.1745574310415809,0.8026946610212327,0.25,0.2153991003243017
|
| 3 |
+
1.0,0.4675857600874437,0.9027431421446384,0.6060407587475124,0.4763472986221313,0.9,0.4736842105263157
|
| 4 |
+
2.0,0.5866577330224234,0.7256857855361596,0.513005652711535,0.6167518982291221,0.64,0.4375
|
| 5 |
+
3.0,0.5269989409946146,0.830423940149626,0.5381436314363144,0.5146803015470505,0.87,0.5315315315315315
|
| 6 |
+
4.0,0.5795579990395286,0.7556109725685786,0.5263018322082931,0.6097906637191772,0.72,0.4509803921568627
|
| 7 |
+
5.0,0.4119972102065336,0.917705735660848,0.6270818655770043,0.4261703714728355,0.9,0.4736842105263157
|
| 8 |
+
6.0,0.3935673372852534,0.945137157107232,0.6621476715686274,0.4099864727258682,0.93,0.4818652849740932
|
| 9 |
+
7.0,0.3852492288461052,0.9675810473815462,0.4917617237008872,0.3783520367741584,0.98,0.494949494949495
|
| 10 |
+
8.0,0.3450439700164699,0.9625935162094764,0.5956846138334342,0.3503015179932117,0.97,0.4923857868020304
|
| 11 |
+
9.0,0.4083979555644894,0.9251870324189526,0.654071773636991,0.4579902449250221,0.82,0.4505494505494505
|
| 12 |
+
10.0,0.3780508323797859,0.9600997506234414,0.626107226107226,0.3967352497577667,0.96,0.4897959183673469
|
| 13 |
+
11.0,0.3500697660698855,0.972568578553616,0.7310529845741114,0.3593754816055298,0.97,0.4923857868020304
|
| 14 |
+
12.0,0.33633866032906,0.9750623441396508,0.7436061381074168,0.3547454452514648,0.97,0.4923857868020304
|
| 15 |
+
13.0,0.3203463320274305,0.9750623441396508,0.7663170163170163,0.3380023889243603,0.98,0.494949494949495
|
| 16 |
+
14.0,0.3281833549910353,0.9850374064837906,0.8711439588688946,0.3426649966835975,0.96,0.4897959183673469
|
| 17 |
+
15.0,0.3227994160684861,0.972568578553616,0.6263447691656078,0.3271419849991798,0.97,0.4923857868020304
|
| 18 |
+
16.0,0.3925927337862904,0.972568578553616,0.6694642188085426,0.3969073858857155,0.97,0.4923857868020304
|
| 19 |
+
17.0,0.3454272510330576,0.9750623441396508,0.8012490087232356,0.3656989574432373,0.95,0.4871794871794871
|
| 20 |
+
18.0,0.380446008390322,0.972568578553616,0.8032296917517956,0.4153752334415913,0.91,0.4764397905759162
|
| 21 |
+
19.0,0.3547488882431663,0.9800498753117208,0.8281919451585261,0.3774605143070221,0.96,0.4897959183673469
|
| 22 |
+
20.0,0.3434731739194613,0.9775561097256856,0.7574107683000605,0.3558128044009209,0.98,0.494949494949495
|
| 23 |
+
21.0,0.3124375886230397,0.9800498753117208,0.7726757369614512,0.3174805633723735,0.98,0.494949494949495
|
| 24 |
+
22.0,0.3398004178320083,0.9850374064837906,0.8461636828644501,0.3577431660890579,0.97,0.4923857868020304
|
| 25 |
+
23.0,0.3332205895622472,0.9825436408977556,0.8113194864556026,0.3461201253533363,0.98,0.494949494949495
|
| 26 |
+
24.0,0.3081701873172251,0.9750623441396508,0.6811386768447838,0.3110647469758987,0.97,0.4923857868020304
|
| 27 |
+
25.0,0.3425032720898749,0.9925187032418952,0.938069498069498,0.3614000388979911,0.96,0.4897959183673469
|
| 28 |
+
26.0,0.348875393705475,0.9775561097256856,0.7295616335706256,0.3590987691283226,0.98,0.494949494949495
|
| 29 |
+
27.0,0.3564763904509699,0.942643391521197,0.6900561212487818,0.4057183757424354,0.91,0.4764397905759162
|
| 30 |
+
28.0,0.3352353116520622,0.9900249376558604,0.9259874492432631,0.3607664787769317,0.94,0.4845360824742268
|
| 31 |
+
29.0,0.3623031254049548,0.9850374064837906,0.8461636828644501,0.3811146940290928,0.98,0.494949494949495
|
| 32 |
+
30.0,0.3333076039826186,0.9825436408977556,0.8288518992744345,0.3531834325194359,0.97,0.4923857868020304
|
| 33 |
+
31.0,0.35530781898266656,0.9875311720698254,0.8880951052073449,0.38312663942575453,0.95,0.48717948717948717
|
| 34 |
+
32.0,0.35758701769491086,0.9900249376558603,0.9065268065268066,0.377894392311573,0.96,0.4897959183673469
|
| 35 |
+
33.0,0.3531981258098027,0.9975062344139651,0.9793564993564994,0.38275331556797026,0.96,0.4897959183673469
|
| 36 |
+
34.0,0.35102429406304014,0.9675810473815462,0.4917617237008872,0.3463621637225151,0.98,0.494949494949495
|
| 37 |
+
35.0,0.40948218560575544,0.942643391521197,0.75003387809307,0.44932947754859925,0.89,0.4708994708994709
|
| 38 |
+
36.0,0.3496590307600183,0.9825436408977556,0.8113194864556026,0.36772355556488034,0.97,0.49238578680203043
|
| 39 |
+
37.0,0.38007864883713,0.9875311720698254,0.9105589507962707,0.4135826751589775,0.94,0.4845360824742268
|
| 40 |
+
38.0,0.370662797121633,0.9950124688279302,0.9602498017446471,0.3925481590628624,0.96,0.4897959183673469
|
| 41 |
+
39.0,0.3735190102287064,0.9975062344139651,0.9793564993564994,0.397390978038311,0.96,0.4897959183673469
|
| 42 |
+
40.0,0.3622509740534566,0.9875311720698254,0.877751356624596,0.3770077621936798,0.97,0.49238578680203043
|
| 43 |
+
41.0,0.3617524172079533,0.9875311720698254,0.877751356624596,0.3731985855102539,0.97,0.49238578680203043
|
| 44 |
+
42.0,0.36945653422514996,0.9900249376558603,0.914095972579263,0.3863560518622398,0.97,0.49238578680203043
|
| 45 |
+
43.0,0.3636637723951268,0.9900249376558603,0.9065268065268066,0.3810462811589241,0.97,0.49238578680203043
|
| 46 |
+
44.0,0.3833152058713157,0.9875311720698254,0.8967824967824969,0.4025957652926445,0.96,0.4897959183673469
|
| 47 |
+
45.0,0.3813843165252571,0.9900249376558603,0.9065268065268066,0.39940249383449555,0.95,0.48717948717948717
|
| 48 |
+
46.0,0.3717211904073891,0.9950124688279302,0.9570479862896315,0.388293200135231,0.96,0.4897959183673469
|
| 49 |
+
47.0,0.3668941553691379,0.9850374064837906,0.8461636828644501,0.3753925836086273,0.98,0.494949494949495
|
| 50 |
+
48.0,0.3677405445207087,0.9975062344139651,0.9793564993564994,0.39863425552845,0.95,0.48717948717948717
|
| 51 |
+
49.0,0.3686292369169487,0.9950124688279302,0.9570479862896315,0.389600787460804,0.96,0.4897959183673469
|
| 52 |
+
50.0,0.37652253316822193,0.9950124688279302,0.9570479862896315,0.39477082699537275,0.96,0.4897959183673469
|
| 53 |
+
51.0,0.37869071655737196,0.9825436408977556,0.8113194864556026,0.39129578858613967,0.98,0.494949494949495
|
| 54 |
+
52.0,0.3779986936998486,0.9825436408977556,0.8113194864556026,0.38317407011985777,0.98,0.494949494949495
|
| 55 |
+
53.0,0.3663945824576732,0.9925187032418953,0.932857063124407,0.3785070723295212,0.96,0.4897959183673469
|
| 56 |
+
54.0,0.3712265429056791,0.9825436408977556,0.8113194864556026,0.38410212635993957,0.96,0.4897959183673469
|
| 57 |
+
55.0,0.3726333433999088,0.9850374064837906,0.8461636828644501,0.38482681959867476,0.97,0.49238578680203043
|
| 58 |
+
56.0,0.39072265782558413,0.9750623441396509,0.6811386768447838,0.3948486211895943,0.98,0.494949494949495
|
| 59 |
+
57.0,0.3779865834035184,0.9875311720698254,0.877751356624596,0.3847907677292824,0.97,0.49238578680203043
|
| 60 |
+
58.0,0.3711818195786559,0.9775561097256857,0.7295616335706256,0.3730782407522202,0.98,0.494949494949495
|
| 61 |
+
59.0,0.38221285928811816,0.9900249376558603,0.9065268065268066,0.39688980489969256,0.97,0.49238578680203043
|
results/CFE/Fold_1/log_IDH.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.774360790960212,0.3216957605985037,0.3181295323830957,0.759283975660801,0.38,0.3777599357687675
|
| 3 |
+
1.0,0.5070324366972631,0.9002493765586035,0.8288518992744345,0.5204398530721664,0.86,0.7254901960784313
|
| 4 |
+
2.0,0.5467675218261091,0.8453865336658354,0.8047159733567928,0.5677060103416443,0.83,0.7562724014336918
|
| 5 |
+
3.0,0.5767878344528693,0.8079800498753117,0.7443978112763967,0.5560908910632133,0.83,0.7562724014336918
|
| 6 |
+
4.0,0.5411360331455668,0.8329177057356608,0.7952475670073238,0.5729489552974701,0.76,0.69558599695586
|
| 7 |
+
5.0,0.5075724014171639,0.9027431421446384,0.8538096974115932,0.5023066827654838,0.9,0.8139880952380952
|
| 8 |
+
6.0,0.5207887984570719,0.9077306733167082,0.8771781690548919,0.5528659135103225,0.82,0.745906267645398
|
| 9 |
+
7.0,0.4958385941839575,0.8054862842892768,0.5544444444444444,0.4768120983242989,0.85,0.563826693806339
|
| 10 |
+
8.0,0.4966288262471891,0.8653366583541147,0.7457734573119188,0.5048765370249748,0.85,0.6009577015163607
|
| 11 |
+
9.0,0.5042269622298547,0.8478802992518704,0.7947644418341234,0.546210578083992,0.77,0.6702508960573477
|
| 12 |
+
10.0,0.4549636725624303,0.9251870324189526,0.8933888691953209,0.4866128864884376,0.85,0.7699033594109526
|
| 13 |
+
11.0,0.4674499330675215,0.9226932668329176,0.8847925413110165,0.4867661365866661,0.89,0.8176090200630077
|
| 14 |
+
12.0,0.5014399464736853,0.8703241895261845,0.8312289562289562,0.5455879545211793,0.77,0.6801557502433597
|
| 15 |
+
13.0,0.488348601316276,0.9351620947630924,0.904586719379164,0.4942557671666145,0.92,0.8644986449864498
|
| 16 |
+
14.0,0.4507802290809422,0.9326683291770572,0.9058562671188208,0.4898314723372459,0.84,0.7588908981314044
|
| 17 |
+
15.0,0.4791316373687135,0.912718204488778,0.8640032557824052,0.4864931190013885,0.89,0.8095238095238095
|
| 18 |
+
16.0,0.4619347954777411,0.8927680798004988,0.8107348663629879,0.4562468314170837,0.89,0.7485714285714287
|
| 19 |
+
17.0,0.4838928086056079,0.9052369077306732,0.8734385382059802,0.5233122757077218,0.8,0.7258771929824561
|
| 20 |
+
18.0,0.4599364556725185,0.8952618453865336,0.8561987704918033,0.490539116859436,0.86,0.7890295358649788
|
| 21 |
+
19.0,0.453146644289654,0.9201995012468828,0.8912099837221921,0.4976028335094452,0.84,0.7668997668997669
|
| 22 |
+
20.0,0.4267457221214313,0.9326683291770572,0.9029116636925312,0.4656105926632881,0.89,0.8248128682911291
|
| 23 |
+
21.0,0.5399847754516507,0.8129675810473815,0.7742879657773274,0.567012485563755,0.77,0.6973285958678774
|
| 24 |
+
22.0,0.4187845001345561,0.9201995012468828,0.8773606544842878,0.4557545307278633,0.91,0.8366902558519325
|
| 25 |
+
23.0,0.4577507582537254,0.8827930174563591,0.8515341289534838,0.5066827028989792,0.81,0.7432085416948236
|
| 26 |
+
24.0,0.5957699542182342,0.6957605985037406,0.6724382666452408,0.642875000834465,0.6,0.5604395604395604
|
| 27 |
+
25.0,0.4387317488615649,0.9226932668329176,0.8964057434769203,0.5156575298309326,0.79,0.7236478484011054
|
| 28 |
+
26.0,0.4163669359654262,0.9226932668329176,0.8748099136932637,0.4536317270994186,0.9,0.8139880952380952
|
| 29 |
+
27.0,0.4926665423814198,0.8703241895261845,0.8380552966759863,0.570348229110241,0.72,0.6600291403593979
|
| 30 |
+
28.0,0.4214866173980836,0.8977556109725686,0.8665124020622742,0.4725353208184242,0.81,0.7275985663082437
|
| 31 |
+
29.0,0.3766561765920491,0.9551122194513716,0.9333887043189368,0.4360155382752418,0.86,0.7395833333333333
|
| 32 |
+
30.0,0.4641527646497598,0.8753117206982544,0.8434083099031553,0.5246111115813256,0.77,0.7047875754075215
|
| 33 |
+
31.0,0.38477250799871143,0.9376558603491272,0.9147077090618274,0.4572216498851776,0.83,0.7635933806146572
|
| 34 |
+
32.0,0.41952597322012125,0.9301745635910225,0.9027306119620209,0.46324847370386124,0.85,0.7699033594109526
|
| 35 |
+
33.0,0.36926287821403464,0.942643391521197,0.9191992640939157,0.4364471706748009,0.83,0.7392238073324129
|
| 36 |
+
34.0,0.45761017453046215,0.8802992518703242,0.820848845867461,0.4736658868193626,0.89,0.8176090200630077
|
| 37 |
+
35.0,0.4152139090094483,0.9476309226932669,0.9273155700561899,0.4844359129667282,0.81,0.718560213301733
|
| 38 |
+
36.0,0.46360049409759313,0.8728179551122195,0.8416087734380446,0.5472428905963898,0.76,0.69558599695586
|
| 39 |
+
37.0,0.39300875547818115,0.9326683291770573,0.9072244453775031,0.4684702309966087,0.84,0.7588908981314044
|
| 40 |
+
38.0,0.4256324139319156,0.9376558603491272,0.9153043551725595,0.49669274389743806,0.82,0.745906267645398
|
| 41 |
+
39.0,0.38509780019893314,0.9526184538653366,0.9327400972836498,0.46079392075538633,0.83,0.7481854540068138
|
| 42 |
+
40.0,0.3800626492262481,0.970074812967581,0.9570203644158628,0.4547809284925461,0.86,0.7890295358649788
|
| 43 |
+
41.0,0.3707227069243529,0.9600997506234414,0.9392286125634615,0.43313287109136583,0.9,0.8139880952380952
|
| 44 |
+
42.0,0.3855842686353479,0.970074812967581,0.956676750216076,0.45821196377277373,0.82,0.7076023391812865
|
| 45 |
+
43.0,0.3675096148713271,0.9551122194513716,0.9310153681474118,0.42289233177900315,0.89,0.7900362664630655
|
| 46 |
+
44.0,0.37372679209471343,0.940149625935162,0.9166262388245894,0.45730680763721465,0.82,0.7377622377622377
|
| 47 |
+
45.0,0.4090123853629961,0.9201995012468828,0.8948127746081711,0.5175228562951087,0.76,0.69558599695586
|
| 48 |
+
46.0,0.38211992620827256,0.9600997506234414,0.9426938192211505,0.46370896011590956,0.82,0.7377622377622377
|
| 49 |
+
47.0,0.3999869739474204,0.9326683291770573,0.9097727443186079,0.47760122805833816,0.85,0.7849462365591398
|
| 50 |
+
48.0,0.4572505059087663,0.885286783042394,0.8551118512002012,0.5313990983366966,0.77,0.7047875754075215
|
| 51 |
+
49.0,0.37350174357320304,0.940149625935162,0.9166262388245894,0.44667663842439653,0.81,0.7432085416948236
|
| 52 |
+
50.0,0.37117178842165227,0.9301745635910225,0.8989124171708441,0.4468278726935387,0.82,0.7076023391812865
|
| 53 |
+
51.0,0.4180169440713012,0.9002493765586035,0.8701761201761202,0.4945090800523758,0.78,0.7066666666666668
|
| 54 |
+
52.0,0.37509799115081083,0.9526184538653366,0.9327400972836498,0.44683795392513276,0.84,0.7588908981314044
|
| 55 |
+
53.0,0.3993774449587463,0.9326683291770573,0.9072244453775031,0.46652628540992735,0.84,0.75
|
| 56 |
+
54.0,0.43608574602669314,0.885286783042394,0.8551118512002012,0.5281055396795273,0.75,0.6865203761755485
|
| 57 |
+
55.0,0.45333751798270644,0.8927680798004988,0.8633730834752982,0.5436171206831932,0.76,0.69558599695586
|
| 58 |
+
56.0,0.42283650653023375,0.9102244389027432,0.8808910891089108,0.516164598762989,0.79,0.707968293700459
|
| 59 |
+
57.0,0.3887749219921759,0.9226932668329177,0.8956999622435708,0.4627590599656105,0.81,0.735780837157558
|
| 60 |
+
58.0,0.4007178333929352,0.9551122194513716,0.9360333215171925,0.45108958303928376,0.88,0.8125
|
| 61 |
+
59.0,0.46810959706877237,0.8753117206982544,0.8442839391115253,0.5522894445061683,0.75,0.6865203761755485
|
results/CFE/Fold_1/log_LHG.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.8453010856510695,0.2693266832917705,0.2662419984387197,0.813938749730587,0.34,0.3397358943577431
|
| 3 |
+
1.0,0.5139798242552323,0.8927680798004988,0.8107348663629879,0.5474579074978828,0.81,0.670995670995671
|
| 4 |
+
2.0,0.6046761344941775,0.773067331670823,0.7338074917022286,0.6061482647061348,0.78,0.7428705002337541
|
| 5 |
+
3.0,0.5937451925360948,0.7755610972568578,0.6896284829721362,0.621451951265335,0.72,0.592074592074592
|
| 6 |
+
4.0,0.5474526278693183,0.8254364089775561,0.783196366782007,0.547833744585514,0.78,0.7380952380952381
|
| 7 |
+
5.0,0.5004644941659342,0.9077306733167082,0.8624943235002456,0.5260323819518089,0.85,0.751285027358647
|
| 8 |
+
6.0,0.4580240832302635,0.9201995012468828,0.8862814604750089,0.4716323971748352,0.9,0.8588368153585545
|
| 9 |
+
7.0,0.5180887712950718,0.8628428927680798,0.7208404531358774,0.5351522269845009,0.82,0.6021220159151194
|
| 10 |
+
8.0,0.5017346680312977,0.8628428927680798,0.7286440198334092,0.5301123896241188,0.82,0.6021220159151194
|
| 11 |
+
9.0,0.4852692102850821,0.8753117206982544,0.8236773603489518,0.4914894673228264,0.87,0.8243005811596162
|
| 12 |
+
10.0,0.4474541042511005,0.917705735660848,0.8822697306963461,0.4834220480918884,0.85,0.7849462365591398
|
| 13 |
+
11.0,0.4721318481123061,0.8927680798004988,0.8428525860104807,0.4990397849678993,0.83,0.7481854540068138
|
| 14 |
+
12.0,0.4672483838258539,0.9052369077306732,0.8698941256830601,0.4926060882210731,0.88,0.8355263157894737
|
| 15 |
+
13.0,0.4699411514839924,0.9351620947630924,0.9029597915115412,0.5053370347619057,0.89,0.837061176122056
|
| 16 |
+
14.0,0.4317681930606205,0.9301745635910224,0.8989124171708441,0.4624925035238266,0.9,0.8588368153585545
|
| 17 |
+
15.0,0.4279011502824816,0.9276807980049876,0.8862544871230572,0.4682495194673538,0.87,0.7929606625258798
|
| 18 |
+
16.0,0.4488323357634413,0.9152119700748128,0.8545241143832694,0.4751575335860252,0.86,0.7519489723600283
|
| 19 |
+
17.0,0.4561683141679835,0.912718204488778,0.8797353921560227,0.4853927305340766,0.88,0.8400000000000001
|
| 20 |
+
18.0,0.4149480752665503,0.9102244389027432,0.8700302506482281,0.4458651256561279,0.89,0.8422939068100359
|
| 21 |
+
19.0,0.4217520661633508,0.9052369077306732,0.8689542483660131,0.459401449561119,0.85,0.7972699013380187
|
| 22 |
+
20.0,0.4245392226816115,0.9251870324189526,0.894206416209371,0.4524422889947891,0.9,0.8666666666666667
|
| 23 |
+
21.0,0.4178508323178327,0.917705735660848,0.8840685093521399,0.4521109890937805,0.86,0.8023715415019763
|
| 24 |
+
22.0,0.4061529978255084,0.9376558603491272,0.9101033923078992,0.4487323465943336,0.88,0.8306041784302653
|
| 25 |
+
23.0,0.4411150173207471,0.8977556109725686,0.8620547887737551,0.4639467805624008,0.87,0.8243005811596162
|
| 26 |
+
24.0,0.5259912796597231,0.7855361596009975,0.7455283353010626,0.5300390869379044,0.79,0.7523292841136926
|
| 27 |
+
25.0,0.3984607144484199,0.9551122194513716,0.932232987832357,0.4356089150905609,0.89,0.837061176122056
|
| 28 |
+
26.0,0.4284204822823294,0.9650872817955112,0.943178137651822,0.4688879469037056,0.88,0.8050682261208577
|
| 29 |
+
27.0,0.4374655221317177,0.9052369077306732,0.8708118556701031,0.4891756215691566,0.83,0.7914366335418968
|
| 30 |
+
28.0,0.4589208957560342,0.8927680798004988,0.8563047409518572,0.4858020338416099,0.87,0.8331408034912078
|
| 31 |
+
29.0,0.4169971793518399,0.9551122194513716,0.9339446518778828,0.4516061297059059,0.9,0.84375
|
| 32 |
+
30.0,0.4799352265950153,0.8678304239401496,0.828517714645344,0.5193359720706939,0.81,0.771607164322635
|
| 33 |
+
31.0,0.45331992495089696,0.8977556109725686,0.8620547887737551,0.48902796298265455,0.83,0.7817995122577333
|
| 34 |
+
32.0,0.39783139790680044,0.9675810473815462,0.9494869235763219,0.43384918123483657,0.9,0.84375
|
| 35 |
+
33.0,0.4413593522925627,0.9476309226932669,0.9238779661016949,0.4776546737551689,0.91,0.8709677419354839
|
| 36 |
+
34.0,0.458608290649709,0.885286783042394,0.8425034153005464,0.47001522183418276,0.87,0.8136200716845878
|
| 37 |
+
35.0,0.417530370695038,0.9152119700748129,0.882748538011696,0.45236699223518373,0.88,0.8355263157894737
|
| 38 |
+
36.0,0.42879970234231163,0.9201995012468828,0.8888349850994525,0.46280076980590823,0.86,0.8224251648909182
|
| 39 |
+
37.0,0.4130090964108037,0.940149625935162,0.9035594035594035,0.44262087672948836,0.88,0.8125
|
| 40 |
+
38.0,0.39598595241358747,0.9102244389027432,0.8406200317965025,0.4253340473771095,0.89,0.8176090200630077
|
| 41 |
+
39.0,0.41350742357032855,0.972568578553616,0.9576504699636126,0.4462184277176857,0.92,0.8834498834498834
|
| 42 |
+
40.0,0.466885931176735,0.9077306733167082,0.8728631288506525,0.4892403906583786,0.87,0.8243005811596162
|
| 43 |
+
41.0,0.4466197140644911,0.9650872817955112,0.9458526234567901,0.4786617225408554,0.89,0.837061176122056
|
| 44 |
+
42.0,0.43987648735319884,0.9625935162094763,0.9437729605429204,0.4636361911892891,0.92,0.8794454490657022
|
| 45 |
+
43.0,0.5216865489756377,0.8802992518703242,0.8411881188118813,0.551993533372879,0.83,0.786833855799373
|
| 46 |
+
44.0,0.4303855212252039,0.972568578553616,0.9580324437467295,0.4636353051662445,0.92,0.8834498834498834
|
| 47 |
+
45.0,0.4081314376316166,0.9301745635910225,0.8839986775766593,0.43876184165477755,0.87,0.8005829114894922
|
| 48 |
+
46.0,0.408704349822237,0.9750623441396509,0.9616752045263399,0.4471883252263069,0.9,0.8588368153585545
|
| 49 |
+
47.0,0.4058439236626661,0.9102244389027432,0.8387255340066136,0.4287450286746025,0.9,0.8375568551007146
|
| 50 |
+
48.0,0.39061675122253914,0.9351620947630923,0.9061329588014981,0.4235780650377274,0.89,0.8470310109859547
|
| 51 |
+
49.0,0.4305094616520137,0.940149625935162,0.9133535004321521,0.46164932906627654,0.9,0.8588368153585545
|
| 52 |
+
50.0,0.4077519305477713,0.9850374064837906,0.9763542731346804,0.4461753132939339,0.9,0.84375
|
| 53 |
+
51.0,0.39328968859372887,0.9625935162094763,0.9427715142000856,0.4228401604294777,0.9,0.8493068113321278
|
| 54 |
+
52.0,0.39323129558801057,0.9600997506234414,0.9343967280163599,0.4291898575425148,0.9,0.84375
|
| 55 |
+
53.0,0.41022115919804036,0.9576059850374065,0.9313473720253381,0.4468307015299797,0.9,0.84375
|
| 56 |
+
54.0,0.38918013157244036,0.9775561097256857,0.9646996684175005,0.4285614271461964,0.9,0.8375568551007146
|
| 57 |
+
55.0,0.3866904870307356,0.9526184538653366,0.9216933718408584,0.4187583148479462,0.9,0.8493068113321278
|
| 58 |
+
56.0,0.38323527325567164,0.9276807980049875,0.8660515797597246,0.4205521324276924,0.87,0.774891774891775
|
| 59 |
+
57.0,0.39377656036481595,0.9625935162094763,0.9442544554730725,0.4257628720998764,0.94,0.9153020892151327
|
| 60 |
+
58.0,0.44512952905046077,0.9077306733167082,0.8728631288506525,0.48086806774139407,0.87,0.8289248585340177
|
| 61 |
+
59.0,0.36952572786005355,0.9675810473815462,0.9494869235763219,0.4003751990199089,0.92,0.875
|
results/CFE/Fold_1/log_mean.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.8165434062084552,0.2601828761429759,0.2529763206211321,0.7919724621375401,0.3233333333333333,0.3109649768169374
|
| 3 |
+
1.0,0.4961993403466463,0.8985868661679136,0.7485425081283115,0.5147483530640602,0.8566666666666668,0.623390025866806
|
| 4 |
+
2.0,0.5793671297809033,0.7813798836242727,0.6838430392568521,0.5968687244256338,0.75,0.6455476338891486
|
| 5 |
+
3.0,0.5658439893278596,0.8046550290939317,0.6573899752282825,0.5640743812918663,0.8066666666666666,0.6266261750132718
|
| 6 |
+
4.0,0.5560488866848045,0.8046550290939317,0.701581921999208,0.5768577878673872,0.7533333333333333,0.6282205424026536
|
| 7 |
+
5.0,0.4733447019298772,0.9093931837073982,0.7811286288296143,0.4848364787300427,0.8833333333333333,0.6796524443743527
|
| 8 |
+
6.0,0.4574600729908629,0.9243557772236076,0.8085357670328427,0.478161594470342,0.8833333333333333,0.6955361226593486
|
| 9 |
+
7.0,0.4663921981083782,0.8786367414796343,0.5890155404270697,0.463438787360986,0.8833333333333333,0.5536327348903178
|
| 10 |
+
8.0,0.4478024880983189,0.8969243557772236,0.6900340303262541,0.4617634815474351,0.8799999999999999,0.5651551680778368
|
| 11 |
+
9.0,0.4659647093598087,0.8827930174563591,0.7575045252733554,0.4985634301106135,0.82,0.6483669759221381
|
| 12 |
+
10.0,0.4268228697311055,0.9343308395677472,0.8005886086662977,0.4555900614460309,0.8866666666666667,0.6815485047791464
|
| 13 |
+
11.0,0.4298838490832377,0.9293433083956776,0.8195660372985362,0.448393801053365,0.8966666666666666,0.686060086957284
|
| 14 |
+
12.0,0.4350089968761997,0.9168744804655028,0.8149097400064779,0.4643131626645724,0.8733333333333334,0.6693559509449546
|
| 15 |
+
13.0,0.4262120282758996,0.948462177888612,0.8579545090692404,0.4458650636176268,0.93,0.7321697720193336
|
| 16 |
+
14.0,0.4035772590441993,0.9492934330839568,0.8919708810528532,0.4316629908482234,0.8999999999999999,0.7025078772857687
|
| 17 |
+
15.0,0.4099440679065604,0.9376558603491272,0.7922008373570234,0.4272948744893074,0.91,0.6982900862839067
|
| 18 |
+
16.0,0.434453288342491,0.9268495428096428,0.7782410665182665,0.4427705836296081,0.9066666666666666,0.6643020625778292
|
| 19 |
+
17.0,0.4284961246022163,0.9310058187863676,0.8514743130284129,0.4581346545616786,0.8766666666666666,0.6843522267206478
|
| 20 |
+
18.0,0.4184435131097969,0.9260182876142976,0.8431529042972756,0.450593158652385,0.8866666666666667,0.7025877444169769
|
| 21 |
+
19.0,0.4098825328987237,0.9351620947630922,0.8627853924155771,0.4448215991258621,0.8833333333333333,0.6846551955350441
|
| 22 |
+
20.0,0.3982527062408347,0.945137157107232,0.8515096160673209,0.4246218953529994,0.9233333333333332,0.7288096766357636
|
| 23 |
+
21.0,0.4234243987975077,0.9035743973399836,0.8103440706969728,0.445534679343303,0.87,0.6648832107731163
|
| 24 |
+
22.0,0.388245971930691,0.9476309226932668,0.8778759098855456,0.4207433478037516,0.92,0.719893407028076
|
| 25 |
+
23.0,0.4106954550455732,0.9210307564422276,0.8416361347276139,0.4389165362715721,0.8866666666666667,0.6874862059346448
|
| 26 |
+
24.0,0.4766438070650609,0.8187863674147963,0.6997017595970291,0.494659611582756,0.7866666666666666,0.6017182104517612
|
| 27 |
+
25.0,0.3932319117999532,0.9567747298420616,0.9222360764595916,0.4375554946064948,0.88,0.6835016476301695
|
| 28 |
+
26.0,0.3978876039844102,0.9551122194513716,0.8491832283052371,0.4272061477104823,0.92,0.7046686054361494
|
| 29 |
+
27.0,0.4288694849880358,0.9060681629260184,0.7996410911982904,0.4884140754739444,0.82,0.6426351881590703
|
| 30 |
+
28.0,0.4052142749353933,0.9268495428096424,0.8829348640857981,0.439701277812322,0.8733333333333334,0.6817584840912261
|
| 31 |
+
29.0,0.3853188271162813,0.9650872817955112,0.9044990130204232,0.4229121206700801,0.9133333333333332,0.6927609427609428
|
| 32 |
+
30.0,0.4257985317424646,0.9085619285120532,0.8335926412743113,0.4657101720571518,0.85,0.656260175510729
|
| 33 |
+
31.0,0.397800083977425,0.940980881130507,0.8882858676809757,0.4431254174311956,0.87,0.6775241266839592
|
| 34 |
+
32.0,0.3916481296072775,0.9625935162094764,0.9195814473550499,0.4249973490834236,0.9033333333333333,0.7011497592594331
|
| 35 |
+
33.0,0.38794011877213336,0.9625935162094764,0.9408112431840366,0.4322850533326467,0.9,0.6999958225450813
|
| 36 |
+
34.0,0.42241425308107045,0.9110556940980882,0.7183713282896317,0.43001442412535357,0.9133333333333334,0.7087261955656968
|
| 37 |
+
35.0,0.41407548843674724,0.9351620947630922,0.8533659953869853,0.4620441275835037,0.86,0.674995333330226
|
| 38 |
+
36.0,0.41401974239997436,0.9251870324189526,0.8472544149976998,0.4592557386557261,0.8633333333333333,0.6701323162162695
|
| 39 |
+
37.0,0.39536550024203826,0.9534497090606816,0.9071142665777258,0.44155792762835816,0.8866666666666666,0.6853089935352105
|
| 40 |
+
38.0,0.3974270544890454,0.9476309226932669,0.9053913962379031,0.43819165011247,0.89,0.6844370686919176
|
| 41 |
+
39.0,0.3907080779993228,0.9742310889443059,0.9565823555345873,0.4348011088371277,0.9033333333333333,0.707143751941348
|
| 42 |
+
40.0,0.4030665181521466,0.9551122194513715,0.9025449499637038,0.4403430271148682,0.9,0.7019053012755418
|
| 43 |
+
41.0,0.3930316127322658,0.9709060681629259,0.9209441975482825,0.42833105971415836,0.92,0.7144783527207271
|
| 44 |
+
42.0,0.3983057634045655,0.9742310889443058,0.9381818944460866,0.4360680689414342,0.9033333333333333,0.6931445250163396
|
| 45 |
+
43.0,0.41761997874736384,0.941812136325852,0.8929100978286999,0.4519773821036021,0.8966666666666666,0.6897519696881563
|
| 46 |
+
44.0,0.39580917306374436,0.9667497921862012,0.9238137264512719,0.44117929269870126,0.8999999999999999,0.7036693465264893
|
| 47 |
+
45.0,0.39950937983995655,0.9467996674979218,0.8951127529038789,0.45189573059479393,0.86,0.6611161318749464
|
| 48 |
+
46.0,0.38751515547929954,0.9767248545303407,0.9538056700123739,0.43306349515914916,0.8933333333333332,0.6954649904960464
|
| 49 |
+
47.0,0.3909083509930748,0.9426433915211971,0.8648873203965572,0.42724628011385607,0.91,0.7058175288697832
|
| 50 |
+
48.0,0.4052026005506714,0.9393183707398172,0.9135337697860662,0.451203806300958,0.87,0.679666024524321
|
| 51 |
+
49.0,0.3908801473807218,0.9584372402327513,0.929009241848791,0.4326422516504924,0.89,0.6972804251402417
|
| 52 |
+
50.0,0.38514875071254845,0.970074812967581,0.9441048921983853,0.4292580043276151,0.8933333333333332,0.680382752516211
|
| 53 |
+
51.0,0.396665783074134,0.9484621778886119,0.8747557069439361,0.4362150096893311,0.8866666666666667,0.6836409909827633
|
| 54 |
+
52.0,0.38210932681289006,0.9650872817955113,0.8928187705852041,0.4197339605291684,0.9066666666666666,0.6991967976936332
|
| 55 |
+
53.0,0.39199772887148665,0.9609310058187863,0.9238096268424161,0.4306213530898095,0.8999999999999999,0.694515306122449
|
| 56 |
+
54.0,0.39883080683493755,0.9484621778886119,0.8770436686911015,0.44692303106188774,0.87,0.6712910498812033
|
| 57 |
+
55.0,0.40422044947111696,0.9434746467165419,0.8770767127268689,0.44906741837660474,0.8766666666666666,0.6790928650300061
|
| 58 |
+
56.0,0.3989314792038298,0.9376558603491271,0.8093604485711398,0.44385511746009193,0.88,0.6592698545139096
|
| 59 |
+
57.0,0.3868460219201701,0.9576059850374065,0.9059019247804132,0.4244375665982565,0.9066666666666666,0.7144895710582405
|
| 60 |
+
58.0,0.4056763940073506,0.9467996674979218,0.8461526946461569,0.43501196384429935,0.91,0.7121247844945042
|
| 61 |
+
59.0,0.40661606140564804,0.9443059019118869,0.9000992230715513,0.44985148280858994,0.88,0.684635387659193
|
results/CFE/Fold_2/log_1p19q.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.4910355293542667,0.8728179551122195,0.4848225306698239,0.49009001642465594,0.9,0.47368421052631576
|
| 3 |
+
1.0,0.4119401999245261,0.9600997506234414,0.589769820971867,0.41082524985075,0.95,0.48717948717948717
|
| 4 |
+
2.0,0.5537298646502364,0.6783042394014963,0.47904770536874225,0.5398321107029915,0.71,0.47377971330067137
|
| 5 |
+
3.0,0.47169521986100443,0.9077306733167082,0.6262437967604605,0.47234929621219635,0.93,0.5927865037812682
|
| 6 |
+
4.0,0.4943325820557792,0.7830423940149626,0.5451558649822037,0.5002966329455376,0.75,0.4958661020367009
|
| 7 |
+
5.0,0.43407119041369147,0.972568578553616,0.7035020501445184,0.43335694789886475,0.97,0.49238578680203043
|
| 8 |
+
6.0,0.3325523387761485,0.9750623441396509,0.6365119651921682,0.33450694918632506,0.97,0.49238578680203043
|
| 9 |
+
7.0,0.41113481349184033,0.9451371571072319,0.6961284100303113,0.4165606653690338,0.95,0.7091332169866201
|
| 10 |
+
8.0,0.32527793865845983,0.972568578553616,0.7035020501445184,0.34198916882276537,0.97,0.49238578680203043
|
| 11 |
+
9.0,0.3279852143992807,0.972568578553616,0.5699522277469046,0.3336261934041977,0.97,0.49238578680203043
|
| 12 |
+
10.0,0.32282162433550543,0.9750623441396509,0.6365119651921682,0.3325134129822254,0.97,0.49238578680203043
|
| 13 |
+
11.0,0.38266091639561545,0.972568578553616,0.7729214929214929,0.38813416570425036,0.97,0.49238578680203043
|
| 14 |
+
12.0,0.33251878039497984,0.970074812967581,0.49240506329113926,0.34363681480288505,0.97,0.49238578680203043
|
| 15 |
+
13.0,0.5314009663024151,0.7880299251870324,0.5487641817917047,0.5349719554185868,0.78,0.5137046861184793
|
| 16 |
+
14.0,0.3538746426527637,0.970074812967581,0.49240506329113926,0.35373298421502114,0.97,0.49238578680203043
|
| 17 |
+
15.0,0.32979780989246177,0.9800498753117207,0.744910941475827,0.34452572658658026,0.97,0.49238578680203043
|
| 18 |
+
16.0,0.3676290402091352,0.9775561097256857,0.69428208386277,0.38141518741846087,0.97,0.49238578680203043
|
| 19 |
+
17.0,0.36590200253852884,0.9750623441396509,0.6365119651921682,0.36716148018836975,0.97,0.49238578680203043
|
| 20 |
+
18.0,0.3579489069983846,0.970074812967581,0.49240506329113926,0.3630705536901951,0.97,0.49238578680203043
|
| 21 |
+
19.0,0.3923944431796038,0.9825436408977556,0.874782531114779,0.40612262427806856,0.94,0.609375
|
| 22 |
+
20.0,0.3639059153726868,0.9800498753117207,0.813053613053613,0.37581113547086714,0.97,0.49238578680203043
|
| 23 |
+
21.0,0.3524991021935185,0.9775561097256857,0.69428208386277,0.3587559542059898,0.97,0.49238578680203043
|
| 24 |
+
22.0,0.3639668310223672,0.9775561097256857,0.69428208386277,0.372560887336731,0.97,0.49238578680203043
|
| 25 |
+
23.0,0.3718791118732414,0.9775561097256857,0.69428208386277,0.37275978565216067,0.97,0.49238578680203043
|
| 26 |
+
24.0,0.34999510274266366,0.9825436408977556,0.7896590483327088,0.36538475096225737,0.97,0.49238578680203043
|
| 27 |
+
25.0,0.345292155433474,0.9750623441396509,0.6365119651921682,0.36018376529216767,0.97,0.49238578680203043
|
| 28 |
+
26.0,0.35830837198326415,0.9800498753117207,0.744910941475827,0.36942687287926673,0.97,0.49238578680203043
|
| 29 |
+
27.0,0.3588918867402541,0.9850374064837906,0.8295068027210883,0.3727010270953178,0.97,0.49238578680203043
|
| 30 |
+
28.0,0.3366790912915346,0.9775561097256857,0.69428208386277,0.34771061047911644,0.97,0.49238578680203043
|
| 31 |
+
29.0,0.34556939242932566,0.9875311720698254,0.8652282046111447,0.36597629234194756,0.97,0.49238578680203043
|
| 32 |
+
30.0,0.35174269911059713,0.9775561097256857,0.69428208386277,0.3607086391746998,0.97,0.49238578680203043
|
| 33 |
+
31.0,0.3371696753097591,0.9750623441396509,0.6365119651921682,0.3431284752488136,0.97,0.49238578680203043
|
| 34 |
+
32.0,0.34874646488270555,0.9825436408977556,0.7896590483327088,0.36233110368251803,0.97,0.49238578680203043
|
| 35 |
+
33.0,0.3452013620265999,0.9850374064837906,0.8295068027210883,0.36885028451681134,0.97,0.49238578680203043
|
| 36 |
+
34.0,0.358807885215764,0.9825436408977556,0.7896590483327088,0.3758854579925537,0.96,0.4897959183673469
|
| 37 |
+
35.0,0.3654788473151866,0.9775561097256857,0.7574107683000605,0.3734254178404808,0.96,0.4897959183673469
|
| 38 |
+
36.0,0.3535867901588616,0.9825436408977556,0.8113194864556026,0.37301691859960556,0.96,0.4897959183673469
|
| 39 |
+
37.0,0.3545982897876207,0.9775561097256857,0.69428208386277,0.36908056765794756,0.97,0.49238578680203043
|
| 40 |
+
38.0,0.36859764132713735,0.9900249376558603,0.8974424552429667,0.385208985209465,0.97,0.49238578680203043
|
| 41 |
+
39.0,0.36122453799866083,0.9875311720698254,0.877751356624596,0.37652040392160413,0.97,0.49238578680203043
|
| 42 |
+
40.0,0.3688759376060338,0.9825436408977556,0.7896590483327088,0.38098053574562074,0.97,0.49238578680203043
|
| 43 |
+
41.0,0.368039557687065,0.9850374064837906,0.8807494052339413,0.3858072623610497,0.96,0.4897959183673469
|
| 44 |
+
42.0,0.36903063781986806,0.9825436408977556,0.8288518992744345,0.3857991024851799,0.96,0.4897959183673469
|
| 45 |
+
43.0,0.33937198651996336,0.9900249376558603,0.8974424552429667,0.36020388126373293,0.97,0.49238578680203043
|
| 46 |
+
44.0,0.35776819723502656,0.9825436408977556,0.7896590483327088,0.3702958071231842,0.97,0.49238578680203043
|
| 47 |
+
45.0,0.370570158423331,0.9775561097256857,0.69428208386277,0.38090890675783157,0.97,0.49238578680203043
|
| 48 |
+
46.0,0.3657945814424025,0.9825436408977556,0.7896590483327088,0.3804925385117531,0.97,0.49238578680203043
|
| 49 |
+
47.0,0.3650398848954579,0.9825436408977556,0.7896590483327088,0.3772184520959854,0.97,0.49238578680203043
|
| 50 |
+
48.0,0.35585282271045104,0.9800498753117207,0.744910941475827,0.36547036081552503,0.97,0.49238578680203043
|
| 51 |
+
49.0,0.3641164485653142,0.9825436408977556,0.8113194864556026,0.38392075419425964,0.96,0.4897959183673469
|
| 52 |
+
50.0,0.34506121798049183,0.9925187032418953,0.9266508139747576,0.3713074657320976,0.96,0.4897959183673469
|
| 53 |
+
51.0,0.35643095863133,0.9825436408977556,0.7896590483327088,0.3703010691702366,0.97,0.49238578680203043
|
| 54 |
+
52.0,0.3603647201138542,0.9850374064837906,0.8295068027210883,0.37763297885656355,0.97,0.49238578680203043
|
| 55 |
+
53.0,0.35360663452945146,0.9950124688279302,0.9532634032634033,0.37904503583908083,0.97,0.49238578680203043
|
| 56 |
+
54.0,0.3628251066528948,0.9900249376558603,0.8974424552429667,0.38066451624035835,0.97,0.49238578680203043
|
| 57 |
+
55.0,0.3670033176343637,0.9800498753117207,0.744910941475827,0.37911288797855375,0.97,0.49238578680203043
|
| 58 |
+
56.0,0.36719092801027464,0.9950124688279302,0.9532634032634033,0.38856987476348875,0.97,0.49238578680203043
|
| 59 |
+
57.0,0.36499616199003493,0.9850374064837906,0.8295068027210883,0.3807366505265236,0.97,0.49238578680203043
|
| 60 |
+
58.0,0.36014994614736695,0.9950124688279302,0.9532634032634033,0.3783276927471161,0.97,0.49238578680203043
|
| 61 |
+
59.0,0.370092835732529,0.9925187032418953,0.9266508139747576,0.39036240249872206,0.97,0.49238578680203043
|
results/CFE/Fold_2/log_IDH.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.5580712324960571,0.8678304239401496,0.7995850818048942,0.5828781124949455,0.8,0.6875
|
| 3 |
+
1.0,0.5570402574955376,0.8703241895261845,0.7613095238095238,0.5784290236234665,0.81,0.6168582375478927
|
| 4 |
+
2.0,0.6145884696384916,0.7331670822942643,0.7007400071141118,0.643984027504921,0.67,0.6349153667441089
|
| 5 |
+
3.0,0.5915027294967538,0.7905236907730673,0.7452813067150635,0.6200765946507454,0.73,0.6815662224318906
|
| 6 |
+
4.0,0.558166329625836,0.8379052369077307,0.7992297323319854,0.5896344876289368,0.77,0.7178260336155073
|
| 7 |
+
5.0,0.49445934983857553,0.8902743142144638,0.8004975124378109,0.5181972223520279,0.85,0.6975196612220206
|
| 8 |
+
6.0,0.5430300127241082,0.8952618453865336,0.8518889826931195,0.57589813798666,0.82,0.745906267645398
|
| 9 |
+
7.0,0.4934538558980176,0.9276807980049875,0.8973401484855708,0.5262762817740441,0.85,0.7849462365591398
|
| 10 |
+
8.0,0.5885864772701501,0.7805486284289277,0.7408190845525588,0.6236871162056923,0.69,0.6521153630344518
|
| 11 |
+
9.0,0.5821104656877066,0.8179551122194514,0.7792000120684583,0.6082513776421546,0.73,0.6754417598269022
|
| 12 |
+
10.0,0.5522978937536701,0.8104738154613467,0.7707054291561334,0.5706706580519676,0.79,0.7423629002576371
|
| 13 |
+
11.0,0.5979277606765528,0.7381546134663342,0.7052399453953586,0.6188887134194374,0.74,0.6961196820944366
|
| 14 |
+
12.0,0.5248903995588831,0.8728179551122195,0.8349887442813687,0.5488225245475769,0.83,0.7702392215164211
|
| 15 |
+
13.0,0.48160850637571473,0.8952618453865336,0.861039603960396,0.5131482672691345,0.85,0.7914059240717564
|
| 16 |
+
14.0,0.507388909930303,0.9177057356608479,0.8857816100882985,0.5503167927265167,0.81,0.7432085416948236
|
| 17 |
+
15.0,0.5753398906263033,0.7880299251870324,0.7524637428556904,0.6185070869326591,0.7,0.6657754010695187
|
| 18 |
+
16.0,0.4403901519323525,0.8952618453865336,0.861039603960396,0.48801772445440295,0.82,0.76
|
| 19 |
+
17.0,0.4802245033203515,0.9052369077306733,0.8689542483660131,0.514442655146122,0.86,0.8023715415019763
|
| 20 |
+
18.0,0.5190441594308154,0.8877805486284289,0.8525554602279691,0.5622888094186783,0.82,0.76
|
| 21 |
+
19.0,0.4696601865594821,0.912718204488778,0.8814260972415833,0.5258077853918075,0.83,0.7702392215164211
|
| 22 |
+
20.0,0.45739736900365263,0.9625935162094763,0.9456271186440678,0.5087005153298378,0.88,0.8050682261208577
|
| 23 |
+
21.0,0.5950087500629282,0.743142144638404,0.7119272965677899,0.6504305559396744,0.66,0.6263736263736264
|
| 24 |
+
22.0,0.46996630895464797,0.9002493765586035,0.8667774086378738,0.5340104362368584,0.8,0.7401247401247402
|
| 25 |
+
23.0,0.4344575845838485,0.9376558603491272,0.9028594684160037,0.48149978727102277,0.9,0.8306233062330624
|
| 26 |
+
24.0,0.6041459426320996,0.7082294264339152,0.6805694560754917,0.6782092291116715,0.64,0.6138996138996139
|
| 27 |
+
25.0,0.6972317676294474,0.5361596009975063,0.5291287878787879,0.7607322019338608,0.48,0.47665056360708535
|
| 28 |
+
26.0,0.44993265236999624,0.9152119700748129,0.8852125008419209,0.49349659085273745,0.87,0.8074359354169753
|
| 29 |
+
27.0,0.41643184430878655,0.9077306733167082,0.8763552422143887,0.47537985593080523,0.85,0.7914059240717564
|
| 30 |
+
28.0,0.5252159236375233,0.8129675810473815,0.7775534204628665,0.5858285263180733,0.73,0.6815662224318906
|
| 31 |
+
29.0,0.5363182409148561,0.8079800498753117,0.7716215116752095,0.5983594763278961,0.74,0.6904761904761905
|
| 32 |
+
30.0,0.46228019822565397,0.8902743142144638,0.8562911318172932,0.5184873127937317,0.81,0.7432085416948236
|
| 33 |
+
31.0,0.4858913253667646,0.8753117206982544,0.8397025903421811,0.5416101658344269,0.79,0.7366771159874608
|
| 34 |
+
32.0,0.39154537449453836,0.942643391521197,0.9145234983920445,0.4394458121061325,0.9,0.8228206945428774
|
| 35 |
+
33.0,0.47104336882469955,0.8503740648379052,0.8131407269338304,0.5488832208514214,0.75,0.6994831109508355
|
| 36 |
+
34.0,0.41138577059914644,0.9251870324189526,0.894206416209371,0.4565785196423531,0.85,0.7849462365591398
|
| 37 |
+
35.0,0.40332242980264965,0.9476309226932669,0.9198801198801199,0.42989881306886674,0.93,0.8787878787878788
|
| 38 |
+
36.0,0.4255654857937535,0.942643391521197,0.9179455698792716,0.473213292658329,0.87,0.8136200716845878
|
| 39 |
+
37.0,0.4548742736961479,0.8653366583541147,0.8268787975695555,0.4996159839630127,0.8,0.7401247401247402
|
| 40 |
+
38.0,0.3708592724621742,0.9501246882793017,0.92779458369346,0.43124533742666243,0.91,0.8566650740563784
|
| 41 |
+
39.0,0.3962004351942914,0.9501246882793017,0.9211809104489347,0.4236396726965904,0.93,0.8729813101070586
|
| 42 |
+
40.0,0.3888738786341841,0.9675810473815462,0.9494869235763219,0.4507027590274811,0.9,0.803921568627451
|
| 43 |
+
41.0,0.46468475193454145,0.9152119700748129,0.8867607973421927,0.5163995781540871,0.83,0.7702392215164211
|
| 44 |
+
42.0,0.4052602954190271,0.9152119700748129,0.884410607704829,0.45634560972452165,0.83,0.7635933806146572
|
| 45 |
+
43.0,0.4482597937607706,0.8778054862842892,0.8424310951796699,0.5046142441034317,0.81,0.7432085416948236
|
| 46 |
+
44.0,0.4038323134258204,0.940149625935162,0.9140407288317256,0.45256340622901914,0.88,0.8251748251748252
|
| 47 |
+
45.0,0.4018192147078954,0.9276807980049875,0.9003521820721331,0.4598580530285835,0.84,0.7866666666666666
|
| 48 |
+
46.0,0.4354340298068791,0.9002493765586035,0.8685159682602138,0.5124172362685203,0.81,0.756128866640996
|
| 49 |
+
47.0,0.37772243453231535,0.9301745635910225,0.8906931464174455,0.40659871488809585,0.91,0.8282114907425081
|
| 50 |
+
48.0,0.44397851044400377,0.9152119700748129,0.8867607973421927,0.5145842242240906,0.81,0.7499671009343334
|
| 51 |
+
49.0,0.3976964133784658,0.9576059850374065,0.9378719526087946,0.45862891733646394,0.87,0.8136200716845878
|
| 52 |
+
50.0,0.43847388475018545,0.9201995012468828,0.8919647066747491,0.5121151176095009,0.79,0.7304582210242587
|
| 53 |
+
51.0,0.4360307939629305,0.9326683291770573,0.9065485900722442,0.4974637344479561,0.87,0.8136200716845878
|
| 54 |
+
52.0,0.4281559890493788,0.9251870324189526,0.8987169125075773,0.5031501063704491,0.82,0.76
|
| 55 |
+
53.0,0.37072960564174556,0.9551122194513716,0.9339446518778827,0.42890205055475233,0.9,0.84375
|
| 56 |
+
54.0,0.3884665498561098,0.9526184538653366,0.9305627705627706,0.4432102125883102,0.88,0.8125
|
| 57 |
+
55.0,0.41599154123047044,0.9351620947630923,0.9083122273814549,0.46204029232263566,0.88,0.8251748251748252
|
| 58 |
+
56.0,0.34959630118195256,0.9675810473815462,0.9524903167008429,0.41807606279850007,0.9,0.8375568551007146
|
| 59 |
+
57.0,0.4291132739059943,0.9276807980049875,0.9003521820721331,0.4971772488951683,0.82,0.7532894736842105
|
| 60 |
+
58.0,0.4062251314855276,0.9251870324189526,0.8980093597395551,0.4865227535367012,0.8,0.7401247401247402
|
| 61 |
+
59.0,0.37170618824530716,0.9326683291770573,0.9065485900722442,0.4421162921190262,0.86,0.8023715415019763
|
results/CFE/Fold_2/log_LHG.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.5761961407792241,0.8329177057356608,0.7179761717314859,0.5770780730247498,0.84,0.6677740863787375
|
| 3 |
+
1.0,0.6029392440717416,0.8229426433915212,0.6978787525069772,0.6104560816287994,0.82,0.6470588235294118
|
| 4 |
+
2.0,0.5711454454800138,0.7955112219451371,0.7595923261390887,0.5823036035895348,0.79,0.7304582210242587
|
| 5 |
+
3.0,0.6158192333883775,0.7406483790523691,0.6862284820031299,0.6459909802675248,0.68,0.6114618746964546
|
| 6 |
+
4.0,0.4912854967420535,0.8703241895261845,0.8342869858223663,0.5196832072734833,0.83,0.7702392215164211
|
| 7 |
+
5.0,0.4944395288416275,0.8453865336658354,0.6782867494824016,0.48758003771305086,0.87,0.6219831346321605
|
| 8 |
+
6.0,0.5747647625103853,0.8329177057356608,0.7697791792701005,0.6012255108356476,0.83,0.7392238073324129
|
| 9 |
+
7.0,0.4514485385055257,0.9226932668329177,0.8885282064617951,0.4727078023552895,0.89,0.8248128682911291
|
| 10 |
+
8.0,0.5511254090026132,0.8229426433915212,0.7841487175988051,0.5767704638838768,0.78,0.7141372141372141
|
| 11 |
+
9.0,0.5377781314594192,0.8603491271820449,0.7961806564042986,0.5573061063885689,0.84,0.7588908981314044
|
| 12 |
+
10.0,0.5818374678678346,0.7680798004987531,0.7214965833986782,0.6092667457461357,0.77,0.6973285958678774
|
| 13 |
+
11.0,0.514863433980585,0.8129675810473815,0.7764887742740995,0.5333067399263381,0.81,0.7499671009343334
|
| 14 |
+
12.0,0.44390930989733957,0.9301745635910225,0.8980903282021493,0.45021107941865923,0.91,0.8507710164151883
|
| 15 |
+
13.0,0.49344561596463743,0.8977556109725686,0.8656616415410385,0.5033121559023858,0.89,0.837061176122056
|
| 16 |
+
14.0,0.42208032551549024,0.9201995012468828,0.8701214574898786,0.42881094068288805,0.91,0.8185117967332123
|
| 17 |
+
15.0,0.45010911117765373,0.8952618453865336,0.8619417666732245,0.4684661781787872,0.9,0.8493068113321278
|
| 18 |
+
16.0,0.4553734951483044,0.9027431421446384,0.8696717417935449,0.47112855821847915,0.91,0.8619420156465716
|
| 19 |
+
17.0,0.40995788247210724,0.9301745635910225,0.8863562753036437,0.42258209973573685,0.9,0.7789566755083996
|
| 20 |
+
18.0,0.4109658934826268,0.9576059850374065,0.9345507263074013,0.41942346453666685,0.92,0.8338870431893688
|
| 21 |
+
19.0,0.4221758360131423,0.9451371571072319,0.9230030721966206,0.44421390801668165,0.9,0.8493068113321278
|
| 22 |
+
20.0,0.39406080428798895,0.972568578553616,0.9591199340135865,0.40101656794548035,0.94,0.8883928571428572
|
| 23 |
+
21.0,0.42901474824570063,0.942643391521197,0.9179455698792716,0.44721404910087587,0.91,0.8507710164151883
|
| 24 |
+
22.0,0.39955855382053634,0.9625935162094763,0.9427715142000856,0.41605358392000197,0.92,0.8582565556343018
|
| 25 |
+
23.0,0.44323010456532314,0.9276807980049875,0.8840404846188363,0.44837228059768675,0.91,0.8185117967332123
|
| 26 |
+
24.0,0.46720875639867904,0.8877805486284289,0.8552938629201049,0.49899789482355117,0.86,0.8023715415019763
|
| 27 |
+
25.0,0.46895118834371874,0.8877805486284289,0.854401833189443,0.5039520791172981,0.81,0.7432085416948236
|
| 28 |
+
26.0,0.40797287426387285,0.9526184538653366,0.9327400972836498,0.42856724202632906,0.92,0.8700454840805718
|
| 29 |
+
27.0,0.42900435474150794,0.942643391521197,0.9191992640939157,0.4456417939066887,0.93,0.8885172798216276
|
| 30 |
+
28.0,0.4996070673043591,0.8603491271820449,0.8246173070915339,0.5312617626786232,0.86,0.7890295358649788
|
| 31 |
+
29.0,0.4296201005986801,0.9351620947630923,0.9096784253933051,0.44325593948364256,0.89,0.8248128682911291
|
| 32 |
+
30.0,0.412379178025776,0.9451371571072319,0.9218185040765685,0.42157370716333387,0.92,0.8700454840805718
|
| 33 |
+
31.0,0.5608493665655949,0.7755610972568578,0.7373209502736695,0.585021635890007,0.75,0.6791169297907842
|
| 34 |
+
32.0,0.4622302193594098,0.9326683291770573,0.9072244453775031,0.5045835962891578,0.86,0.78125
|
| 35 |
+
33.0,0.5095574204761191,0.827930174563591,0.7923449285151413,0.5431754097342492,0.79,0.7304582210242587
|
| 36 |
+
34.0,0.4765529987074788,0.8927680798004988,0.8608728628254678,0.5218015745282173,0.85,0.7849462365591398
|
| 37 |
+
35.0,0.5088504516424384,0.8703241895261845,0.8362133970089229,0.5442607423663139,0.82,0.7532894736842105
|
| 38 |
+
36.0,0.5209745373809129,0.8179551122194514,0.7813897912699301,0.5637026271224022,0.78,0.7066666666666668
|
| 39 |
+
37.0,0.6164616582696872,0.7007481296758105,0.6729022785360814,0.6458828991651535,0.66,0.609375
|
| 40 |
+
38.0,0.4913178249041636,0.8703241895261845,0.8332906939558682,0.5183208417892456,0.86,0.78125
|
| 41 |
+
39.0,0.6440651775000993,0.5910224438902744,0.5761973501056865,0.6751921266317368,0.53,0.4986666666666667
|
| 42 |
+
40.0,0.4174904159625569,0.9576059850374065,0.9362760219486432,0.4266278606653213,0.91,0.8366902558519325
|
| 43 |
+
41.0,0.454961621181626,0.9152119700748129,0.882748538011696,0.4792024692893028,0.85,0.7699033594109526
|
| 44 |
+
42.0,0.4612821915797759,0.8952618453865336,0.8582036775106082,0.48573298066854476,0.87,0.8005829114894922
|
| 45 |
+
43.0,0.6262063827003327,0.6708229426433915,0.6435075431034483,0.6547439265251159,0.63,0.5783475783475784
|
| 46 |
+
44.0,0.5386206106354768,0.7955112219451371,0.7500608087564609,0.5561494135856628,0.8,0.717673630717109
|
| 47 |
+
45.0,0.44418803228999015,0.9351620947630923,0.9003555317684838,0.4461144381761551,0.94,0.8883928571428572
|
| 48 |
+
46.0,0.443618805182545,0.9152119700748129,0.8791740517546969,0.45573140799999234,0.9,0.8306233062330624
|
| 49 |
+
47.0,0.5189660283692757,0.8503740648379052,0.8087926759488842,0.5301816260814667,0.85,0.7611084567606308
|
| 50 |
+
48.0,0.557715029639199,0.770573566084788,0.7338239538239538,0.582466279566288,0.74,0.6702181633688482
|
| 51 |
+
49.0,0.473625797583278,0.8753117206982544,0.8275713794289645,0.4862869176268578,0.85,0.7699033594109526
|
| 52 |
+
50.0,0.5444542084846116,0.7755610972568578,0.731137135705346,0.5536516067385674,0.77,0.6891471820516286
|
| 53 |
+
51.0,0.5102060468416856,0.8354114713216958,0.7998638838475499,0.5243110412359238,0.84,0.7741389045736872
|
| 54 |
+
52.0,0.4870332811687355,0.85785536159601,0.8199456457520974,0.5060198619961739,0.85,0.7778106947118946
|
| 55 |
+
53.0,0.5531414232943718,0.773067331670823,0.7394709599114697,0.5910123756527901,0.75,0.6865203761755485
|
| 56 |
+
54.0,0.4591512593842504,0.9077306733167082,0.8763552422143887,0.4856483274698257,0.86,0.796037296037296
|
| 57 |
+
55.0,0.4656119681801879,0.912718204488778,0.8770423584037847,0.4734548717737198,0.88,0.7967479674796748
|
| 58 |
+
56.0,0.5138417132328871,0.8354114713216958,0.7909082290481608,0.5425255852937698,0.79,0.707968293700459
|
| 59 |
+
57.0,0.4706000750350239,0.9027431421446384,0.8550615842299886,0.48184174954891207,0.87,0.7844470237108274
|
| 60 |
+
58.0,0.4876283048245675,0.8802992518703242,0.8411881188118813,0.5164720150828361,0.82,0.7377622377622377
|
| 61 |
+
59.0,0.5328813160298174,0.7930174563591023,0.7526475768633367,0.5625782454013825,0.74,0.6702181633688482
|
results/CFE/Fold_2/log_mean.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.5417676342098493,0.85785536159601,0.667461261402068,0.550015400648117,0.8466666666666667,0.6096527656350177
|
| 3 |
+
1.0,0.5239732338306018,0.8844555278470491,0.6829860324294561,0.5332367850343386,0.86,0.5836988494189305
|
| 4 |
+
2.0,0.5798212599229139,0.7356608478802992,0.6464600128739809,0.588706580599149,0.7233333333333333,0.6130511003563462
|
| 5 |
+
3.0,0.5596723942487118,0.8129675810473816,0.685917861826218,0.5794722903768221,0.7800000000000001,0.6286048669698712
|
| 6 |
+
4.0,0.5145948028078896,0.830423940149626,0.7262241943788519,0.5365381092826526,0.7833333333333333,0.6613104523895431
|
| 7 |
+
5.0,0.47432335636463147,0.9027431421446384,0.7274287706882436,0.47971140265464784,0.8966666666666666,0.6039628608854039
|
| 8 |
+
6.0,0.4834490380035474,0.9010806317539485,0.7527267090517961,0.5038768660028775,0.8733333333333334,0.6591719539266138
|
| 9 |
+
7.0,0.4520124026317946,0.9318370739817124,0.8273322549925591,0.4718482498327891,0.8966666666666666,0.7729641072789629
|
| 10 |
+
8.0,0.48832994164374105,0.8586866167913549,0.7428232840986274,0.5141489163041114,0.8133333333333334,0.6195461213245655
|
| 11 |
+
9.0,0.4826246038488022,0.8836242726517041,0.7151109654065538,0.49972789247830707,0.8466666666666667,0.642239481586779
|
| 12 |
+
10.0,0.4856523286523367,0.8512053200332502,0.7095713259156599,0.5041502722601096,0.8433333333333334,0.6440257609758483
|
| 13 |
+
11.0,0.4984840370175845,0.8412302576891105,0.7515500708636503,0.5134432063500086,0.84,0.6461575232769335
|
| 14 |
+
12.0,0.43377282995040084,0.9243557772236076,0.741828045258219,0.44755680625637373,0.9033333333333333,0.70446534157788
|
| 15 |
+
13.0,0.5021516962142557,0.8603491271820448,0.7584884757643797,0.5171441261967024,0.84,0.7140572621040971
|
| 16 |
+
14.0,0.427781292699519,0.9359933499584372,0.7494360436231053,0.4442869058748086,0.8966666666666666,0.6847020417433555
|
| 17 |
+
15.0,0.45174893723213955,0.887780548628429,0.7864388170015806,0.47716633056600893,0.8566666666666666,0.6691559997345591
|
| 18 |
+
16.0,0.421130895763264,0.9251870324189526,0.8083311432055703,0.44685382336378104,0.9,0.704775934149534
|
| 19 |
+
17.0,0.41869479611032917,0.9368246051537822,0.7972741629539417,0.43472874502340947,0.91,0.691238001270802
|
| 20 |
+
18.0,0.4293196533039423,0.9384871155444721,0.7598370832755034,0.4482609425485134,0.9033333333333333,0.6954242766637998
|
| 21 |
+
19.0,0.42807682191740937,0.9467996674979219,0.8930705668509943,0.4587147725621859,0.89,0.7429736776161829
|
| 22 |
+
20.0,0.40512136288810946,0.971737323358271,0.905933555237089,0.42850940624872846,0.93,0.7286156233552484
|
| 23 |
+
21.0,0.45884086683404907,0.887780548628429,0.774718316769944,0.48546685308217996,0.8466666666666667,0.6565101431969483
|
| 24 |
+
22.0,0.4111638979325172,0.9467996674979219,0.8346103355669099,0.44087496916453045,0.8966666666666666,0.6969223608536907
|
| 25 |
+
23.0,0.416522267007471,0.9476309226932669,0.82706067896587,0.4342106178402901,0.9266666666666667,0.713840296589435
|
| 26 |
+
24.0,0.4737832672578141,0.8595178719866999,0.7751741224427685,0.5141972916324934,0.8233333333333333,0.6362189807345402
|
| 27 |
+
25.0,0.5038250371355467,0.799667497921862,0.6733475287534664,0.5416226821144422,0.7533333333333333,0.5707482973679797
|
| 28 |
+
26.0,0.40540463287237777,0.9492934330839568,0.8542878465337993,0.43049690191944445,0.9199999999999999,0.7232890687665258
|
| 29 |
+
27.0,0.40144269526351617,0.945137157107232,0.875020436343131,0.43124089231093726,0.9166666666666666,0.7241029968984716
|
| 30 |
+
28.0,0.45383402741113904,0.8836242726517041,0.7654842704723901,0.4882669664919376,0.8533333333333334,0.6543271816996333
|
| 31 |
+
29.0,0.4371692446476207,0.9102244389027433,0.8488427138932199,0.4691972360511621,0.8666666666666667,0.6692249485231168
|
| 32 |
+
30.0,0.40880069178734235,0.9376558603491271,0.8241305732522105,0.43358988637725515,0.9,0.7018799375258086
|
| 33 |
+
31.0,0.4613034557473729,0.8753117206982544,0.7378451686026729,0.4899200923244158,0.8366666666666666,0.6360599441934252
|
| 34 |
+
32.0,0.4008406862455513,0.9526184538653366,0.8704689973674188,0.43545350402593613,0.91,0.6988188271149692
|
| 35 |
+
33.0,0.44193405044247286,0.8877805486284288,0.8116641527233533,0.48696963836749396,0.8366666666666666,0.6407757062590416
|
| 36 |
+
34.0,0.41558221817412977,0.9334995843724023,0.848246109122516,0.4514218507210413,0.8866666666666667,0.6865627971618755
|
| 37 |
+
35.0,0.4258839095867582,0.9318370739817124,0.8378347617297011,0.44919499109188715,0.9033333333333333,0.7072910902798121
|
| 38 |
+
36.0,0.43337560444450934,0.914380714879468,0.8368849492016014,0.4699776127934456,0.8700000000000001,0.6700275522395339
|
| 39 |
+
37.0,0.47531140725115195,0.8478802992518704,0.7313543866561356,0.5048598169287045,0.81,0.6139618423089236
|
| 40 |
+
38.0,0.41025824623115836,0.9368246051537822,0.8861759109640982,0.4449250548084576,0.9133333333333332,0.7101002869528029
|
| 41 |
+
39.0,0.4671633835643505,0.8428927680798005,0.7917098723930724,0.4917840677499771,0.8099999999999999,0.6213445878585852
|
| 42 |
+
40.0,0.39174674406759163,0.969243557772236,0.8918073312858913,0.4194370518128077,0.9266666666666667,0.7109992037604713
|
| 43 |
+
41.0,0.4292286436010775,0.9384871155444721,0.8834195801959434,0.4604697699348132,0.88,0.6766461664315736
|
| 44 |
+
42.0,0.4118577082728903,0.9310058187863675,0.8571553948299573,0.4426258976260821,0.8866666666666667,0.6846574034904988
|
| 45 |
+
43.0,0.47127938766035554,0.8462177888611803,0.7944603645086948,0.5065206839640936,0.8033333333333333,0.6046473022814775
|
| 46 |
+
44.0,0.4334070404321079,0.9060681629260183,0.8179201953069651,0.4596695423126221,0.8833333333333334,0.6784114142313215
|
| 47 |
+
45.0,0.4055258018070722,0.9467996674979219,0.8316632659011289,0.4289604659875234,0.9166666666666666,0.7224817702038514
|
| 48 |
+
46.0,0.41494913881060885,0.9326683291770573,0.8457830227825398,0.4495470609267553,0.8933333333333334,0.6930459865586963
|
| 49 |
+
47.0,0.4205761159323497,0.9210307564422276,0.8297149568996796,0.437999597688516,0.91,0.6939019114350563
|
| 50 |
+
48.0,0.4525154542645513,0.8886118038237739,0.7884985642139912,0.48750695486863455,0.84,0.6375236837017374
|
| 51 |
+
49.0,0.41181288650901937,0.9384871155444721,0.8589209394977871,0.44294552971919376,0.8933333333333334,0.6911064498209626
|
| 52 |
+
50.0,0.4426631037384296,0.8960931005818787,0.8499175521182843,0.4790247300267219,0.84,0.6364671071477447
|
| 53 |
+
51.0,0.434222599811982,0.9168744804655029,0.8320238407508344,0.4640252816180388,0.8933333333333332,0.6933815876867685
|
| 54 |
+
52.0,0.4251846634439895,0.9226932668329177,0.8493897869935877,0.4622676490743955,0.88,0.6767321605046416
|
| 55 |
+
53.0,0.4258258878218563,0.9077306733167082,0.8755596716842519,0.46631982068220773,0.8733333333333334,0.6742187209925263
|
| 56 |
+
54.0,0.40348097196441834,0.9501246882793017,0.901453489340042,0.4365076854328314,0.9033333333333333,0.7003076942797755
|
| 57 |
+
55.0,0.41620227568167395,0.9426433915211971,0.8434218424203556,0.4382026840249697,0.91,0.7047695264855102
|
| 58 |
+
56.0,0.4102096474750381,0.9326683291770573,0.898887316337469,0.44972384095191953,0.8866666666666667,0.679303645201068
|
| 59 |
+
57.0,0.4215698369770177,0.9384871155444721,0.8616401896744033,0.4532518829902013,0.8866666666666667,0.6767074280656894
|
| 60 |
+
58.0,0.4180011274858207,0.9334995843724023,0.8974869606049465,0.4604408204555512,0.8633333333333333,0.6567575882296695
|
| 61 |
+
59.0,0.42489344666921786,0.9060681629260183,0.8619489936367795,0.4650189800063769,0.8566666666666668,0.6549918305576183
|
results/CFE/Fold_3/log_1p19q.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.6168519633815176,0.6882793017456359,0.46809639525876245,0.6292971938848495,0.69,0.46320346320346323
|
| 3 |
+
1.0,0.4873636980306478,0.8952618453865336,0.6097052280311457,0.4973486986756325,0.88,0.46808510638297873
|
| 4 |
+
2.0,0.5434906169066108,0.7057356608478803,0.4894475615019422,0.5299421766400337,0.73,0.4846344722275243
|
| 5 |
+
3.0,0.4062532851672232,0.9326683291770573,0.6529918912855357,0.416293765604496,0.93,0.48186528497409326
|
| 6 |
+
4.0,0.5274630768638002,0.8029925187032418,0.5525628169093657,0.5224021565914154,0.8,0.5579133510167993
|
| 7 |
+
5.0,0.3922311520933213,0.9376558603491272,0.6265598807971688,0.40225650191307066,0.93,0.48186528497409326
|
| 8 |
+
6.0,0.3759593213734187,0.9501246882793017,0.674512987012987,0.39403264701366425,0.91,0.47643979057591623
|
| 9 |
+
7.0,0.3867765722652326,0.9526184538653366,0.7308249425896485,0.3953580677509308,0.92,0.5789473684210527
|
| 10 |
+
8.0,0.36749966111860966,0.9750623441396509,0.7436061381074168,0.38737393319606783,0.94,0.4845360824742268
|
| 11 |
+
9.0,0.4295893103404533,0.8927680798004988,0.6066564774049319,0.44605454578995707,0.85,0.5178399228543876
|
| 12 |
+
10.0,0.4040274725218961,0.9177057356608479,0.6666498727863567,0.4268492624163628,0.89,0.4708994708994709
|
| 13 |
+
11.0,0.36448260454316983,0.9376558603491272,0.7174862618007609,0.38528950318694116,0.91,0.47643979057591623
|
| 14 |
+
12.0,0.3513631721461503,0.9800498753117207,0.8281919451585261,0.37748169645667073,0.96,0.4897959183673469
|
| 15 |
+
13.0,0.321947080981999,0.9875311720698254,0.877751356624596,0.3486673308908939,0.96,0.4897959183673469
|
| 16 |
+
14.0,0.3299025747915753,0.9825436408977556,0.8658542413381123,0.36464474216103554,0.93,0.48186528497409326
|
| 17 |
+
15.0,0.4971533439254523,0.85785536159601,0.6086197154158319,0.5060185414552688,0.87,0.5315315315315315
|
| 18 |
+
16.0,0.3594730842366183,0.9800498753117207,0.8614853195164076,0.39546039044857023,0.94,0.4845360824742268
|
| 19 |
+
17.0,0.35569215917081903,0.9775561097256857,0.69428208386277,0.37226996436715126,0.97,0.49238578680203043
|
| 20 |
+
18.0,0.44400100008656557,0.9451371571072319,0.7463193006671267,0.46660050928592683,0.92,0.5789473684210527
|
| 21 |
+
19.0,0.33641221071419275,0.9925187032418953,0.9380694980694981,0.36522707879543304,0.95,0.48717948717948717
|
| 22 |
+
20.0,0.37549492107365195,0.9825436408977556,0.874782531114779,0.4078582336008549,0.94,0.4845360824742268
|
| 23 |
+
21.0,0.3405798472222545,0.9875311720698254,0.9041816009557945,0.3770632265508175,0.96,0.4897959183673469
|
| 24 |
+
22.0,0.3025061096113519,0.9850374064837906,0.8295068027210883,0.32803359359502793,0.97,0.49238578680203043
|
| 25 |
+
23.0,0.331995290116479,0.9975062344139651,0.9793564993564994,0.3616422449052334,0.96,0.4897959183673469
|
| 26 |
+
24.0,0.2999006399044075,0.9975062344139651,0.977619021041469,0.3321428391337395,0.97,0.49238578680203043
|
| 27 |
+
25.0,0.31085113118265634,0.9775561097256857,0.69428208386277,0.3333944018185139,0.97,0.49238578680203043
|
| 28 |
+
26.0,0.40476558816403224,0.9850374064837906,0.8889811738648947,0.425523025393486,0.95,0.48717948717948717
|
| 29 |
+
27.0,0.40131752746658134,0.9675810473815462,0.8158275922981806,0.44189903512597084,0.92,0.4791666666666667
|
| 30 |
+
28.0,0.3886900096388529,0.9850374064837906,0.8711439588688946,0.40909650817513465,0.93,0.48186528497409326
|
| 31 |
+
29.0,0.33781924858652146,0.9975062344139651,0.9793564993564994,0.3905514833331108,0.93,0.48186528497409326
|
| 32 |
+
30.0,0.38089077698619583,0.9750623441396509,0.8372564935064934,0.4291081500053406,0.88,0.46808510638297873
|
| 33 |
+
31.0,0.36043283904431167,0.9850374064837906,0.8461636828644501,0.4003425747156143,0.94,0.4845360824742268
|
| 34 |
+
32.0,0.3678580576419236,0.9875311720698254,0.8652282046111447,0.3995802304148674,0.96,0.4897959183673469
|
| 35 |
+
33.0,0.38309992875838816,0.972568578553616,0.8261811876896402,0.4282624964416027,0.92,0.4791666666666667
|
| 36 |
+
34.0,0.4467653299953575,0.9476309226932669,0.7527961250550419,0.4915898802876473,0.85,0.4594594594594595
|
| 37 |
+
35.0,0.3816266770003145,0.9950124688279302,0.9570479862896315,0.4035138699412346,0.96,0.4897959183673469
|
| 38 |
+
36.0,0.40131819761007503,0.9900249376558603,0.9259874492432631,0.4499278178811073,0.92,0.4791666666666667
|
| 39 |
+
37.0,0.36263327701876585,0.9875311720698254,0.9105589507962707,0.42157787322998047,0.91,0.47643979057591623
|
| 40 |
+
38.0,0.3287352405284111,0.9950124688279302,0.9532634032634033,0.35194615632295606,0.96,0.4897959183673469
|
| 41 |
+
39.0,0.38851387077882105,0.9376558603491272,0.7174862618007609,0.4301051560044289,0.89,0.5475113122171946
|
| 42 |
+
40.0,0.4539891487716737,0.9177057356608479,0.6883786647827623,0.5023971156775952,0.87,0.46524064171123
|
| 43 |
+
41.0,0.4383387517304789,0.9326683291770573,0.7173180856896686,0.4831656613945961,0.86,0.5244565217391304
|
| 44 |
+
42.0,0.3816200917647069,0.9975062344139651,0.977619021041469,0.4173787949979305,0.96,0.4897959183673469
|
| 45 |
+
43.0,0.3988401430503389,0.9900249376558603,0.9259874492432631,0.44244584441185,0.92,0.4791666666666667
|
| 46 |
+
44.0,0.38326851644569504,0.9875311720698254,0.8967824967824969,0.41066773027181624,0.95,0.48717948717948717
|
| 47 |
+
45.0,0.4138109157433236,0.9775561097256857,0.849002133801933,0.4496946457028389,0.94,0.4845360824742268
|
| 48 |
+
46.0,0.39934552154338865,0.9750623441396509,0.8464307598039216,0.437923024147749,0.92,0.4791666666666667
|
| 49 |
+
47.0,0.3593397435553353,0.9950124688279302,0.9570479862896315,0.3884894534945488,0.96,0.4897959183673469
|
| 50 |
+
48.0,0.38130901360006403,0.9925187032418953,0.932857063124407,0.41785534709692,0.96,0.4897959183673469
|
| 51 |
+
49.0,0.451296079820231,0.9102244389027432,0.6757412398921834,0.49798172324895856,0.83,0.5056702529805176
|
| 52 |
+
50.0,0.40763600735444383,0.9775561097256857,0.849002133801933,0.44366122752428055,0.93,0.48186528497409326
|
| 53 |
+
51.0,0.4729641735776701,0.8753117206982544,0.618531202435312,0.510941396355629,0.85,0.4594594594594595
|
| 54 |
+
52.0,0.5128956284754889,0.8104738154613467,0.5658689458689459,0.5653905558586121,0.75,0.42857142857142855
|
| 55 |
+
53.0,0.4923472632642399,0.8753117206982544,0.6278215028215028,0.5343287554383278,0.81,0.44751381215469616
|
| 56 |
+
54.0,0.42718822209912344,0.970074812967581,0.8157169117647058,0.4637201787531376,0.92,0.4791666666666667
|
| 57 |
+
55.0,0.44234658573333757,0.972568578553616,0.8356863475507543,0.4905035711824894,0.88,0.46808510638297873
|
| 58 |
+
56.0,0.4264705090823019,0.9775561097256857,0.8577846081097056,0.4762869781255722,0.9,0.47368421052631576
|
| 59 |
+
57.0,0.40000777786360714,0.9750623441396509,0.8464307598039216,0.4404852199554443,0.92,0.4791666666666667
|
| 60 |
+
58.0,0.41433332068961753,0.9950124688279302,0.9532634032634033,0.4434354257583618,0.95,0.48717948717948717
|
| 61 |
+
59.0,0.4264558956138511,0.970074812967581,0.8255004351610096,0.4783501297235489,0.89,0.4708994708994709
|
results/CFE/Fold_3/log_IDH.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.5729768671597031,0.800498753117207,0.7335548172757476,0.5759822061657905,0.79,0.7236478484011054
|
| 3 |
+
1.0,0.61898772444511,0.7880299251870324,0.7490742581181857,0.6167038533091546,0.8,0.7571636716852841
|
| 4 |
+
2.0,0.6770396263076183,0.6184538653366584,0.599149336521688,0.6680133536458015,0.67,0.6396986570586308
|
| 5 |
+
3.0,0.5447256686978804,0.8753117206982544,0.820918185066095,0.552170623242855,0.84,0.7668997668997669
|
| 6 |
+
4.0,0.5205156155803852,0.8927680798004988,0.8401961056894747,0.5320356899499893,0.85,0.7778106947118946
|
| 7 |
+
5.0,0.517501412410094,0.8154613466334164,0.6470406318393758,0.531178857088089,0.78,0.5137046861184793
|
| 8 |
+
6.0,0.5440753564572989,0.773067331670823,0.6169527108591822,0.5580225238204002,0.76,0.5535714285714286
|
| 9 |
+
7.0,0.5148628439540578,0.8528678304239401,0.7843791296422875,0.5339201951026916,0.83,0.7392238073324129
|
| 10 |
+
8.0,0.4965164838289085,0.8653366583541147,0.7551560379918589,0.5167854183912277,0.85,0.7136858179041802
|
| 11 |
+
9.0,0.6629162935396085,0.5760598503740648,0.5646203760474147,0.6937640058994293,0.56,0.548440065681445
|
| 12 |
+
10.0,0.646126727139266,0.6508728179551122,0.6251735925648969,0.6702222979068756,0.59,0.5577607593571352
|
| 13 |
+
11.0,0.49891398063027054,0.9501246882793017,0.9266051687532031,0.533051900267601,0.86,0.796037296037296
|
| 14 |
+
12.0,0.5546055669499157,0.827930174563591,0.7857059875926485,0.6034469872713089,0.67,0.6108031607500884
|
| 15 |
+
13.0,0.5029022833355644,0.9351620947630923,0.9076036866359447,0.5419321721792221,0.82,0.745906267645398
|
| 16 |
+
14.0,0.5218732867603587,0.8827930174563591,0.8460023695714345,0.5605189582705498,0.82,0.7661122661122661
|
| 17 |
+
15.0,0.8366457287064217,0.32917705735660846,0.3243195840771712,0.8561071830987931,0.27,0.2574509205574204
|
| 18 |
+
16.0,0.6129836101187137,0.6708229426433915,0.647571108980505,0.666877597272396,0.61,0.584
|
| 19 |
+
17.0,0.4271970970969545,0.912718204488778,0.8422626071906223,0.44428893059492114,0.88,0.7967479674796748
|
| 20 |
+
18.0,0.9352944935497798,0.2119700748129676,0.17844917012448133,0.9557885661721229,0.21,0.180412905903102
|
| 21 |
+
19.0,0.731389569745694,0.43640897755610975,0.43581602669455655,0.7718281903862954,0.33,0.32993299329932996
|
| 22 |
+
20.0,0.4921676133041667,0.9251870324189526,0.894206416209371,0.5518343836069107,0.8,0.7258771929824561
|
| 23 |
+
21.0,0.6169814259334098,0.7082294264339152,0.6715530820119711,0.6751427349448204,0.57,0.5305164319248826
|
| 24 |
+
22.0,0.4916411081603043,0.9052369077306733,0.8742739273927393,0.5514699277281762,0.8,0.7463216641298833
|
| 25 |
+
23.0,0.4495832705289646,0.9551122194513716,0.932232987832357,0.5211404973268509,0.78,0.6894409937888198
|
| 26 |
+
24.0,0.5206094844234257,0.8778054862842892,0.8424310951796699,0.5892720767855644,0.74,0.6775793650793651
|
| 27 |
+
25.0,0.5302519046903549,0.8902743142144638,0.85145147167778,0.591213241815567,0.72,0.6361746361746362
|
| 28 |
+
26.0,0.585731453208852,0.7905236907730673,0.7383970177073625,0.6556289547681808,0.63,0.5552350042072365
|
| 29 |
+
27.0,0.5175494379979416,0.8379052369077307,0.8023896710411597,0.6077052584290504,0.7,0.6553308823529411
|
| 30 |
+
28.0,0.4572989708764892,0.8827930174563591,0.7743333692541639,0.5007911768555641,0.89,0.7781810848961483
|
| 31 |
+
29.0,0.6632742137088443,0.5610972568578554,0.5513857106534452,0.7311809620261193,0.52,0.512987012987013
|
| 32 |
+
30.0,0.6947326612591446,0.49625935162094764,0.492824584251653,0.7417022106051445,0.44,0.43797671617824163
|
| 33 |
+
31.0,0.48075249887761334,0.9102244389027432,0.8644659756647138,0.5462523612380028,0.79,0.6889349725966524
|
| 34 |
+
32.0,0.6825342794457576,0.5536159600997507,0.5419482467055934,0.7475201940536499,0.44,0.4318181818181818
|
| 35 |
+
33.0,0.5697739964857363,0.7206982543640897,0.6916909220715031,0.6615384131669998,0.58,0.5586380832282472
|
| 36 |
+
34.0,0.5049482329825213,0.8753117206982544,0.8311948541792955,0.5937119901180268,0.74,0.6702181633688482
|
| 37 |
+
35.0,0.49260572000334685,0.8877805486284289,0.8251470431488067,0.5634262934327126,0.71,0.5967181198720624
|
| 38 |
+
36.0,0.7368761260907846,0.4314214463840399,0.43082324816972956,0.8078477150201797,0.38,0.37975190076030413
|
| 39 |
+
37.0,0.5095388143883084,0.8428927680798005,0.8074715928576328,0.5733636483550072,0.74,0.7012867647058824
|
| 40 |
+
38.0,0.5974189878401911,0.683291770573566,0.6564951401957412,0.6710671105980873,0.52,0.5
|
| 41 |
+
39.0,0.5580356871695292,0.7955112219451371,0.7606701991382322,0.638482682108879,0.63,0.5906626839252129
|
| 42 |
+
40.0,0.5052452791956,0.827930174563591,0.7594104604147646,0.5776838004589081,0.73,0.6350858224084336
|
| 43 |
+
41.0,0.4451027624773563,0.9451371571072319,0.9205740420628061,0.5228413727879524,0.83,0.7392238073324129
|
| 44 |
+
42.0,0.49672568163966896,0.9002493765586035,0.8640124796527401,0.5679287317395211,0.74,0.643640350877193
|
| 45 |
+
43.0,0.5195405837009078,0.8478802992518704,0.8125952882589542,0.6015397745370865,0.67,0.6176572818908586
|
| 46 |
+
44.0,0.4683777925528196,0.9052369077306733,0.8502437298529759,0.5440362524986267,0.77,0.647185151096794
|
| 47 |
+
45.0,0.4785102405155686,0.9027431421446384,0.8678747940691928,0.5685181170701981,0.73,0.6534462841740469
|
| 48 |
+
46.0,0.63166131982185,0.6334164588528678,0.6148689703835826,0.6974413585662842,0.53,0.5219204557013528
|
| 49 |
+
47.0,0.48372715577817615,0.942643391521197,0.9203932433948747,0.5608266890048981,0.77,0.7047875754075215
|
| 50 |
+
48.0,0.6077402762492696,0.6733167082294265,0.6487747801959014,0.6777743050456047,0.57,0.5361881134721174
|
| 51 |
+
49.0,0.6836087504527218,0.5236907730673317,0.5178862556258459,0.7545667934417725,0.44,0.43797671617824163
|
| 52 |
+
50.0,0.576972883910015,0.7281795511221946,0.6928498647271706,0.6677938875555992,0.61,0.568536342515765
|
| 53 |
+
51.0,0.7376836598514024,0.47880299251870323,0.47660265417642467,0.8255974721908569,0.34,0.3397358943577431
|
| 54 |
+
52.0,0.8029644001005891,0.3341645885286783,0.3298972943540059,0.8659069713950157,0.27,0.264038713579998
|
| 55 |
+
53.0,0.6422609336804274,0.6034912718204489,0.587899196597659,0.7390350744128227,0.47,0.4542271650705386
|
| 56 |
+
54.0,0.6308245189915274,0.6483790523690773,0.6240550010970963,0.7440792536735534,0.47,0.4501504305425874
|
| 57 |
+
55.0,0.7259711033834186,0.4763092269326683,0.4742658076116272,0.8311301609873771,0.36,0.3597438975590236
|
| 58 |
+
56.0,0.6504324290371892,0.6483790523690773,0.6279340637646826,0.7504179611802101,0.47,0.4608890245142916
|
| 59 |
+
57.0,0.5537448575966376,0.7905236907730673,0.7426187419768935,0.6435442295670509,0.59,0.5249681381068243
|
| 60 |
+
58.0,0.7473398880322378,0.42144638403990026,0.42141400069655205,0.8110282161831855,0.32,0.3197278911564626
|
| 61 |
+
59.0,0.7791446139687612,0.4014962593516209,0.40140319450664275,0.8582102498412132,0.31,0.30937844059653685
|
results/CFE/Fold_3/log_LHG.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.6458040730762957,0.6458852867830424,0.5778321470937129,0.6443048605322838,0.67,0.6108031607500884
|
| 3 |
+
1.0,0.6222221175036823,0.7306733167082294,0.6901614010989011,0.6194074136018753,0.75,0.7103464256748928
|
| 4 |
+
2.0,0.6504958386433095,0.6483790523690773,0.6208787893011124,0.6177179265022278,0.73,0.7052079921388797
|
| 5 |
+
3.0,0.6001015219307897,0.8179551122194514,0.7720189095100505,0.6033146569132805,0.81,0.7759169713409599
|
| 6 |
+
4.0,0.5252702052605123,0.9002493765586035,0.8567345480528761,0.5243934333324433,0.91,0.8815633636004737
|
| 7 |
+
5.0,0.49618322274036836,0.885286783042394,0.7888507326007326,0.518473293185234,0.82,0.6651785714285714
|
| 8 |
+
6.0,0.5672699273227159,0.8553615960099751,0.806827242524917,0.5739316013455391,0.86,0.818087318087318
|
| 9 |
+
7.0,0.5429616271706293,0.8204488778054863,0.7770019772614929,0.5454790607094765,0.84,0.8095238095238095
|
| 10 |
+
8.0,0.4896692224868813,0.9052369077306733,0.8297658414514255,0.518202793598175,0.87,0.774891774891775
|
| 11 |
+
9.0,0.6136455743984689,0.743142144638404,0.7051154820975976,0.6163961738348007,0.72,0.6961805555555556
|
| 12 |
+
10.0,0.6664605307162849,0.6134663341645885,0.5919901271523005,0.6658438238501548,0.61,0.5983935742971888
|
| 13 |
+
11.0,0.5093802631347256,0.85785536159601,0.8095202380059501,0.5229631224274636,0.86,0.8263888888888888
|
| 14 |
+
12.0,0.6877474376834242,0.513715710723192,0.5053985844133665,0.7008911228179932,0.48,0.47916666666666663
|
| 15 |
+
13.0,0.5304704920906675,0.8478802992518704,0.8013965006292372,0.5640790459513664,0.83,0.7995046585682274
|
| 16 |
+
14.0,0.5326793407858755,0.8503740648379052,0.8087926759488842,0.5629068940877915,0.81,0.7759169713409599
|
| 17 |
+
15.0,0.6155927392312713,0.713216957605985,0.6589152447097285,0.6307539823651314,0.76,0.7085964060223409
|
| 18 |
+
16.0,0.554579984368826,0.770573566084788,0.7224328879258457,0.5923026531934739,0.73,0.6923076923076923
|
| 19 |
+
17.0,0.44139039850889,0.942643391521197,0.912249655106798,0.47169033080339434,0.89,0.8552441110672457
|
| 20 |
+
18.0,0.7936077480601551,0.2743142144638404,0.2654706826550845,0.8018283760547638,0.28,0.26108374384236455
|
| 21 |
+
19.0,0.8374121593418264,0.2817955112219451,0.2742081447963801,0.8432105922698975,0.31,0.29813854134879464
|
| 22 |
+
20.0,0.4516501622158393,0.8927680798004988,0.8401961056894747,0.49425329208374025,0.84,0.7807017543859649
|
| 23 |
+
21.0,0.6899328047497909,0.571072319201995,0.5528267634854772,0.7174398282170296,0.54,0.5308037535699714
|
| 24 |
+
22.0,0.6357876484530822,0.6234413965087282,0.6005475475805654,0.6720831686258316,0.59,0.5805626598465473
|
| 25 |
+
23.0,0.4821572459100785,0.8927680798004988,0.8359450073735788,0.5364320135116577,0.78,0.7209538305428715
|
| 26 |
+
24.0,0.611876381157045,0.6708229426433915,0.6378489326765189,0.6635794454813003,0.59,0.5710848415106182
|
| 27 |
+
25.0,0.7493303799421115,0.4164588528678304,0.41540819377990434,0.782179302573204,0.4,0.3997599039615846
|
| 28 |
+
26.0,0.5411334860503227,0.830423940149626,0.7704250016838419,0.5906646928191185,0.7,0.6553308823529411
|
| 29 |
+
27.0,0.4619820098627238,0.885286783042394,0.8009710832973673,0.5125407093763351,0.84,0.7807017543859649
|
| 30 |
+
28.0,0.45606629940637033,0.8952618453865336,0.794208211143695,0.49280862480401993,0.85,0.7402597402597402
|
| 31 |
+
29.0,0.6519655533264997,0.6184538653366584,0.5942181392487946,0.70089724868536,0.56,0.5535714285714286
|
| 32 |
+
30.0,0.8188615455443128,0.4114713216957606,0.41102813044560615,0.8371192568540573,0.4,0.39903846153846156
|
| 33 |
+
31.0,0.6273394830506341,0.6783042394014963,0.6378662186285835,0.6836377060413361,0.63,0.6161427533976553
|
| 34 |
+
32.0,0.7520004248529896,0.456359102244389,0.4530905905905906,0.7763145491480827,0.45,0.4499449944994499
|
| 35 |
+
33.0,0.5206254093427016,0.8329177057356608,0.7609718774743996,0.5809132674336434,0.77,0.7178260336155073
|
| 36 |
+
34.0,0.4582998860358003,0.8528678304239401,0.6658380531348427,0.501447733938694,0.81,0.6373353693452949
|
| 37 |
+
35.0,0.5330630248770155,0.800498753117207,0.6458222928811164,0.583665574491024,0.68,0.5614035087719298
|
| 38 |
+
36.0,0.6708098794159449,0.5860349127182045,0.5398833222738332,0.7360517928004264,0.48,0.4583333333333333
|
| 39 |
+
37.0,0.7597070547410675,0.486284289276808,0.4778381795195954,0.8270217841863632,0.41,0.4099409940994099
|
| 40 |
+
38.0,0.6142603299415617,0.683291770573566,0.6055747887574836,0.6560814180970191,0.59,0.5327635327635327
|
| 41 |
+
39.0,0.7644584526742189,0.4488778054862843,0.43791583420543556,0.819559651017189,0.39,0.3884711779448622
|
| 42 |
+
40.0,0.5924374039036377,0.7032418952618454,0.6149737366565271,0.6573014357686042,0.59,0.539894512400404
|
| 43 |
+
41.0,0.7364070824256859,0.486284289276808,0.44197200605274534,0.8056651815772057,0.4,0.3842364532019704
|
| 44 |
+
42.0,0.6972184587743812,0.5660847880299252,0.5068278201865988,0.7502815955877304,0.42,0.39583333333333337
|
| 45 |
+
43.0,0.7744593419636276,0.44139650872817954,0.4306865429469628,0.8191376647353172,0.41,0.4085213032581454
|
| 46 |
+
44.0,0.6266452340116525,0.6758104738154613,0.6057924984875983,0.687026564180851,0.57,0.5305164319248826
|
| 47 |
+
45.0,0.7447928923026582,0.46384039900249374,0.435399899149318,0.7911253294348717,0.42,0.41414141414141414
|
| 48 |
+
46.0,0.6360032081306723,0.6259351620947631,0.5540480427046264,0.7089467868208885,0.52,0.4851994851994852
|
| 49 |
+
47.0,0.5585695673848625,0.7381546134663342,0.606410723800443,0.6165828970074654,0.67,0.5862068965517242
|
| 50 |
+
48.0,0.7031173432557065,0.5536159600997507,0.5240150927381118,0.7584312853217124,0.45,0.4405452141186044
|
| 51 |
+
49.0,0.7223249909437802,0.5411471321695761,0.5087354852455523,0.7850426638126373,0.42,0.4162640901771336
|
| 52 |
+
50.0,0.6894266835026016,0.5760598503740648,0.5142926356589147,0.7330724784731865,0.48,0.44821731748726656
|
| 53 |
+
51.0,0.5469410983552957,0.7556109725685786,0.6100460427085814,0.5935307404398918,0.72,0.592074592074592
|
| 54 |
+
52.0,0.8117253354511356,0.4114713216957606,0.407932932932933,0.8586843281984329,0.39,0.38945050545490945
|
| 55 |
+
53.0,0.6197467670773628,0.6733167082294265,0.5787443565007497,0.6708927443623542,0.54,0.4875222816399287
|
| 56 |
+
54.0,0.6116511138002771,0.6733167082294265,0.5498667534982562,0.6638833674788475,0.57,0.483110950835437
|
| 57 |
+
55.0,0.5845785279226422,0.6758104738154613,0.5580405588714054,0.6367151966691017,0.63,0.5360501567398119
|
| 58 |
+
56.0,0.5703435851600105,0.7256857855361596,0.5996405750798722,0.6336760559678077,0.68,0.5733333333333333
|
| 59 |
+
57.0,0.6373140432144936,0.6508728179551122,0.5895478738960052,0.7067928960919381,0.52,0.49558638083228246
|
| 60 |
+
58.0,0.5765497619077155,0.71571072319202,0.6096823770491804,0.6142556703090668,0.7,0.6101871101871101
|
| 61 |
+
59.0,0.5298446639814877,0.773067331670823,0.6778604659374807,0.5911890605092048,0.69,0.6021049929405724
|
results/CFE/Fold_3/log_mean.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.6118776345391721,0.711554447215295,0.5931611198760743,0.6165280868609746,0.7166666666666667,0.5992181574515524
|
| 3 |
+
1.0,0.5761911799931467,0.8046550290939317,0.6829802957494109,0.5778199885288875,0.81,0.6451984012477185
|
| 4 |
+
2.0,0.6236753606191795,0.657522859517872,0.5698252291082476,0.6052244855960209,0.71,0.6098470404750116
|
| 5 |
+
3.0,0.5170268252652978,0.8753117206982544,0.7486429952872271,0.5239263485868771,0.86,0.6748940077382733
|
| 6 |
+
4.0,0.5244162992348992,0.8653366583541148,0.7498311568839054,0.5262770932912826,0.8533333333333334,0.7390958031097226
|
| 7 |
+
5.0,0.46863859574792793,0.8794679966749793,0.6874837484124257,0.48396955072879794,0.8433333333333333,0.553582847507048
|
| 8 |
+
6.0,0.49576820171781116,0.8595178719866999,0.699430980132362,0.5086622573932011,0.8433333333333333,0.6160328457448876
|
| 9 |
+
7.0,0.48153368112997325,0.8753117206982544,0.7640686831644764,0.49158577452103297,0.8633333333333333,0.7092316617590916
|
| 10 |
+
8.0,0.4512284558114665,0.915211970074813,0.7761760058502337,0.47412071506182346,0.8866666666666667,0.6577045584233939
|
| 11 |
+
9.0,0.5687170594261769,0.7373233582709893,0.6254641118499814,0.5854049085080624,0.71,0.5874868480304627
|
| 12 |
+
10.0,0.5722049101258156,0.7273482959268497,0.6279378641678514,0.5876384613911311,0.6966666666666667,0.5423512681845982
|
| 13 |
+
11.0,0.4575922827693886,0.915211970074813,0.8178705561866381,0.48043484196066855,0.8766666666666666,0.6996219918340337
|
| 14 |
+
12.0,0.5312387255931634,0.7738985868661677,0.7064321723881805,0.5606066021819909,0.7033333333333333,0.526588581928034
|
| 15 |
+
13.0,0.4517732854694103,0.9235245220282627,0.8622505146299261,0.48489284967382745,0.87,0.6784022815269908
|
| 16 |
+
14.0,0.46148506744593654,0.9052369077306732,0.8402164289528103,0.49602353150645895,0.8533333333333334,0.6746315074757732
|
| 17 |
+
15.0,0.6497972706210485,0.6334164588528678,0.5306181814009105,0.6642932356397311,0.6333333333333334,0.49919295270376424
|
| 18 |
+
16.0,0.509012226241386,0.8071487946799668,0.7438297721409194,0.5515468803048134,0.7599999999999999,0.5869479249273063
|
| 19 |
+
17.0,0.4080932182588879,0.9443059019118869,0.8162647820533969,0.4294164085884889,0.9133333333333334,0.7147926217829838
|
| 20 |
+
18.0,0.7243010805655001,0.47714048212801324,0.3967463844822308,0.7414058171709378,0.47000000000000003,0.34014800605550644
|
| 21 |
+
19.0,0.6350713132672378,0.57024106400665,0.5493645565201449,0.6600886204838753,0.53,0.3717503406092039
|
| 22 |
+
20.0,0.4397708988645526,0.9334995843724023,0.8697283510045416,0.4846486364305019,0.86,0.6637050099475493
|
| 23 |
+
21.0,0.5491646926351517,0.7556109725685786,0.7095204821510809,0.5898819299042225,0.69,0.5170387012874004
|
| 24 |
+
22.0,0.47664495540824614,0.8379052369077308,0.768109425898131,0.5171955633163452,0.7866666666666666,0.606423370259487
|
| 25 |
+
23.0,0.42124526885184066,0.9484621778886119,0.9158448315208118,0.473071585247914,0.84,0.6333969142330128
|
| 26 |
+
24.0,0.47746216849495937,0.8487115544472154,0.819299682965886,0.5283314538002014,0.7666666666666666,0.580349997797338
|
| 27 |
+
25.0,0.5301444719383742,0.7614297589359933,0.6537139164401514,0.5689289820690949,0.6966666666666667,0.509440108979417
|
| 28 |
+
26.0,0.5105435091410689,0.8686616791354945,0.7992677310853664,0.5572722243269285,0.7600000000000001,0.5659151245798882
|
| 29 |
+
27.0,0.46028299177574894,0.8969243557772236,0.8063961155455691,0.5207150009771188,0.82,0.6383997678018576
|
| 30 |
+
28.0,0.43401842664057083,0.9210307564422279,0.813228513088918,0.4675654366115729,0.89,0.6667687033766606
|
| 31 |
+
29.0,0.5510196718739552,0.7256857855361596,0.7083201164195797,0.6075432313481967,0.67,0.5161412421775117
|
| 32 |
+
30.0,0.631494994596551,0.6275976724854531,0.5803697360679175,0.6693098724881809,0.5733333333333334,0.4350334280332273
|
| 33 |
+
31.0,0.48950827365751975,0.85785536159601,0.7828319590525825,0.5434108806649843,0.7866666666666666,0.5965379361561781
|
| 34 |
+
32.0,0.6007975873135569,0.6658354114713217,0.6200890139691095,0.6411383245388667,0.6166666666666666,0.4571863648949928
|
| 35 |
+
33.0,0.4911664448622754,0.8420615128844555,0.7596146624118477,0.5569047256807487,0.7566666666666667,0.5852102611701404
|
| 36 |
+
34.0,0.4700044830045597,0.8919368246051538,0.7499430107897268,0.5289165347814561,0.7999999999999999,0.5890043307245342
|
| 37 |
+
35.0,0.4690984739602257,0.8944305901911886,0.8093391074398516,0.5168685792883237,0.7833333333333333,0.5493058490037797
|
| 38 |
+
36.0,0.6030014010389348,0.6691604322527015,0.6322313398956086,0.6646091085672378,0.5933333333333334,0.4390839669201014
|
| 39 |
+
37.0,0.5439597153827139,0.7722360764754779,0.731956241057833,0.6073211019237836,0.6866666666666666,0.5292225164604029
|
| 40 |
+
38.0,0.5134715194367213,0.7871986699916874,0.7384444440722094,0.5596982283393542,0.69,0.5075198170436265
|
| 41 |
+
39.0,0.5703360035408563,0.7273482959268495,0.6386907650481429,0.6293824963768323,0.6366666666666667,0.5088817246957565
|
| 42 |
+
40.0,0.5172239439569705,0.8162926018287614,0.687587620618018,0.5791274506350358,0.73,0.5467403255066892
|
| 43 |
+
41.0,0.5399495322111737,0.7880299251870323,0.69328804460174,0.6038907385865847,0.6966666666666667,0.5493055940911712
|
| 44 |
+
42.0,0.5251880773929191,0.8212801330008314,0.7828197736269361,0.5785297074417274,0.7066666666666667,0.5097565341926243
|
| 45 |
+
43.0,0.5642800229049582,0.7597672485453034,0.7230897601497267,0.6210410945614179,0.6666666666666666,0.5017817506052236
|
| 46 |
+
44.0,0.4927638476700557,0.8561928512053201,0.784272908374357,0.5472435156504313,0.7633333333333333,0.5549603567337212
|
| 47 |
+
45.0,0.5457046828538501,0.7813798836242727,0.7174256090068146,0.6031126974026362,0.6966666666666667,0.5173745935965627
|
| 48 |
+
46.0,0.555670016498637,0.7448046550290939,0.6717825909640435,0.6147703898449739,0.6566666666666667,0.49542886918916823
|
| 49 |
+
47.0,0.46721215557279133,0.8919368246051538,0.8279506511616498,0.5219663465023041,0.7999999999999999,0.5935967967755308
|
| 50 |
+
48.0,0.5640555443683467,0.7398171238570241,0.7018823120194734,0.618020312488079,0.6599999999999999,0.48884308198602283
|
| 51 |
+
49.0,0.6190766070722443,0.6583541147132169,0.5674543269211939,0.6791970601677896,0.5633333333333334,0.45330368644529767
|
| 52 |
+
50.0,0.5580118582556869,0.7605985037406483,0.6853815447293394,0.6148425311843554,0.6733333333333333,0.49953964832570824
|
| 53 |
+
51.0,0.585862977261456,0.7032418952618453,0.5683932997734394,0.6433565363287926,0.6366666666666666,0.4637566486305982
|
| 54 |
+
52.0,0.7091951213424045,0.5187032418952618,0.43456639105196154,0.7633272851506868,0.47000000000000003,0.3606868825354453
|
| 55 |
+
53.0,0.5847849880073434,0.7173732335827099,0.5981550186399706,0.6480855247378349,0.6066666666666667,0.4630877529550545
|
| 56 |
+
54.0,0.556554618296976,0.7639235245220283,0.663212888786686,0.6238942666351796,0.6533333333333333,0.4708093493482304
|
| 57 |
+
55.0,0.5842987390131328,0.7082294264339152,0.6226642380112622,0.6527829762796561,0.6233333333333334,0.45462638689393814
|
| 58 |
+
56.0,0.5490821744265005,0.7838736492103076,0.6951197489847535,0.62012699842453,0.6833333333333335,0.5026355227913135
|
| 59 |
+
57.0,0.5303555595582461,0.8054862842892767,0.7261991252256067,0.5969407818714778,0.6766666666666667,0.4999070618685912
|
| 60 |
+
58.0,0.5794076568765236,0.71072319201995,0.6614532603363786,0.6229064374168715,0.6566666666666666,0.4723648295076866
|
| 61 |
+
59.0,0.5784817245213666,0.714879467996675,0.634921365201711,0.6425831466913223,0.63,0.46079430147886
|
results/CFE/Fold_4/log_1p19q.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.5492992783871078,0.827930174563591,0.5363540392446,0.5741417422890663,0.78,0.5431893687707641
|
| 3 |
+
1.0,0.6892309498013999,0.571072319201995,0.4068455452356381,0.7045783308148384,0.55,0.4479205005520795
|
| 4 |
+
2.0,0.44457970295760996,0.942643391521197,0.5885711736628452,0.4843817114830017,0.86,0.5726495726495726
|
| 5 |
+
3.0,0.5954558077893055,0.7107231920199502,0.4803378317990884,0.6329626733064652,0.65,0.5132804895007649
|
| 6 |
+
4.0,0.45705274616988223,0.8379052369077307,0.5330944917151814,0.4960586577653885,0.8,0.6279761904761905
|
| 7 |
+
5.0,0.5326074329100345,0.7780548628428927,0.5123454259752682,0.5594795677065849,0.74,0.5776478232618583
|
| 8 |
+
6.0,0.3944388974337209,0.9501246882793017,0.602498017446471,0.4215096879005432,0.89,0.646415943426551
|
| 9 |
+
7.0,0.4107112404414246,0.9226932668329177,0.6191132763428011,0.4284863165020943,0.9,0.6947496947496947
|
| 10 |
+
8.0,0.3396826983612969,0.942643391521197,0.5592353643966548,0.38193551287055016,0.89,0.5475113122171946
|
| 11 |
+
9.0,0.35332516081018045,0.912718204488778,0.587993541758403,0.38880235999822615,0.87,0.6541633413141793
|
| 12 |
+
10.0,0.3905661418253644,0.912718204488778,0.5699666023225174,0.4311648428440094,0.83,0.5824121837386391
|
| 13 |
+
11.0,0.3127148365810922,0.9850374064837906,0.7819071791153009,0.35126622587442397,0.94,0.6842105263157895
|
| 14 |
+
12.0,0.3735535304965521,0.9625935162094763,0.7316768523888121,0.40774006575345995,0.91,0.6297819827231592
|
| 15 |
+
13.0,0.39479678512511407,0.9775561097256857,0.7799524419242729,0.4241384369134903,0.91,0.6297819827231592
|
| 16 |
+
14.0,0.4962176281838048,0.8553615960099751,0.5212038866930171,0.5209616802632808,0.79,0.441340782122905
|
| 17 |
+
15.0,0.34114819753942943,0.9650872817955112,0.7217486122125297,0.393098184466362,0.87,0.5315315315315315
|
| 18 |
+
16.0,0.326557794265319,0.9800498753117207,0.594949494949495,0.3699982884526253,0.94,0.4845360824742268
|
| 19 |
+
17.0,0.29250631278887057,0.9825436408977556,0.6773934030571198,0.34345428928732874,0.94,0.4845360824742268
|
| 20 |
+
18.0,0.32349482650620087,0.9750623441396509,0.6811386768447838,0.3685637052357197,0.93,0.5927865037812682
|
| 21 |
+
19.0,0.35142115527703577,0.9825436408977556,0.7263332358389393,0.39139748737215996,0.94,0.4845360824742268
|
| 22 |
+
20.0,0.32224575331680794,0.972568578553616,0.6263447691656078,0.371535162627697,0.92,0.5789473684210527
|
| 23 |
+
21.0,0.3482307472505474,0.9825436408977556,0.7896590483327088,0.38392245963215826,0.95,0.6299037749814952
|
| 24 |
+
22.0,0.3523327215502684,0.9900249376558603,0.8546047860768673,0.3977130514383316,0.94,0.4845360824742268
|
| 25 |
+
23.0,0.3798975400868199,0.9775561097256857,0.4943253467843632,0.41984902039170263,0.94,0.4845360824742268
|
| 26 |
+
24.0,0.3904478064647636,0.9675810473815462,0.7090472735390969,0.4328592425584793,0.93,0.6632996632996633
|
| 27 |
+
25.0,0.34499696142358377,0.9775561097256857,0.4943253467843632,0.3827376498281956,0.94,0.4845360824742268
|
| 28 |
+
26.0,0.3721648028069304,0.9775561097256857,0.4943253467843632,0.4047548016905785,0.94,0.4845360824742268
|
| 29 |
+
27.0,0.3554456866441522,0.9900249376558603,0.8724554707379135,0.39625113636255266,0.95,0.6299037749814952
|
| 30 |
+
28.0,0.39488044254797655,0.9451371571072319,0.5929309708379475,0.43483244627714157,0.89,0.6036036036036037
|
| 31 |
+
29.0,0.37072674859491667,0.9825436408977556,0.6773934030571198,0.4069021518528462,0.94,0.4845360824742268
|
| 32 |
+
30.0,0.3766249920661907,0.9825436408977556,0.6773934030571198,0.41627194330096245,0.94,0.4845360824742268
|
| 33 |
+
31.0,0.3982249589409317,0.9800498753117207,0.7092095721537346,0.4439738953113556,0.92,0.4791666666666667
|
| 34 |
+
32.0,0.4059084814013983,0.9775561097256857,0.6481427317929219,0.4447793889045715,0.93,0.48186528497409326
|
| 35 |
+
33.0,0.38821292510650995,0.9850374064837906,0.7462025316455696,0.42369448095560075,0.94,0.4845360824742268
|
| 36 |
+
34.0,0.4012398401697972,0.9850374064837906,0.7462025316455696,0.43863559514284134,0.94,0.4845360824742268
|
| 37 |
+
35.0,0.3829634743289757,0.9800498753117207,0.594949494949495,0.4156599533557892,0.94,0.4845360824742268
|
| 38 |
+
36.0,0.4690802286093372,0.9501246882793017,0.7237531000275558,0.5250361597537995,0.84,0.5914198161389173
|
| 39 |
+
37.0,0.37520660329935257,0.9875311720698254,0.8045237398849566,0.4177126908302307,0.94,0.4845360824742268
|
| 40 |
+
38.0,0.4038630349380417,0.9825436408977556,0.7263332358389393,0.4428336387872696,0.93,0.48186528497409326
|
| 41 |
+
39.0,0.3992009951438095,0.9850374064837906,0.7462025316455696,0.43643389761447904,0.94,0.609375
|
| 42 |
+
40.0,0.39977991744467145,0.9825436408977556,0.6773934030571198,0.43052552014589307,0.94,0.4845360824742268
|
| 43 |
+
41.0,0.3890989552858167,0.9850374064837906,0.7462025316455696,0.4213301122188568,0.94,0.4845360824742268
|
| 44 |
+
42.0,0.3919458248445815,0.9850374064837906,0.7819071791153009,0.42126387894153594,0.94,0.4845360824742268
|
| 45 |
+
43.0,0.35802021622657776,0.9775561097256857,0.5852200896448684,0.3959688061475754,0.94,0.4845360824742268
|
| 46 |
+
44.0,0.3986146305118713,0.9825436408977556,0.6773934030571198,0.4275959712266922,0.94,0.4845360824742268
|
| 47 |
+
45.0,0.3968860324184199,0.9850374064837906,0.7462025316455696,0.4278225752711296,0.94,0.4845360824742268
|
| 48 |
+
46.0,0.40424455735748843,0.9825436408977556,0.6773934030571198,0.432058681845665,0.94,0.4845360824742268
|
| 49 |
+
47.0,0.3885288878420642,0.9775561097256857,0.5852200896448684,0.42095537602901456,0.94,0.4845360824742268
|
| 50 |
+
48.0,0.40209627983873325,0.9850374064837906,0.7462025316455696,0.4332592514157295,0.94,0.4845360824742268
|
| 51 |
+
49.0,0.4012159317211617,0.9875311720698254,0.8045237398849566,0.43333110481500625,0.94,0.4845360824742268
|
| 52 |
+
50.0,0.3822882280236765,0.9775561097256857,0.5852200896448684,0.41407894968986514,0.94,0.4845360824742268
|
| 53 |
+
51.0,0.40340676777380663,0.9825436408977556,0.6773934030571198,0.43274484276771547,0.94,0.4845360824742268
|
| 54 |
+
52.0,0.3930920695426161,0.9850374064837906,0.7462025316455696,0.4251534986495972,0.94,0.4845360824742268
|
| 55 |
+
53.0,0.39716607347093613,0.9825436408977556,0.6773934030571198,0.4247986763715744,0.94,0.4845360824742268
|
| 56 |
+
54.0,0.40658656022792444,0.9825436408977556,0.6773934030571198,0.43453473776578905,0.94,0.4845360824742268
|
| 57 |
+
55.0,0.3995934915810155,0.9800498753117207,0.594949494949495,0.4312118202447891,0.94,0.4845360824742268
|
| 58 |
+
56.0,0.4178702341499471,0.9875311720698254,0.8045237398849566,0.4442878256738186,0.94,0.4845360824742268
|
| 59 |
+
57.0,0.4157379871591963,0.9825436408977556,0.6773934030571198,0.4440522912144661,0.94,0.4845360824742268
|
| 60 |
+
58.0,0.4046936101301055,0.9850374064837906,0.7462025316455696,0.43560825288295746,0.94,0.4845360824742268
|
| 61 |
+
59.0,0.4053080017281292,0.9850374064837906,0.7462025316455696,0.4387582039833069,0.94,0.4845360824742268
|
results/CFE/Fold_4/log_IDH.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.5036775496535171,0.8877805486284289,0.8041928448191673,0.5221419501304626,0.88,0.8251748251748252
|
| 3 |
+
1.0,0.5973364665472597,0.7206982543640897,0.6786858974358974,0.5979337742924691,0.72,0.7106242248863166
|
| 4 |
+
2.0,0.5197983355890783,0.8229426433915212,0.5909162751268014,0.5628525447845459,0.73,0.5858260469397147
|
| 5 |
+
3.0,0.5595346802933853,0.827930174563591,0.7781172564774941,0.5786387181282043,0.81,0.795059864092331
|
| 6 |
+
4.0,0.711491197347641,0.5511221945137157,0.5365947611710323,0.6972653073072433,0.55,0.54995499549955
|
| 7 |
+
5.0,0.573539924368894,0.8104738154613467,0.7606195802438105,0.5795961305499077,0.82,0.8021978021978022
|
| 8 |
+
6.0,0.49458422491378023,0.9102244389027432,0.8567516075256014,0.5177360337972641,0.91,0.8918139199423007
|
| 9 |
+
7.0,0.5344217337872322,0.885286783042394,0.8365295994328252,0.5401190176606179,0.87,0.8466800330227622
|
| 10 |
+
8.0,0.5300545829935859,0.8603491271820449,0.742948717948718,0.5592282122373581,0.79,0.7161778618732261
|
| 11 |
+
9.0,0.5544284178580429,0.8453865336658354,0.7987729862729862,0.5620778569579125,0.85,0.8340524394291404
|
| 12 |
+
10.0,0.4897379759243896,0.8653366583541147,0.8001661129568106,0.5246431371569633,0.83,0.7995046585682274
|
| 13 |
+
11.0,0.5031379997878895,0.9301745635910225,0.8945846477392219,0.5296758249402046,0.91,0.8938554074772969
|
| 14 |
+
12.0,0.4622530688222804,0.9002493765586035,0.8600055858120375,0.5216050180792808,0.81,0.7867803837953091
|
| 15 |
+
13.0,0.4341969148179242,0.9326683291770573,0.8979018341270215,0.47114954978227613,0.9,0.8809523809523809
|
| 16 |
+
14.0,0.6002634485017629,0.7182044887780549,0.6803473549807064,0.6262586855888367,0.65,0.6457131288591963
|
| 17 |
+
15.0,0.4875928871054899,0.8802992518703242,0.8379470600121237,0.5235114669799805,0.86,0.8440285204991087
|
| 18 |
+
16.0,0.4145186061127822,0.9501246882793017,0.9093170511080959,0.4780635753273964,0.85,0.7778106947118946
|
| 19 |
+
17.0,0.5052852925665658,0.9177057356608479,0.869323063249889,0.5674211773276329,0.79,0.7366771159874608
|
| 20 |
+
18.0,0.4673662694760986,0.885286783042394,0.8204244548286604,0.5255559325218201,0.82,0.7814473045167557
|
| 21 |
+
19.0,0.44006153354026434,0.9301745635910225,0.8896532746285086,0.49382120847702027,0.89,0.8650472334682862
|
| 22 |
+
20.0,0.5702053798255777,0.8029925187032418,0.7585754894563966,0.6017180797457695,0.76,0.7477931904161412
|
| 23 |
+
21.0,0.44075540258105556,0.9152119700748129,0.8752287868804451,0.49962773263454435,0.87,0.8518518518518519
|
| 24 |
+
22.0,0.42143831110357344,0.9551122194513716,0.9238221884498481,0.48865711033344267,0.86,0.8081140350877194
|
| 25 |
+
23.0,0.4177118690679793,0.9451371571072319,0.9058685446009389,0.48345100462436674,0.85,0.7972699013380187
|
| 26 |
+
24.0,0.4746460106753352,0.8603491271820449,0.8170978041311006,0.5266130274534225,0.83,0.8092245539221188
|
| 27 |
+
25.0,0.4830157443918195,0.8329177057356608,0.7858469435742924,0.5186978885531426,0.81,0.795059864092331
|
| 28 |
+
26.0,0.4236100076737249,0.9326683291770573,0.8898586993011262,0.515174823999405,0.81,0.718560213301733
|
| 29 |
+
27.0,0.5000604211986808,0.8678304239401496,0.8240660259434938,0.5536112004518509,0.8,0.7802197802197802
|
| 30 |
+
28.0,0.4921927726328224,0.9052369077306733,0.8670053065214356,0.5443033260107041,0.81,0.7897997566102445
|
| 31 |
+
29.0,0.4329722246475648,0.9526184538653366,0.9275105846534418,0.5032465440034867,0.86,0.8333333333333334
|
| 32 |
+
30.0,0.39412442986804647,0.970074812967581,0.9480794130340958,0.47974445432424545,0.84,0.7588908981314044
|
| 33 |
+
31.0,0.3798502494123511,0.9900249376558603,0.9837651821862348,0.4577374106645584,0.89,0.8513312609812136
|
| 34 |
+
32.0,0.40290696149752325,0.9251870324189526,0.8530058651026393,0.5240449991822242,0.78,0.6426250812215724
|
| 35 |
+
33.0,0.4081875400947514,0.970074812967581,0.9531542056074767,0.4921380877494812,0.86,0.8300145701796988
|
| 36 |
+
34.0,0.4159950761872337,0.942643391521197,0.8987651610778772,0.5383176752924919,0.81,0.7275985663082437
|
| 37 |
+
35.0,0.3809092968627996,0.9850374064837906,0.975398773006135,0.45655928254127504,0.85,0.8026056060007896
|
| 38 |
+
36.0,0.4035365206196421,0.9775561097256857,0.9632862331003753,0.5039649477601051,0.83,0.7762863534675615
|
| 39 |
+
37.0,0.6520006042020279,0.5985037406483791,0.5772064361071637,0.6680856874585152,0.6,0.5985547972701726
|
| 40 |
+
38.0,0.3980217567108516,0.9875311720698254,0.9796034628335419,0.4644762265682221,0.87,0.8243005811596162
|
| 41 |
+
39.0,0.4093882601308704,0.9476309226932669,0.9212821447600886,0.4892181843519211,0.83,0.8030355694589271
|
| 42 |
+
40.0,0.4059077230028975,0.9177057356608479,0.8752133528219153,0.4841542464494705,0.86,0.836372136512389
|
| 43 |
+
41.0,0.4141803033036781,0.942643391521197,0.9106307109427234,0.49147391378879546,0.86,0.8263888888888888
|
| 44 |
+
42.0,0.3881340006045867,0.9750623441396509,0.9609618380062306,0.46496730208396914,0.85,0.8159735001840265
|
| 45 |
+
43.0,0.5928183143721555,0.7206982543640897,0.6825558382810291,0.628271349966526,0.65,0.6457131288591963
|
| 46 |
+
44.0,0.38284575389210423,0.9625935162094763,0.9361715674310516,0.4710473173856735,0.85,0.7778106947118946
|
| 47 |
+
45.0,0.39460278954589156,0.9650872817955112,0.9442922918155117,0.47806913942098617,0.86,0.8263888888888888
|
| 48 |
+
46.0,0.3884745865242737,0.9526184538653366,0.9173258678125373,0.4945529755949974,0.81,0.7275985663082437
|
| 49 |
+
47.0,0.3931167675669948,0.9800498753117207,0.9681670238945781,0.4596077293157578,0.88,0.84779299847793
|
| 50 |
+
48.0,0.40541320139927756,0.9650872817955112,0.9458526234567901,0.48450522005558017,0.86,0.8263888888888888
|
| 51 |
+
49.0,0.35143356534311004,0.972568578553616,0.9536975804335275,0.43189155668020246,0.87,0.8192184675288555
|
| 52 |
+
50.0,0.43830315385970686,0.9201995012468828,0.8862814604750089,0.4958152496814728,0.85,0.8340524394291404
|
| 53 |
+
51.0,0.3763845723466088,0.9775561097256857,0.9640125641920526,0.43759015917778016,0.88,0.8440748440748441
|
| 54 |
+
52.0,0.4835617411463635,0.8603491271820449,0.8170978041311006,0.5272355690598488,0.8,0.7854997854997855
|
| 55 |
+
53.0,0.40983589004697346,0.9276807980049875,0.8828866934549886,0.4909499925374985,0.84,0.8057309373482273
|
| 56 |
+
54.0,0.428842144936992,0.9201995012468828,0.8825682700051248,0.4956872355937958,0.84,0.8161764705882353
|
| 57 |
+
55.0,0.4421339561963022,0.8827930174563591,0.8385018123238019,0.4968609401583672,0.83,0.8119260980196925
|
| 58 |
+
56.0,0.40059062860850386,0.9650872817955112,0.9458526234567901,0.4714804470539093,0.89,0.8620689655172413
|
| 59 |
+
57.0,0.3926476553045306,0.9501246882793017,0.9134656883901597,0.4898868557810783,0.82,0.7532894736842105
|
| 60 |
+
58.0,0.37498821418481576,0.9600997506234414,0.9330103575008353,0.4566441261768341,0.86,0.8081140350877194
|
| 61 |
+
59.0,0.4218362086728921,0.9451371571072319,0.9178890543559196,0.501194935142994,0.83,0.8030355694589271
|
results/CFE/Fold_4/log_LHG.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.5448133563460257,0.8204488778054863,0.7312732688011914,0.5630171585083008,0.82,0.7377622377622377
|
| 3 |
+
1.0,0.6055146813987199,0.7256857855361596,0.6869855237013909,0.6293141797184945,0.65,0.6368917937545389
|
| 4 |
+
2.0,0.5081042967680981,0.8778054862842892,0.761544156017524,0.5259217584133148,0.88,0.8191681735985534
|
| 5 |
+
3.0,0.6803992062138203,0.5610972568578554,0.5460533086343522,0.7068403854966163,0.47,0.46994699469946993
|
| 6 |
+
4.0,0.5848944957119568,0.7755610972568578,0.7298167335449481,0.614466547369957,0.7,0.6782496782496783
|
| 7 |
+
5.0,0.4779110823634854,0.8977556109725686,0.8525695633849548,0.5088620600104332,0.81,0.771607164322635
|
| 8 |
+
6.0,0.4812572356174117,0.912718204488778,0.8731299435028248,0.512399075627327,0.85,0.8159735001840265
|
| 9 |
+
7.0,0.5104560649900365,0.8802992518703242,0.834468524251806,0.5383438974618912,0.84,0.8057309373482273
|
| 10 |
+
8.0,0.5360941300517008,0.8603491271820449,0.8170978041311006,0.5696752429008484,0.78,0.7549019607843137
|
| 11 |
+
9.0,0.5618529603665606,0.8428927680798005,0.799825680440553,0.5862723663449287,0.78,0.7549019607843137
|
| 12 |
+
10.0,0.5707117327282256,0.8079800498753117,0.7646875023815511,0.5977662992477417,0.74,0.7178819444444444
|
| 13 |
+
11.0,0.5462842053011469,0.8653366583541147,0.8224965571512886,0.578697203695774,0.8,0.7738579828132067
|
| 14 |
+
12.0,0.5068740732503354,0.8902743142144638,0.85145147167778,0.5535885545611382,0.81,0.7834757834757835
|
| 15 |
+
13.0,0.49606574941751663,0.9027431421446384,0.8659908655452824,0.5292160111665726,0.86,0.8333333333333334
|
| 16 |
+
14.0,0.5974063069891751,0.7281795511221946,0.6904483679294056,0.6266439205408096,0.68,0.6637242538881883
|
| 17 |
+
15.0,0.5731766796171517,0.827930174563591,0.7845110240574451,0.6066798090934753,0.71,0.6906666666666667
|
| 18 |
+
16.0,0.5565718032624062,0.8802992518703242,0.8401328903654486,0.5889726826548576,0.82,0.7931985294117647
|
| 19 |
+
17.0,0.6118365670380153,0.6982543640897756,0.6640215487096395,0.652587553858757,0.6,0.5920032639738881
|
| 20 |
+
18.0,0.5870784804262128,0.8204488778054863,0.7770019772614929,0.6185870227217675,0.75,0.7270444371656295
|
| 21 |
+
19.0,0.4693250951178353,0.8927680798004988,0.8532972595863431,0.5137851193547249,0.84,0.8129967274427303
|
| 22 |
+
20.0,0.5816822042340353,0.7630922693266833,0.7221067221067221,0.6324688658118248,0.63,0.6189887756152817
|
| 23 |
+
21.0,0.44276299812549963,0.940149625935162,0.9104244229337304,0.5042379847168923,0.85,0.8074701578744705
|
| 24 |
+
22.0,0.40977586816968464,0.9501246882793017,0.9247033198137299,0.4587672245502472,0.89,0.8620689655172413
|
| 25 |
+
23.0,0.3984753103773493,0.9326683291770573,0.902128813559322,0.43472390830516816,0.87,0.8405103668261562
|
| 26 |
+
24.0,0.479572669154688,0.8603491271820449,0.8182465682465683,0.5335345110297203,0.8,0.7738579828132067
|
| 27 |
+
25.0,0.4580202337512352,0.8877805486284289,0.8475478393106071,0.5010964757204056,0.82,0.7896213183730716
|
| 28 |
+
26.0,0.43267246672042886,0.9526184538653366,0.92815314253383,0.4754886496067047,0.89,0.8513312609812136
|
| 29 |
+
27.0,0.4085558770303417,0.9326683291770573,0.902128813559322,0.4609141564369202,0.87,0.8405103668261562
|
| 30 |
+
28.0,0.45200959606063634,0.8628428927680798,0.8197900069452956,0.49345351845026014,0.83,0.8030355694589271
|
| 31 |
+
29.0,0.3672802397735101,0.9576059850374065,0.935715969635532,0.4204277330636978,0.88,0.84779299847793
|
| 32 |
+
30.0,0.41196797613491143,0.9650872817955112,0.946345286336876,0.4612679973244667,0.9,0.8700623700623701
|
| 33 |
+
31.0,0.3797622116426577,0.9576059850374065,0.935715969635532,0.4327048662304878,0.89,0.8552441110672457
|
| 34 |
+
32.0,0.4142915736558729,0.972568578553616,0.9564410210832963,0.4635909628868103,0.9,0.8666666666666667
|
| 35 |
+
33.0,0.3905748589675028,0.9576059850374065,0.935715969635532,0.44550940304994585,0.9,0.8700623700623701
|
| 36 |
+
34.0,0.3911314503361757,0.9800498753117207,0.9684723641795738,0.44472091645002365,0.9,0.8700623700623701
|
| 37 |
+
35.0,0.4435139117841411,0.9152119700748129,0.8801006050372872,0.4939299774169922,0.87,0.8437312176944345
|
| 38 |
+
36.0,0.4190843402596186,0.9750623441396509,0.9609618380062306,0.4760978704690933,0.87,0.8331408034912078
|
| 39 |
+
37.0,0.6094001489238549,0.685785536159601,0.653152287330441,0.6252078524231911,0.7,0.6816638370118846
|
| 40 |
+
38.0,0.4391711288110871,0.9002493765586035,0.8620571035431717,0.4880075976252556,0.83,0.7995046585682274
|
| 41 |
+
39.0,0.39945004408496276,0.9451371571072319,0.9185861941675895,0.45391514599323274,0.87,0.8405103668261562
|
| 42 |
+
40.0,0.39364919757605193,0.9750623441396509,0.9609618380062306,0.4425539895892143,0.87,0.8405103668261562
|
| 43 |
+
41.0,0.4257500392391795,0.9077306733167082,0.8709882179035694,0.47690914928913114,0.85,0.8196898665705012
|
| 44 |
+
42.0,0.40392941883080025,0.9326683291770573,0.9029116636925312,0.4683561542630196,0.87,0.8437312176944345
|
| 45 |
+
43.0,0.4741277722200551,0.827930174563591,0.7845110240574451,0.5261633065342903,0.79,0.7566909975669099
|
| 46 |
+
44.0,0.4200626155384758,0.9152119700748129,0.8801006050372872,0.4848939096927643,0.84,0.8057309373482273
|
| 47 |
+
45.0,0.3876834610602505,0.9600997506234414,0.9381172839506173,0.45501853108406065,0.86,0.8224251648909182
|
| 48 |
+
46.0,0.42702723641942564,0.9600997506234414,0.9381172839506173,0.4908630567789078,0.85,0.8119122257053292
|
| 49 |
+
47.0,0.3984563309058287,0.9501246882793017,0.9253536857781087,0.4586605876684189,0.86,0.8263888888888888
|
| 50 |
+
48.0,0.3936802215706975,0.9825436408977556,0.9722806497802794,0.45692120522260665,0.89,0.8552441110672457
|
| 51 |
+
49.0,0.4309083391306109,0.972568578553616,0.9576504699636126,0.4843079361319542,0.88,0.84779299847793
|
| 52 |
+
50.0,0.39852932325919666,0.9576059850374065,0.9362760219486432,0.46326119631528856,0.87,0.8405103668261562
|
| 53 |
+
51.0,0.4013151493750308,0.9750623441396509,0.9609618380062306,0.4658131954073906,0.87,0.8369905956112853
|
| 54 |
+
52.0,0.3887951960438802,0.9501246882793017,0.9253536857781087,0.46037199676036833,0.86,0.8300145701796988
|
| 55 |
+
53.0,0.4467701766259058,0.8977556109725686,0.8591186022399122,0.5066739776730538,0.81,0.7759169713409599
|
| 56 |
+
54.0,0.36484401920192555,0.9900249376558603,0.9839265672599006,0.43592183619737623,0.87,0.8331408034912078
|
| 57 |
+
55.0,0.4192229151874409,0.912718204488778,0.8770423584037847,0.48043470323085785,0.84,0.8095238095238095
|
| 58 |
+
56.0,0.3512559618587209,0.9825436408977556,0.9722806497802794,0.4203566928207874,0.88,0.8440748440748441
|
| 59 |
+
57.0,0.3869664718088069,0.9750623441396509,0.9602087798682226,0.4577907156944275,0.87,0.8331408034912078
|
| 60 |
+
58.0,0.44903752400988056,0.9077306733167082,0.8709882179035694,0.5051024082303047,0.83,0.7995046585682274
|
| 61 |
+
59.0,0.3762185609994684,0.9576059850374065,0.935715969635532,0.443895021378994,0.86,0.8300145701796988
|
results/CFE/Fold_4/log_mean.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
epoch,Train_loss,Train_Accuracy,Train_F1,Val_loss,Val_Accuracy,Val_F1
|
| 2 |
+
0.0,0.5325967281288836,0.8453865336658354,0.6906067176216529,0.5531002836426099,0.8266666666666667,0.702042143902609
|
| 3 |
+
1.0,0.6306940325824598,0.6724854530340814,0.5908389887909754,0.643942094941934,0.64,0.5984788397309783
|
| 4 |
+
2.0,0.4908274451049288,0.8811305070656692,0.6470105349357236,0.5243853382269541,0.8233333333333333,0.6592145977292803
|
| 5 |
+
3.0,0.6117965647655037,0.6999168744804655,0.6015027989703116,0.6394805923104286,0.6433333333333333,0.5927624494308553
|
| 6 |
+
4.0,0.5844794797431601,0.7215295095594346,0.5998353288103873,0.602596837480863,0.6833333333333332,0.6187269547418063
|
| 7 |
+
5.0,0.5280194798808047,0.8287614297589361,0.7085115232013445,0.5493125860889753,0.79,0.7171509299274318
|
| 8 |
+
6.0,0.45676011932163757,0.9243557772236076,0.7774598561582992,0.4838815991083781,0.8833333333333333,0.7847344545176261
|
| 9 |
+
7.0,0.48519634640623116,0.8960931005818787,0.7633704666758107,0.5023164105415344,0.87,0.7823868883735615
|
| 10 |
+
8.0,0.4686104704688612,0.8877805486284288,0.7064272954921579,0.5036129893362522,0.82,0.6728637116249114
|
| 11 |
+
9.0,0.48986884634492806,0.8669991687448046,0.7288640694906473,0.5123841944336891,0.8333333333333334,0.7477059138425445
|
| 12 |
+
10.0,0.4836719501593265,0.8620116375727348,0.711606739220293,0.5178580930829048,0.7999999999999999,0.6999329289171037
|
| 13 |
+
11.0,0.4540456805567095,0.9268495428096427,0.8329961280019371,0.4865464181701342,0.8833333333333334,0.7839746388687644
|
| 14 |
+
12.0,0.4475602241897227,0.9177057356608479,0.8143779699595431,0.4943112127979597,0.8433333333333334,0.733346049998084
|
| 15 |
+
13.0,0.441686483120185,0.9376558603491271,0.8479483805321922,0.474834665954113,0.89,0.7813558990029579
|
| 16 |
+
14.0,0.5646291278915809,0.7672485453034081,0.6306665365343763,0.591288095464309,0.7066666666666667,0.5835927216234299
|
| 17 |
+
15.0,0.46730592142069033,0.8911055694098088,0.7814022320940328,0.5077631535132726,0.8133333333333334,0.688742239565769
|
| 18 |
+
16.0,0.43254940121350244,0.9368246051537822,0.7814664788076798,0.47901151547829307,0.87,0.685181768865962
|
| 19 |
+
17.0,0.46987605746448385,0.8661679135494597,0.7369126716722162,0.5211543401579063,0.7766666666666667,0.6044054874785253
|
| 20 |
+
18.0,0.4593131921361708,0.8935993349958437,0.7595217029783123,0.5042355534931025,0.8333333333333334,0.7004260818212179
|
| 21 |
+
19.0,0.42026926131171183,0.9351620947630922,0.8230945900179303,0.4663346050679684,0.89,0.7208600144617477
|
| 22 |
+
20.0,0.49137777912547365,0.8462177888611805,0.7023423269095755,0.5352407027284305,0.77,0.6485764448174919
|
| 23 |
+
21.0,0.41058304931903417,0.945968412302577,0.8584374193822949,0.46259605899453166,0.89,0.7630752615692726
|
| 24 |
+
22.0,0.39451563360784214,0.9650872817955113,0.9010434314468151,0.44837912877400715,0.8966666666666666,0.7182396943597292
|
| 25 |
+
23.0,0.39869490651071615,0.9517871986699916,0.7674409016482079,0.44600797777374585,0.8866666666666667,0.7074387835461339
|
| 26 |
+
24.0,0.44822216209826227,0.8960931005818787,0.7814638819722552,0.49766892701387405,0.8533333333333334,0.7487940666783296
|
| 27 |
+
25.0,0.4286776465222128,0.8994181213632585,0.7092400432230876,0.4675106713672479,0.8566666666666666,0.6897390883132098
|
| 28 |
+
26.0,0.4094824257336947,0.9542809642560265,0.7707790628731064,0.46513942509889605,0.88,0.6848091855857245
|
| 29 |
+
27.0,0.4213539949577249,0.9301745635910224,0.8662167700802431,0.47025883108377453,0.8733333333333334,0.7502113073424773
|
| 30 |
+
28.0,0.4463609370804784,0.9044056525353282,0.7599087614348928,0.4908630969127019,0.8433333333333334,0.7321463098909251
|
| 31 |
+
29.0,0.39032640433866383,0.9642560266001662,0.8468733191153645,0.4435254763066769,0.8933333333333332,0.7218874714284967
|
| 32 |
+
30.0,0.39423913268971617,0.9725685785536159,0.8572727008093639,0.45242813164989154,0.8933333333333332,0.704496450222667
|
| 33 |
+
31.0,0.3859458066653135,0.9758935993349959,0.8762302413251671,0.44480539073546727,0.9,0.7285806795717087
|
| 34 |
+
32.0,0.4077023388515982,0.9584372402327515,0.8191965393262858,0.47747178365786863,0.87,0.6637190109541108
|
| 35 |
+
33.0,0.39565844138958806,0.9709060681629259,0.8783575689628594,0.4537806572516759,0.8999999999999999,0.7282043409054318
|
| 36 |
+
34.0,0.40278878889773556,0.969243557772236,0.8711466856343403,0.4738913956284523,0.8833333333333333,0.6940656729482803
|
| 37 |
+
35.0,0.40246222765863876,0.9600997506234416,0.8168162909976391,0.4553830711046854,0.8866666666666667,0.7102909687231502
|
| 38 |
+
36.0,0.4305670298295327,0.9675810473815462,0.8826670570447206,0.5016996593276659,0.8466666666666667,0.7336156576992288
|
| 39 |
+
37.0,0.5455357854750784,0.7572734829592686,0.6782941544408537,0.5703354102373123,0.7466666666666667,0.5882515722520947
|
| 40 |
+
38.0,0.4136853068199935,0.9567747298420616,0.8559979340718842,0.4651058209935824,0.8766666666666666,0.7018901749006456
|
| 41 |
+
39.0,0.40267976645321424,0.9592684954280964,0.8620236235244159,0.459855742653211,0.88,0.7509736454283611
|
| 42 |
+
40.0,0.3997789460078736,0.9584372402327515,0.8378561979617553,0.452411252061526,0.89,0.7204728619375906
|
| 43 |
+
41.0,0.4096764326095581,0.9451371571072319,0.8426071534972874,0.46323772509892774,0.8833333333333333,0.7102049459778724
|
| 44 |
+
42.0,0.3946697480933228,0.9642560266001663,0.8819268936046876,0.4515291117628415,0.8866666666666667,0.714746933450896
|
| 45 |
+
43.0,0.47498876760626274,0.8420615128844555,0.6840956506611141,0.5168011542161306,0.7933333333333333,0.6289800696334443
|
| 46 |
+
44.0,0.4005076666474838,0.9534497090606816,0.8312218585084862,0.46117906610170994,0.8766666666666666,0.6893592381781163
|
| 47 |
+
45.0,0.39305742767485397,0.970074812967581,0.8762040358038995,0.45363674859205877,0.8866666666666666,0.711116712084678
|
| 48 |
+
46.0,0.40658212676706257,0.9650872817955113,0.8442788516067582,0.4724915714065234,0.8666666666666667,0.6746822914959333
|
| 49 |
+
47.0,0.3933673287716292,0.969243557772236,0.8262469331058518,0.44640789767106376,0.8933333333333332,0.719572656613682
|
| 50 |
+
48.0,0.4003965676029028,0.9775561097256857,0.8881119349608797,0.45822855889797215,0.8966666666666666,0.7220563608101204
|
| 51 |
+
49.0,0.39451927873162757,0.9775561097256859,0.9052905967606989,0.4498435325423877,0.8966666666666666,0.7171825161603375
|
| 52 |
+
50.0,0.40637356838086003,0.9517871986699916,0.8025925240228401,0.4577184652288755,0.8866666666666667,0.7196996295765078
|
| 53 |
+
51.0,0.3937021631651488,0.9783873649210307,0.8674559350851343,0.44538273245096205,0.8966666666666666,0.7218671740534521
|
| 54 |
+
52.0,0.42181633557761994,0.9318370739817124,0.8295513405182596,0.47092035482327144,0.8666666666666667,0.7000168127179037
|
| 55 |
+
53.0,0.4179240467146051,0.9359933499584372,0.8064662329173403,0.4741408821940422,0.8633333333333333,0.6887279970544714
|
| 56 |
+
54.0,0.4000909081222807,0.9642560266001663,0.8479627467740484,0.45538126985232036,0.8833333333333333,0.7112844521845566
|
| 57 |
+
55.0,0.4203167876549195,0.9251870324189526,0.7701645552256938,0.4695024878780047,0.87,0.7019953300059095
|
| 58 |
+
56.0,0.38990560820572395,0.9783873649210307,0.907552337707342,0.44537498851617174,0.9033333333333333,0.7302266306887707
|
| 59 |
+
57.0,0.39845070475751126,0.969243557772236,0.8503559571051674,0.46390995422999065,0.8766666666666666,0.690322119883215
|
| 60 |
+
58.0,0.40957311610826724,0.9509559434746467,0.8500670356833248,0.4657849290966987,0.8766666666666666,0.6973849253767246
|
| 61 |
+
59.0,0.40112092380016323,0.9625935162094762,0.8666025185456737,0.4612827201684316,0.8766666666666666,0.7058620740376176
|