Open-source project
Deep-MI/FastSurfer avatar
Deep-MI/FastSurfer

FastSurfer: a deep learning replacement for FreeSurfer volumetry

PyTorch implementation of FastSurferCNN

642 stars160 forksPythonApache-2.0

At a glance

What is it?
FastSurfer is a neuroimaging pipeline that uses trained networks to reproduce FreeSurfer style brain segmentation and cortical surface analysis in minutes rather than hours. It ships as four separate modules plus a surface reconstruction stage, and the surface stage still needs a FreeSurfer licence file.
Who is it for?
Adopt FastSurfer if your lab runs FreeSurfer for volumetric and cortical thickness analysis and needs the same output shape in minutes, because the modules are drop-in replacements for the FreeSurfer stages and the flag names match. Do not adopt it if you cannot supply a FreeSurfer licence file and need the surface pipeline, or if your images fall outside the 0.7 to 1mm isotropic range the modules expect.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 5 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What FastSurfer replaces, and what it does not

FastSurfer is described as a fast and accurate deep-learning based neuroimaging pipeline that provides a fully compatible FreeSurfer alternative for volumetric analysis within minutes and surface-based thickness analysis in about half an hour, supporting sub-millimeter resolutions down to 0.7mm. The compatibility claim is the important part of that sentence, because in neuroimaging a pipeline is not just a speed, it is a set of output files that downstream scripts read. The pipeline has two main parts, a segmentation sub-pipeline called seg that does whole brain segmentation and volumetric calculation, and a surface sub-pipeline called recon-surf that reconstructs cortical surfaces, maps cortical labels and performs point-wise and ROI thickness analysis. The primary language is Python, the licence is Apache-2.0, the default branch is dev, the last push was on 2026-10-18, and the recent release tags are v2.6.0 from 2026-10-08, v2.5.4 from 2026-06-02 and v2.5.3 from 2026-05-29. The homepage is fastsurfer.org.

bash
   curl -fsSLO https://deep-mi.org/FastSurfer/stable/fastsurfer
   chmod +x fastsurfer
   ./fastsurfer <fastsurfer_flags>

That launcher is the container route, and it is the easiest way to run the pipeline if you are not installing from source.

Four segmentation modules, each with its own scope

The segmentation stage is four networks that all run by default and can each be switched off individually. The first is asegdkt, FastSurferVINN, for whole brain segmentation; it is the core, it outputs anatomical segmentation and cortical parcellation with statistics of 95 classes, it mimics the FreeSurfer DKTatlas, it requires a T1w image, and it supports high resolution up to 0.7mm, experimental beyond that. It performs bias-field correction and calculates volume statistics corrected for partial volume effects, and the bias correction is skipped if --no_biasfield is passed. The second is cc, CorpusCallosum, for corpus callosum segmentation and shape analysis, which requires the asegdkt segmentation and the orig.mgz from the segmentation stage, standardizes brain orientation from AC and PC landmarks, and outputs CC segmentation, thickness and shape metrics. The third is cereb, CerebNet, for cerebellum sub-segmentation, which requires a T1w image that gets resampled to 1mm isotropic with no native high resolution support. The fourth is hypothal, HypVINN, for hypothalamus subsegmentation including the 3rd ventricle, the mammilare, the fornix and the optic tracts, where a T1w image is highly recommended and an optional T2w can be passed with --t2, registered to the T1w according to the --reg_mode option.

The --seg_only flag runs just the segmentation half, and the README notes the whole segmentation stage takes a few minutes on a GPU.

Surface reconstruction, and the FreeSurfer licence it needs

The surface stage is the slower half, at approximately 20 to 40 minutes with both hemispheres in parallel, which is the default, and --surf_only runs only the surface part. It supports high resolution images up to 0.7mm, experimental beyond that. Two prerequisites are named. The first is a FreeSurfer licence file, because the surface pipeline uses some FreeSurfer binaries internally, and the licence is free but not included in the images or the macOS package. The second is the outputs of the asegdkt and cc modules, which can be produced in the same run. The licence requirement is the detail that surprises people, since the project presents itself as a FreeSurfer alternative while still calling into FreeSurfer for the surface work, and it is the point at which a purely open-source workflow becomes a mixed one.

The module directory naming in the repository reflects this structure directly, with separate directories for FastSurferCNN, CorpusCallosum, CerebNet and HypVINN, plus recon_surf for the surface stage and Tutorial/ for the notebooks.

How the image requirements constrain what you can feed it

The README is unusually specific about input images, and the constraint is worth reading before you plan a study. All pipeline parts and modules require good quality MRI images, preferably from a 3T MR scanner, and FastSurfer expects a similar image quality to FreeSurfer, so what works with FreeSurfer should also work with FastSurfer. Notwithstanding module specific limitations, resolution should be between 1mm and 0.7mm isotropic, with slice thickness not exceeding 1.5mm. The preferred sequence is Siemens MPRAGE or multi-echo MPRAGE, and GE SPGR should also work, with the --vox_size flag governing high-resolution behaviour. Two modules carry extra limits beyond that. The cereb module resamples the T1w to 1mm isotropic with no native high resolution support, and both asegdkt and hypothal support 0.7mm but call it experimental beyond that. The FastSurfer-LIT extension wraps the segmentation and surface pipelines with lesion inpainting when a lesion mask is provided via --lesion_mask, and the README asks you to review LIT-modified outputs before using them for downstream analyses.

