rciric commited on
Commit
1e727cc
·
verified ·
1 Parent(s): 036033c

Initial upload via tools/push_to_hf.py (architecture: ilex.models.brain_ldm.BrainLDM)

Browse files
Files changed (3) hide show
  1. README.md +65 -0
  2. config.json +46 -0
  3. model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: ilex
3
+ tags:
4
+ - jax
5
+ - equinox
6
+ - ilex
7
+ - neuroimaging
8
+ - 3d
9
+ license: apache-2.0
10
+ license_link: https://www.apache.org/licenses/LICENSE-2.0
11
+ ---
12
+
13
+ # Brain LDM (conditional 3D latent diffusion for synthetic brain MRI) -- Brain LDM v1 (model.pt + DDIM sampler)
14
+
15
+ ## Description
16
+
17
+ Conditional 3D latent-diffusion model that generates synthetic T1-weighted brain MRI volumes from a 4-dimensional demographic / morphometric conditioning vector (age, sex, ventricular-CSF volume, brain volume, each in [0, 1]). Composite of three sub-networks: (1) a KL-regularised 3D VAE (3-channel latent at 8x spatial downsampling) shared with the ``brain_ldm.vae`` base bundle; (2) a 553M-param conditional diffusion U-Net with channels (256, 512, 768), cross-attention at the two deepest levels, ResBlock-up/downsampling, and dual conditioning (both spatial concatenation and cross-attention from the same 4-vector); (3) a DDIM scheduler at the published training schedule (1000 timesteps, linear-beta in [1e-4, 2e-2], set_alpha_to_one=True, epsilon prediction, eta=0 by default for deterministic sampling). Trained on 31,740 UK Biobank T1w MRIs at 1mm isotropic. The local bundle is a parsimonious delta of the VAE base bundle: only the U-Net weights and scheduler buffers are stored locally; the VAE is loaded from the base.
18
+
19
+ ## Intended use
20
+
21
+ Research tool / prototype. Sample synthetic T1w brain MRI volumes conditional on a 4-dim demographic vector (age, sex, vCSF, brain volume; each normalised to [0, 1] per the upstream's UK Biobank percentiles). Generates 1 mm iso volumes at any multiple-of-8 spatial size. NOT a clinical tool.
22
+
23
+ ## Usage
24
+
25
+ ```python
26
+ from ilex.models.brain_ldm import BrainLDM
27
+ model = BrainLDM.from_pretrained('ilex-hub/brain_ldm.1')
28
+ ```
29
+
30
+ ## Authors
31
+
32
+ Walter H. L. Pinaya, Petru-Daniel Tudosiu, Jessica Dafflon, Pedro F. Da Costa, Virginia Fernandez, Parashkev Nachev, Sebastien Ourselin, M. Jorge Cardoso
33
+
34
+ ## Citation
35
+
36
+ Pinaya W. H. L., Tudosiu P.-D., Dafflon J., Da Costa P. F., Fernandez V., Nachev P., Ourselin S., Cardoso M. J. (2022). Brain imaging generation with latent diffusion models. MICCAI Workshop on Deep Generative Models, Springer, pp. 117-126.
37
+
38
+ ### References
39
+
40
+ - Pinaya W. H. L., Tudosiu P.-D., Dafflon J., Da Costa P. F., Fernandez V., Nachev P., Ourselin S., Cardoso M. J. (2022). Brain imaging generation with latent diffusion models. MICCAI Workshop on Deep Generative Models, Springer, pp. 117-126.
41
+ - Song J., Meng C., Ermon S. (2021). Denoising Diffusion Implicit Models. ICLR. https://arxiv.org/abs/2010.02502
42
+ - Upstream bundle: huggingface.co/MONAI/brain_image_synthesis_latent_diffusion_model (model.pt 2.2 GB, ~553M params; autoencoder.pt ~13.77M params).
43
+ - Architecture: monai.networks.nets.DiffusionModelUNet + monai.networks.schedulers.DDIMScheduler (MONAI 1.4+).
44
+
45
+ ## License
46
+
47
+ HF Hub license tag: `apache-2.0`
48
+
49
+ Upstream license reference: https://www.apache.org/licenses/LICENSE-2.0
50
+
51
+ ### Copyright
52
+
53
+ Network architecture and pretrained weights -- copyright (c) MONAI Consortium, released under the Apache License 2.0. JAX / Equinox port code -- copyright (c) the ilex authors, released under the Apache-2.0 / GPL-3.0 dual license used by ilex itself.
54
+
55
+ ## Upstream source
56
+
57
+ Original weights / reference implementation: https://huggingface.co/MONAI/brain_image_synthesis_latent_diffusion_model
58
+
59
+ ## Provenance
60
+
61
+ This artefact was produced by [ilex](https://github.com/hypercoil/ilex)'s
62
+ save/load pipeline. The architecture is implemented in
63
+ `ilex.models.brain_ldm.BrainLDM` and the weights have been converted
64
+ from their upstream format. See the upstream source above
65
+ for the canonical reference.
config.json ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_ilex": {
3
+ "architecture": "ilex.models.brain_ldm.model.BrainLDM",
4
+ "base_bundle": "ilex-hub/brain_ldm.vae.1",
5
+ "base_subpath": "vae",
6
+ "constructor_kwargs": {
7
+ "combined_attention": false
8
+ },
9
+ "format": "ilex",
10
+ "framework_version": {
11
+ "equinox": "0.13.8",
12
+ "ilex": "0.0.0.dev0",
13
+ "jax": "0.10.0",
14
+ "jaxlib": "0.10.0",
15
+ "numpy": "2.4.4",
16
+ "safetensors": "0.7.0"
17
+ },
18
+ "has_state": false,
19
+ "origin": "ilex-native",
20
+ "weights_status": "bundled"
21
+ },
22
+ "authors": "Walter H. L. Pinaya, Petru-Daniel Tudosiu, Jessica Dafflon, Pedro F. Da Costa, Virginia Fernandez, Parashkev Nachev, Sebastien Ourselin, M. Jorge Cardoso",
23
+ "copyright": "Network architecture and pretrained weights -- copyright (c) MONAI Consortium, released under the Apache License 2.0. JAX / Equinox port code -- copyright (c) the ilex authors, released under the Apache-2.0 / GPL-3.0 dual license used by ilex itself.",
24
+ "data_type": "nibabel",
25
+ "description": "Conditional 3D latent-diffusion model that generates synthetic T1-weighted brain MRI volumes from a 4-dimensional demographic / morphometric conditioning vector (age, sex, ventricular-CSF volume, brain volume, each in [0, 1]). Composite of three sub-networks: (1) a KL-regularised 3D VAE (3-channel latent at 8x spatial downsampling) shared with the ``brain_ldm.vae`` base bundle; (2) a 553M-param conditional diffusion U-Net with channels (256, 512, 768), cross-attention at the two deepest levels, ResBlock-up/downsampling, and dual conditioning (both spatial concatenation and cross-attention from the same 4-vector); (3) a DDIM scheduler at the published training schedule (1000 timesteps, linear-beta in [1e-4, 2e-2], set_alpha_to_one=True, epsilon prediction, eta=0 by default for deterministic sampling). Trained on 31,740 UK Biobank T1w MRIs at 1mm isotropic. The local bundle is a parsimonious delta of the VAE base bundle: only the U-Net weights and scheduler buffers are stored locally; the VAE is loaded from the base.",
26
+ "equinox_version": "0.13.8",
27
+ "ilex_version": "0.0.0.dev0",
28
+ "image_classes": "None at inference time (the model generates samples unconditional on any input image). The conditioning is a 4-vector of normalised scalars.",
29
+ "intended_use": "Research tool / prototype. Generate synthetic T1-weighted brain MRI volumes conditional on a 4-dimensional demographic / morphometric vector. The 4 conditioning scalars must each be normalised into [0, 1] using the cohort percentiles described in the upstream preprocessing recipe (UK Biobank: age 44-82 linearly mapped; sex 0/1; vCSF and brain-volume percentiles). The output is a single 3D T1w volume at the same intensity normalisation as the upstream training data ([0, 1], 1 mm isotropic). NOT a clinical tool; generated samples should not be used in any patient-facing or diagnostic workflow.",
30
+ "jax_version": "0.10.0",
31
+ "network_data_format": {
32
+ "inputs": {},
33
+ "outputs": {}
34
+ },
35
+ "numpy_version": "2.4.4",
36
+ "pred_classes": "Single-channel 3D T1-weighted brain MRI, 1 mm isotropic, intensity in [0, 1]. The published training resolution is 160 x 224 x 160; each spatial dim must be a multiple of 8 (the VAE's three stride-2 downsamples).",
37
+ "references": [
38
+ "Pinaya W. H. L., Tudosiu P.-D., Dafflon J., Da Costa P. F., Fernandez V., Nachev P., Ourselin S., Cardoso M. J. (2022). Brain imaging generation with latent diffusion models. MICCAI Workshop on Deep Generative Models, Springer, pp. 117-126.",
39
+ "Song J., Meng C., Ermon S. (2021). Denoising Diffusion Implicit Models. ICLR. https://arxiv.org/abs/2010.02502",
40
+ "Upstream bundle: huggingface.co/MONAI/brain_image_synthesis_latent_diffusion_model (model.pt 2.2 GB, ~553M params; autoencoder.pt ~13.77M params).",
41
+ "Architecture: monai.networks.nets.DiffusionModelUNet + monai.networks.schedulers.DDIMScheduler (MONAI 1.4+)."
42
+ ],
43
+ "schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20240725.json",
44
+ "task": "3D conditional latent diffusion for synthetic brain MRI",
45
+ "version": "0.0.0"
46
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db8c0633b365d0eb9c72dc6490b4412718376d9ec60594e99bc51ef886057e58
3
+ size 2212759243