File size: 17,369 Bytes
c9aee57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# ่งฃ่€ฆ่’ธ้ฆ vs ้›†ๆˆ่’ธ้ฆ ๆถˆ่žๅฎž้ชŒ่ฎพ่ฎก

> ๆœ€ๅŽๆ›ดๆ–ฐ: 2026-01-11

---

## ๐Ÿ“‹ ๅฎก็จฟไบบ่ฆๆฑ‚

> The advantages of the decoupled learning frameworkโ€”especially compared to integrated or joint distillation strategiesโ€”require clearer justification through more focused ablation studies.
>
> DeCLIP claims decoupling avoids optimization conflicts, but lacks:
> (1) direct comparison with integrated distillation (e.g., joint content+context distillation without decoupling) in terms of mIoU/mAP and training stability

---

## ๐ŸŽฏ ๆ ธๅฟƒๅฏนๆฏ”ๅฎšไน‰

### 1. ่งฃ่€ฆ่’ธ้ฆ (Decoupled Distillation) - DeCLIP

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                              DeCLIP ่งฃ่€ฆ่’ธ้ฆๆžถๆž„                                      โ”‚
โ”‚                                                                                     โ”‚
โ”‚  Input Image                                                                        โ”‚
โ”‚       โ†“                                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚
โ”‚  โ”‚                    EVA-CLIP / OpenAI-CLIP ViT                   โ”‚               โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  Block 0 โ†’ Block 1 โ†’ ... โ†’ Block (N-2)                  โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚            (ๅฎŒๆ•ด็š„ Attention + Residual + MLP)           โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚               โ”‚
โ”‚  โ”‚                             โ†“                                   โ”‚               โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚              Block (N-1) - ๆœ€ๅŽไธ€ไธช Block                โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚  LayerNorm โ†’ Q, K, V Projection                 โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚                                                 โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚      โ”‚   Q    โ”‚        โ”‚   V    โ”‚               โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚      โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜        โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜               โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚           โ”‚                 โ”‚                   โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚      Q @ Q^T           V @ V^T                  โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚           โ”‚                 โ”‚                   โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚      softmax            softmax                 โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚           โ†“                 โ†“                   โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”            โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚   โ”‚ Q Self-Sim   โ”‚  โ”‚ V Self-Sim   โ”‚            โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚   โ”‚  (Content)   โ”‚  โ”‚  (Context)   โ”‚            โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜            โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚          โ”‚                 โ”‚                    โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ”‚  โŒ ๆ— ๆฎ‹ๅทฎ่ฟžๆŽฅ   โŒ ๆ—  MLP                       โ”‚    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚               โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚
โ”‚                             โ†“                         โ†“                             โ”‚
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                   โ”‚
โ”‚                    โ”‚  L_content Loss  โ”‚      โ”‚  L_context Loss  โ”‚                   โ”‚
โ”‚                    โ”‚  (Q features)    โ”‚      โ”‚  (V self-sim)    โ”‚                   โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ”‚
โ”‚                             โ†“                         โ†“                             โ”‚
โ”‚                    Teacher: CLIP crops       Teacher: DINOv2 corr                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

**ๅ…ณ้”ฎ็‰น็‚น**๏ผš
- ๅœจๆœ€ๅŽไธ€ไธช Block ไฝฟ็”จ `forward_without_rcffn` ๆ–นๆณ•
- **ๅŽปๆމๆฎ‹ๅทฎ่ฟžๆŽฅ**๏ผš้ฟๅ…็‰นๅพๆททๅˆ
- **ๅŽปๆމ MLP**๏ผšไฟๆŒ Q ๅ’Œ V ็š„็บฏๅ‡€่กจ็คบ
- Q ็š„่‡ช็›ธไผผๆ€ง โ†’ Content Loss๏ผˆไธŽ CLIP Teacher ๅฏน้ฝ๏ผ‰
- V ็š„่‡ช็›ธไผผๆ€ง โ†’ Context Loss๏ผˆไธŽ DINOv2 ็›ธๅ…ณๆ€งๅฏน้ฝ๏ผ‰