Installation routes, and what the images already contain

The README lists installation choices by system, and the structure of the list tells you how much work each option is. For macOS with Apple silicon there is an installer package with all software included. For macOS with an Intel CPU the answer is Docker. For Linux there are Apptainer or Singularity images and Docker images, for NVIDIA GPUs, for AMD GPUs as experimental, and a CPU-only option. For Windows it is Docker in WSL2. For developers there is installation from source, documented for Ubuntu, which gives full control. The images published on Docker Hub and the macOS package include all the software FastSurfer needs, so the FreeSurfer licence file is the one extra thing you have to obtain yourself, and the installation overview page is there to help you choose and explains that licence. Every installation method uses the run_fastsurfer.sh call interface, with the FastSurfer flags as the general starting point, and the container route is the easiest because the launcher takes those flags and writes and runs the container command for the right image.

The dependency set tells you what the pipeline actually pulls in

The pyproject.toml is a long list, and reading it explains the shape of the project. The direct dependencies include torch pinned to the 2.14 series, torchvision constrained to 0.29 and below 0.30, monai, torchio, nibabel for neuroimaging IO, simpleitk, scikit-image and scikit-learn, h5py, and several packages annotated with what they are needed for, meshpy and monai and pyrr for FastSurfer-CC, neuroreg for registration, libigl for the cortical ribbon, lapy for surface maths, and nibabel again with a note that a specific version is needed to fix a bug in nibabel. The package requires Python 3.12 or newer and the classifiers list 3.12, 3.13 and 3.14. The separate requirements.txt is fully pinned and says it was resolved for Linux and macOS together with Python 3.14 so that every pin exists on both, with the PyTorch backend variants deliberately not pinned and selected at install time, and the file gives the exact compile and sync commands for a CUDA or CPU backend. The repository also carries the usual supporting scripts, bids_fastsurfer.py for BIDS inputs, the long and srun variants for cluster schedulers, and stools.sh.

The requirements file gives the exact compile and sync commands, and it shows two of them, one selecting a CUDA backend with the cu132 flag and one selecting the cpu backend instead.

Where the limits are, and the alternative to weigh

Three constraints bound the adoption decision. The first is the licence dependency for the surface stage, which means a workflow that wanted to be entirely open source cannot be, at least not for cortical thickness. The second is the image quality requirement, since the pipeline expects 3T quality data at specific resolutions, and a clinic with a 1.5T scanner and thicker slices is outside the range the networks were trained for, and the README does not promise graceful degradation there. The third is the status of the project itself, where a dev branch, a development version string of 2.7.0.dev0 in the pyproject while the last tag is v2.6.0, and a beta-flavoured set of tutorials all point at a pipeline that is usable but still moving. The alternative to weigh is FreeSurfer itself, which is slower, but is the reference implementation the networks were trained to match, and it has no licence file of its own to obtain. A third option is a per-module hybrid, using the deep learning segmentation where it is strongest and falling back to the classical pipeline for the stages you do not trust, which is what the module flags in the README are shaped to allow.

Editorial conclusion

Adopt FastSurfer if your lab runs FreeSurfer for volumetric and cortical thickness analysis and needs the same output shape in minutes, because the modules are drop-in replacements for the FreeSurfer stages and the flag names match. Do not adopt it if you cannot supply a FreeSurfer licence file and need the surface pipeline, or if your images fall outside the 0.7 to 1mm isotropic range the modules expect. Before you run a cohort, check the module documentation for the resolution limits of each network, and review the FastSurfer-LIT outputs yourself, since the README asks you to review lesion-inpainting results before using them downstream.

Frequently asked questions

What is FastSurfer?

It is a fast and accurate deep-learning based neuroimaging pipeline that provides a fully compatible FreeSurfer alternative for volumetric analysis within minutes and surface-based thickness analysis in about half an hour, supporting resolutions down to 0.7mm. It is Apache 2.0 licensed and written in Python.

Which segmentation modules does FastSurfer include?

Four, all enabled by default and individually switchable: asegdkt (FastSurferVINN) for whole brain segmentation, cc (CorpusCallosum) for corpus callosum segmentation and shape analysis, cereb (CerebNet) for cerebellum sub-segmentation, and hypothal (HypVINN) for hypothalamus subsegmentation.

Does FastSurfer need a FreeSurfer licence?

The surface pipeline does. The README states that it requires a FreeSurfer licence file because it uses some FreeSurfer binaries internally, and that the licence is free but not included in the images or the macOS package.

What image requirements does FastSurfer have?

All modules require good quality MRI images, preferably from a 3T scanner, with resolution between 1mm and 0.7mm isotropic and slice thickness not exceeding 1.5mm. The preferred sequence is Siemens MPRAGE or multi-echo MPRAGE, and GE SPGR should also work.

How do I install FastSurfer on Linux or Windows?

For Linux the README points to Apptainer or Singularity images and Docker images, for NVIDIA GPUs, AMD GPUs as experimental, or CPU only. For Windows it is Docker in WSL2, for macOS with Apple silicon an installer package with all software included, for Intel Macs Docker, and for developers installation from source documented for Ubuntu.

Official sources

  1. Deep-MI/FastSurfer on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/deep-mi-fastsurfer.svg)](https://hysenlabs.com/projects/deep-mi-fastsurfer)

Was this useful?