<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by shu hao on Medium]]></title>
        <description><![CDATA[Stories by shu hao on Medium]]></description>
        <link>https://medium.com/@lose-hao?source=rss-c4eed6b07973------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*juGmCw6RDihiNYaf6qf-MA.jpeg</url>
            <title>Stories by shu hao on Medium</title>
            <link>https://medium.com/@lose-hao?source=rss-c4eed6b07973------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:24:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lose-hao/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[景深估計一NeW CRFs: Neural Window Fully-connected CRFs for Monocular Depth Estimation]]></title>
            <link>https://lose-hao.medium.com/%E6%99%AF%E6%B7%B1%E4%BC%B0%E8%A8%88%E4%B8%80new-crfs-neural-window-fully-connected-crfs-for-monocular-depth-estimation-ad3d85a0965b?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad3d85a0965b</guid>
            <category><![CDATA[nyu]]></category>
            <category><![CDATA[paper]]></category>
            <category><![CDATA[crf]]></category>
            <category><![CDATA[kitti]]></category>
            <category><![CDATA[depth-estimation]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Sun, 12 Jun 2022 05:30:20 GMT</pubDate>
            <atom:updated>2022-06-12T05:30:20.045Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*B4Cf485Z2ULWxRv5sLgefQ.png" /><figcaption>CVPR 2022</figcaption></figure><p><strong>Paper Link : </strong><a href="https://arxiv.org/pdf/2203.01502.pdf">https://arxiv.org/pdf/2203.01502.pdf</a><br><strong>Github Link : </strong><a href="https://github.com/aliyun/NeWCRFs">https://github.com/aliyun/NeWCRFs</a><br><strong>Datasets：<br>1. </strong>NYU-v2<br>2. KITTI_Eigen<br><strong>Training Setting :<br></strong>Nvidia GTX 2080 Ti GPUs</p><p><strong>簡介<br></strong>從單張圖像去估計出準確的深度是蠻有挑戰性的，這篇的論文主要是去優化CRF(Conditional Random Fields) 。計算成本很高而且 CRF 的範圍通常都是在附近而不是整張圖 (FC-CRFs)。</p><p>作者會嘗試使用 FC-CRFs 的想法是因為可以捕捉到全局之間的關係，所以作者對於模型的這部分有去做修改，並且在數據上的表現有顯著地提升。</p><p><strong>方法</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*-ktFgwPL4iFFF3S2PZFaeA.png" /><figcaption>(a) FC-CRFs (b) Window FC-CRFs</figcaption></figure><p><strong>Window FC-CRFs</strong></p><blockquote>優點：<br>1. 可以帶來全局的關係<br>缺點：<br>1. 計算成本還是很高<br>2. 像素的深度不是由遠處像素決定，可能就是附近的 Window 就能決定</blockquote><p>所有 Windows 都不是重疊的，這問題其實蠻大的因為這樣每個 Window 之間沒有一個關聯性。</p><p>為了解決這個問題，作者提出把圖像中 (N/2，N/2) 個 Patched 去做 Shift Windows，在計算原本 Window 的能量函數 (Energy Function) 之後，再去做 Shift Window 的能量函數。這樣子就可以把相鄰像素在 Shift Window 中連接起來。所以說在計算能量函數的時候，會計算兩次，一個是原本的 Window，另一個是 Shift Window。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*Ko0Zk6G3ZEdfbyl_ht--uA.png" /><figcaption>Neural Window FC-CRFs</figcaption></figure><p><strong>Neural Window FC-CRFs</strong></p><p>傳統的 CRF 當中，Unary Potential 通常會受到預測值上的分佈作用，例如：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*rBwyMsoP4P4rMXdZXWl89Q.png" /></figure><p>I 是輸入圖像，P 是預測的機率分佈。Pairwise Potential 通常會根據 像素對 的顏色和位置來計算，例如：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*db6xHpfTEwNd9V1epnOsVQ.png" /></figure><p>在不同顏色和較遠像素具有各種值的預測的同時，也去懲罰相似的顏色和相鄰像素中值的差異。因為很難去表示高維信息和其中複雜的連接，作者是建議使用神經網路。</p><p>對於 Unary Potential，它是從圖像特徵中去計算出來的，這樣子網路就可以直接得到它：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*rrNpyuuoD_3E9BFVhDXQcA.png" /></figure><p>其中 θ 是 Unary Network 中的參數。</p><p>對於 Pairwise Potential，作者發現它是由當前節點和其他節點組成，節點其實就是把 Patch 當作節點，並且根據 節點對 的顏色和位置訊息去計算的權重。所以做把它改寫成：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*4mnnvpXM3fsH0wV9fwjY_Q.png" /></figure><p>其中 F 是特徵圖，w 是 Weighting Function。對於每個節點 i，會把它所有的 Pairwise Potential 做相加並且得到：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*eHZSol5yv8y-Z9eQFR82YQ.png" /></figure><p>其中 α, β 是 Weighting Functions，會由網路來計算。</p><p>作者受到 Tansformer 的啟發，在 Window 中的每個 Patch 的特徵圖去計算查詢向量 q 和關鍵向量 k，並將所有補丁的向量去組合到矩陣 Q 和 K。</p><p>然後再計算矩陣 Q 和 K 的乘積得到任意一對之間的 Potential Weight，之後預測值 X 再去乘上權重得到最後的 Pairwise Potentia。為了引入位置的訊息，作者還添加一個相對位置 P。因此，式子 8. 可以計算成：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*d7tm2lzUR4ccPn0DXBQv1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_yg3I9mw1Jh3FlK8hdLnCA.png" /><figcaption>流程圖1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*E4bq7FOPQqgNdrevEUlnIw.png" /><figcaption>流程圖2</figcaption></figure><p>為了把上面提到的 CRF 嵌入預測的網路，作者建構了一個 Bottom-Up-Top-Down 的結構。</p><p>Encoder 是使用 Swin-Transformer 當作 Backbone 來提取特徵。<br>Decoder 是嵌入 Neural FC-CRF 來優化解碼的這個動作。</p><p>對於一張 H × W 大小的圖像， Encder 跟 Decoder 有 4 個階段需要處理，每個階段 Window 的大小都是固定的，作者這邊是以 7×7 個 Patches 當作一個 Window。</p><p>每個階段的 Patch 大小都不一樣，從底到高階段的 Patch 大小是 4 × 4 到 32 × 32 像素，所以在最底層會有 ((H/4N)×(W/4N)) 個 Windows<br>最高層會有 ((H/32N)×(W/32N)) 個 Windows。</p><p><strong>Pyramid Pooling Module (PPM)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*bcuTbSou3CjuCjAZELDp8A.png" /><figcaption>PPM Head</figcaption></figure><p>在最頂層的部分，為了彌補 Window FC-CRF 全局訊息的不足，作者使用Pyramid Pooling Module (PPM) 來去聚合整個圖像的訊息，跟<a href="https://arxiv.org/abs/1612.01105">這篇論文</a>類似，用 Global Averaging Pooling(GAP) scales = [1, 2, 3, 6] 來提取整個全局訊息，最後再跟輸入的特徵做 Concat，通過 Conv-layer 映射到 X。</p><p><strong>實驗<br></strong>網路使用 Adam 優化器進行端到端優化（β1 = 0.9，β1 = 0.999）。 訓練運行 20 個 Epoch，Batch Size 為 8，學習率從 1 × 10^-4 下降到 1 × 10^-5。</p><p>作者輸出深度圖是原始圖像的 1/4 × 1/4 ，然後再把它調整為全分辨率。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HnV1ypsOcXP-7tcYqlEwHg.png" /><figcaption>KITTI Eigen 數據上的表現</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bt6vmu9fckcLHhLsL5XMJg.png" /><figcaption>NYUv2 數據上的表現</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EmW9oiMqk9ErrMrMMq6rzQ.png" /><figcaption>KITTI 上的結果</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*B5ikGgY9Lovz0bS6j5SXDw.png" /><figcaption>NYUv2 上的結果</figcaption></figure><p><strong>Network Details</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*I0imH_CPgNz4ndCOd9rcaQ.png" /></figure><p><strong>總結</strong></p><p>1. 提出一種 Neural Window Fully-Connected CRFs 來解決深度估計的問題。為了解決 FC-CRF 計算成本太高的問題，把輸入切成很多個 Windows 並且去對每個 Window 進行計算。</p><p>2. 為了去捕捉 Patch 之間的關係，作者利用 Multi-Head Attention 去計算 Neural Potential Function。</p><p>論文 Code 的部分相對來說還算完整，有重現論文 KITTI 提到的數據，但是在 Training 時 GPU 內存不夠，所以要再想想辦法。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad3d85a0965b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[物件追蹤一Graph Attention Tracking]]></title>
            <link>https://lose-hao.medium.com/%E7%89%A9%E4%BB%B6%E8%BF%BD%E8%B9%A4%E4%B8%80graph-attention-tracking-196366b09e44?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/196366b09e44</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[object-tracking]]></category>
            <category><![CDATA[cvpr]]></category>
            <category><![CDATA[cvpr-2021]]></category>
            <category><![CDATA[tracking]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Mon, 24 Jan 2022 19:44:51 GMT</pubDate>
            <atom:updated>2022-01-24T19:48:08.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*Ydje9PSplf2uv_9Fe-Lglg.png" /><figcaption>CVPR 2021</figcaption></figure><p><strong>Paper Link : </strong><a href="https://arxiv.org/abs/2011.11204">https://arxiv.org/abs/2011.11204</a><br><strong>Github Link : </strong><a href="https://github.com/ohhhyeahhh/SiamGAT">https://github.com/ohhhyeahhh/SiamGAT</a><br><strong>Datasets：<br></strong>1. UAV123<br>2. GOT-10k<br>3. OTB-100<br>4. LaSOT</p><p><strong>Training Setting :<br></strong>4 張 RTX-2080Ti GPUs</p><p><strong>簡介<br></strong>以往的追蹤器其實都是從 Template 和 Search branch 之間的互相關去做學習。但是作者認為會有一些缺點：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*hLJEMgv88DQhhbu8Cr7ciw.png" /></figure><p>1. 通常都是以目標中點為中心去取一個 m× m 大小的區域作為 Template，但這有可能會去<strong>提取到部份的背景訊息</strong>或是<strong>遺失掉部份的目標訊息。</strong></p><blockquote>想法：只提取 ROI (Region of Interest) 的特徵，並且把其他背景的部分過濾</blockquote><p>2. 互相關是將提取到的 Template 特徵在 Search 區域上面做一個 Global Search，缺點就是無法去<strong>適應旋轉、姿態的變化、遮擋</strong>之類的問題。</p><blockquote>想法：把 Template &amp; Search 特徵中每個 1×1×C 的張量看成是一個節點，組合成 Graph 的概念，去做一個相似度和注意力的計算</blockquote><p>主要的<strong>貢獻</strong>如下：<br>1. 提出 GAM（Graph Attention Module）來實現 Part-To-Part 的訊息匹配。與剛剛提到的互相關的方法相比，提出來的模組可以順利的解決它們的缺點，並且將目標訊息從 Template 傳遞到 Search 區域。</p><p>2. 提出一個使用 GAM 的網路，叫做 SiamGAT（Target-Aware Siamese Graph Attention Tracking）。對於之前預先固定 Global 特徵匹配相比之下，這個模型更可以去適應<strong>不同對象的大小</strong>和<strong>橫縱方向</strong>的變化。</p><p>3. 在 GOT-10k、UAV123、OTB-100 和 LaSOT 在內的資料集上面表現優於許多現有的追蹤器。</p><p><strong>方法</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*CyM6o3F66oMtWB1F6sedKQ.png" /><figcaption>架構圖</figcaption></figure><p><strong>Feature Extraction</strong>：使用 GoogleNet（ Inception v3 ）</p><p><strong>Classification &amp; Regression</strong>：使用 SiamCAR (這篇算是 <a href="https://arxiv.org/abs/1911.07241">SiamCAR </a>的延伸)</p><h4><strong>Target-Aware Graph Attention Tracking</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*2shuEXvyYsGi3f9A" /><figcaption>畫的偏醜 請見諒 XD</figcaption></figure><p>1. 找出 Template 圖像中 ROI 的區域 (Bt)</p><p>2. 映射 Bt 到 Feature maps 上 (Rt)</p><blockquote><em>關於如何映射：<br>a. </em><a href="http://kaiminghe.com/iccv15tutorial/iccv2015_tutorial_convolutional_feature_maps_kaiminghe.pdf"><em>Convolutional Feature Maps(ICCV 2015)</em></a><em><br>b. </em><a href="https://arxiv.org/abs/1406.4729"><em>Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition</em></a></blockquote><p>3. 算出 Ft-hat</p><p>4. Resize Ft-hat</p><blockquote><em>因為你每次映射出來的 </em>Ft-hat<em> 大小都不會是固定的，所以必須做 Resize 變回原本 Ft 的大小，有點像是把 Ft 乘上一個 Mask 的感覺，只保留想要有興趣的區域。</em></blockquote><p>5. 得到新的 Ft-hat</p><h4><strong>Graph Attention Information Embedding</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/0*uNaSQSpr8LW_TQBy" /></figure><p>首先將 Feature Map 每個 1×1×C視為一個 Node。Vt 是 Ft (Feature of Template) 所有的 Nodes，Vs 就是 Fs (Feature of Template)的節點。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/0*jc8lsaIWTxSZuA8l" /></figure><p>因為不能打完整的符號，所以我都用底線表示，應該看得懂吧？<br><strong>h_i_s </strong>：Search branch 的一個 節點 i<br><strong>h_j_t</strong> ： Template branch 的一個 節點 j<br><strong>eij</strong>：表示兩個節點的相似程度</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*HycgfxfOWBDavw5El5k7ww.png" /><figcaption>這裡用內積來實現這個 eij</figcaption></figure><p>首先分別對 Node 去進行線性轉換，然後計算這兩者的內積來算得分(相似程度)。其中 Ws 和 Wt 都是一個線性轉換的矩陣。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/0*SwFiaOzWi8X0mR6I" /></figure><p>為了去平衡訊息量，對 eij 做 Softmax</p><p><strong>aij </strong>可以理解成 Template 節點 j 的訊息傳遞給 Search 節點 i 的注意力。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/1*w-yp1tyaM3zbQTgaAv-nnA.png" /></figure><p>再把 Gt 中所有的 Nodes 的注意力傳遞到 Gs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*KkVSnmtDveCTJkp9Rgvq6A.png" /></figure><p>下一步把聚合的特徵和原本特徵做一個拼接的動作得到更強的特徵</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*4mSgkS593shZrXQi603gmg.png" /></figure><p>最後把從 GAM 得到的特徵去做 Cls (Classification)跟 Reg (Regression)，主要是使用之前作者提出來的 SiamCAR：</p><blockquote><strong>Classification</strong>：主要是預測每個位置的類別<br><strong>Regression</strong>：將每個位置回歸為一個相對的框<br>相關知識：<a href="https://ithelp.ithome.com.tw/articles/10217431">https://ithelp.ithome.com.tw/articles/10217431</a></blockquote><p><strong>實驗</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*3tkuHQj6AYk3n-9O" /><figcaption>可以看到物體在<strong>有旋轉或形變</strong>的情況下還是表現的不錯</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*MzPHuoeNRTzV8ibfMCI9sg.png" /><figcaption>UAV123 Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*rjMG88TcOHF3bH6hMSDZNg.png" /><figcaption>UVA123 Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*9Cr9s0RHQlzDthjt7Sqomg.png" /><figcaption>GOT-10k Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*aHdzCyCPOEqVaXYLgdmdeA.png" /><figcaption>GOT-10k Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*oorLPvpB8EYWAzECKCoDjg.png" /><figcaption>OTB100 Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*JIH4p1XeqyK7k9ntbnV-Kw.png" /><figcaption>LaSOT Dataset</figcaption></figure><p><strong>總結<br></strong>Target-Aware 和 Graph-Attention 要一起搭配表現的才會比較好，因為前者已經將背景訊息給去除掉了, 而後者可以通過 Graph 的想法去計算出每個 Node 的相似度 &amp; 注意力分數，能更好的去適應物件移動和形狀改變。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=196366b09e44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[景深估計一From Big to Small: Multi-Scale Local Planar Guidance for Monocular Depth Estimation]]></title>
            <link>https://lose-hao.medium.com/%E6%99%AF%E6%B7%B1%E4%BC%B0%E8%A8%88%E4%B8%80from-big-to-small-multi-scale-local-planar-guidance-for-monocular-depth-estimation-3125153f6cac?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/3125153f6cac</guid>
            <category><![CDATA[monocular]]></category>
            <category><![CDATA[2021]]></category>
            <category><![CDATA[depth-estimation]]></category>
            <category><![CDATA[paper]]></category>
            <category><![CDATA[cnn]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Sun, 28 Nov 2021 10:19:52 GMT</pubDate>
            <atom:updated>2021-11-28T10:19:52.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*HH8hkXaYicgZS6dLI2MRsA.png" /><figcaption>2021 v6. arXiv paper</figcaption></figure><p><strong>Paper Link : </strong><a href="https://arxiv.org/pdf/1907.10326v6.pdf">https://arxiv.org/pdf/1907.10326v6.pdf</a><br><strong>Github Link : </strong><a href="https://github.com/cleinc/bts">https://github.com/cleinc/bts</a><br><strong>Datasets：<br>1. </strong>NYU-Depth-v2<br>2. KITTI<br><strong>Training Setting :<br></strong>4 張 NVIDIA 1080ti GPUs</p><p><strong>簡介<br></strong>2D 圖像的深度估計一直是近年來研究的熱門主題，但是從單張圖像去準確的估計依然具有挑戰性，而當有人第一次提出了基於深度學習的深度估計方法過後，在這任務方面取得相當大的進步，大多數的研究都是以深度捲積神經網路 (DCNNs) 模型去實驗。</p><p>作者也從常用的 Encoder-Decoder 結構出發，考慮到 Decoder 階段不同尺度的特徵，從而更有效利用這些特徵去生成出最終的深度圖。</p><p><strong>方法</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxbxchTGBpj8D3zyp8Khcg.png" /><figcaption>流程圖</figcaption></figure><p>前面的 DFE 的意思是 Dense Feature Extractor，其實就是 Encoder 的部份，後面接了一個 ASPP（Atrous Spatial Pyramid Pooling），目的是為了提取多尺度的特徵。</p><p>後面每一階段都有接上一個 LPG（Local Planar Guidance） 的層，主要的想法是以有效的方式去定義內部特徵跟最終輸出之間 <strong>明確且直接</strong>的關係。</p><p>與一般的 Upsampling 方式不一樣，主要功能是可以使用假設出來局部的平面，去把特徵引導到 H 上，並且去得到最後估計出來的深度 ~d。</p><p>從上圖可以看出來，LPG 的輸出都恢復到 H（完整的分辨率），因此他可以用作 Decoder 內部的 Skip-Connection，讓內部特徵跟最終預測之間產生直接的關聯。不同階段的 LPG 輸出還會去進行融合，最後在經過捲積之類的才會得到最終的結果 H。</p><p>因此在後面輸出的 c 圖 （圖中最右側）並不完全代表示深度。它比較像是反應真實的場景，比如物體的輪廓這樣。</p><p><strong>LPG （Local Planar Guidance）</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*2KtrnMmycJW2mMnHJFQ-Yg.png" /><figcaption>LPG 內部構造</figcaption></figure><p>輸入的是一個多通道的特徵圖，會先通過捲積將通道壓縮到剩下 4 個，然後這 4 個通道都有對應不同的參數去進行不同的處理方式，再利用以下的公式去計算出 c 圖 （流程圖右邊）。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*fjPH_ANWFivMy8V41mrBqg.png" /></figure><ol><li>n= (n1, n2, n3, n4) ，表示為估計的平面係數</li><li>(ui, vi)，表示為像素 i 標準化過後的座標</li></ol><p><strong>實驗</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*rSNOcFrQ4q8XRxi5WJNJxQ.png" /><figcaption>NYU Depth v2 Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*15s98Dj8jPYcolloMJOoqA.png" /><figcaption>KITTI Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*cgqmuyVjqTHiXu4fWx-SrA.png" /><figcaption>KITTI Evaluation Server 結果</figcaption></figure><p><strong>Ablation Study</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7xrpdFJ4jG5P9W8hU8xuQ.png" /><figcaption>Ablation Studing with NYU Depth V2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2nItjnekbkkkl2IliIAC_Q.png" /><figcaption>NYU Depth V2 with Various Base Networks</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pufHLYSv_3f8OSb-n6SIuw.png" /><figcaption>KITTI with Various Base Networks</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*NulJ-b1Pin6eKZzlICBKRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*moaghPYut5uf7izEfQw0Ow.png" /></figure><p><strong>總結<br></strong>作者在這篇論文提出了深度估計網絡並且得到了蠻不錯的結果。也因為受益於深度學習的發展，作者提出一種架構使用 LPG 的層，提供從內部網路映射到最終預測的明確關係，以便更好地去訓練網路。</p><p>註解：最早好像在 2019 就提出這篇論文了，目前看的是 2021 年的，已經出到 Version.6 了。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3125153f6cac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[景深估計一Excavating the Potential Capacity of Self-Supervised Monocular Depth Estimation]]></title>
            <link>https://lose-hao.medium.com/%E6%99%AF%E6%B7%B1%E4%BC%B0%E8%A8%88%E4%B8%80excavating-the-potential-capacity-of-self-supervised-monocular-depth-estimation-b8f7fc94c511?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8f7fc94c511</guid>
            <category><![CDATA[self-supervised-learning]]></category>
            <category><![CDATA[2021]]></category>
            <category><![CDATA[iccv]]></category>
            <category><![CDATA[depth-estimation]]></category>
            <category><![CDATA[monocular]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Mon, 15 Nov 2021 14:45:05 GMT</pubDate>
            <atom:updated>2021-11-16T05:54:45.273Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*MU31-YtyCqPBuaFdmAslwA.png" /><figcaption>ICCV 2021</figcaption></figure><p><strong>Paper Link : </strong><a href="https://arxiv.org/pdf/2109.12484v1.pdf">https://arxiv.org/pdf/2109.12484v1.pdf</a><br><strong>Github Link : </strong><a href="https://github.com/prstrive/EPCDepth">https://github.com/prstrive/EPCDepth</a><br><strong>Datasets：<br>1. </strong>NYU-Depth-v2<br>2. KITTI<br><strong>Training Setting : <br></strong>目前沒說</p><p><strong>簡介</strong><br>大多數現有的先進方法在 Monocular Depth Estimation (MDE) 都依賴於監督訓練，但是收集訓練的數據集是一件很繁瑣而且困難的事。作為這個替代的方案，自監督的方法通過將 Depth-Estimation 重建為立體圖像、單目視頻或是兩者的結合。</p><p>通常來說，圖像上的投影越靠近下邊界時，物體的深度會越小。垂直圖像位置的特徵已經被以前的 MDE 模型證明對於推斷深度是很重要的線索，幾乎每個訓練的樣本都有存在這種特徵，而其他線索的樣本相對來說就較少，但是這樣分配往往會間接降低模型的泛化能力。作者也在後面針對這個問題提出一種數據增強的方法：<strong>數據嫁接</strong>(後面會提到)。</p><p>模型最後作者也 Encoder &amp; Decoder 上插入預測的模塊，將傳統的多尺度網絡去擴展到<strong>全尺度</strong>，在表現上也是不錯。</p><ol><li>引入一種概念簡單但是表現得不錯的數據增強方式，它可以讓模型學習除了垂直圖像位置之外更有效的資訊。</li><li>作者在沒有任何輔助網絡的情況下將 <strong>自蒸餾（Self-Distillation）</strong>應用在 Monocular Depth Estimation (MDE)上，並且利用他們訓練導向的<strong>選擇性後處理（SPP）</strong>方式生成更好的偽標籤。</li><li>提出一種擁有更高效率的全面網路來加強對模型的約束，並且提高 Encoder 深度估計的特殊性。</li><li>沒再跟你開玩笑，即使跟那些通過額外約束去訓練的高性能模組相比，作者在自監督的方法中也達到了 SOTA 的效能。</li></ol><p><strong>方法</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E5CnoCFV6zVe-NYLYiM5nA.png" /><figcaption>架構圖</figcaption></figure><p>作者在 Training 的時候採用<strong>校正後的立體圖像</strong>當作自監督模型的輸入，而在 Testing 時只需要一張圖像來推斷深度。</p><p>主要由三個步驟組成：<br>1. 輸入的 Batch 數據先通過<strong>數據嫁接</strong>進行重建，這裡是以 0.6 的嫁接比例。</p><p>2. 在所有尺度上使用<strong>全尺度網絡</strong>進行預測視差圖，全尺度的意思是不僅 Encoder 且 Decoder 也會去預測。</p><p>3. 最後對 Encoder 和 Decoder 分別進行<strong>選擇性後處理 (SPP)</strong>，使用全尺度視差生成的<strong>自蒸餾標籤 (Self-Distillation)</strong>，去計算自蒸餾損失(Lsd)，同時模型也將在光度損失 (Lph) 和深度提示損失 (Lh) 的幫助下訓練。</p><p><strong>數據嫁接 (Data Grafting)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*CjVqAMUGQEby00tJaxCBhw.png" /></figure><p>缺乏資料是 MDE 第一個比較麻煩的問題，會導致降低模型的泛化能力。MDE 中 Overfitting 的風險之一是對於垂直圖像位置的過度依賴性，雖然數據增強是 CP 值最高的解決方法，但是現有的自監督 MDE 方法幾乎沒有相關的研究，只有使用一些簡單的數據變動，像是水平的翻轉。</p><p>作者注意到，如果用成對的立體圖像作為輸入的效果或許會比較好。因為這兩個圖像是用平行相機去拍攝並且校正的，所以它們之間的匹配只會發生在水平方向，例如向左或向右。因此就可以在垂直方向上進行調整來增加數據。作者也發現如果<strong>將兩個語義不同的圖像嫁接</strong>在一起的時候可以有效減輕 Overfitting 的風險，並且讓模型可以在不被破壞的情況下更好地利用輸入的圖像。</p><p>主要嫁接是在一個 Minibatch 內，會由兩個超參數決定：<br>1. 嫁接比率 r<br>2. 均勻機率 p<br>通過從另一個輸入以 p 的機率垂直嫁接一個比例為 r 的區域當作新的輸入</p><p><strong>全尺度網路 (Full-Scale Network)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*sswq1x4YMehfPLbLqj4MOg.png" /></figure><p>從粗到細的這種架構在 MDE 中已被證明是有效的，通常的做法是在 Encoder 輸出多尺度的視差預測，直觀地來說，因為在 Encoder 引入深度估計的專業化可以給模型提供更強的約束去提升效能，所以作者將<strong>傳統的多尺度</strong>去擴展到<strong>全尺度</strong>，這意味著作者還將多尺度的<strong>殘差預測模組</strong>加到 Encoder。同時在預測模組和 Encoder 之間又插入了一個 <strong>RSU 模組(Encoder 中紅色方塊)</strong>，作為減輕不同尺度之間影響的橋樑。</p><p>在訓練後也可以丟棄 Encoder-Scale，甚至是部份的 Decoder-Scale，只有保留 Encoder 最大的 Scale，這意味著<strong>全尺度網路</strong>在參數和計算量上不會比傳統網路更多。</p><p><strong>自蒸餾 (Self-distillation)<br></strong>自蒸餾是為模型生成出更多監督訊號的有效方式，對於自監督學習來說頗為重要。而在這裡作者建議使用<strong>選擇性後處理 (SPP) </strong>去生成自蒸餾標籤，並使用它為模型創造一個新的損失，叫做自蒸餾損失(Lsd)。</p><p><strong>選擇性後處理 (SPP)<br></strong>SPP 指的是在多個視差尺度中濾除每個像素的最佳視差。實際上 Encoder 中輸出最大的視差圖並不是在所有像素中都是最好的，因此，為了去區分每個像素的最佳尺度，作者採用重建損失或是光度損失作為標準。</p><p>最後 Encoder (ye) 和 Decoder (yd) 的自蒸餾標籤可以去基於誤差值越小，預測的視差越好的假設來去建構。</p><p><strong>實驗</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*p__q6oYATG1f2DF_JJ8Afg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*dxUBpJG_gUTzgHY0uABh_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*JDnJTwuYvf1gLzFnBRqFsg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*Cw43M3u1LUpQm4C9yh1Z2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l1hbzX24-FHd-Rtl5vYHQQ.png" /></figure><p><strong>總結<br></strong>作者通過他們提出的方法（數據增強、自蒸餾、全尺寸網絡...）表現出了對於自監督 MDE 的潛在能力。實驗上也表明，作者的模型（EPCDepth）可以用最少的計算成本來得到最佳的性能。在未來作者將嘗試探索更準確的標籤生成方法來進一步提高自蒸餾的性能。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8f7fc94c511" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[景深估計一AdaBins: Depth Estimation using Adaptive Bins]]></title>
            <link>https://lose-hao.medium.com/%E6%99%AF%E6%B7%B1%E4%BC%B0%E8%A8%88%E4%B8%80adabins-depth-estimation-using-adaptive-bins-ad6e33787e37?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad6e33787e37</guid>
            <category><![CDATA[cvpr]]></category>
            <category><![CDATA[2021]]></category>
            <category><![CDATA[estimations]]></category>
            <category><![CDATA[encoder-decoder]]></category>
            <category><![CDATA[depth-estimation]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Thu, 11 Nov 2021 08:00:42 GMT</pubDate>
            <atom:updated>2021-11-11T08:00:42.936Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uexyXDJ80rf0ICRN5M-Lg.png" /><figcaption>CVPR 2021</figcaption></figure><p><strong>Paper Link : </strong><a href="https://arxiv.org/pdf/2011.14141v1.pdf">https://arxiv.org/pdf/2011.14141v1.pdf</a><strong> </strong><br><strong>Github Link : </strong><a href="https://github.com/shariqfarooq123/AdaBins">https://github.com/shariqfarooq123/AdaBins</a><br><strong>Datasets：<br>1. </strong>NYU <br>2. KITTI<br><strong>Training Setting :<br></strong>4 張 NVIDIA V100 32GB GPUs.</p><h4>簡介</h4><p>作者從 Encoder-Decoder 網絡架構中提出了對於資訊的全局處理是如何幫助改善整體表現的問題。並且提出了一種基於 Transformer 的架構，它將深度範圍劃分成每張圖像自己估計出來的中心值 Bin ，最後被估計的深度值為 Bin 中心的線性組合，作者稱這個模組叫做 AdaBins。</p><blockquote>創新點：利用基於 Transformer 架構(AdaBins)，去對場景資訊做全局的處理</blockquote><p><strong>貢獻</strong>的部分為：<br>1. 提出一種架構模組，可以對場景資訊進行全局的處理，並且建議將預測出來的深度範圍劃分為 Bin，Bin 為每個圖像的 Bin 寬度變化 (後面會提到)，最後的深度估計就是 Bin 中心值的線性組合。</p><p>2. 在兩個最流行的 Datasets，NYU 和 KITTI 的所有指標上展現了監督單圖像深度估計的改進。</p><p>3. 分析 AdaBins 的不同修改，並且研究它們對於深度估計準確性的影響。</p><h4>方法</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bm6hr3cmASVgzGfWOt2oAA.png" /><figcaption>架構圖</figcaption></figure><p>主要架構分成兩個部分：<br><strong>1. Encoder-Decoder</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*s_CUMV9A50pgMKQqUKxXeg.png" /><figcaption>Encoder-Decoder</figcaption></figure><p>建立在一個 Pretrained 的 EfficientNet B5 和一個標準的 Decoder</p><blockquote>主要是基於另一篇<a href="https://arxiv.org/pdf/1812.11941.pdf">論文</a>的深度回歸網路進行一些修改。<br>將 Encoder 從 DenseNet 切換到了 EfficientNet B5，並且為這個新架構使用不同的損失函數。</blockquote><p><strong>2. AdaBins</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*C6v1Mhp4drtEyAK6qIJ_rA.png" /><figcaption>AdaBins</figcaption></figure><blockquote>輸入是大小為 h×w×Cd 解碼特徵，輸出 Tensor 大小為 h×w×1。但由於 GPU 內存的限制，它們只用 h = H/2 和 w = W/ 2 來促進更好的學習，最後是用雙線性 Upsampling 到 H × W × 1</blockquote><p>主要分成四個 Components：<br><strong>a. Mini-ViT (黃色那塊)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*NAejBITxZ1K6uIKRDtxX6A.png" /><figcaption>Mini-ViT</figcaption></figure><p>是 ViT 的簡化版，用來適應比較小的數據集</p><p><strong>b. </strong>Bin-Width 向量 <strong>b<br></strong>它定義了輸入圖像劃分的深度區間</p><p><strong>c. </strong>Range Attention Maps <strong>R：<br></strong>大小為 H × W × C ，主要是包含對於 Pixel-wise 深度計算有用的資訊</p><p><strong>d. </strong>Hybrid Regression<br>先利用 Range Attention Maps (R) 經過捲積後變成一個 N 個通道的向量，為每個像素的分類深度去預測機率，得到機率 Pk。</p><p>再利用 Bin-Width 向量 <strong>b </strong>先去算出所有的 Bin 中心值 C(b)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*c0NzaJ1kmD_wyowsZI3RcQ.png" /><figcaption>c(b) means center of Bin</figcaption></figure><p>有了這兩個資訊值之後就可以根據機率值 Pk 跟 Bin 的中心 C(b) 去計算加權和，得到每個像素的深度值 d：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/1*p8q4NSebptmGhteXgrV4Ew.png" /></figure><p><strong>Loss</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*K9geVqWVSOOfqF7hrZbOzg.png" /><figcaption>Pixel-Wise Depth Loss</figcaption></figure><p>受到這篇<a href="https://arxiv.org/pdf/1907.10326.pdf">論文</a>的啟發， 引入了一種 Scaled 版本的 Scale-Invariant loss (SI)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*5A0yK4L9yys3zbQJ2kkubQ.png" /><figcaption>Bin-Center Density loss.</figcaption></figure><p>這個 Loss 鼓勵 Bin 中心的分布去遵照 Ground-Truth 中深度值的分布。作者當然希望 Bin 中心會越靠近 GT 的深度值，反之亦然。並且使用雙向的 Chamfer Loss 當作 Regularizer。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*Ch3YIOD5fpybBhO67cqvng.png" /><figcaption>β = 0.1</figcaption></figure><h4>實驗</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8OWHFmlvtjaaaLBb8HwJSg.png" /><figcaption>NYU Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ppHSJEqcB5PVGHiuCFZnhg.png" /><figcaption>KITTI Dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*Ov6Co8sn19e49_EimTipAw.png" /><figcaption>Loss 上面的表現</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*Ju51HBOirSmUJmFjlMzuPg.png" /><figcaption>NYU Dataset 上的結果</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I5wsu8f8PhnwPozFvKolhg.png" /><figcaption>KITTI Dataset 上的結果</figcaption></figure><h4>總結</h4><p>引入了一種新的架構，叫做 AdaBins，用於從單張 RGB 圖像進行深度的估計，並且在兩個最流行的 Dataset 上面帶來很大的改進。在未來作者也會希望研究以高分辨率的輸入圖像進行全局處理看能不能也提高其他任務的性能，例如分割，3D重建之類的。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad6e33787e37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[圖像修復一Image Inpainting via Conditional Texture and Structure Dual Generation]]></title>
            <link>https://lose-hao.medium.com/%E5%9C%96%E5%83%8F%E4%BF%AE%E5%BE%A9%E4%B8%80image-inpainting-via-conditional-texture-and-structure-dual-generation-15b26d166b46?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/15b26d166b46</guid>
            <category><![CDATA[inpainting]]></category>
            <category><![CDATA[fusion]]></category>
            <category><![CDATA[encoder-decoder]]></category>
            <category><![CDATA[loss]]></category>
            <category><![CDATA[paper]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Fri, 22 Oct 2021 11:14:32 GMT</pubDate>
            <atom:updated>2021-10-22T11:14:32.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NLpK0G2A6TEyDgTcndVDYg.png" /><figcaption>In ICCV 2021</figcaption></figure><p><strong>Paper Link : </strong><a href="https://arxiv.org/pdf/2108.09760.pdf">https://arxiv.org/pdf/2108.09760.pdf</a><br><strong>Github Link :</strong> <a href="https://github.com/Xiefan-Guo/CTSDG">https://github.com/Xiefan-Guo/CTSDG</a> (released Code)<br><strong>Datasets：</strong><br>1. CelebA (train 4 days)<br>2. Place2 (train 10 days)<br>3. Paris StreetView (train 4 days)<br><strong>Training Setting :<br></strong>一張 NVIDIA 1080TI GPU (11GB) (Batch size of 6)</p><h3><strong>簡介</strong></h3><p>引入結構先驗的的方式，在以前的任務中都有不錯的進展，但是在結構重建的過程缺乏跟紋理之間的溝通，在處理大損壞面積的圖像上是表現不佳的，所以作者提出了一種新型的 <strong>Dual-Stream Network</strong>，它可以以耦合的方式去對結構跟紋理去進行重建建模，以便互相去參考來得到更合理的結果。另外為了增加全局的一致性，他們也有引入兩種模塊，分別是<strong>雙向門控特徵融合（Bi-GFF）</strong>和<strong>特徵聚合（CFA） </strong>來讓整個網路的表現更為出色。</p><p><strong>貢獻</strong>的部分為：</p><ol><li>提出一種新型的 Dual-Stream Network，可以將結構跟紋理互相參考來得到更準確的結果</li><li>設計了兩個模塊：<br>a. <strong>雙向門控特徵融合 (Bi-GFF) </strong>來分享 &amp; 組合結構跟紋理特徵之間的訊息來增強一致性<br>b. <strong>上下文特徵聚合 (CFA)</strong> 通過對長期空間依賴性進行建模來產生更生動的細節。</li><li>在多個資料集中對於質量和數量上都達到了 SOTA。</li></ol><h3>方法</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YiLvO17jXHfl2KD3EGncHA.png" /><figcaption>流程圖</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*h9lZa6Wzs-IrSc6gf2MY5Q.png" /><figcaption>Generator</figcaption></figure><p>Generator 是一個 Dual-Stream 的架構，是由 U-Net 去修改的</p><p>在 Encode 階段損壞的圖像和 Map 被單獨投影到 Latent Space，左邊藍色的部分主要關注 Texture 的特徵，右邊紅色的部分關注 Structure 的特徵</p><p>在 Decode 階段，Texture Decoder((藍右下) 通過從 Structure Encoder(紅右下) 借用的 Structure 特徵來合成紋理，同理 Structure Decoder(紅右上) 也通過 Texture Encoder(藍左上) 取得 Texture 特徵來恢復結構。</p><p>作者表示這樣的架構在結構跟紋理上可以起到很好的互補作用，帶來更好的結果。在這個基於 Encoder-Decoder 的架構中，作者使用 Patial Conv Layer 取代所有普通的 Conv Layer，目的是想更好地從不規則的邊界去得到訊息。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*sxj4MpTYF3AQ4KeLcZo2-A.png" /><figcaption>特徵融合</figcaption></figure><p>通過從 Generator 取得的 Fsruc 和 Ftext 之後，再來就是進行特徵融合，在這個部分會去介紹它所提供的兩個模組，<strong>Bi-GFF &amp; CFA。</strong></p><p><strong>Bi-directional Gated Feature Fusion (Bi-GFF)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*7qHB7V7oSTQg1XNiXJihTg.png" /><figcaption>Bi-GFF</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*UUWotcB9XFsgJ3TYgUP5cg.png" /></figure><p><strong>上半部<br>Gt<br></strong>-<strong> </strong>Ft 跟 Fs 去做 Concat<br>- Conv Layer 的 Mapping Function (g)<br>- Sigmoid activation (σ)<br>目的：是為了建構紋理感知的結構特徵，類似參考紋理去生成結構的特徵<br><strong>F’s <br></strong>- Element-Wise 相乘 (⊙)<br>- Element-Wise 相加（⊕）<br>- 訓練參數 (α) <br>目的：讓 Ft 自適應的融合進 Fs</p><p><strong>下半部<br></strong>Gs &amp; F’t 就跟上半部的部分差不多 <br>h 跟 β 也是遵循 α 跟 g 的格式</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*uSrI7WM7CKI5atzsDg4WUw.png" /></figure><p>取得到 F’s 和 F&#39;t 之後就可以將它 Concat 起來得到特徵圖 Fb (F̶a̶c̶e̶b̶o̶o̶k̶)</p><p><strong>Contextual Feature Aggregation (CFA)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*xQKZryNohIIzD3xRb9c3TQ.png" /><figcaption>CFA</figcaption></figure><p>這個模組是為了可以瞭解說現有區域有哪些是有助於填充孔洞的，他可以去增強局部的特徵之間的關聯性並且保持整體圖像的一致性。以往的補丁匹配都是用固定的尺度，本篇論文採用的是多尺度的特徵聚合。</p><p>具體來說給定一個 特徵圖 F，可以先提取 3×3 像素的 Patch 來去算他們的餘弦相似度：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*z14EeQb12adkPwwmcF3DOA.png" /><figcaption>餘弦相似度</figcaption></figure><p>fi 跟 fj 分別對應 Feature Map 的第 i 個跟第 j 個 Patch，然後用 Softmax 來得到每個 Patch 的 Attention Score：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*4XW1g3g__FJHQ7JkLAd2eQ.png" /><figcaption>Softmax</figcaption></figure><p>接下來，被提取的 Patch 用於重建 Feature Map：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*cqm6EfAI45dPAhE8LHRkfA.png" /></figure><p>其中 f~i 是重建 Feature Map (Frec) 的第 i 個塊。 <br>重構 Feature Map 時，使用四組不同 Dilation Rate (k = 1,2,4,8) 的 Dilated Conv Layers 來獲得多尺度的語意特徵 ：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*xOd53tUx-d3Tw4De6ESVxQ.png" /><figcaption>k = 1,2,4,8</figcaption></figure><p>為了更好的去聚合 多尺度的語意特徵，作者進一步設計了一個 Pixel-Level Weight Map Generator (<strong>Gw</strong>)：</p><p>Gw 由兩個 Conv Layer 組成，Kernel 大小分別為 3 和 1，每個 Layer 後跟 ReLU 非線性，Gw 的輸出 Channels 為 4。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*bkIuUCMJaV7Ou-pAP2S7tQ.png" /></figure><p>最後通過 Element-Wise Weighted Sum 生成精細的特徵圖 <strong>Fc</strong>：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*C_7nM_Sl_Yjr4TRpb1wcAg.png" /></figure><p><strong>Discriminator</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*aQ_wk4X3WYMszlcF3fcv5Q.png" /></figure><p>受到一些論文的啟發，作者開發了一個 Dual-Stream Discriminator，通過估計紋理跟結構的特徵統計來區分說真實的圖像跟生成的圖像。</p><p>Texture Branch 主要包含 3 個 Conv，Kernel Size = 4，Stride = 2，後面兩個的 Stride = 1。</p><p>Structure Branch 與跟 Texture Branch 是類似的，其中輸入邊緣圖由 Residual Block 產生出來的。</p><p>最後在這兩個 Branch 的通道維度來計算 對抗損失 (Ladv)</p><p>Note: Loss 的部分 Structure Branch 不同於 Texture Branch，如果只用邊緣圖來優化 Loss 是不夠的，所以採用灰階圖像作為附加的條件。</p><h3>實驗</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*v5AeCe66F1PhwYn_e8tQQg.png" /><figcaption>在 CelebA, Paris StreetView, Places2 上的驗證</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*xp1BDBMV0UuzMsJYfMyGAA.png" /><figcaption>CelebA、Paris StreetView 和 Places2 上基於不同結構的方法的視覺比較</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*CdKZi7-xCrDoyeDpzgSzBg.png" /><figcaption>在 Place2 上的驗證</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*jun9G9g2ZNkyPW4-9ib85Q.png" /><figcaption>網絡架構和 Single Module 對 Paris StreetView 的可視化圖</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*N8K1gwDGZEeqKO8L_-8e5g.png" /><figcaption>在 Paris StreetView 上的 Ablation Sudy</figcaption></figure><h3>總結</h3><p>提出一種新的 Dual-Stream 的修復方法，可以讓結構跟紋理可以互相參考來修復損壞的圖像，原來 Encoder &amp; Decoder 可以這樣使用，然後還有提出了兩種模組，可以進一步的去產生更完善的圖像，也在資料集上面表現得不錯</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15b26d166b46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[圖像修復一Context-Aware Image Inpainting with Learned Semantic Priors]]></title>
            <link>https://lose-hao.medium.com/%E5%9C%96%E5%83%8F%E4%BF%AE%E5%BE%A9%E4%B8%80context-aware-image-inpainting-with-learned-semantic-priors-ed7013ac8532?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed7013ac8532</guid>
            <category><![CDATA[image-inpainting]]></category>
            <category><![CDATA[semantics]]></category>
            <category><![CDATA[inpainting]]></category>
            <category><![CDATA[ijcai]]></category>
            <category><![CDATA[2021]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Fri, 08 Oct 2021 09:34:50 GMT</pubDate>
            <atom:updated>2021-10-08T09:34:50.315Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*Sdfr_Pn3ihO7yDBQQmzshQ.png" /><figcaption>In IJCAI 2021</figcaption></figure><p><strong>Paper Link : </strong><a href="https://arxiv.org/pdf/2106.07220.pdf">https://arxiv.org/pdf/2106.07220.pdf</a><br><strong>Github Link :</strong> <a href="https://github.com/WendongZh/SPL">https://github.com/WendongZh/SPL</a><br><strong>Datasets：</strong><br>1. CelebA<br>2. Place2<br>3. Paris StreetView</p><h3>簡介</h3><p>為了可以把缺失內容跟背景之間做一個全局的關係建模，作者將一個預先處理的多標籤分類模型的 High-Level Feature Map 當作語義上的監督，這個方法也有助於全局上下文的理解，而且這個模型主要是提取高級特徵，也間接地提高了作者模型對局部紋理跟結構缺陷的鲁棒性。</p><p><strong>貢獻</strong>的部分為：<br>1. 作者表示從特定的任務中提取 High-Level Feature 有助於理解全局上下文的關係，因此對 Low-Level 圖像修復在與義上是有意義的。也不需要對 Dataset 去做額外的註解。<br>2. 提出 SPL 模型，一種用於上下文感知的圖像修復新模型，它可以自適應地將學習到的語意先驗和局部的圖像特徵合併到一個統一的生成網路當中。並且是使用 End-To-End 的方式去進行訓練。<br>3. SPL 在三個標準資料及上達到了 SOTA 的性能。</p><h3>方法</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7QGYjGDBLiOopk_nvGV_DQ.png" /><figcaption>模型架構</figcaption></figure><p>主要分成三個部分：Image Encoder, Semantic Learner, Image Decoder。</p><p>整個流程又可以分成兩個階段：<br>1. 在 Encoder 階段利用待修復圖像中學習圖像的特徵跟語義先驗。<br>2. 在 Decoder 階段所學習到的語義先驗在空間上跟圖像特徵中合併，有助於恢復全局跟局部的結構內容</p><h4>Image Encoding</h4><p>目標是可以從剩餘內容中提取豐富的低級特徵，這些特徵在恢復局部紋理的方面有著重要的作用，作者利用兩個 Down-Sampling 將 Input 嵌入到圖像特徵當中。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/194/1*cVWqFbSnxXMp3r_qgGirrw.png" /><figcaption>EI 是第一個 Encoder，用於提取特徵</figcaption></figure><h4>Semantic Priors Learning</h4><p>目標是在預先訓練的深層網路的監督下學習完整的語義先驗。為了可以更有效的理解多個不同對象的全局上下文，作者利用了一個預先處理的多標籤分類模型 H 和 不對稱損失 來提供監督</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*l5IJz-i3wAbw-afh4ECi5Q.png" /></figure><p>作者表明不會在 Dataset 上微調這個模型。對於這個 Encoder，紋理細節不太重要，重要的是要去理解全局上下文，為此作者進行了兩樣修改：<br>1. 因為目標是從深層網路的更高層學習語義的信息，對輸入圖像 I 去做 Up-Sampling 以保留更多局部結構，之後就可以利用 I&#39; 作為多標籤分類模型 H 的輸入。並且也將待修復圖像 Im 和 Mask M 也以相同的方式去處理，去得到一個 Im’ 跟 M’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/140/1*k7diuRCkHLOoC5jYYNci5A.png" /><figcaption>H 的輸入是經過 Up-Sampling 的 I</figcaption></figure><p>2. 為了建立剩餘圖像和語義先驗之間的映射，作者利用三個 Down-Sampling 和 5 個 Residual Blocks 來組成 語義學習器 Es。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/193/1*OfH0v4a5MCyGslL-k7FkfA.png" /><figcaption>Es Encoder 的輸入就是經過 Up-Sampling 的 Im,M</figcaption></figure><p>然後作者利用 1×1 卷積層使 Sm 轉換成 Sm’ ，可以去適應上面所得到的 S</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/1*TRXsJ0pyhFpVQStArp7DDQ.png" /></figure><p>最後，提出了對缺失區域具有額外約束的 L1 重建損失來監督語義學習器：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*rxTjJQrCIvs5O_N7P0odaA.png" /></figure><h4>Context-Aware Image Inpainting</h4><p>在生成的階段，會利用下圖所示的 Decoder 來解決另一個關鍵的問題：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*XB0Qsx3h5mHxiu27VvZw6g.png" /></figure><p>即是如何利用 語義先驗 Sm 來關注圖像內容的不同面向，如果直接去進行特徵融合可能會影響原本 Background 的局部紋理，還會影響 Encoder 的學習的過程。為此作者利用一個空間自適應歸一化的模塊（SPADE）利用 8 個 Residual Blocks 將 語義先驗的空間注入到 Decoder 的階段。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*TQM1rS44QUOV5FJWmZtfHg.png" /><figcaption>SPADE 的細節</figcaption></figure><p><strong>SPADE 主要的功能就是：</strong>在給定一個語義分割圖 (利用 Sm) 時，去合成對應的實際圖像 (利用 Fm)，更多詳細的內容可以看<a href="https://www.twblogs.net/a/5d6d72aebd9eee5327ff19d1">這裡</a>。</p><p>最後得到一個 Fm’ 後，再經過兩個 Up-Sampling 的 Generator 後就可以得到修復的圖像。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/134/1*0zvQDcPhy7HoAsgBcbAPqA.png" /></figure><h4>Loss Function</h4><p>對於整個 SPL 模型，作者利用重建和對抗損失來訓練：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*JZ0MNwStNEvhSpuDwCkHag.png" /><figcaption>重建損失</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*Sxw1TFHRlKc14tS7BLuSig.png" /><figcaption>對抗損失</figcaption></figure><p>為了生成更合理的局部細節，作者也用來訓練 Discriminator：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*Z3PcU2l983K2P-Dk0nIDKg.png" /><figcaption>Discriminator Loss</figcaption></figure><p>最後總和的 Loss 可以寫成：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*mwZ9VmbCrK1WQrpGos6yvQ.png" /><figcaption>All Lose</figcaption></figure><h3>實驗</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*7d8U9zGCrjClK38OUfU0zA.png" /><figcaption>跟之前的 baseline 做比較</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4NP7SfOSgdlbzYZ3mPOa2Q.png" /><figcaption>評估指標</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*QUBFIQ0gm-0ULshhG2cYhg.png" /></figure><h3>總結</h3><p>提出一種 新的 SPL 圖像修復模型，它並沒有去關注局部紋理的一致性，而是展示在其他任務（Ex: 多標籤分類和對象檢測）下經過訓練的深度神經網路的高級特徵中富含豐富的語意信息，也對於理解全局上下文有所幫助。</p><p>也藉由將高級特徵從模型轉移到低級特徵的空間中，並且使用學習到的鮮豔作為圖像修復結構的引導。最後提出一個上下文感知修復模型，可以在統一的 Image-Decoding 模塊中自適應地結合全局語意和局部的紋理。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed7013ac8532" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[圖像修復一PD-GAN: Probabilistic Diverse GAN for Image Inpainting]]></title>
            <link>https://lose-hao.medium.com/%E5%9C%96%E5%83%8F%E4%BF%AE%E5%BE%A9%E4%B8%80pd-gan-probabilistic-diverse-gan-for-image-inpainting-b21d1844adef?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/b21d1844adef</guid>
            <category><![CDATA[gaussian]]></category>
            <category><![CDATA[cvpr-2021]]></category>
            <category><![CDATA[cvpr]]></category>
            <category><![CDATA[paper]]></category>
            <category><![CDATA[image-inpainting]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Fri, 24 Sep 2021 10:24:24 GMT</pubDate>
            <atom:updated>2021-09-24T10:24:24.790Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*sxnJpEr85nWiyaunLQQQuw.png" /><figcaption>In CVPR 2021</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*rRlnzvv_J2mDkHzXRN8Lgg.png" /><figcaption>架構圖</figcaption></figure><p><strong>Paper Link :</strong> <a href="https://arxiv.org/pdf/2105.02201.pdf">https://arxiv.org/pdf/2105.02201.pdf</a><br><strong>Github Link :</strong> <a href="https://github.com/KumapowerLIU/PD-GAN">https://github.com/KumapowerLIU/PD-GAN</a><br><strong>Datasets：</strong><br>1. CelebA-HQ<br>2. Place2<br>3. Paris StreetView</p><h3>簡介</h3><p>圖像修復使用 CNN 深度學習的方法後，在修復的任務上有著不錯的進展（先不討論硬體架構），目前常見的架構都是一些 Encoder-Decoder 去填充缺失的部分，但是在訓練時會使用 Reconstruction Loss，可能會限制了多樣化的內容生成，所以很難去同時兼顧質量跟多樣性。</p><p>但是作者注意到 GAN 非常強大，可以根據不同的 Random Noise 輸入生成不同的圖像內容。 因此作者提出的 PD-GAN 不是將輸入圖像發送到 CNN，而是從隨機噪聲向量(Random Noise Vector)開始，然後對該它進行 Decode 以生成內容，這樣做的好處就是可以讓多樣性提高，同時作者也有提出新的Normalization 和 Loss 的方法，達到兼顧質量跟多樣性。</p><p><strong>貢獻</strong>的部分為：<br>1. PD-GAN 通過所提出的 SPDNorm 來調整機噪聲向量(Random Noise Vector)的特徵，以達到上下文的約束。<br>2. 提出了一種 Perceptual Diversity Loss 來增強多樣性。<br>3. PD-GAN 在一些資料集上面表現得不錯</p><h3>方法</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*rRlnzvv_J2mDkHzXRN8Lgg.png" /><figcaption>架構圖</figcaption></figure><p>輸入的部分是從高斯分佈取出來的 Random Vector，然後用一個 Pre-Trained 好的 Partial CNN 去對 Iin 產生一個 Coarse 預測圖 P ，並且透過 SPDNorm ResBlock 來去提高多樣性跟生成圖片質量。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B7XfzHJdSAwkd1xfzk--yw.png" /><figcaption>內部介紹</figcaption></figure><p>在 SPDNorm ResBlock 中有使用到兩個部分：</p><p><strong>1. Hard SPDNorm(Dh) :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*xjmm7B0BSdeap_yg2QoSbg.png" /><figcaption>Feature Map 大小為 8 * 8</figcaption></figure><p>透過 Partail CNN 生成的 Mask 去算出來的，不需要學習。</p><p>主要是通過 Dilation Operation 去實現的， 背景的部分則是 1，數值則會朝著孔的中心遞減，直觀來說，越靠近孔的中心代表多樣性應該要是高的，所以產生出來的內容對於先驗訊息來說可信度就會較低。在實驗中將 K 設為 4</p><p>值越小，對於先驗信息的可信度就會越低，多樣性就越大。 Dh 是直接計算出來的沒有使用學習的方式（即 Dh 是固定的）。可以讓生成的內容跟背景保持一致性，也可以確保預測的多樣性。</p><p><strong>2. Soft SPDNorm(Ds) </strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/1*AAlPW_0q5byBlAXX9nV-SA.png" /><figcaption>Feature Map 大小為 8 * 8</figcaption></figure><p>主要是透過學習的方式來自我適應機率分佈。公式如下：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*1g66wdRmu6Pu_TpmprEmCg.png" /></figure><p>M 是 Binary Mask，Fp 是 P (先驗資訊) 經過 CNN 後學習到的 Feature。之所以需要 Soft SPDNorm，是因為 Hard SPDNorm 對於訓練來說不夠穩定，測試時很容易產生偽影，因此透過網路去自己學習一個機制來讓生成的結果更加合理。</p><p>最後把 Hard 和 Soft SPDNorm 做成一個 ResBlock，把 Soft 的輸出當作殘差加到 Hard SPDNorm 當中。</p><p><strong>Loss<br></strong>作者也曾利用 Reconstruction Loss 來訓練網路，但是對於多樣性有嚴重的影響，所以就嘗試使用一種 Diversity Loss 來解決這個問題：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*wFffUa1SaYLEqYQgJ2_nkQ.png" /><figcaption>Iout1 = G(z1, P, M)，Iout2 = G(z2, P, M)</figcaption></figure><p>主要使用相同的 P (先驗資訊)，M，但用不同的 Latent Vector z1,z2 當參考</p><p>但是這個 Loss 在本篇論文中非常不適合，主要有以下兩點：<br>1. 直接對全圖去算 Loss ，會改變上下文區域的內容，這些內容對於不同的Latent Vector z 應該是固定的。<br>2. 由於 Iout1 和 Iout2 都被統一到 (-1, 1)，最後可能出現全黑或全白的情況</p><p>基於以上兩點，作者又提出了另一種更有效的 Loss 叫做 :<br><strong>Perceptual Diversity Loss</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*gq8Z9W2MpMD8Sk-43murrQ.png" /><figcaption><strong>Perceptual Diversity Loss</strong></figcaption></figure><p>Fi 代表是 VGG 第幾層的 Feature，M 代表 Binary Mask，先用 VGG 提取特徵有利於輸出不會往 1 或 -1 兩個極端值靠近，同時 * M 可以去確保不會影響到背景的區域，最後分子的部分是 1 而不是兩個 Latent Vector z1,2 是因為作者發現最後仍然會影響到背景的區域。</p><h3>實驗</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*r4-amP6fiIaf3_tNEjliSQ.png" /><figcaption>CelebA-HQ</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SC5mRTRgS8VhTuTPWCqcUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*y-SQnWZyAn_WEXFCUNdcFw.png" /><figcaption>Place2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*uCACR0lJWZGrP6w5q_yD_A.png" /><figcaption>Places2 多樣性</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*VKxrbKlCPgRYzbX6TjQX6w.png" /><figcaption>Place2</figcaption></figure><h3>總結</h3><p>不同以往的修復方法，有人說利用 GAN 的架構來做 Diverse 的生成是一個不錯的啟發，Code 目前還沒有被釋出。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b21d1844adef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[圖像修復一Rethinking Image Inpainting via a Mutual Encoder-Decoder with Feature Equalizations]]></title>
            <link>https://lose-hao.medium.com/%E5%9C%96%E5%83%8F%E4%BF%AE%E5%BE%A9%E4%B8%80rethinking-image-inpainting-via-a-mutual-encoder-decoder-with-feature-equalizations-68c90d4be5f4?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/68c90d4be5f4</guid>
            <category><![CDATA[paper]]></category>
            <category><![CDATA[mutual]]></category>
            <category><![CDATA[image-inpainting]]></category>
            <category><![CDATA[encoder-decoder]]></category>
            <category><![CDATA[eccv-2020]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Thu, 02 Sep 2021 09:03:29 GMT</pubDate>
            <atom:updated>2021-09-02T09:06:07.465Z</atom:updated>
            <content:encoded><![CDATA[<p>Hongyu Liu 1 , Bin Jiang 1*, Yibing Song 2*, Wei Huang 1 , and Chao Yang 1 <br>1.College of Computer Science and Electronic Engineering, Hunan University, Changsha, China. 2.Tencent(騰訊) AI Lab.</p><p>In ECCV 2020</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*nR7u5bp-Wj4SwKviFz1PEQ.png" /><figcaption>架構圖</figcaption></figure><p>Paper Link : <a href="https://arxiv.org/pdf/2007.06929.pdf">https://arxiv.org/pdf/2007.06929.pdf</a><br>Github Link : <a href="https://github.com/KumapowerLIU/Rethinking-Inpainting-MEDFE">https://github.com/KumapowerLIU/Rethinking-Inpainting-MEDFE</a><br>Training Setting：NVIDIA 2080TI GPU *1 <br>Datasets：<br>1. CelebA<br>2. Place2<br>3. Paris StreetView</p><h3>簡介</h3><p>Image Inpainting 最近基於 Attention 和 雙階段（ex : Coarse and Refine）的模型非常流行，而 Image Inpainting 的目標就是重建出合理的結構跟真實的紋理，雙階段模型通常在第一階段會得到一個 Coarse 的圖像，這些生成的圖像結構就已經修復的不錯了，然後在第二階段進行細節的修復。但其實這些都是基於 Image Level 上的修復，作者則是想要把 紋理跟結構 的修復放在 Feature Level 上面，並且只使用單階段的網路去實現。</p><p><strong>貢獻</strong>的部分為：<br>1.<strong> Mutual Encoder-Decoder：</strong><br>提出一種 Mutual Encoder-Decoder 的網路，CNN 淺層的特徵被學習用來表示紋理（Texture），而深層的特徵表示結構（Structure）。<br>2. <strong>Feature Equalization：<br></strong>提出一種特徵均衡的方法，使結構跟紋理的特徵相互一致。並且在特徵連接後去對 Channels 重新的加權，並且提出雙向傳播的 Activation Function 使得整個特徵保持一致性。<br>3. <strong>Performance in Experiments</strong>：<br>有大量的實驗去證明他們所提出的修復方法在消除 模糊跟偽影（結構和紋理特徵不一致所引起的）的有效性。並且相對於 SOTA 修復方法表現良好。</p><h3>方法</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*nR7u5bp-Wj4SwKviFz1PEQ.png" /><figcaption>架構圖</figcaption></figure><p>在 CNN 當中，越深的 Layer 代表著 結構訊息，反之，越淺的 Layer 代表著 紋理訊息。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*Sex87F370kCXXxaJXuXifg.png" /><figcaption>Encoder 的部分</figcaption></figure><p>利用上述的觀念把上圖 Encoder 的特徵分成兩個部分，前三層代表紋理，後三層代表結構。 Fte 代表前三層去融合的特徵（Textures），Fst 代表後三層去融合的特徵（Structures），分別的大小都是 32×32×256。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*Mv_kIo1DGO-HjEZI4I68qA.png" /><figcaption>圖(一) Multi-Scale filling 模組</figcaption></figure><p><strong>具體上要怎麼去修復這些 Feature 的 孔洞區塊呢？</strong><br>作者將 Fst 和 Fte 分別通過 Multi-Scale Filling 的模組去修復孔洞，具體來說這個模組內部是分成三個部分，每個部分都是由 5 個同樣大小 Partial Convolutions 去組成（就是橘色方塊的數量），三個部分的 Kernel Size 分別是 3, 5, 7，經過這個模組之後：<br>1. Fst 會變成 Ffst （圖(一)中 右邊較黑的區塊）<br>2. Fte 會變成 Ffte（圖(一)中 右邊較白的區塊）</p><p><strong>要怎麼保證這些 Feature 是真的能夠關注紋理或是結構呢？</strong></p><p>作者將 Ffst 和 Ffte 用 1 × 1 Convolution 去映射到 RGB 層，然後用新的符號去代表映射過後的圖：<br>1. Ffst 映射過後會得到 Iost<br>2. Ffte 映射過後會得到 Iote</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*wJlEuLdcwNeb2bHG7EA2PQ.png" /><figcaption>L1 Loss</figcaption></figure><p>有了這些參數之後再利用 GT (Grount Truth) 計算 L1 Loss <br>對於 Iost ( Structure）的 GT 來說就是 GT 的結構圖：Ist (只有結構)<br>對於 Iote（Texture）的 GT 來說就是 GT 原圖： Igt (有紋理跟細節)</p><p>通過這樣的 Constrain 就可以保證孔洞填充的效果，並且確定這些 Feature 是真的有去關注紋理或是結構。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*KdnOiFPXZJqQGg_F3x9skg.png" /><figcaption>除了上述提到的 L1 Loss 之外，作者還有提出一些 Loss，有興趣可以看一下 Paper</figcaption></figure><p>這時候我們會得到填充過後的結構跟紋理的 Feature，但是這時候會出現一個問題，一張圖片通常都是由結構跟紋理一起構成的，那要怎麼把這兩者融合變成一張完整的特徵圖呢？這時候作者就提出了 Feature Equalizations。</p><h4>Feature Equalizations</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*oG9KPkQqh04Xa53VR7j87A.png" /><figcaption>圖(二) 介紹 Feature Equalizations 的圖片</figcaption></figure><p>作者將 Ffst 和 Ffte 拼接起來並且通過 1×1的 Conv 後得到一個簡單的 Fsf ， 並且去進行 Feature Equalizations，其中分為兩個維度上的平衡：<br><strong>1. Channel Equalization</strong><br>這裡是使用 <a href="https://meetonfriday.com/posts/79fdff34/">SE-Block</a> 去實現，因為其中的 Attention 值是由 Fsf 得到，所以是由結構跟紋理的訊息一起得到的，可以去確保平衡。</p><p><strong>2. Spatial Equalization</strong><br>這邊作者提出了 Bilateral Propagation Activation function (BPA)，作者說這是由雙向濾波去得到的啟發，對於每個特徵點來說，可以去利用周圍（Local, 3×3）的特徵點以及全局（Global, 32×32）的特徵點來進行融合，得到一個新的特徵點，具體一點來說：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*7GZDAJ1VURxIlK_QmcL0nw.png" /><figcaption>BPA</figcaption></figure><p>其中 ysi (第一條公式) 就是在 Spatial 上融合得到的特徵點，而 yri (第二條公式)就是在 Range 上得到的特徵點，這裡的 Spatial 和 Range 的概念就跟<a href="https://zh.wikipedia.org/wiki/%E9%9B%99%E9%82%8A%E6%BF%BE%E6%B3%A2%E5%99%A8">雙邊濾波</a>中的一樣。<br>1. Spatial 的範圍是 Global, 32×32，也就是當前的特徵點是藉由全圖所有的特徵點去融合合成的。前面有提到全圖的大小是 32×32<br> 2. Range 上的範圍是 3×3 ，當前特徵點（中心）由周圍 9 個特徵點（包含自己）去融合得到的。</p><p>得到 ysi 和 yri 之後，就可以利用 1×1 的 Conv 去把這兩個特徵點進行融合 得到 yi（第三條公式）。</p><p>利用這種方式，你當前的特徵點 yi 可以由 Local 和 Global 的資訊去構成，也就確保了 Local 和 Global 的特徵一致性。也可以確保孔洞內容是有效的，並且孔洞周圍跟 Background 也會一致。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*mdKTXA4oGVhjUTrpTVf50w.png" /><figcaption>Feature Equalization flow</figcaption></figure><ol><li>X 符號為 Broadcast Dot Product Operation</li><li>+ 符號為 Element-Wise Addition</li><li>三角形 符號為 Concatenation</li><li><a href="https://www.796t.com/article.php?id=317322">Onfold</a> 是 Pytorch 中的函數，主要就是將輸入的特徵去做 Reshape 到 Conv 乘法所需要的大小</li></ol><h3>實驗</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*cfEiGkJjFd1cIQDVNMtivA.png" /><figcaption>Visualization of the Feature Map</figcaption></figure><p>這裡作者就把每個階段的 Feature Map 去做視覺化的處理，那 (a) 跟 (e) 的部分代表 Input 和 Output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tj30w8Y6hM5DAO9D2NzB_w.png" /></figure><p>填充中心孔洞過後的比較，可以看到作者們產生出來的結構跟紋理是比其他的修復技術還要完整的。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*9XqC--yZwIqvFtnvGvLzXg.png" /><figcaption>在 CelebA 數據集對中心孔洞填充過後的數值評估</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*PU-ssad1RHAF2wz0-_0tpw.png" /><figcaption>在 Place2 資料集上面的評估</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*HaRG6_7UkG2NCrLYEJpXEQ.png" /><figcaption>在 Paris StreetView 資料集上面的評估</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*5gIGc6DUChoxBntpb2bd7Q.png" /></figure><p>這張是 User Study，不事先告知 User 孔洞的區域，來讓 User 選出他們覺得填充的結果是自然且合理的圖片。那可以看到作者們的圖片被挑選的比例是最高的。</p><p>後面就是 Ablation Study 的部分</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*R0tai0ShhxGL3AfsojQhCg.png" /><figcaption>這是在 Place2 上面做的 Ablation Study，主要是驗證 Feature Equalization 的有效性</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*xdq22lEeU2MWIRqRp4RMfA.png" /><figcaption>他 Ablation Study 打錯了(？ 主要是去看兩個 Branches 的有效性（Structure &amp; Texture）</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4aaczmOdrpjVAuYIXStUA.png" /><figcaption>經過 Feature Equalizations 後再視覺化後的結果，可以看到紋理跟結構是比其他的合理的</figcaption></figure><h3>總結</h3><p>作者提出了一種具有 Feature Equalizations 的 Mutual Encoder-Decoder，淺層跟深層的特徵分別分成兩個 Branches 去重組紋理跟結構的特徵。並且在最後將這兩者融合再一起得到一張完整的 Feature Map，在眾多實驗中表明他們的這個模型在圖像修復上是有一定的有效性的。</p><p>作者最後有提到說 Feature Equalizations 的這種方式應該可以取代傳統的 Attention Block (None-Local/CBAM)，但他們沒有時間做這一部分的驗證，希望有人可以幫他們做這部分的實驗，我覺得可以思考這個想法的可行性。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68c90d4be5f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[圖像修復一 Contextual Residual Aggregation for Ultra High-Resolution Image Inpainting]]></title>
            <link>https://lose-hao.medium.com/%E5%9C%96%E5%83%8F%E4%BF%AE%E5%BE%A9%E4%B8%80-contextual-residual-aggregation-for-ultra-high-resolution-image-inpainting-809c361c4687?source=rss-c4eed6b07973------2</link>
            <guid isPermaLink="false">https://medium.com/p/809c361c4687</guid>
            <category><![CDATA[high-resolution]]></category>
            <category><![CDATA[cvpr]]></category>
            <category><![CDATA[image-inpainting]]></category>
            <category><![CDATA[residual]]></category>
            <category><![CDATA[cvpr-2020]]></category>
            <dc:creator><![CDATA[shu hao]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 03:56:54 GMT</pubDate>
            <atom:updated>2021-08-10T03:56:54.045Z</atom:updated>
            <content:encoded><![CDATA[<p>Zili Yi* Qiang Tang* Shekoofeh Azizi* Daesik Jang* Zhan Xu* Huawei Technologies Canada Co. Ltd. In CVPR 2020</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xnNNb3ASjyekD7ygiLSo3A.png" /><figcaption>架構圖</figcaption></figure><p>Paper Link : <a href="https://arxiv.org/pdf/2005.09704.pdf">https://arxiv.org/pdf/2005.09704.pdf</a><br>Github Link : <a href="https://github.com/duxingren14/Hifill-tensorflow">https://github.com/duxingren14/Hifill-tensorflow</a><br>Training Setting : NVIDIA 1080 Ti GPUs * 2<br>Datasets :<br>1. Places2 (randomly cropped to 512 × 512)<br>2. CelebA-HQ (down-sampled to 512 × 512)<br>3. DIV2K (down-sampled to 512 × 512)</p><h3>簡介</h3><p>近幾年來 Data-Driven 的圖像修復技術比起傳統的方法更有進展，但是由於內存的限制，他們只能處理一些低分辨率的輸入(通常小於 1K )，同時拍攝的照片隨著設備可以到達 8K。如果用低分辨率簡單的 Up-Sampling 只能產生大而模糊的結果，而在大的模糊圖像上添加高頻的殘差圖像可以產生清晰、豐富細節與紋理的結果。</p><p>作者受到這個啟發，提出了一種 Contextual Residual Aggregation (CRA) 的機制，通過加權聚合來自 Contextual Patches 的殘差，可以為缺失的內容生成高頻殘差，因此只需要來自網絡的低分辨率預測。</p><p>而由於網路的捲積層只需要對低分辨率的輸入和輸出進行操作，因此可以很好地降低內存和計算能力的成本，也減輕了對高分辨率訓練數據集的需求。</p><p>在作者的實驗中，使用在分辨率為 512×512 的小圖像上訓練所提出的模型，並對高分辨率圖像進行推理，從而實現不錯的修復質量。作者的模型可以修復到 8K 的圖像，並帶有蠻大的孔洞，這對於之前 Learning-Based 的方法來說是難以處理的。</p><p>而且因為網路架構的輕量化設計，在 GTX 1080 Ti GPU 上實現了 2K 圖像的即時推理。</p><p><strong>貢獻</strong>的部分為：<br>1. 設計了一種 Contextual Residual Aggregation (CRA) 的機制，能夠超高分辨率的修復，且產生令人滿意的質量。這個機制可以使圖像( 高達8K ) 在具有相當大的孔尺寸(高達 25% )能夠使用有限的內存和計算資源下進行修復，並且這個模型可以在小圖像上訓練並且運用在大圖像，減少對高分辨路訓練數據集的需求</p><p>2. 開發了一種用於不規則孔填充的輕量化模型，可以在 NVIDIA GTX 1080 Ti GPU 上對 2K 分辨率的圖像運行即時推理，使用的技術包括 Slim and Deep Layer Configuration、Attention Score Sharing 和 Light Weight Gated Convolution（ LWGC）。</p><p>3. 在多個抽象級別使用注意力轉移 (Attention Transfer)，它可以通過從多個尺度的上下文中加權複製特徵來填充漏洞，即使在低分辨率圖像上進行測試時，也能在一定程度上提高現有方法的修復質量。</p><h3>方法</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4-HCGZQeVShRcomK0beHww.png" /><figcaption>流程圖</figcaption></figure><p>首先將圖像 Down-Sampling 到 512 × 512 再 Up-Sampling 到原始輸入大小相同的模糊圖像。Height 和圖像的 Width 不必相等，但必須是 512 的倍數。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_oKCq3_PX8E1uhBqMjXmnA.png" /><figcaption>Generator 是唯一可訓練的部分</figcaption></figure><p>Generator 用 512 × 512 的圖像和 Binary Mask 當作輸入去填充孔洞，輸出的部分也是 512 × 512 的圖像，並且採用的是 Two-Stage 的 Coarse-To-Fine 網路架構。</p><ol><li>Coarse 網路__產生粗略的缺失內容<br>為了擴大感知範圍並減少計算量，網路在 Convolution 之前將輸入 Down-Sampling 到 256×256，並且在輸出會 Up-sampling 到 512×512，並且將預測結果 Mask 的部分跟原本的 Input 做結合，當作 Refine 網路的輸入</li><li>Refine 網路__預測更精細的結果<br>用 High-Level Feature Map 計算上下文的 Attention Scores 並在多個 Lower-Level Feature Maps 上執行注意力轉移 (ATM)，因此可以在多個抽象級別借用遠處的上下文信息。</li></ol><p>為了提高計算效率，修復網絡以 Slim And Deep Fushion 的方式設計，並且 應用 Light Weight Gated Convolution（ LWGC） 於生成器的所有層。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*sazaYI-V21OJeQUHRb_Kqw.png" /></figure><p>Attention Scores 由 Generator 的注意力計算模塊（ACM）計算，然後利用注意力轉移模塊 (ATM) 根據 Contextual Residual 和 Attention Scores 計算 Mask 中的 Aggregated Residual。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*hkhGwYbXYfYFdKpBiKuF4A.png" /></figure><p>得到 Aggregated Residual 之後，再將修復好的 512 × 512 圖像去做 Up-Sampling，並且與前者相加，這樣會在 Mask 生成一個大的清晰輸出，而 Mask 外的部分就跟原始輸入相同。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*1U5Eg5AVXoD0vCgg-eluqQ.png" /><figcaption>網路訓練</figcaption></figure><ol><li><strong>Contextual Residual Aggregation (CRA)<br></strong>之前已經有方法提出通過使用上下文信息和注意機制來填充缺失的區域，同樣，CRA 機制從上下文區域借用信息，然而不僅是借用了特徵，還借用了殘差。特別的是採用上下文注意 [註1] 的思想，通過獲取缺失區域內/外 Patches 的區域親和度來計算 Attention Scores ，因此，上下文相關的特徵和外部殘差可以轉移到孔中。 <br>[註1] Generative image inpainting with contextual attention. IEEE 2018</li><li><strong>Attention Computing Module (ACM)</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*hblWzrpBYIjhYbXVfypU4w.png" /><figcaption>在 Generator 內部，紅色圓形那部分</figcaption></figure><p>Attention Scores 是基於來自 High-Level Feature Map（在上圖表示為 P）的區域親和力計算的，P 被分成 Patches，ACM 計算缺失區域內外的patch之間的餘弦相似度：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/292/1*UkQEYQLzgNQv8osBYzUi6A.png" /></figure><p>Pi 是從 P Outside Mask 提取的第 i 個 Patch<br>Pj 是從 P Inside Mask 提取的第 j 個 Patch<br>然後將 Softmax 應用於相似度分數以獲得每個 Patch 的Attention Score：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*Qyw08yq5xOEqSXTzq-srqA.png" /></figure><p>N 是缺失孔外的 Patches 數量。 在架構中，每個 Patch 大小為 3 × 3，P 為 32 × 32，因此總共可以有 1024 個 Patches 提取。</p><p>在實踐中，孔內 Patches 的數量可能因不同的孔尺寸而異。作者統一使用一個 1024 × 1024 的矩陣來保存任何可能的一對 Patches，儘管其中只有一小部分是有用的。</p><p><strong>3. Attention Transfer Module (ATM)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*3LGPw4Q-3vfxGtamqVhoeg.png" /><figcaption>在 Generator 內部，紫色區域那塊</figcaption></figure><p>從 P 獲得 Attention Scores 後，在 Low-Feature Map 對應的孔洞可以利用(Pl) Attention Scores 加權的上下文 Patch去填充：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*bW085dv0wKJQp46iVwRR2w.png" /></figure><p>在計算完所有的孔內 Patches 後，最終可以得到一個填充特徵 Pl。</p><p>因為 Feature Map 的大小因 Layer 而異，因此 Patch 的大小應要跟著變化，假設 Feature Map 大小為 128×128 且 Attention Scores 是 從 32×32 個 Patches 被計算出來的，那 Patch 的大小應該是要大於等於 (128/32)^2 = 4^2，以便可以覆蓋所有像素。 如果 Patch 大小大於 4 × 4，則某些 Pixels 會重疊，這樣做比較好的原因是可以讓網路後面的 Layer 學習適應。</p><p><strong>4. Residual Aggregation<br></strong>目標是去計算 Residual<strong> </strong>用於孔區域，以便可以恢復丟失內容的清晰細節。<br>缺失內容的 Residual 可以通過聚合從前面步驟獲得的加權上下文 Residual 來計算：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*ia1_GVF-TXmR4jWdV-A7hw.png" /><figcaption>R 是 Residual Image</figcaption></figure><p>一獲得 Aggregated Residual Image，將其添加到 Generator 的 Up-Sampling 模糊圖像中，即可獲得高解析且清晰的結果。</p><p><strong>5. Light Weight Gated Convolution ( LWGC )<br></strong>Gated Convolution (GC) 可以說是不規則孔修復的藝術。 然而，與普通 Convolution 相比，GC 的參數數量和處理時間幾乎翻了一倍。</p><p>作者提出了 GC 的三個修改版本，稱為輕量級門控卷積 (LWGC)，它在保持有效性的同時減少了參數量和處理時間。 原始 GC 的輸出可以表示為：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/289/1*swTHAwunorFv9Va941O7RQ.png" /></figure><p>而提出的三個版本其實就是對 G 去做修改：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*j_4gx_wPDHdKJxJzsa3kWA.png" /></figure><p>分別把三個版本的 GC 稱為：<br>1. Depth-Separable LWGC<br>2. Pixel-Wise LWGC<br>3. Single-Channel LWGC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*br-FptpsHiQvyFu3871goA.png" /><figcaption>參數量的比較</figcaption></figure><p>對 Coarse 網路所有 Layers 使用 Single-Channel LWGC<br>對 Refine 網路所有 Layers 使用 Depth-Separable LWGC 或 Pixel-Wise LWGC<br>已經在實驗中證實跟原本 GC 有著一樣的效果，但是效率會更高</p><h3>實驗結果</h3><p>解析度 : 512 × 512 和 Batch Size : 8<br>對於 CelebA-HA 和 DIV2K 輸入圖像將 Down-Sampling 到 512 × 512<br>對於 Place2 輸入圖像將隨機裁剪到 512 × 512<br>最後在 512 到 8K 的各種分辨率的圖像上測試模型</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*UwdSsS7eHE4xEjitzIMC2A.png" /><figcaption>有 Dash 的表示 Out-Of-Memory</figcaption></figure><p>可以看到再 Place2 上面的實驗，先前的方法在圖像大於 1K 的時候就會 OOM， 而作者他們的模型甚至可以做到 4K 的圖像</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*l701sFy2Cdg9bzTrvG82mw.png" /><figcaption>兩種解析度的修復</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*V5K5nPNzXjK8aBOb0GKTYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*HTk8hSMa2KtGGqbPVTiZYA.png" /></figure><p><strong>總結<br></strong>作者設計了一種可以用於高解析度的網路，但又大大減少對於高解析度資料及的硬體需求，也不同於 Data-Driven 的方法，提高分辨率和孔的尺寸不會去影響修復的質量，也不會增加網路中處理的速度，而在 1K 和 2K 的圖像測試上面，比先進的方法快了 3~6 倍。在 2020 年是唯一可以在超高分辨率圖像（4K∼8K）上進行端到端修復的技術。可能再 Survay 一下 2021 有沒有類似的論文。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=809c361c4687" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>