### 2. ้›†ๆˆ่’ธ้ฆ (Integrated Distillation) - Baseline

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                            Integrated ้›†ๆˆ่’ธ้ฆๆžถๆž„                                    โ”‚
โ”‚                                                                                     โ”‚
โ”‚  Input Image                                                                        โ”‚
โ”‚       โ†“                                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚
โ”‚  โ”‚                    EVA-CLIP / OpenAI-CLIP ViT                   โ”‚               โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚  Block 0 โ†’ Block 1 โ†’ ... โ†’ Block (N-1)                  โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚     ๅฎŒๆ•ด็š„ Attention + Residual + MLP๏ผˆๆ‰€ๆœ‰ๅฑ‚๏ผ‰          โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚               โ”‚
โ”‚  โ”‚                             โ†“                                   โ”‚               โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚                   Final Processing                       โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ”‚          Head (Linear) โ†’ LayerNorm                       โ”‚    โ”‚               โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚               โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚
โ”‚                             โ†“                                                       โ”‚
โ”‚                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                             โ”‚
โ”‚                    โ”‚  Final Features  โ”‚                                             โ”‚
โ”‚                    โ”‚   (่žๅˆ็š„็‰นๅพ)    โ”‚                                             โ”‚
โ”‚                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                             โ”‚
โ”‚                             โ”‚                                                       โ”‚
โ”‚           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                     โ”‚
โ”‚           โ†“                 โ†“                 โ†“                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                               โ”‚
โ”‚  โ”‚ L_content    โ”‚  โ”‚ L_context    โ”‚  โ”‚ L_region     โ”‚                               โ”‚
โ”‚  โ”‚ (ROIๆฑ ๅŒ–)    โ”‚  โ”‚ (self-sim)   โ”‚  โ”‚ (ROI sim)    โ”‚                               โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                               โ”‚
โ”‚           โ†“                 โ†“                 โ†“                                     โ”‚
โ”‚  Teacher: CLIP       Teacher: DINOv2    Teacher: DINOv2                             โ”‚
โ”‚                                                                                     โ”‚
โ”‚              L_total = L_content + L_context + L_region                             โ”‚
โ”‚              (ๆ‰€ๆœ‰ Loss ไฝœ็”จไบŽๅŒไธ€ไธช่žๅˆ็‰นๅพ๏ผ)                                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

**ๅ…ณ้”ฎ็‰น็‚น**๏ผš
- ไฝฟ็”จๅฎŒๆ•ด็š„ ViT forward๏ผˆๅŒ…ๅซๆ‰€ๆœ‰ๆฎ‹ๅทฎ่ฟžๆŽฅๅ’Œ MLP๏ผ‰
- ๆœ€็ปˆ่พ“ๅ‡บๆ˜ฏ **่žๅˆๅŽ็š„็‰นๅพ**
- Content ๅ’Œ Context Loss ้ƒฝไฝœ็”จไบŽ **ๅŒไธ€ไธช่žๅˆ็‰นๅพ**
- ๅฏ่ƒฝๅฏผ่‡ด **ๆขฏๅบฆๅ†ฒ็ช**๏ผšไธคไธชไปปๅŠก็š„ๆขฏๅบฆๆ–นๅ‘ๅฏ่ƒฝ็›ธๅ

---

## ๐Ÿ“Š ๅฎž้ชŒๆ–นๆกˆ

### ๅฎž้ชŒ 1๏ผš่ฎญ็ปƒๅŠจๆ€ๆ›ฒ็บฟ๏ผˆTraining Dynamics๏ผ‰

**็›ฎ็š„**๏ผš่ฏๆ˜Ž่งฃ่€ฆ่’ธ้ฆ่ฎญ็ปƒๆ›ด็จณๅฎš

**่ฎฐๅฝ•ๆŒ‡ๆ ‡**๏ผˆๆฏไธช iteration๏ผ‰๏ผš
- `L_content` vs Iteration
- `L_context` vs Iteration
- `L_total` vs Iteration

**้ข„ๆœŸ็ป“ๆžœ**๏ผš
- DeCLIP๏ผšๆ›ฒ็บฟๅนณ็จณไธ‹้™๏ผŒๆ”ถๆ•›ๅฟซ
- Integrated๏ผšๆ›ฒ็บฟ้œ‡่ก๏ผŒๆ”ถๆ•›ๆ…ข๏ผŒๅฏ่ƒฝๅ‡บ็Žฐ Loss ๅๅผน

### ๅฎž้ชŒ 2๏ผšๆขฏๅบฆๅ†ฒ็ชๅˆ†ๆž๏ผˆGradient Conflict Analysis๏ผ‰

