> ## Content Index
> Fetch the complete content index at: https://bongholee.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# 중복이미지 검출(Duplicate Image Detection)
- URL: https://bongholee.com/jungbogimiji-geomcul/
- Published: 2022-06-21T03:31:45.000Z
- Updated: 2022-06-21T11:58:23.000Z
- Author: Bongho Lee
- Tags: Data, #Import 2026-11-22 06:32

## 모델 선정시 요구사항

- 현재 가지고 있는 이미지 데이터 규모
- 중복이미지 검출시 정확도
- Inference 시 실시간 여부

## 쓸 수 있는 기술

- FileName: File Naming Scheme에 대해서 통제가 가능해야
- FileHash: File이 Binary여야 하고, 조금만 변경이 발생해도 Hash값이 달라질 수 있음
- Perceptual Hash: File size나 Format이 달라도 Pixel에 기반해서 식별 가능하고 속도가 빠른 편, Hash간 Distance를 계산해서 중복 이미지 검출 뿐만 아니라, 비슷한 이미지도 검출 가능  
  - 하지만 이미지의 세부사항이나 Semantic Meaning을 고려하지 않기 때문에 False Positive가 많이 발생할 수 있음
  - 즉 완전히 다른 컨텐츠가 있어도 유사하게 보일 수 있는 이미지가 중복으로 평가될 수 있음
  - dHash(Difference Hash) 등이 있음  
    - Python 기준 imagehash Library
  - Perceptual Hash를 활용해서 CSAM(Child Sexual Abuse Material)을 Detect하려고 한 게 Apple의 NeuralHash
  - Hashing 처리를 한 다음 Index 생성 및Similarity Search를 효율적으로 하기 위해서는 faiss 등의 Library를고려할 필요 있음
- Embedding: Perceptual Hash가 놓치고 있는 이미지의 Semantic Meaning을 충분히 고려할 수 있음. 이미지 크기나 포멧에 대해 제한받는 것 없
- Interest Point: 이미지 전체를 사용하는 것대신 필요하다고 판단되는 일부만 활용해서 다른 이미지와 비교를 해서 구하는 방식.  
  - 필요하다고 판단되는 일부 지점 별로 모두 임베딩을 생성해서 비교하기 때문에 부하가 상당히 있어, Real-time Operation에는 비적합.

## 중복이미지 검출 이후 Action

실시간으로 이미지 검출시 해당 이미지 업로드 거부  
먼저 올라온 이미지로 연결  
기존 이미지와 새롭게 올라온 이미지를 통합  
중복 이미지 삭제

## References

- [What Is The Best Technique to Detect Duplicate Images?](https://becominghuman.ai/what-is-the-best-technique-to-detect-duplicate-images-3333f31f3c58?ref=bongholee.com)
- [Apple’s NeuralHash — How it works and how it might be compromised](https://towardsdatascience.com/apples-neuralhash-how-it-works-and-ways-to-break-it-577d1edc9838?ref=bongholee.com)
- [Kind of Like That](https://www.hackerfactor.com/blog/?/archives/529-Kind-of-Like-That.html&ref=bongholee.com)