3. Pinterest 의
Visual Search System
• 관련 논문
• Visual Search at Pinterest: Yushi Jing, David
Liu, Dmitry Kislyuk, Andrew Zhai, Jiajing Xu, Jeff
Donahue, Sarah Tavel
Visual
Search
System
AWS
open-source
tools
small
enigineering
team
• 요약하면
• 상용 visual search
system 을 scratch 부터
만든 경험을 공유
• AWS와 오픈소스, 작은 팀
만 있으면 만들 수 있다
4. 2 Main Challenges
• 상용 visual search system 의 전체적인 아키텍처를 설명
하는 자료가 별로 없다
• 현실 세계의 visual search system은 복잡
• 검색 기술등 core 기술의 사용에 대한 사업적 이슈
• 그래서 우리의 2가지 challenges 는
• 제한된 개발자와 연산 비용(스타트업 ㅠ)
• 예를 들면 feature computation 비용이 비쌈
• 그래서 scalable 하고 cost effective 해야 함
• 효과가 사용자로부터 측정가능 해야 함
• 개발이나 운영 비용 대비
• 실제 트래픽에 대해 A/B 테스트
5. 2 Main Contributions
• scalable 하고 cost-
effective 한 visual search
system 개발
• 제한된 개발자를 위한 널리 알
려진 오픈소스 사용
• 2가지 주요 서비스에 visual
search system 을 적용한 결
과를 공유
• Related Pins, Similar Looks
• A/B 테스트를 통해 user
engagement 측정
6. Visual Search Architecture
• human-curated 데이터와 meta 데이터의 사용
• 다음과 같이 나누어 설명
• Image Representation and Features
• Incremental Fingerprinting Service
• Search Infrastructure
image board
pin
curatoriallink
semantic
relations
meta data(annotation)
propagated
rich description to image, board, users
7. Image Representation and
Features
• 이미지로부터 다양한 feature 를 추출하여 사용
• Local feature
• Deep feature(CNN)
• AlexNet and VGGNet: fc6 ~ fc8
• Binarized feature: for efficiency and
• Compared using Hamming distance
• Caffe with multi-GPU
• Salient color signatures
8. • Two-step Object Detection and Localization
어떤 object를
찾을 것인가?
Aggregate annotations
(pin description + board title)
Deep learning based
object detectors
9. • Click Prediction
• visual content 중에 어떤 이미지가 사용자로부터 가장 관심
을 받았는지 알아보기 위해
• CUR/CTR은 search ranking, recommendation system, ads
targeting 등에 많이 쓰임
• CNN은 최근 semantic
prediction 에 가장
dominant 한 approach
• 그러나 학습하기 위해
많은 data set 과 시간
이 필요
• 미리 만들어진 모델을
fine-tuning 함
• 전통적인 computer
vision 기법(baseline)과
비교
• PHOW+SVM
10. Incremental Fingerprinting
Service
• 대부분의 vision applications 에서 전체 이미지에 대한 feature 컬렉
션을 bulk processing 가능한 형태로 저장하는 것은 매우 중요
• 불필요한 re-computation 을 피하고 최신 feature 컬렉션을 incremental 하
게 유지하는 것은 critical
• Incremental Fingerprinting Service
• Pinterest 의 증분 feature 관리 서비스(Amazon EC2)
• 다음 2가지 change scenarios 에
• new image uploaded
• feature evolution(add/modified by engineers)
(type:{global, local, deep feature), version, date)
(type:{global, local, deep feature), version, date)
(type:{global, local, deep feature), version, date)
…
detect missing
epochs and
enqueues jobs
on eachrun
증분 업데이트를 가능하게 하는 구조
11. 새로운 데이터에 대해 날짜순으로
epoch 단위를 분할
feature store 에 없는 데이터를 PinLater 에 job 등록
(30분간 처리할 수 있는 데이터 단위인 chunk 로 분할)
20~600개의 EC2 인스턴스를 이용하여
work chunk 처리 후 S3 에 저장
처리된 결과를 정렬 + 합병
(모든 feature 를 포함)
annotation text 등 다른 데이터를 join 하여
random access 가능한 format 생성(HFile)
• 32-core 의 수백대의
장비로 전체 이미지에
대해 feature 추출하는
데 하루 조금 넘게 걸림
(5TB feature 데이터)
• 증분 데이터는 5대의
장비에서 수행
12. Search Infrastructure
• visual search system 은 다양한 용도로 사용
• explore similar looking products
• near-duplicate detection
• content recommendation
• 공통적으로 visual search system 의 검색 결과를
사용
• IFS 에 의해 최종 생성된 VisualJoin 데이터를 분산 색
인한 검색 시스템
• flexible 하고, reconfigurable 해야 함
• 다양한 용도로 사용하기 위해
13. VisualJoin 데이터로부터 분산 이미지
index 생성(Hadoop)
vector-quantized features
(visual vocabulary, image doc-id
posting list)
visual and meta data
(annotation, topic vector from
user-board-image graph)
fast lookup
more accurate
top K 개의 후보를 뽑아 query 이미지와 re-rank
14. Application 1: Related Pins
• Related Pins 는 Pinterest 의 추천 기능
• 사용자가 보고있는 pin 에 따라서 사용자가 좋아할 만
한 다른 이미지를 추천
• 일반적으로 user-curated image-to-board
relationship + content based signal[1] 사용
• user-to-board relationship 은 offline 프로세스
• 6%의 이미지는 추천 안됨
• 6% 의 이미지 추천
• 초기 local token index 를 사용
• 충분한 추천 결과를 주지 못함
• CNN 기반 visual search 를 이용한 추천
15. [1] Human Curation and
Convnets
• PinJoin
• 3-tuple
• p = {u, P, A}
• u: image URL
• P: collection of
Pins
• A: aggregation of
text
annotations(board
title/desc)
• BoardJoin
• 2-tuple
• b = {t, P}
• t: board title
• P: list of Pins
Human Curation and Convnets: Powering Item-to-Item Recommendations on Pinterest: Dmitry Kislyuk, Yuchen Liu, David Liu, Eric Tzeng, Yushi Jing
전통적인 CF 기법을 이용하여
Pin/Board 의 co-occurences 계산
visual similarity feature + topic
vector similarity(text annotation)
16. • Static Evaluation of Search Relevance
• 초기에는 fine-tuned AlexNet 사용 -> deeper CNN
• 이미지로 후보군을 찾고 텍스트로 relevancy
• top-queries 1000개
• query 당 3000개의 결
과
• 전체 1.6 million
• label 을 공유하면
relevant 하다고 판단acceptable
17. • Live Experiments
• visual search 이용한 추천 결과를 random access 가 가능한 HBase 저장
• 추천 품질은 precision 이 매우 중요
• low precision 은 사용자 이탈 원인
2%
• A/B Test
• 10% eligible traffic
• Repin: Pinterest’s
one of top line
metrics and
standard metric for
measuring
engagement
18. Application 2: Similar Looks
• 배경
• 가장 popular 한 카테고리는 여성의류
• 그러나 쇼핑(구매) 경험까지 연결되지 못함
• 다른 카테고리에 비해 click-through 가 발생하지 않음
• Challenges
• “street style” 의 이미지들
• multiple objects: 호피무늬 핸드백, 검정 부츠, 선글래스, 찢어진 청바지를 입
고 거리를 걸음
• 핸드백 or 선글래스?
• Similar Looks
• localized + classified fashion object
• “red dot” 으로 탐색: red dot 클릭하면 유사한 상품 찾아줌
• Like.com, Google Shopping, Zappos(Amazon), Baidu, Alibaba
19. • Static Evaluation of Object Localization
• “여성의류” 카테고리에서 randomly sampling
• manually labeling 2,399 fashion objects in 9 categories
• text-based filter, image-based detection, combined approach
• “we observed
that text-
prefiltering was
crucial to achieve
an acceptable
false positive rate
(1% or less).”
glasses 의 독특한 모양
Surprisingly, precision < 1%
20. • Live Experiments
• 80 million “clickable”
objects
• “clickable” red dot 은
detected object 에
• Similar Looks 결과를
Related Pins 에 삽입하
여 CTR 측정
red dot 이 있는 12% 의 이미지 중
55%가 Similar Looks 이미지 클릭
21. Conclusion and Future Work
• Amazon EC2 와 오픈소스들만 있으면 large-
scale visual search system 을 만들 수 있다
• 물론 handful of engineer 도
• Visual Search Pipeline 의 처음부터 끝까지 만들
어 보았다
• 증분 feature 추출도 되고
• search accuracy 도 높이고
• 개발 비용도 줄였다
• Live product experiments 는 Visual Search 가
사용성을 개선시킨 다는 것을 보여주었다
23. Importance of feature
location and magnitude
Analyzing the Performance of Multilayer Neural Networks for Object Recognition, Pulkit Agrawal, Ross Girshick, Jitendra Malik
24. Precision@k
• Precision at fixed retrieval level
• Precision-at-𝑘 : top 의 𝑘 개 결과로 Precision 계산
• 웹 검색에 적합: 사람들은 가장 좋은 결과를 가장 먼저 보
기를 원함
• 𝑘 값을 결정하기 어렵고 평균 값이 엉망
25. DCG
• DCG(Discounted Cumulative Gain)
• 웹 검색에서 널리 쓰이는 평가 방법
• 높은 relevance 를 갖는 문서가 더 중요
• 상위 rank 문서가 하위 rank 문서보다 더 중요
• the total gain accumulated at a particular rank p
• DCG 예제
• 10 ranked documents judged on 0‐3 relevance scale:
• discounted gain:
• 3, 2/1, 3/1.59, 0, 0, 1/2.59, 2/2.81, 2/3, 3/3.17, 0
• 3, 2, 1.89, 0, 0, 0.39, 0.71, 0.67, 0.95, 0
• DCG:
• 3, 5, 6.89, 6.89, 6.89, 7.28, 7.99, 8.66, 9.61, 9.61
26. NDCG
• NDCG(Normalized DCG)
• DCG 값을 정규화하여 상대적인 비교를 더 쉽게
• NDCG 예제
• Perfect ranking:
• 3, 3, 3, 2, 2, 2, 1, 0, 0, 0
• ideal DCG values:
• 3, 6, 7.89, 8.89, 9.75, 10.52, 10.88, 10.88, 10.88, 10
• NDCG values (divide actual by ideal):
• 1, 0.83, 0.87, 0.76, 0.71, 0.69, 0.73, 0.8, 0.88, 0.88
• NDCG <= 1 at any rank position
27. A/B 테스트
• 목적: 하나의 개선 포인트를 테스트
• 필요한 것: 이미 서비스 중인 검색 시스템
• 방법:
• 대부분의 사용자는 기존 시스템을 이용
• 1% 정도의 일부 사용자는 개선 포인트가 적용된 새로운 시스템으로
접근
• 첫 번째 결과에 대한 click 과 같은 자동화된 measure 를 평가
• 개선 포인트가 사용자를 더 만족시키는 관찰
• 특징
• 대규모 검색 시스템에 적합
• 수학적 기법에 의한 분석보다 강력하지 않지만 쉽게 이해할 수 있음