UNSUPERVISED ANOMALY DETECTION ON
IMPLICIT SHAPE REPRESENTATIONS FOR
SARCOPENIA DETECTION

Louise Piecuch, Jeremie Huet, Antoine Frouin, Antoine Nordez, Anne-Sophie

Boureau, Diana Mateus

► To cite this version:

Louise Piecuch, Jeremie Huet, Antoine Frouin, Antoine Nordez, Anne-Sophie Boureau, et al. UNSUPERVISED ANOMALY DETECTION ON IMPLICIT SHAPE REPRESENTATIONS FOR SARCOPENIA DETECTION. International Symposium on Biomedical Imaging, Apr 2025, Houston, United States. hal-04942033

HAL Id: hal-04942033

https://hal.science/hal-04942033v1

Submitted on 12 Feb 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# UNSUPERVISED ANOMALY DETECTION ON IMPLICIT SHAPE REPRESENTATIONS FOR SARCOPENIA DETECTION

Louise Piecuch*

Jeremie Huet (MD)†◊

Antoine Frouin (PT)†

Antoine Nordez†‡

Anne-Sophie Boureau (MD)◊‡

Diana Mateus *

* Nantes Université, École Centrale Nantes, CNRS, LS2N, UMR 6004, F-44000 Nantes, France

† Nantes Université, Movement - Interactions - Performance, MIP, IP UR 4334 UFR STAPS, Nantes - France

◊ Nantes Université, CHU Nantes, CNRS, INSERM, l'Institut du thorax, F-44000 Nantes, France

‡ Institut Universitaire de France (IUF), Paris - France

## ABSTRACT

Sarcopenia is an age-related progressive loss of muscle mass and strength that significantly impacts daily life. A commonly studied criterion for characterizing the muscle mass has been the combination of 3D imaging and manual segmentations. In this paper, we instead study the muscles' shape. We rely on an implicit neural representation (INR) to model normal muscle shapes. We then introduce an unsupervised anomaly detection method to identify sarcopenic muscles based on the reconstruction error of the implicit model. Relying on a conditional INR with an auto-decoding strategy, we also learn a latent representation of the muscles that clearly separates normal from abnormal muscles in an unsupervised fashion. Experimental results on a dataset of 103 segmented volumes indicate that our double anomaly detection strategy effectively discriminates sarcopenic and non-sarcopenic muscles.

**Index Terms—** Sarcopenia, Implicit Neural Shape Representations, Shape-priors, Anomaly Detection.

## 1. INTRODUCTION

Sarcopenia is a degenerative disease characterized by muscle fat infiltrations and loss of muscular mass. It primarily affects older adults leading to decreased strength and potential independence loss [1][2]. Current diagnosis guidelines focus on strength tests and muscular mass measurements [2]. However, there is no agreement on the criteria, and different recommendations exist in Europe and Asia. [3]. A recent European consensus [1] highlights the importance of early detection and treatment, and calls for a multi-parametric muscle appreciation approach. Interestingly, the shape of the muscle, an apparently obvious parameter, has rarely been studied, despite its expected role in force production.

A critical bottleneck in mass-based criteria is the need to segment individual muscles from volumetric images. Several deep-learning solutions have thus focused on assisting the segmentation of muscles from CT and MR, ultrasound and x-ray data [4, 5, 6]. They target the accurate estimation of muscle volume, a known but weak sarcopenia biomarker [3].

Instead, we aim to characterize patients based on their muscular shape. Muscle shape has been characterized through classical shape descriptors [7, 8], or relying on statistical shape models [9, 10]. However, such methods require heavy preprocessing. Instead, we propose an implicit representation of the muscles' shape. Moreover, we concieve an anomaly detection approach based on the implicit representation of a "normal" population.

In practice, we rely on the implicit neural representation by Amiranashvili et al. [11], capable of modelling a shape-prior over a population. The method was initially designed to predict entire volumes from 2D sparse annotations, relying on the prior to accelerate manual segmentations. Here, we adapt the implicit shape-prior to an Anomaly Detection (AD) task. Similar to AD approaches based on autoencoders or generative models [12], we train the model with a dataset of non-sarcopenic muscles. Since the learned shape-prior captures the variations only within the training population, the reconstruction error is expected to be higher for out-of-distribution muscles, enabling the detection of sarcopenic muscles. Experimental results on a dataset of 103 segmented volumes detailed in Sec. 4.1, shows that the Dice reconstruction error is effectively lower for sarcopenic muscles. Moreover, a Linear Discriminant Analysis (LDA) of the latent shape representations, naturally clusters the non-sarcopenic training populations, and clearly separates sarcopenia muscles during inference. This separation, combined with a simple classifier, could assist physicians during diagnosis.

