OCSVM-Guided Representation Learning for Unsupervised Anomaly Detection

Nicolas Pinon, Carole Lartizien
7/25/2025
cs.LGcs.AIeess.IV

Official code: Nicolas-Pinon/uad_ocsvm_guided_repr_learning (2 stars, GPL-3.0, last commit 2025-08-11).

Abstract

Unsupervised anomaly detection (UAD) aims to detect anomalies without labeled data, a necessity in many machine learning applications where anomalous samples are rare or not available. Most state-of-the-art methods fall into two categories: reconstruction-based approaches, which often reconstruct anomalies too well, and decoupled representation learning with density estimators, which can suffer from suboptimal feature spaces. While some recent methods attempt to couple feature learning and anomaly detection, they often rely on surrogate objectives, restrict kernel choices, or introduce approximations that limit their expressiveness and robustness. To address this challenge, we propose a novel method that tightly couples representation learning with an analytically solvable one-class SVM (OCSVM), through a custom loss formulation that directly aligns latent features with the OCSVM decision boundary. The model is evaluated on two tasks: a new benchmark based on MNIST-C, and a challenging brain MRI subtle lesion detection task. Unlike most methods that focus on large, hyperintense lesions at the image level, our approach succeeds to target small, non-hyperintense lesions, while we evaluate voxel-wise metrics, addressing a more clinically relevant scenario. Both experiments evaluate a form of robustness to domain shifts, including corruption types in MNIST-C and scanner/age variations in MRI. Results demonstrate performance and robustness of our proposed mode,highlighting its potential for general UAD and real-world medical imaging applications. The source code is available at https://github.com/Nicolas-Pinon/uad_ocsvm_guided_repr_learning

View on arXivView PDF

Code Implementations(1)

GPL-3.0

This repository host the code for the paper titled "SVM-Compatible Representation Learner for Unsupervised Anomaly Detection"

20PythonMar 17, 20251 years agoGPL-3.0

Similar Papers

Cite this paper

@article{pinon2025ocsvmguided,
  title  = {OCSVM-Guided Representation Learning for Unsupervised Anomaly Detection},
  author = {Nicolas Pinon and Carole Lartizien},
  year   = {2025},
  eprint = {2507.21164},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.21164v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.21164.svg)](https://codeofpaper.com/paper/2507.21164)

Discussion