**็›ฎ็š„**๏ผšๆ•ฐๅญฆ่ฏๆ˜ŽไธคไธชไปปๅŠกๅญ˜ๅœจไผ˜ๅŒ–ๅ†ฒ็ช

**ๆ–นๆณ•**๏ผˆๅ‚่€ƒ PCGrad ่ฎบๆ–‡๏ผ‰๏ผš
```python
# ๅœจ Integrated baseline ่ฎญ็ปƒๆ—ถ๏ผš
# 1. ๅˆ†ๅˆซ่ฎก็ฎ— L_content ๅ’Œ L_context ๅฏนๆœ€ๅŽ N ๅฑ‚็š„ๆขฏๅบฆ
grad_content = torch.autograd.grad(L_content, params, retain_graph=True)
grad_context = torch.autograd.grad(L_context, params, retain_graph=True)

# 2. ่ฎก็ฎ—ๆขฏๅบฆไฝ™ๅผฆ็›ธไผผๅบฆ
cos_sim = cosine_similarity(grad_content, grad_context)

# 3. ้€ๅฑ‚็ปŸ่ฎก
# cos_sim < 0: ๆขฏๅบฆๅ†ฒ็ช
# cos_sim โ‰ˆ 0: ๆขฏๅบฆๆญฃไบค
# cos_sim > 0: ๆขฏๅบฆไธ€่‡ด
```

**ๅˆ†ๆž่Œƒๅ›ด**๏ผš้€ๅฑ‚ๅˆ†ๆžๆฏไธช ViT Block

**้ข„ๆœŸ็ป“ๆžœ**๏ผš
- ๆขฏๅบฆไฝ™ๅผฆ็›ธไผผๅบฆไธป่ฆๅˆ†ๅธƒๅœจ **่ดŸๅ€ผๅŒบ้—ด**๏ผˆๅ†ฒ็ช๏ผ‰ๆˆ– **ๆŽฅ่ฟ‘ 0**๏ผˆๆญฃไบค๏ผ‰
- ่ฏดๆ˜ŽไธคไธชไปปๅŠก็š„ๆขฏๅบฆๆ–นๅ‘็ปๅธธ็›ธๅๆˆ–ไธ็›ธๅ…ณ

### ๅฎž้ชŒ 3๏ผšPCA ๅฏ่ง†ๅŒ–

**็›ฎ็š„**๏ผš็›ด่ง‚ๅฑ•็คบ่งฃ่€ฆๆ•ˆๆžœ

**ๅฏนๆฏ”ๅ†…ๅฎน**๏ผš
- DeCLIP ่งฃ่€ฆ่’ธ้ฆ็š„ๆœ€็ปˆ่พ“ๅ‡บ็‰นๅพ
- Integrated ้›†ๆˆ่’ธ้ฆ็š„ๆœ€็ปˆ่พ“ๅ‡บ็‰นๅพ

**ๆ–นๆณ•**๏ผš
- ้€‰ๅ–ๆŒ‘ๆˆ˜ๆ€งๅ›พ็‰‡๏ผˆๅคš็‰ฉไฝ“ใ€ๅคๆ‚่ƒŒๆ™ฏ๏ผ‰
- ๆๅ–็‰นๅพ็š„ๅ‰ 3 ไธปๆˆๅˆ†๏ผŒๆ˜ ๅฐ„ไธบ RGB

**้ข„ๆœŸ็ป“ๆžœ**๏ผš
- Integrated๏ผš็‰นๅพ"ๆจก็ณŠ"ๆˆ–"ๆททไนฑ"
- DeCLIP๏ผš่พน็•Œๆธ…ๆ™ฐ๏ผŒ่ฏญไน‰ๅ‡†็กฎ

### ๅฎž้ชŒ 4๏ผšCKA ๅˆ†ๆž

**็›ฎ็š„**๏ผšๅˆ†ๆž็‰นๅพ็›ธไผผๆ€ง

**ๅฏนๆฏ”ๅ†…ๅฎน**๏ผš
1. DeCLIP ็š„ Q ็‰นๅพ vs V ็‰นๅพ
2. Integrated ่พ“ๅ‡บ็‰นๅพ vs DeCLIP Q ็‰นๅพ
3. Integrated ่พ“ๅ‡บ็‰นๅพ vs DeCLIP V ็‰นๅพ