<footnote>© 2025 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.</footnote>
<figure><img src="image_2.png" /><figcaption>Fig. 1. Overview of the training and testing phases.</figcaption></figure>

## 2. RELATED WORK

Implicit Neural Representations (INRs) have been shown effective in representing 3D shapes, by letting simple coordinate-based neural networks continuously represent an occupancy grid while fitting a Signed Distance Function (SDF) [13]. Neural SDFs address known problems of voxel and mesh representations, including limited resolution or foldings. They have been adapted to fit single or multiple surfaces from medical images [14, 11]. A clever way to learn a consistent INR across multiple shapes is the autodecoder (AutoD) principle introduced in [15] and used in [11]. An AutoD conditions the INR to an additional learnable latent variable defined on a coordinate system shared over the dataset. The joint INR becomes a conditional generative shape model. When trained on a population, the AutoD INR learns an implicit shape prior, with latent variables encoding variations across the population, including changes in shape. Such shape prior was used to complete partial annotations for volume segmentation [11]. We extend this approach to the unsupervised detection of abnormal shapes, relying either on the reconstruction error or distances in the learned latent space. To the best of our knowledge, anomaly detection based on INRs has been studied for images [16] and to detect abnormal regions in point-clouds [17], but not for global shape abnormalities.

## 3. METHOD

This paper aims to develop a generative model to distinguish variations between “normal” and sarcopenic muscles. Given a dataset of N segmented “normal” muscles {$Y_i$}$_{i=1}^N$, we train

a generative model $f_\theta$ to learn the expected normal shape variations across the population. Here, each muscle $Y_i$ is a binary volumetric occupancy grid. We specifically choose the implicit generative model in [11] since it provides for each input volume: a latent representation $z_i$ in a shared coordinate system, and a reconstruction of the original input volume $\hat{Y}_i$. As later shown, applying $f_\theta$ to reconstruct abnormal (i.e. sarcopenic) data, leads to observable discrepancies both in $z_i$ and $\hat{Y}_i$, with respect to the “normal” training data. Next, we describe in detail the chosen generative model, as well as the training and inference phases illustrated in Fig. 1.

### 3.1. Implicit prior shape model

The generative model in [11], consists of a binary classifier, parameterized by a Multilayer Perceptron (MLP) $f_\theta$, used to classify a voxel as occupied or not given its 3D coordinates $x \in \mathbb{R}^3$ and a conditioning vector $z \in \mathbb{R}^d$:

$$f_{\theta}: \mathbb{R}^3 \times \mathbb{R}^d \rightarrow [0, 1] \qquad (1)$$

As shown in Fig. 1, the coordinates of all points of the volume under study are given one-by-one to the MLP, along with $z$. The MLP provides the probability that the voxel associated with the coordinates $x$ is located within the shape, i.e. it predicts its occupancy probability $\hat{y} = f_\theta(x, z)$.

For a dataset, one latent vector $z_i$ is learned to represent each volume $Y_i$ during training. Such latent conditioning enables to learn a single shared classifier to predict the occupancy grids for the entire population {$Y_i$}$_{i=1}^N$. Learned with an autodecoding scheme, the resultant MLP is a generative model encoding a shape prior over possible values of $z$. In its original version, the shape prior was used to fill incomplete annotations $\hat{Y}_i$. As we describe next, we deal with full occupancy grids, and an anomaly detection task.

### 3.2. Training Phase

The model $f_\theta$ is trained on full binary occupancy grids of a dataset of N “normal” muscles {$Y_i$}$_{i=1}^N$. For a training shape $Y_i$, the auto-decoder training scheme is used to compute its latent vector $z_i$. In practice, the {$z_i$} are optimized along with the parameters $\theta$. To do so, a Soft Dice loss combined with a cross-entropy loss is used: $L(\hat{Y}_i, Y_i)$. Where $X_i = \{x_i^j\}_{j=1}^M$ are the set of 3D coordinates of each shape, $Y_i = \{y_i^j\}_{j=1}^M$ their associated ground truth (GT) occupancies and $\hat{Y}_i = \{f_\theta(x_i^j, z_i)\}_{j=1}^M$ the predictions. The overall minimization problem is formalized as:

$$\min_{\{z_i\}_{i=1}^N, \theta} \frac{1}{N} \sum_{i=1}^N \left( L(\hat{Y}_i, Y_i) + \lambda \|z_i\|_2^2 \right), \qquad (2)$$

