All models

CFA

An anomaly localization method that adapts pre-trained CNN features with a patch descriptor and a memory bank.

Segmentation · 192 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (34 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
78.9M
Operations
192
Framework
PyTorch
Recurrent
No
Published
IEEE Access 10 (arXiv 2022)
Cited by
342 (as of 27 October 2026)
Authors
Sungwook Lee, Seunghyun Lee, Byung Cheol Song
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m15077
Graph hash
6c0f62f7e7166bcf9321fcbfa93e9d77a51a03432dc1732c1570ba7c5817eb37
Skeleton hash
972b0891f451dc29d4dbe2078d25c5e36f564aefad18d68f1295e73bcf065548
Architecture hash
4d10449ae00d8b0af54b14495f51be913bad08a7377bc4aa8c357e8df7c46c50
Diagram SHA-256
6ba972b644719f10d08de6a67168f4241f268609ea72784803aef98d84d3c62d
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model uses the wrn50_2 backbone at an input size of 224, the setting in the repository's training example.

CFA, short for Coupled-hypersphere-based Feature Adaptation, is a method for anomaly localization that uses features adapted to the target dataset. The paper's starting point is that earlier methods approximated the distribution of normal features without such adaptation.

CFA adds two parts to a pre-trained CNN: a learnable patch descriptor and a memory bank whose size is independent of the size of the target dataset. The patch descriptor is a 1 × 1 CoordConv layer. It is trained so that a normal patch feature is embedded inside a hypersphere centered on a nearby stored feature. At test time each patch feature is matched with its nearest neighbor in the memory bank to produce heatmaps of the degree of anomaly.

On the MVTec AD benchmark the paper reports AUROC scores of 99.5% for anomaly detection and 98.5% for anomaly localization. The paper also evaluates a variant named CFA++, which ensembles the results from cropped images and from resized-only samples. It notes slightly lower pixel-level AUROC than CFLOW when all classes are considered.

Key idea. CFA attaches a learnable patch descriptor and a compact memory bank to a pre-trained CNN, adapting its features to the target dataset for anomaly localization.

  • CFA
  • Coupled-hypersphere-based Feature Adaptation
  • CFA anomaly
  • anomaly localization
  • anomaly detection
  • industrial anomaly detection
  • MVTec AD
  • memory bank
  • feature adaptation

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{lee2022cfacoupledhyperspherebasedfeatureadaptation,
      title={CFA: Coupled-hypersphere-based Feature Adaptation for Target-Oriented Anomaly Localization}, 
      author={Sungwook Lee and Seunghyun Lee and Byung Cheol Song},
      year={2022},
      eprint={2206.04325},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2206.04325}, 
}