**้ข„ๆœŸ็ป“ๆžœ**๏ผš
- DeCLIP ็š„ Q ๅ’Œ V ๆœ‰ไธ€ๅฎšๅทฎๅผ‚๏ผˆ่ฏๆ˜Ž็กฎๅฎž่งฃ่€ฆไบ†๏ผ‰
- Integrated ่พ“ๅ‡บไธŽ DeCLIP Q/V ็š„ๅ…ณ็ณปๆจก็ณŠ

### ๅฎž้ชŒ 5๏ผšๅฎš้‡่กจๆ ผๅฏนๆฏ”๏ผˆๆš‚ไธๅฎž็Žฐ๏ผŒ็”จๆˆท่‡ช่กŒ่ฏ„ไผฐ๏ผ‰

**ๆŒ‡ๆ ‡**๏ผš
- Detection: mAP
- Segmentation: mIoU

---

## ๐Ÿ”ง ่ฎญ็ปƒ้…็ฝฎ

### ็ปŸไธ€้…็ฝฎ

| ้…็ฝฎ้กน | ๅ€ผ |
|-------|---|
| VFM Teacher | DINOv2 |
| Epochs | 6 |
| Learning Rate | 1e-5 |
| Batch Size | 16 (total) |
| Optimizer | AdamW |
| Scheduler | Cosine |
| Dataset | COCO |

### ๆจกๅž‹้…็ฝฎ

| Student Model | VFM Size |
|--------------|----------|
| EVA02-CLIP-B-16 | DINOv2-B |
| EVA02-CLIP-L-14-336 | DINOv2-L |
| OpenAI-CLIP-B-16 | DINOv2-B |
| OpenAI-CLIP-L-14-336 | DINOv2-L |

### Loss ้…็ฝฎ

**DeCLIP๏ผˆ่งฃ่€ฆ๏ผ‰**๏ผš
- Content Loss ๆƒ้‡: 1.0
- Context Loss ๆƒ้‡: 0.25
- Region Loss ๆƒ้‡: 0.05

**Integrated๏ผˆ้›†ๆˆ๏ผ‰**๏ผš
- Content Loss ๆƒ้‡: 1.0
- Context Loss ๆƒ้‡: 1.0๏ผˆ็›ดๆŽฅ็›ธๅŠ ๏ผŒไธ็”จ็ณปๆ•ฐ๏ผ‰

---

## ๐Ÿ“ ไปฃ็ ็ป„็ป‡

```
decoupling_analysis/
โ”œโ”€โ”€ DESIGN.md                           # ๆœฌ่ฎพ่ฎกๆ–‡ๆกฃ
โ”œโ”€โ”€ PROGRESS.md                         # ่ฟ›ๅบฆ่ฎฐๅฝ•
โ”œโ”€โ”€ gradient_analysis.py                # ๆขฏๅบฆๅ†ฒ็ชๅˆ†ๆž
โ”œโ”€โ”€ pca_visualization.py                # PCA ๅฏ่ง†ๅŒ–
โ””โ”€โ”€ cka_analysis.py                     # CKA ๅˆ†ๆž

scripts/decoupling_ablation/
โ”œโ”€โ”€ dist_integrated_eva_vitb16_coco.sh      # EVA-B/16 ๅคšๅก่ฎญ็ปƒ
โ”œโ”€โ”€ dist_integrated_eva_vitL14_336_coco.sh  # EVA-L/14-336 ๅคšๅก่ฎญ็ปƒ
โ”œโ”€โ”€ dist_integrated_openai_vitb16_coco.sh   # OpenAI-B/16 ๅคšๅก่ฎญ็ปƒ
โ”œโ”€โ”€ dist_integrated_openai_vitL14_coco.sh   # OpenAI-L/14 ๅคšๅก่ฎญ็ปƒ
โ”œโ”€โ”€ debug_integrated_eva_vitb16_coco.sh     # EVA-B/16 ๅ•ๅก่ฐƒ่ฏ•
โ”œโ”€โ”€ debug_integrated_eva_vitL14_336_coco.sh # EVA-L/14-336 ๅ•ๅก่ฐƒ่ฏ•
โ”œโ”€โ”€ debug_integrated_openai_vitb16_coco.sh  # OpenAI-B/16 ๅ•ๅก่ฐƒ่ฏ•
โ””โ”€โ”€ debug_integrated_openai_vitL14_coco.sh  # OpenAI-L/14 ๅ•ๅก่ฐƒ่ฏ•

src/training/
โ”œโ”€โ”€ integrated_distill.py     # ้›†ๆˆ่’ธ้ฆๅฎž็Žฐ (IntegratedDistillation ็ฑป)
โ”œโ”€โ”€ main.py                   # (ๅทฒไฟฎๆ”น) ๆทปๅŠ  integrated ็‰ˆๆœฌๆ”ฏๆŒ
โ””โ”€โ”€ params.py                 # (ๅทฒไฟฎๆ”น) ๆทปๅŠ  --version integrated ้€‰้กน
```