with $\lambda$ a regularization term. Effectively, the latent vectors are initialized randomly for each shape $z_i \sim N(0, 0.1^2)$, and the gradient backpropagation updates both $z_i$ and $\theta$.
<figure><img src="image_3.png" /></figure>

<figure><img src="image_4.png" /><figcaption>**Fig. 2.** (left) Example muscles from the dataset. (right) Distribution of the muscle volumes for each fold, considering the train/test split vs. the average volume of RF muscle in patients with sarcopenia.</figcaption></figure>

### 3.3. Inference and Anomaly Detection

During inference (see Fig. 1-bottom), $f_θ$ allows to predict new unseen shapes $S$ after training and freezing $θ$. To this end, the 3D coordinates and full binary GT occupancy grid $S$ are fed to optimize the unknown latent variable $z_S$. After obtaining the predicted occupancy probabilities $\hat{S}$, we minimize:

$$z_S = \arg\min_z \mathcal{L}(\hat{S}, S) + \lambda \|z\|_2^2. \quad (3)$$

Since our goal is to discriminate “normal” from “sarcopenic” muscles, we propose to compute the reconstruction error, here the Dice score $DSC(\hat{S}, S)$, for a new shape. A threshold on the error is used to detect a “sarcopenic” shape. We also find the projection of all the latent variables $z_i$ onto the 2D most discriminant directions to analyse the separation of normal and sarcopenic muscles in the latent space.

## 4. EXPERIMENTAL VALIDATION

### 4.1. Experimental settings

**Datasets.** Two in-house datasets were used for this study. The *Young subjects dataset* is composed of 3D Ultrasounds (3DUS) from 15 healthy participants, 8 males, aged 27 ± 2 years (height: 172 ± 6 cm, weight: 63 ± 6kg). Each participant was scanned 3 times with a different compression of the probe: standard, minimal compression and using a gel pad; leading to 45 images in total. The segmentations were manually created by an expert clinician. The initial study included 4 muscles [18], but we focus on the right Rectus Femoris (RF). The *DIASEM dataset* includes 58 “older adults” (age ≥ 75), hospitalized in rehabilitation or geriatric medicine, with 23 diagnosed with sarcopenia. 3DUS scans were acquired in patients’ rooms using the protocol from [19], with patients lying on their backs. Three muscles per patient were scanned and manually segmented; as before, we focus on the right RF. Manual segmentations were created by the same expert as for the *Young subjects dataset*.

The “normal” dataset is composed of all volumes in the *Young subjects dataset* and the non-sarcopenic older subjects of the DIASEM dataset. This normal data are split across the train (77%) and test sets (23%), with an equilibrated partition of the young (10%) and non-sarcopenic (13%) test muscles. The 23 sarcopenic muscles of DIASEM are all part of the test set. Experiments follow a 5-fold cross-validation to balance the limited data respecting a subject-wise splitting.

Example RF muscles from each subgroup in Fig. 2, show that muscles without sarcopenia can resemble those from sarcopenic older adults. However, sarcopenic muscles appear less “smooth”, with possibly affected boundaries, supporting our hypothesis of characterizing sarcopenia through shape.

**Evaluation Metrics.** We measure the volumetric error of the muscles, in $cm^3$ and percentage as: $Vol_{err_{cm^3}} = |V_{GT} - V_{pred}|$ and $Vol_{err_{%}} = 100 \times \frac{|V_{GT}V_{pred}|}{V_{GT}}$, where $V_{GT}$ and $V_{pred}$ correspond to the ground-truth and predicted volumes of a given muscle respectively. Note that $Vol_{err_{%}}$ takes into account the size of the muscle while $Vol_{err_{cm^3}}$ does not. We also rely on the Dice Score (DSC) to evaluate the reconstruction error.

**Implementation details.** Most of the model parameters are kept as in [11] including the MLP architecture: the learning rate was set to $1.0e^{-4}$ and to $1.0e^{-3}$ for the AutoD. The MLP has 8 layers, the output of the 4th layer is concatenated with the 3D coordinates, and the dimension of $z$ is 128. Contrary to [11], the entire volume was provided during the training and testing phases with a batch size of 1. The model was updated using ADAM during 2500 epochs for training and 1500 epochs for inference on a GPU NVIDIA GeForce RTX 3090. Training and inference took ~3h and ~1h, respectively.

### 4.2. Quantitative results

