{"id":19417373,"url":"https://github.com/neuronets/brainy","last_synced_at":"2026-04-22T09:02:40.217Z","repository":{"id":92392194,"uuid":"328712533","full_name":"neuronets/brainy","owner":"neuronets","description":"Automated brain segmentation","archived":false,"fork":false,"pushed_at":"2022-05-20T20:17:56.000Z","size":2662,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-25T08:41:11.897Z","etag":null,"topics":["brain","brain-extraction","mri","neuroimaging","segmentation","tensorflow","trained-models"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neuronets.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-11T15:44:09.000Z","updated_at":"2024-09-23T15:11:03.000Z","dependencies_parsed_at":"2023-06-12T04:00:32.131Z","dependency_job_id":null,"html_url":"https://github.com/neuronets/brainy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/neuronets/brainy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fbrainy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fbrainy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fbrainy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fbrainy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuronets","download_url":"https://codeload.github.com/neuronets/brainy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fbrainy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32128705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brain","brain-extraction","mri","neuroimaging","segmentation","tensorflow","trained-models"],"created_at":"2024-11-10T13:09:10.060Z","updated_at":"2026-04-22T09:02:40.212Z","avatar_url":"https://github.com/neuronets.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automated Brain Extraction\n\n### [3D U-Net](https://github.com/neuronets/nobrainer/blob/master/nobrainer/models/unet.py)\n\nThis model achieved a median Dice score of 0.97, mean of 0.96, minimum of 0.91, and maximum of 0.98 on a validation dataset of 99 T1-weighted brain scans and their corresponding binarized FreeSurfer segmentations (public and private sources). This model should be agnostic to orientation and can predict the brainmask for a volume of size 256x256x256 in approximately three seconds.\n\nThis model was trained for five epochs on a dataset of 10,000 T1-weighted brain scans comprised of both public and private data. The ground truth labels were binarized FreeSurfer segmentations (i.e., binarized `aparc+aseg.mgz`). All volumes were size 256x256x256 and had 1mm isotropic voxel sizes. Because the full volumes could not fit into memory during training, each volume was separated into non-overlapping blocks of size 128x128x128, and training was performed on blocks in batches of two. The Jaccard loss function was used. During training, approximately 50% of the volumes were augmented with random rigid transformations. That is to say, 50% of the data was rotated and translated randomly in three dimensions (the transformation for pairs of features and labels was the same). The augmented features were interpolated linearly, and the augmented labels were interpolated with nearest neighbor. Each T1-weighted volume was standard scored (i.e., Z-scored) prior to training.\n\n![Predicted brain mask on T1-weighted brain scan](/images/unet-best-prediction.png)\n\n![Predicted brain mask on T1-weighted brain scan with motion](/images/unet-worst-prediction.png)\n\n```diff\n! CAUTION: this tool is not a medical product and is only intended for research purposes. !\n```\n\n## Requirements for use\n\n- Input data should be T1-weighted magnetic resonance images. The model was trained and evaluated on this type of data.\n- CPU or, optionally, GPU\n  - Runtime will be much faster when a GPU is available. Please see the Singularity usage example below for running the model on a GPU.\n\n## Singularity usage example\n\nTo run using singularity, first pull the image:\n\n```\nsingularity pull docker://neuronets/brainy:latest-gpu\n```\n\nYou have a few options when running the image. To see them call help.\n\n```\nsingularity run --cleanenv --bind $(pwd):/data -W /data --nv brainy_latest-gpu.sif --help\n```\n\nHere is an example.\n\n```\nsingularity run --cleanenv --bind $(pwd):/data -W /data --nv \\\n    brainy_latest-gpu.sif T1_001.nii.gz output\n```\n\nThis will generate two files `output.nii.gz` and `output_orig.nii.gz`. The first is the mask in conformed FreeSurfer space. The second is the mask in the original input space.\n\n## Docker usage example\n\nInstead of singularity with GPU, once can also use Docker directly. This is an example with a CPU. Note that the CPU-based run is significantly slower.\n\n```\ndocker run -it --rm -v $(pwd):/data --user 1001:1000 neuronets/brainy:latest-cpu T1_001.nii.gz output\n```\n\nThe above examples assume there is a file named `T1_001.nii.gz` in the working directory. The option `--user 1001:1000` runs the container with user ID 1001 and group ID 1000. This will prevent the created files from being owned by root. Replace the IDs with your own IDs. On Unix-like systems, one can use `id -u` and `id -g` to get user ID and group ID, respectively.\n\n### DockerHub tags\n\nThe DockerHub tags follow the following naming scheme:\n\n- `master-gpu`: gpu version of current GitHub master\n- `latest-gpu`: gpu version of latest release\n- `SEMVER-gpu`: gpu version of semantically versioned release\n\nfor `cpu` versions replace `gpu` with `cpu`\n\n# nobrainer\n\nThis model is based on the nobrainer framework. The original model is publicly available and can be found on [neuronets/trained-models](https://github.com/neuronets/trained-models#3d-u-net).\n\nThe pre-trained model can be downloaded via `datalad`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuronets%2Fbrainy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuronets%2Fbrainy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuronets%2Fbrainy/lists"}