---

## ๐Ÿ“ ๅฎž็Žฐๆญฅ้ชค

### Step 1: ๅฎž็Žฐ Integrated Distillation โœ…
- [x] ๅˆ›ๅปบ `src/training/integrated_distill.py`
- [x] ไฝฟ็”จๅฎŒๆ•ด็š„ ViT forward๏ผˆ`mode="vanilla"`๏ผŒไธ่ฐƒ็”จ `forward_without_rcffn`๏ผ‰
- [x] ๅœจๆœ€็ปˆ่พ“ๅ‡บ็‰นๅพไธŠๅŒๆ—ถ่ฎก็ฎ— Content + Context Loss

### Step 2: ๅฎž็Žฐ Gradient Analysis โœ…
- [x] ๅˆ›ๅปบ `gradient_analysis.py`
- [x] ๅœจ่ฎญ็ปƒ่ฟ‡็จ‹ไธญ่ฎฐๅฝ•ๆขฏๅบฆไฝ™ๅผฆ็›ธไผผๅบฆ
- [x] ้€ๅฑ‚ๅˆ†ๆž

### Step 3: ๅฎž็Žฐ PCA Visualization โœ…
- [x] ๅˆ›ๅปบ `pca_visualization.py`
- [x] ๅฏนๆฏ” DeCLIP vs Integrated ็š„็‰นๅพ

### Step 4: ๅฎž็Žฐ CKA Analysis โœ…
- [x] ๅˆ›ๅปบ `cka_analysis.py`
- [x] ๅˆ†ๆž Q, V, ่พ“ๅ‡บ็‰นๅพ็š„็›ธไผผๆ€ง

### Step 5: ๅˆ›ๅปบ่ฎญ็ปƒ่„šๆœฌ โœ…
- [x] EVA-CLIP B/L
- [x] OpenAI CLIP B/L

### Step 6: ไปฃ็ ๅฎก้˜…ไธŽไฟฎๅค โœ… (2026-01-11)
- [x] ไฟฎๅค `extract_roi_features_integrated` ็ผบๅฐ‘ `.transpose(-2,-1)` ็š„็ปดๅบฆ้—ฎ้ข˜
- [x] ไฟฎๅค `region_scd_loss` ไธญไธๅฟ…่ฆ็š„ transpose
- [x] ็งป้™คๆœชไฝฟ็”จ็š„ๅฏผๅ…ฅ (`autocast`, `math`)

---

## โš ๏ธ ๆณจๆ„ไบ‹้กน

1. **PCGrad ไป…็”จไบŽๅˆ†ๆž**๏ผšไธไฝฟ็”จๅฎƒๆฅ่งฃๅ†ณๅ†ฒ็ช๏ผŒๅช็”จๆฅ่ฏๆ˜Žๅ†ฒ็ชๅญ˜ๅœจ
2. **Loss ็›ดๆŽฅ็›ธๅŠ **๏ผšIntegrated ็š„ Content ๅ’Œ Context Loss ็›ดๆŽฅ็›ธๅŠ ๏ผŒไธ่ฐƒๆƒ้‡
3. **่ฎญ็ปƒ้…็ฝฎไธ€่‡ด**๏ผš้™คไบ†่งฃ่€ฆ vs ้›†ๆˆ็š„ๅทฎๅผ‚๏ผŒๅ…ถไป–้…็ฝฎๅฎŒๅ…จไธ€่‡ด
4. **่ฏ„ไผฐ็”จๆˆท่‡ช่กŒ**๏ผš่ฎญ็ปƒๅฎŒๆฏ•ๅŽ็”จๆˆท่‡ชๅทฑ่ฟ›่กŒ mAP/mIoU ่ฏ„ไผฐ