- 이미지-텍스트 매칭은 이미지와 텍스트 간의 시각적 의미 유사성을 측정하는 것을 의미하며, 이는 다양한 시각 및 언어 작업에서 점점 더 중요해지고 있습니다.
- 최근 몇 년 동안 이 분야에서 큰 발전이 있었지만 이미지와 텍스트 간의 복잡한 매칭 패턴과 큰 semantic discrepancies로 인해 이미지-텍스트 매칭은 여전히 어려운 문제로 남아 있습니다.
Introduction
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252Fbaf8724f-dce9-49a7-bdec-74ad73599e4a%252FUntitled.png%3Ftable%3Dblock%26id%3D7126aba6-5bd0-412b-8e04-2dfa8dfc2f3c%26cache%3Dv2&w=1920&q=75)
- 이전 접근 방식에는 3가지의 단점이 존재합니다.
- local features 간에 스칼라 기반 코사인 유사성을 계산하는데, 이는 regions과 words간의 연관 패턴을 특성화하기에 충분히 강력하지 않습니다.
- 대부분은 지역과 단어 사이의 잠재적인 모든 정렬을 단순히 max pooling 또는 average pooling으로 집계하여 로컬 정렬과 글로벌 정렬 간의 information communication을 방해합니다.
- 의미 없는 alignments의 distractions을 고려하지 않습니다.
- 위와 같은 문제를 해결하기 위해 본 논문에서는 다음과 같은 방법론을 제안합니다.
- 전체 이미지와 전체 문장 사이의 전역 정렬뿐만 아니라 이미지 영역과 문장 조각 사이의 로컬 정렬을 caputure 합니다.
- 스칼라 기반 코사인 유사도로 이러한 정렬을 특성화하는 대신, cross-modal associations을 보다 효과적으로 모델링하기 위해 벡터 기반 유사성 표현을 학습할 것을 제안합니다.
- 그런 다음 GCNN(Graph Convolution Neural Network)에 의존하는 유사성 그래프 추론(SGR) 모듈을 도입하여 로컬 및 전역 정렬 간의 관계를 캡처하여 보다 정확한 이미지-텍스트 유사성을 추론합니다.
- 또한 SAF(Similarity Attention Filtration) 모듈을 개발하여 서로 다른 중요도 점수가 수반되는 모든 정렬을 집계하여 의미 없는 정렬의 간섭을 줄이고 보다 정확한 cross-modal matching 결과를 얻습니다.
- 본 논문의 주요 기여는 다음과 같이 요약됩니다:
- 이미지와 문장 사이의 전역 정렬뿐만 아니라 영역과 단어 사이의 로컬 정렬을 특성화하는데 더 큰 능력을 가능하게 하는 이미지-텍스트 매칭을 위한 벡터 기반 유사성 표현을 학습할 것을 제안합니다.
- 그래프 추론을 통해 이미지-텍스트 유사성을 추론하는 Similarity Graph Reasoning (SGR) 모듈을 제안합니다. 이 모듈은 로컬 및 전역 정렬 간의 관계를 캡처하여 더 복잡한 matching 패턴을 식별하고 보다 정확한 예측을 달성할 수 있습니다.
- 유사성 집계에서 무의미한 단어의 간섭을 고려하고, 매칭 정확도를 더욱 향상시키기 위해 관련 없는 상호 작용을 억제하는 효과적인 SAF(Similarity Attention Filtration) 모듈을 제안합니다.
Proposed Method
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F4437df8d-5fb4-4b57-8079-a7e50dbe4b30%252FUntitled.png%3Ftable%3Dblock%26id%3D8bcdb93b-2adb-4187-9e1a-726e93a3b587%26cache%3Dv2&w=3840&q=75)
Generic Representation Extraction
- Visual Representations.
- 각 input image를 대상으로 pretrain된 Fatser R-CNN model를 기반으로 visual features를 추출
- Fully-connect layer를 추가하여 d-dimensional vectors로 변환하고 이를 local region representations 로 정의
- 이후에 local regions를 대상으로 self-attention mechanism을 수행, global representation 을 획득
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F59c159ec-a9c7-4aa8-8027-87d22ce6faf4%252FUntitled.png%3Ftable%3Dblock%26id%3Da0151e75-ca16-4ee0-a927-cc80c0c5d609%26cache%3Dv2&w=1080&q=75)
- Textual Representations
- 주어진 문장을 토큰화 기법을 사용하여 단어로 분할하고 단어 임베딩을 bi-directional GRU에 순차적으로 공급
- 그런 다음 각 time step에서 순방향 및 역방향 hidden state를 averaging하여 각 단어의 representation을 획득
- 마찬가지로 global text representation 는 모든 word features를 대상, self-attention 방법으로 계산
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252Fd1e76855-76d0-480b-9806-849608bef12f%252FUntitled.png%3Ftable%3Dblock%26id%3Db291b8a8-aca4-4632-bac1-46b712b86967%26cache%3Dv2&w=640&q=75)
Similarity Representation Learning
- Vector Similarity Function
- 기존 방법과 달리 본 논문은 스칼라 값 대신 벡터 기반의 유사성 표현을 계산하여 서로 다른 modalities의 특징 표현간의 보다 자세한 연관성을 포착
- Similarity function은 다음과 같음
- 는 m-dimensional similarity vector를 획득하기 위한 학습가능한 파라미터 matrix
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F6e671b8a-34c6-4995-a061-a4b40d239b78%252FUntitled.png%3Ftable%3Dblock%26id%3Db6871549-e585-49df-a917-bc3db0f7ee01%26cache%3Dv2&w=1920&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F5750082e-38a5-4262-97a4-2221505875d2%252FUntitled.png%3Ftable%3Dblock%26id%3D97253954-1621-4e7b-90b9-890bcb02be9f%26cache%3Dv2&w=640&q=75)
- Global Similarity Representation
- global image feature 및 sentence features를 Eq(1)을 통해 계산
- 는 global similarity representation을 학습하기 위한 learnable parameter matrix
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252Fa7033fa1-7425-4adb-80ae-fe7d94815c36%252FUntitled.png%3Ftable%3Dblock%26id%3Dfb089eaa-fa5e-4c35-96f7-6fd8102ad2a8%26cache%3Dv2&w=1920&q=75)
- Local Similarity Representation
- 시각적 및 텍스트 observations의 local features간의 로컬 유사성 표현을 활용하기 위해 text-to-visual attention을 적용
- 각 region에 대한 attention weight은 다음과 같이 계산됨
- 는 softmax function을 통해 계산되며 는 i번째 region feature와 j번째 word feature 간의 코사인 유사도
- Attended visual features를 다음과 같이 계산
- local similarity representation은 다음과 같이 계산
- 은 local similarity representation을 학습하기 위한 learnable parameter matrix
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F6471b656-527f-4398-a6e0-2915762b4125%252FUntitled.png%3Ftable%3Dblock%26id%3Df7dd39b7-26b3-4811-bc75-7c4fbbff23f0%26cache%3Dv2&w=1920&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F4708d530-15c3-470c-8cf2-4d08aaf570d6%252FUntitled.png%3Ftable%3Dblock%26id%3D8888a5eb-506e-467a-9fdc-2e393e556ab1%26cache%3Dv2&w=1920&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252Fdba4b8db-fb2e-4a91-9a8d-aec328ae7096%252FUntitled.png%3Ftable%3Dblock%26id%3D2beff887-2235-4e2d-95b9-2c3560623a68%26cache%3Dv2&w=1920&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F76886602-f082-4395-b50f-856e8d9479f1%252FUntitled.png%3Ftable%3Dblock%26id%3Db9eefa18-be06-4e67-85df-8b0f2476c7fe%26cache%3Dv2&w=1920&q=75)
Similarity Graph Reasoning
- Graph Building
- 모든 word-attended 유사도 표현과 global 유사도 표현을 그래프 노드로 취함
- to edge node를 다음과 같이 계산
- 과 은 각각 incoming 및 outgoinig nodes를 위한 linear transformations
- 및 노드 사이의 edge는 방향을 지정하므로 유사성 추론을 위한 효율적이고 복잡한 information propagation이 가능
- Graph Reasoning
- 구축된 graph nodes 및 edges를 가지고 다음과 같은 연산을 통해 nodes와 edge를 updating하여 similarity graph reasoning를 수행
- N steps의 유사성을 반복적으로 reasoning하고 마지막 step에서 global node의 출력을 reasoned similarity representation으로 취하여 fully-connect layer에 공급, final similarity score를 획득 함
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F89b3fa82-64b6-4ac9-aa32-dbfb005fa7c6%252FUntitled.png%3Ftable%3Dblock%26id%3D38dd94e9-2d7f-48b8-8b04-4e06249cebbb%26cache%3Dv2&w=1920&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F770e90b1-687f-4d5a-bb17-f18e2c6adba0%252FUntitled.png%3Ftable%3Dblock%26id%3D27e9028c-9716-43c0-bc01-3952ed2751d0%26cache%3Dv2&w=2048&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F4d0d3041-3a20-4a46-a0d0-1ab24bb61198%252FUntitled.png%3Ftable%3Dblock%26id%3Dde7657c2-20d5-4351-86dd-1d9485cc9ebc%26cache%3Dv2&w=2048&q=75)
Similarity Attention Filtration
- 로컬 정렬을 활용하면 이미지 영역과 sentence fragments 사이의 더 세밀한 대응이 가능하여 matching 성능을 높일 수 있지만, less-meaningful alignments로 인해 구별 능력을 방해
- Similarity Attention Filtration (SAF) module을 통해 비효율적인 정렬을 억제하고 중요한 정렬을 강조함
- local 및 global 유사도 표현이 주어졌을 때, 각 유사도 표현에 대한 aggregation weight 는 다음과 같이 계산됨
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F71f9bd61-6a22-40f8-8d96-449f10e2255e%252FUntitled.png%3Ftable%3Dblock%26id%3D638ef321-1ef9-4770-9fd6-8d79862e81fd%26cache%3Dv2&w=1920&q=75)
- 구해진 weights를 기반으로 similarity representations을 계산하여 fully-connect layer에 공급한 뒤, 이미지와 sentence간의 final similarity를 예측
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F28bf3ea1-65c4-4bf5-bc96-6adfbb2d210b%252FUntitled.png%3Ftable%3Dblock%26id%3D90216a77-a318-4284-b798-19019ba51654%26cache%3Dv2&w=1920&q=75)
Training Objectives and Inference Strategies
- bidirectional ranking loss를 활용하여 SGR 및 SAF 모듈을 모두 훈련
- 일치하는 image-text pair (v, t)와 minibtach 내에서 hardest negatvie image & negative text에 대응하는 bidirectional ranking loss를 계산
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F31c637ca-3aa5-4e31-b203-4c5058e4aa52%252FUntitled.png%3Ftable%3Dblock%26id%3Dafc89595-7085-4347-b210-44e8b1057b59%26cache%3Dv2&w=1920&q=75)
- 는 margin parameter
- 은 similarity prediction function SGR
- 마찬가지로 SAF module은 로 정의
- SGR과 SAF에 대해 joint training & independent training 을 실험
- joint training은 두 모듈이 similarity representations을 공유하며 동시에 Loss를 계산
- inference 단계에서는 SGR 및 SAF 모듈에서 예측된 similarities를 averaging
Experiment
Quatitative Results and Analysis
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F5a25d538-aafc-4da5-b316-3720fee3906d%252FUntitled.png%3Ftable%3Dblock%26id%3D35a430a7-30da-4ec2-9f97-2c37ac36c94c%26cache%3Dv2&w=3840&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252Fa05ac7a4-4147-4ebd-9cdd-e0a2c94141d7%252FUntitled.png%3Ftable%3Dblock%26id%3Dfca59a3b-2c36-4970-9f37-7527e7074417%26cache%3Dv2&w=1920&q=75)
Ablation Studies
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252F784987c4-49f0-4c81-afec-9ae48dde1ca3%252FUntitled.png%3Ftable%3Dblock%26id%3Dd0279f36-6b55-4021-82b6-bc17d7ee484e%26cache%3Dv2&w=1920&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252Fb9338eaa-632b-4c39-896c-c64b5d41fcf7%252FUntitled.png%3Ftable%3Dblock%26id%3Dfb18bf49-2f3f-4264-89fc-989c1e27c85d%26cache%3Dv2&w=1920&q=75)
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252Ff1d42c99-3d87-4257-9407-bdb49d2d69fd%252FUntitled.png%3Ftable%3Dblock%26id%3Dc79dcc36-1a3c-4b18-a427-0c3559754c6e%26cache%3Dv2&w=1920&q=75)
- SGR 모듈은 local 및 global 정렬간에 information propagating을 하여 몇가지 중요한 단서를 자주 포착하고 상대적으로 중요하지 않은 interactions를 제거
- 반면 SAF 모듈은 모든 의미있는 정렬을 수집하고 완전히 관련없는 interactions를 제거
- 따라서 SGR 및 SAF 모듈이 겉보기에는 호환되지 않는 것으로 보이며, independent training에서 명백한 개선이 이뤄짐
Qualitative Results and Analysis
![notion image](https://inblog.ai/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Fs3-us-west-2.amazonaws.com%252Fsecure.notion-static.com%252Fb930e3b9-ca29-48d6-a0cc-26c3e8eb8c21%252FUntitled.png%3Ftable%3Dblock%26id%3D3de15325-41d1-406a-86aa-baf39c52fd6c%26cache%3Dv2&w=3840&q=75)
Share article