Learning Fuzzy Clustering for SPECT/CT Segmentation
Segmentation running entirely in your browser. In Chen et al., Medical Physics, 2021, I turned the objective of the classical fuzzy C-means (FCM) algorithm into loss functions for training a ConvNet: an unsupervised robust FCM loss that needs no labels at all, a supervised FCM loss, and their semi-supervised combination. This page lets you try them on simulated bone SPECT: change the count level to add noise, adjust the spatial regularization β, and decide how much the network was allowed to learn from labels.
- Bone Dice
- ConvNet – Classical –
- Lesion Dice
- ConvNet – Classical –
- ConvNet inference
- –
- Classical RFCM
- –
What you are looking at
Fuzzy C-means assigns every pixel a membership uk in each of C classes and finds class means vk that minimize ΣjΣk ujk2(xj − vk)2. Its robust variant (RFCM) adds β·Σ ujk2Σl∈N(j)Σm≠kulm2, which penalizes a pixel for disagreeing with its neighbours and so suppresses noise. Classically this objective is minimized iteratively for every new image.
The idea of the paper is to use this objective as the loss of a ConvNet. The class means are computed from the network's own predicted memberships, so the loss needs only the input image: the network learns to segment without any labels. When labels exist, a supervised FCM term with weight α can be added, which steers the clusters from pure intensity groups towards anatomical classes. Once trained, the network segments a new image in a single forward pass.
Things to try: drop the counts to 5–10 and move β between 0 and the middle; switch α from 0 to 1 and watch bone boundaries and lesions change; compare the ConvNet with the classical algorithm at the same β.
How this demo was built
- Data. Tc-99m MDP bone SPECT slices simulated from real CT anatomy: soft-tissue, bone (6–14× soft tissue) and hot lesions in bone, averaged onto a 4.4 mm grid and blurred to 7–10.6 mm resolution. The paper used XCAT phantoms with a full SPECT simulation; this is a simplified image-domain version.
- Region. As in SPECT/CT practice, clustering runs inside the body contour from CT, with three classes: soft tissue, normal bone, lesion.
- Network. A 0.48M-parameter U-Net conditioned on (β, α) with FiLM layers, trained for 20,000 iterations on 5,016 simulated slices from 420 patients at random count levels. Loss: RFCM(β) + α·supervised FCM, with clusters ordered by mean intensity.
- Browser. Exported to ONNX (fp16 weights, about 1 MB) and run with ONNX Runtime Web. The classical RFCM baseline is 60 iterations of the standard update, written in JavaScript.
- Paper: Learning fuzzy clustering for SPECT/CT segmentation via convolutional neural networks, Medical Physics, 2021 (arXiv)
- Loss functions in PyTorch and TensorFlow · project page
CT anatomy: FDG-PET-CT-Lesions (Gatidis & Kuestner, TCIA 2022, CC BY 4.0), torso slices of held-out test patients only. Images on this page are simulations, not patient SPECT. Nothing leaves your device.