**Muscle volume** In the first experiment we compare the volume of the muscles as measured in Sec. 4.1 across the different splits. The results in Fig. 2 show that volume can distinguish subjects from the *Young* and *DIASEM* (older sub-
<figure><img src="image_5.png" /><figcaption>**Fig. 3.** (a) Volumetric error in % and (b) Dice Score by fold for the five test sets separated into “Test-healthy” (young and older adults, non-sarcopenic) and “Test-sarcopenia” (sarcopenic). (c) LDA applied on the train and test latents *z* of fold 1.</figcaption></figure>

jects) datasets. In contrast, the volumes of muscles with and without sarcopenia are very close, indicating that a volume threshold alone is insufficient to distinguish between these two populations. Similar observations can be made for the volumes of test muscles reconstructed using *f*<sub>θ</sub> during inference as reported in Fig. 3-(a). The boxplots show the volumetric error in percent for each fold separated into two subsets: “Test_normal” with non-sarcopenic young and older subjects, and “Test_sarcopenia” with sarcopenic muscles only. While “normal” boxplots have a larger variance, the volume of reconstructions is insufficient to characterize sarcopenia.

**Reconstruction Dice** In contrast to the volume, the proposed reconstruction error based on the Dice error between the original muscles and their reconstruction, as reported in Fig. 3-(b), shows a very relevant separation between the two test groups, suggesting that a threshold of around 0.93 could detect shape anomalies, i.e. discriminate sarcopenia.

but some differences are perceptible. These subtle variations are also reflected in the latent space, where differences become much more noticeable. To observe such changes, we apply a Linear Discriminant Analysis (LDA) to the latent spaces of the training and test data of fold 1. We can clearly observe in Fig. 3-(c) the clusters forming according to the populations. It is striking that all normal test data perfectly falls within the cluster of their training data, while all the sarcopenia muscles fall far away from normal cases. This suggests that a linear classifier in the latent space can separate the sarcopenic patient population from the rest. If having two normal clusters (yellow and blue) probably captures acquisition variations between the two datasets, the differences between the two DIASEM subpopulations, patients with (red) and without (yellow) sarcopenia, likely represent changes induced by the disease. As a reminder, the two subsets belong to the same DIASEM dataset and follow the same acquisition protocol. Similar results are observed in the remaining folds.

## 4.3. Qualitative results and latent space anomalies

<figure><img src="image_6.png" /><figcaption>**Fig. 4.** Qualitative results. Muscles from older adults with (a) and without (b) sarcopenia vs. from young subjects (c and d). Superposition of the GT (in green) and the prediction (in red).</figcaption></figure>

Fig. 4 shows the occupancy grid prediction of different test subjects in red vs their GT. Overall, the muscles are well reconstructed, even for the older subjects with sarcopenia (a),

## 5. CONCLUSION

We introduce an implicit neural representation of muscle shapes as well as an unsupervised and implicit shape anomaly detection method based on the representation. To this end, we adapted the method in [11], designed to complete entire volumes from 2D sparse annotations, to a method for anomaly detection. Training on a dataset of non-sarcopenic muscles, we learned a shape prior that captures variations within the training population. Consequently, out-of-distribution muscles exhibit higher reconstruction errors, enabling the detection of sarcopenic muscles. Experimental results on 103 segmented muscles indicate lower Dice reconstruction errors for sarcopenic muscles. Additionally, an LDA analysis of the latent shape representations effectively clusters non-sarcopenic populations and distinctly separates sarcopenic muscles during inference. In future work, we plan to apply the proposed method to other muscles and datasets. Additionally, incorporating an automatic segmentation could address
the challenges associated with manual annotations. Lastly, a
more thorough analysis of the learned latent representations
could improve interpretability of the captured differences.

# 6. COMPLIANCE WITH ETHICAL STANDARDS

This protocol was approved by the local ethics committee
of the Nantes University Hospital "Groupe Nantais d'éthique
dans le Domaine de la Santé" : AVIS 24-6-01-191.

7. REFERENCES

[1] A. J. Cruz-Jentoft, G. Bahat, J. Bauer, Y. Boirie, O. Bruyère, T. Cederholm, C. Cooper, F. Landi, Y. Rolland, A. A. Sayer, et al., "Sarcopenia: revised european consensus on definition and diagnosis," *Age and ageing*, vol. 48, no. 1, pp. 16–31, 2019.

[2] V. Chianca, D. Albano, C. Messina, S. Gitto, G. Ruffo, S. Guarino, F. Del Grande, and L. M. Sconfienza, "Sarcopenia: imaging assessment and clinical application," *Abdominal Radiology*, vol. 47, no. 9, 2022.

[3] H. S. Kim, H. Kim, S. Kim, Y. Cha, J.-T. Kim, J.-W. Kim, Y.-C. Ha, and J-I Yoo, "Precise individual muscle segmentation in whole thigh ct scans for sarcopenia assessment using u-net transformer," *Sci. Reports*, vol. 14, no. 1, pp. 3301, 2024.

