Skip to content
프로젝트

ymxlzgy/FoundAD has 110 GitHub stars and 11 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-19 16:04 UTC. Last push 2026-09-12.

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
기록 수집 중
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

소개

[ICLR 2026] The implementation of the paper Foundation Visual Encoders Are Secretly Few-Shot Anomaly Detectors

머신러닝

README.md

Original

FoundAD FoundAD logo showing a stylized magnifying glass over abstract shapes, representing anomaly detection in visual data. The logo is set against a neutral background and does not contain any text. The tone is professional and focused.

The implementation of the paper Foundation Visual Encoders Are Secretly Few-Shot Anomaly Detectors (arXiv, OpenReview).

Guangyao Zhai, Yue Zhou, Xinyan Deng, Lars Heckler, Nassir Navab, and Benjamin Busam
Technical University of Munich • MVTec Software GmbH

Table of Contents

  1. Environment Setup
  2. Quick Start
  3. Training and Inference
  4. Acknowledgement

Environment Setup

All Python dependencies are listed in requirements.txt. We recommend Python ≥ 3.10.

conda create -n foundad python=3.10
conda activate foundad
git clone [email protected]:ymxlzgy/FoundAD.git
cd FoundAD
pip install -r requirements.txt
pip install -e .

Quick Start

Before we start, please make sure you have the rights to use DINOv3. Download our trained manifold projectors, and put them to ./logs/.

DINOv3-based 1-shot 2-shot 4-shot
MVTec AD ⬇️ link ⬇️ link ⬇️ link
VisA ⬇️ link ⬇️ link ⬇️ link

Run a demo on MVTec-AD

python foundad/main.py mode=demo app=test testing.segmentation_vis=True data.dataset=mvtec data.data_name=mvtec_1shot data.test_root=assets/mvtec

Or a demo on VisA

python foundad/main.py mode=demo app=test testing.segmentation_vis=True data.dataset=visa data.data_name=visa_4shot data.test_root=assets/visa

Training and Inference

Dataset Preparation

Dataset Preferred download
MVTec AD Official site: Here
VisA We use the structured dataset of RealNet.

Few-Shot Sampling

Create a few-shot subset with sample.py:

python foundad/src/sample.py source=/media/ymxlzgy/Data21/xinyan/visa target=/media/ymxlzgy/Data21/xinyan/visa_tmp seed=42 num_samples=2

where source is the dataset folder, target is the folder of few-shot samples, and num_samples is the number of samples training models, e.g., 2 for 2-shot learning. seed can be adjusted to have multiple rounds of experiment.

Model Training

python foundad/main.py mode=train data.batch_size=8 data.dataset=mvtec data.data_name=mvtec_1shot data.data_path=/media/ymxlzgy/Data21/xinyan app=train_dinov3 diy_name=dbug

where data.dataset is "mvtec" or "visa", data.data_name is the folder name of few-shot samples, data.data_path is the path where the few-shot folder is at, app is "train_dinov3" or other model configs under configs/app/, and diy_name (optionally) is the post-fix name of the model saving directory. To adjust the layer, please specify app.meta.n_layer.

Anomaly Detection / Inference

After training, run inference:

python foundad/main.py mode=AD data.dataset=mvtec data.data_name=mvtec_1shot diy_name=dbug data.test_root=/media/ymxlzgy/Data21/xinyan/mvtec app=test app.ckpt_step=1950

where data.test_root is the dataset folder, and app is test_dinov2 or test_dinov3 under configs/app/. To adjust sample number K, please specify testing.K_top_mvtec and testing.K_top_visa.

Acknowledgement

This repo utilizes DINOv3, DINOv2, DINO, SigLIP, CLIP and DINOSigLIP. We also thank I-JEPA for the inspiration.