Downloads · 30 days
0
CarmeloAnthony/Morphology_Function_Framework
Morphology_Function_Framework is a machine learning model from CarmeloAnthony. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository links whole-slide-image (WSI) morphology to molecular function and patient survival. It is organized as five sub-projects that run in sequence (with one branch running in parallel), each documented ind…
Downloads · 30 days
0
Access
Public
Updated Aug 7, 2026
Repo size
10.9 GB
Likes
0
Public
Click a slice to open those files.
.pt5.8 GB · 53%
From the Hugging Face model README
This repository links whole-slide-image (WSI) morphology to molecular function and patient survival. It is organized as five sub-projects that run in sequence (with one branch running in parallel), each documented independently with its own README.md and USAGE.md. This top-level document explains how the five sub-projects fit together, what data flows between them, and where to find detailed instructions.

The framework has a Morphology branch (image -> WSI-to-RNA) and a Function branch (molecular data -> Functional Extraction Module -> survival model). Both branches are trained independently, and the demo project is the joint inference stage that combines their outputs.
Morphology branch (WSI):
image_preprocess -> compute_uni_features -> src_wsi2rna_model
Function branch (molecular / GO):
src_surv_model (GeneExpression / CNA / RPPA)
Joint inference (uses checkpoints and resources from both branches):
demo
Morphology_Function_Framework/
├── img/ overview/data-download/evaluation figures used in this README
├── image_preprocess/ Step 1 (Morphology): organize 40x WSIs, cut into patches
├── compute_uni_features/ Step 2 (Morphology): patches -> HDF5 -> UNI features -> KMeans cluster_features
├── src_wsi2rna_model/ Step 3 (Morphology): ViS model, cluster_features -> predicted (simulated) gene expression
├── src_surv_model/ Function branch: Functional Extraction Module (FEM) + CoxGNN survival model,
│ trained directly from GeneExpression / CNA / RPPA molecular data
├── demo/ Joint inference: WSI -> simulated GE -> survival risk -> GO interpretation -> R figures
├── README.md this file
└── USAGE.md end-to-end setup and run instructions
| Order | Sub-project | Reads | Produces | Docs |
|---|---|---|---|---|
| 1 | image_preprocess | raw TCGA WSIs, gene-expression matrix | data/40x_grouped_with_gene_expression/<SAMPLE_ID>/wsi/*.png + gene_expression.csv | README / USAGE |
| 2 | compute_uni_features | output of step 1 | data/Patches_hdf5, data/uni_features/<PROJECT>/<SLIDE_ID>/<SLIDE_ID>.h5 (dataset cluster_features) | README / USAGE |
| 3 | src_wsi2rna_model | cluster_features from step 2 | trained checkpoints under log/<cohort>/<exp_name>/model_best*.pt | README / USAGE |
| — | src_surv_model | raw GeneExpression / CNA / RPPA + GO ontology resources (independent of steps 1-3) | FEM resources (FEM_files/<MODAL>/files/) + trained survival checkpoints under model/log/ | README / USAGE |
| 4 | demo | UNI features (step 2) + WSI2RNA checkpoints (step 3) + FEM resources and a survival checkpoint (from src_surv_model) | pipeline_results/ predictions, GO scores, GO-occlusion results, R figures | README / USAGE |
Only demo reads from more than one sub-project at once; every other sub-project reads only the single upstream directory named in the table above. See USAGE.md for the exact directory layout expected between projects and every runnable command.

Raw TCGA WSIs, gene-expression/CNA/RPPA matrices, clinical/survival tables, generated patches, UNI features, GO ontology resources, and trained checkpoints are not distributed with this repository. Each sub-project's USAGE.md documents exactly which files must be placed under which path before its scripts can run, and which resources (e.g. the UNI checkpoint, the ViS checkpoint, go-basic.obo) can be downloaded automatically when network access is available.

Quantitative evaluation (C-index, time-dependent AUC/ROC, True GE vs. Simulated-GE agreement, GO high/low group comparisons, and GO-occlusion relevance to survival risk) is produced by src_wsi2rna_model (WSI2RNA metrics), src_surv_model (five-fold CV and hold-out survival metrics, model/figure_script.R), and demo (joint hold-out evaluation and figure_script.R). See each project's USAGE.md for the exact output files.
See USAGE.md for a full, ordered, end-to-end walkthrough (environment setup, required input files, exact commands, and expected outputs for every sub-project).
Raw patient-level data (WSIs, molecular matrices, clinical/survival tables) and trained checkpoints are not included in this repository. Obtain and use them under their applicable access, privacy, and redistribution conditions. Each sub-project ships a .gitignore that excludes these paths by default.