[4] L. Piecuch, V. Gonzales Duque, A. Sarcher, E. Hollville, A. Nordez, G. Rabita, Ga. Guilhem, and D. Mateus, "Muscle volume quantification: guiding transformers with anatomical priors," in *Int. ShapeMI workshop at Med. Img. Computing and Comput. Assisted Interventions (MICCAI)*. Springer, 2023, pp. 173–187.

[5] Chanti D.A., Crouzier M. Duque V.G., Nordez A., Lacourpaille L., and Mateus D., "Ifss-net: Interactive few-shot siamese network for faster muscle segmentation and propagation in volumetric ultrasound.," *IEEE Trans Med. Img.*, vol. 40, no. 10, Oct 2021.

[6] Y. Gu, Y. Otake, K. Uemura, M. Takao, M. Soufi, Y. Hiasa, H. Talbot, S. Okada, N. Sugano, and Y. Sato, "Mskdex: Musculoskeletal (MSK) decomposition from an X-Ray image for fine-grained estimation of lean muscle mass and muscle volume," in *Med. Img. Computing and Comput. Assisted Interventions (MICCAI)*, 2023.

[7] A. D. Ward, G. Hamarneh, R. Ashry, and M. E. Schweitzer, "3D shape analysis of the supraspinatus muscle: A clinical study of the relationship between shape and pathology," *Academic Radiology*, vol. 14, no. 10, pp. 1229–1241, 2007.

[8] B. HajGhanbari, G. Hamarneh, N. Changizi, A. D. Ward, and W. D. Reid, "MRI-based 3D shape analysis of thigh muscles: Patients with chronic obstructive pulmonary disease versus healthy adults," *Academic Radiology*, vol. 18, no. 2, pp. 155-166, 2011.

[9] S.G. Bin Ghouth, S.A. Williams, S.L. Reid, T.F. Besier, and G.G. Handsfield, "A statistical shape model of soleus muscle morphology in spastic cerebral palsy.," *Sci. Reports*, vol. 12, no. 7711, 2022.

[10] Sutherland A.M.T., Serpell B.G. Lynch J.T., Picker- ing M.R., Newman P., Perriman D.M., and Kenneally- Dabrowski C., "Statistical shape modelling reveals dif- ferences in hamstring morphology between professional rugby players and sprinters.," *Journal of Sports Sci.*, vol. 41, no. 2, pp. 164–171, Jan 2023.

[11] T. Amiranashvili, D. Lüdke, H. Bran Li, S. Zachow, and B. H. Menze, "Learning continuous shape priors from sparse data with neural implicit functions," *Med. Img. Analysis*, vol. 94, pp. 103099, 2024.

[12] G. Pang, C. Shen, L. Cao, and A. V. D. Hengel, "Deep learning for anomaly detection: A review," *ACM Comput. Surv.*, vol. 54, no. 2, Mar. 2021.

[13] A. Gropp, L. Yariv, N. Haim, M. Atzmon, and Y. Lipman, "Implicit geometric regularization for learning shapes," in *Int. Conf. on Mach. Learning (ICML)*, 2020.

[14] D. Alblas, C. Brune, K. K. Yeung, and J. M. Wolterink, "Going off-grid: continuous implicit neural representations for 3D vascular modeling," in *Int Work. on Statist. Atlases and Computational Models of the Heart*, 2022.

[15] J. J. Park, P. Florence, J. Straub, R. Newcombe, and S. Lovegrove, "Deepsdf: Learning continuous signed distance functions for shape representation.," in *Conf. on Comput. Vision and Pattern Recognition (CVPR)*, 2019.

[16] S. Naval M. and G. Tarroni, "Implicit field learning for unsupervised anomaly detection in medical images," in *Med. Img. Computing and Comput. Assisted Interventions (MICCAI)*, 2021.

[17] P. Bergmann and D. Sattlegger, "Anomaly detection in 3D point clouds using deep geometric descriptors," in *Winter Conf. on Applications of Comput. Vision (WACV)*, 2023.

[18] J. Huet, A.-S. Boureau, A. Sarcher, C. Cornu, and A. Nordez, "Validation of a scanning technique with minimal compression for measuring muscle volume with freehand 3d ultrasound," *Journal of Biomechanics*, vol. 162, pp. 111878, 2024.
<footnote>[19] J. Huet, A. Nordez, A. Sarcher, M. Mathieu, C. Cornu, and A. Boureau, “Concordance of freehand 3D-ultrasound muscle measurements with sarcopenia parameters in a geriatric rehabilitation ward,” in *Journal of Cachexia, Sarcopenia and Muscle*, 2024.</footnote>