Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beyond Dents and Scratches: Logical Constraints in Unsupervised Anomaly Detection and Localization (2022) #79

Open
YoojLee opened this issue Feb 27, 2024 · 0 comments
Labels
2022 papers publisehd in 2022 AD Anomaly Detection IJCV papers published on International Journal of Computer Vision

Comments

@YoojLee
Copy link
Owner

YoojLee commented Feb 27, 2024

image

Summary

  • logical anomaly를 다루는 benchmark / dataset은 없었다. → logical anomaly를 반영할 수 있는 데이터셋 구축해서 제안함.
  • 요약하자면, logical anomaly는 보다 long-range dependancy를 violate한다. 즉, logical anomaly를 detect하는 데에 있어서 long-range dependancy를 파악하는 것은 중요함. → long-range dependency를 파악하는 경우는 어느 정도 global context를 파악하는 게 필요함.
  • 따라서, global context를 잡아내는 global branch와 local context를 잘 잡아내는 local branch; 두 개의 브랜치를 둬서 feature regression error를 이용하여 두 가지 타입의 anomaly를 효과적으로 탐지하겠다.

Description of the MVTec LOCO

  • 1772 images for training, 304 for validation, 1568 for testing
  • Training은 정상만으로 구성
  • 여기서는 validation도 구성하는데, validation도 정상만으로 구성
  • test set은 정상, 비정상 둘 다
  • Dataset stats
    image

logical constraints?

→ 어떤 논리 규칙을 의미하는 것 같음. 이걸 단순히 image recognition의 접근법만으로 표현을 할 수 있을까 싶긴 하나, 대략 global context라고 얘기하는 것 같음. 조금 더 생각해보면, mid-scale 정도의 feature map이 아닐까? 너무 또 global하게 보는 것보다 region 정보를 가지고 있는 게 중요할 것 같다.

image
→ 많거나, 길거나, 어디는 비어있거나, misallocated, 서로 다른 색의 connector에 연결이 되어 있거나 등등

image
→ 이걸 봤을 때, loco ad라고 해서 anomaly score를 픽셀별로 산출해준다는 점에서 크게 다른 것은 없음.

GCAD (Global Context Anomaly Detection)

logical anomalies를 탐지하는 프레임워크 역시 제안
image

  • Local Branch → Structural anomalies를 잡아내는 부분
  • Global Branch → Logical anomalies를 잡아내는 부분
    • logical anomalies와 같은 경우, 위치 구성 등 어느 정도 global한 정보도 필요로 함.

image
image

→ (좌측 그림) 이거 보면 autoencoder 구조가 bottleneck이 있어서 global context를 조금 잘 잡는다. 따라서, logical anomalies도 어느 정도 잘 잡고 있음. 그래도 reconstruction prediction이 떨어져서 false positive가 발생하는 경향을 확인할 수 있음.

→ 두 개의 encoder (구조는 우측 그림 참고): $E_{glo}$ & $R_{glo}$; $E_{glo}$$E_{loc}$으로부터 knowledge를 distill받음. 이론상으로는 $E_{loc}$$E_{glo}$의 upsampled map의 차이로부터 anomaly score를 산출할 수 있음. 하지만, low_resolution bottleneck때문에 recon에 한계가 있음.

$R_{glo}$를 둬서 $E_{glo}$와의 feature regression을 수행. $R_{glo}$ 같은 경우에는 skip_connection 구조의 encoder-decoder 구조라 feature를 abstract하는 bottleneck이 없음 (global context 학습 X).

→ 따라서, $E_{glo}$$R_{glo}$는 global constraint를 violate하는 부분에서 차이를 보여줄 것임. (이게 앞의 recon 그 부분이랑 논리가 딱딱 맞아보이진 않는데 하여튼 컨셉은 그렇구나..)

추가적인 의문점

$E_{glo}$ 같은 경우에는 random init → 즉, 스크래치로 학습해야 함. anomaly-free industrial image를 받아서 이를 abstract하는 정보를 얻어낸 후에 픽셀 별로 loc 정보를 얻어오다 보니까 local patch descriptor의 지식을 얻어오게 된다….? 흠 왜 굳이 local에서 global로 kd를 걸어주는지에 대해서는 잘 안 와닿음.

최종적인 anomaly score A는 아래와 같이 각 브랜치의 (normalized) regression gap의 summation으로 계산.

image

Training Details

image
image

  • 각 regression network는 U-net 구조 사용
  • $E_{loc}$의 경우에는 앞의 그림 참고

Experiments

sPRO라는 metric을 설계하여 성능 평가 진행.

image
→ 맨 우측을 보면, reconstruction을 하는 것보단 feature regression이 낫더라

image
→ 그림의 우측을 보면, local feature map을 regression하는 게 이미지를 직접 regression해서 distillation 받는 것보단 낫다. (아, 그러면 bottleneck을 가지고 있다는 점에서 그냥 global하다고 보는 거일 듯. 이미지에 대한 global한 feature를 얻는 방향으로 압축하고, 거기에서 decoding을 하는데 그 decoding target이 raw pixel space가 아니라 local patch descriptor의 feature space인 것으로 보면 될 것 같다)

image
image
→ MVTec (MVTec에서도 logical anomalies가 존재함. 따라서 이를 따로 분리해서 성능 report)과 MVTec LOCO에서의 성능 평가. structural anomalies에 기존 베이스라인보다는 약한 경향이 있지만, logical anomalies에 strong함. 전체적으로 averaging하면 GCAD가 가장 높은 이상탐지 성능을 보여줌.

@YoojLee YoojLee added AD Anomaly Detection 2022 papers publisehd in 2022 IJCV papers published on International Journal of Computer Vision labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2022 papers publisehd in 2022 AD Anomaly Detection IJCV papers published on International Journal of Computer Vision
Projects
None yet
Development

No branches or pull requests

1 participant