Aller au contenu
ModelPrésentéExterne
Télécharger

Pig Brain Segresnet

> ⚠️ License is a placeholder (cc-by-nc-4.0). Confirm the final license > before making this repo public / before publication.

TypeOtherVersionRevision 6ca1b1fCClasse

Source du modèle

Type
Other
Taille du fichier
71,7 MB
Version
vRevision 6ca1b1f
Mis à jour
1 nov. 2026
Téléchargements
3
Source
Hugging Face

Description de la source

Pig Brain SegResNet — brain extraction for porcine T2/CISS MRI

⚠️ License is a placeholder (cc-by-nc-4.0). Confirm the final license before making this repo public / before publication.

3D SegResNet (MONAI) for binary brain extraction (brain vs. background) on sub-millimeter porcine T2-weighted / 3D-CISS MRI. This is the deep-learning component of the pipeline described in "Automated Brain Extraction Using Deep Learning and Atlas-Guided Refinement."

The released pipeline pairs this model with ANTs SyN template refinement; the model alone provides a fast, template-free brain mask and the initial mask that anchors the iterative curation workflow.

Files

  • pig_brain_segresnet.pth — model state_dict (load into the architecture below).
  • config.yaml — full training/inference config (architecture + post-processing).

Architecture

fieldvalue
init_filters32
blocks_down(1, 2, 2, 4)
blocks_up(1, 1, 1)
in / out channels1 / 2
spatial_dims3
params~18.8 M

Preprocessing

LPS orientation → 1 mm isotropic resampling (bilinear) → foreground crop → spatial pad to 1283 → per-channel non-zero z-score normalization.

Inference

Gaussian-weighted sliding window (ROI 1283, overlap 0.75) with flip TTA, then: softmax → Gaussian smooth → threshold 0.6 → remove small objects (min 500) → keep largest connected component → fill holes. Spatial preprocessing is inverted to return the mask to native resolution.

Usage

import torch
from omegaconf import OmegaConf
from huggingface_hub import hf_hub_download
from monai.networks.nets import SegResNet

repo = "madhavappaneni9/pig-brain-segresnet"
cfg = OmegaConf.load(hf_hub_download(repo, "config.yaml"))
weights = hf_hub_download(repo, "pig_brain_segresnet.pth")

model = SegResNet(
    spatial_dims=cfg.model.spatial_dims,
    init_filters=cfg.model.init_filters,
    in_channels=cfg.model.in_channels,
    out_channels=cfg.model.out_channels,
    blocks_down=tuple(cfg.model.blocks_down),
    blocks_up=tuple(cfg.model.blocks_up),
    dropout_prob=0.0,
)
model.load_state_dict(torch.load(weights, map_location="cpu", weights_only=False))
model.eval()

A full preprocessing + sliding-window + post-processing example is in the demo Space.

Intended use & limitations

  • Intended: research brain extraction for porcine T2/CISS MRI; baseline for future porcine brain MRI studies.
  • Not for clinical/diagnostic use.
  • Trained on a small cohort; defaults calibrated to ~1-month Yorkshire piglets. Out-of-distribution scans (other ages/cohorts/contrasts) may segment poorly and benefit from transfer-learning the checkpoint on a small new-cohort sample.

Citation

Citation to be added on publication.

Sources

1 source
Hugging FacePrincipalVersion 6ca1b1fd8f475fe510a94e5a437bba468a622c0d
huggingface.co/madhavappaneni9/pig-brain-segresnet/tree/6ca1b1fd8f475fe510a94e5a437bba468a622c0d

Vérifié 1 nov.

Artefacts du modèle

1 artefact

pig_brain_segresnet.pth

pth · 71,7 MB · SHA-256 87e7a660b04a…499c · Hugging Face

Download file

Extraits de sources

3 extraits

--- license: cc-by-nc-4.0 tags: - medical-imaging - segmentation - brain-extraction - skull-stripping - mri - monai - segresnet - pytorch - pig - veterinary library_name: pytorch pipeline_tag: image-segmentation --- # Pig Brain SegResNet — brain extraction for porcine T2/CISS MRI > ⚠️ **License is a placeholder (`cc-by-nc-4.0`).** Confirm the final license > before making this repo public / before publication. 3D `SegResNet` (MONAI) for binary brain extraction (brain vs. background) on sub-millimeter porcine **T2-weighted / 3D-CISS** MRI. This is the deep-learning component of the pipeline described in *"Automated Brain Extraction Using Deep Learning and Atlas-Guided Refinement."* The released pipeline pairs this model with **ANTs SyN template refinement**; the model alone provides a fast, template-free brain mask and the initial mask that anchors the iterative curation workflow. ## Files - `pig_brain_segresnet.pth` — model `state_dict` (load into the architecture below). - `config.yaml` — full training/inference config (architecture + post-processing). ## Architecture | field | value | |---|---| | init_filters | 32 | | blocks_down | (1, 2, 2, 4) | | blocks_up | (1, 1, 1) | | in / out channels | 1 / 2 | | spatial_dims | 3 | | params | ~18.8 M | ## Preprocessing LPS orientation → 1 mm isotropic resampling (bilinear) → foreground crop → spatial pad to 128³ → per-channel non-zero z-score normalization. ## Inference Gaussian-weighted sliding window (ROI 128³, overlap 0.75) with flip TTA, then: softmax → Gaussian smooth → threshold 0.6 → remove small objects (min 500) → keep largest connected component → fill holes. Spatial preprocessing is inverted to return the mask to native resolution. ## Usage ```python import torch from omegaconf import OmegaConf from huggingface_hub import hf_hub_download from monai.networks.nets import SegResNet repo = "madhavappaneni9/pig-brain-segresnet" cfg = OmegaConf.load(hf_hub_download(repo, "config.yaml")) weights = hf_hub_download(repo, "pig_brain_segresnet.pth") model = SegResNet( spatial_dims=cfg.model.spatial_dims, init_filters=cfg.model.init_filters, in_channels=cfg.model.in_channels, out_channels=cfg.model.out_channels, blocks_down=tuple(cfg.model.blocks_down), blocks_up=tuple(cfg.model.blocks_up), dropout_prob=0.0, ) model.load_state_dict(torch.load(weights, map_location="cpu", weights_only=Fa...

Source context: 3 downloads · 0 likes · Pipeline image-segmentation · Library pytorch · Repo madhavappaneni9/pig-brain-segresnet

Source context: 1 downloads · 0 likes · Pipeline image-segmentation · Library pytorch · Repo madhavappaneni9/pig-brain-segresnet