How jw-chae/cleancon works
CleanCon is an experimental pipeline for memory-based anomaly detection: it ranks training images by out-of-bag cross-image support, restricts which patches can enter a fixed-budget memory, then evaluates anomaly localization. The README emphasizes that the detector representation, coreset construction, memory size, and test-time scoring are otherwise held constant. The graph preserves feature caching, selection and audit stages, memory construction, scoring, and evaluation, plus the documented SoftPatch and retention-sweep branches. Some experiment internals were not excerpted, so those links are shown only where the README or source index supports them.
Main entry points: run_fixed_budget.py Fixed-budget runner · build_dinov2_train_cache.py Cache extraction · oob.py OOB support scoring · approx_greedy_coreset.py Greedy coreset
Components 16
Features and caches
- DINOv2 features
cleancon/models/backbones/dinov2_multilayer.py - Feature cache
cleancon/purification/cache.py - Cache extraction
experiments/build_dinov2_train_cache.py
Support-based selection
- OOB support scoring
cleancon/purification/oob.py - Soft projection
cleancon/consensus/soft_projection.py - Protocol views
cleancon/purification/protocol_view.py - Retention and salvage
cleancon/purification/safe_expansion.py - SoftPatch selection
cleancon/purification/softpatch.py
Memory and detection
- Greedy coreset
cleancon/memory/builders/approx_greedy_coreset.py - Memory bank
cleancon/memory/bank.py - Fixed-budget runner
experiments/run_fixed_budget.py - Anomaly maps
cleancon/postprocess/maps.py
Evaluation and analysis
- Detection metrics
cleancon/eval/metrics.py - Retention sweep
experiments/run_retention_sweep.py - Paper analysis
analysis/aggregate_main.py
Other components
- Experiment runner
Connections 17
- Experiment runner → Cache extraction: builds caches
README.md - Cache extraction → DINOv2 features: extracts features
experiments/build_dinov2_train_cache.py - Cache extraction → Feature cache: writes features
- Experiment runner → Fixed-budget runner: runs comparison
README.md - Fixed-budget runner → Feature cache: loads caches
- Fixed-budget runner → OOB support scoring: scores support
experiments/run_fixed_budget.py - OOB support scoring → Soft projection: computes residuals
- Fixed-budget runner → Protocol views: composes protocol
- Fixed-budget runner → Retention and salvage: selects candidates
- Fixed-budget runner → SoftPatch selection: offers variant
experiments/run_fixed_budget.py - Fixed-budget runner → Greedy coreset: builds coreset
experiments/run_fixed_budget.py - Greedy coreset → Memory bank: returns bank
cleancon/memory/builders/approx_greedy_coreset.py - Fixed-budget runner → Anomaly maps: processes maps
experiments/run_fixed_budget.py - Fixed-budget runner → Detection metrics: evaluates detector
experiments/run_fixed_budget.py - Experiment runner → Retention sweep: runs sweep
README.md - Retention sweep → Fixed-budget runner: reuses runner
experiments/run_retention_sweep.py - Experiment runner → Paper analysis: aggregates results