缺陷檢測-2.Mixed supervision for surface-defect detection: from weakly to fully supervised learning(對於表面缺陷檢測的混合監督:從弱到完全監督學習)


這篇文章不管是網絡結構還是文章中提到的亮點基本都是復用了<End-to-end training of a two-stage neural network for defect detection>

唯一的不同點就是針對混合監督,針對其中只有正負標簽,沒有分割標簽的數據,損失函數只是用分類損失函數,如果都有,就是用分類函數和分割函數一起

這樣的好處,可以降低有分割標簽數據的數量,可以節省做分割標簽的時間。

 

 End-to-end learning We combine the segmentation and the classification losses into a single unified loss, which allows for a simultaneous learning in an end-to-end manner.

The combined loss is defined as:

端到端的學習 我們將分割和分類的損失合並成一個簡單的統一的損失,它允許在端到端過程中進行同步的學習, 綜合損失定義為:

 

Using weakly labeled data The proposed end-to-end learning pipeline is designed to enable utilisation of the weakly labeled data alongside fully labeled one. Such adoption of mixed supervision allows us to take a full advantage of any pixel-level labels when available, which weakly and unsupervised methods are not capable of using. We use γ from Eq. 1 to control the learning of the segmentation subnetwork based on the presence of pixel-level annotation:

使用弱標簽數據 提出的端到端的學習管道被設計為可以使用弱標簽與完全標簽數據一起使用。像這樣采用混合監督允許我們充分利用任何有用的像素級別標簽,這是弱和無監督方法無法使用的,我們使用y等於1來控制基於像素級別標簽存在的分割子網絡

通過使用is_segmented[sub_iter]來判斷是否添加分割的損失函數。

 

    if is_segmented[sub_iter]:
                if self.cfg.WEIGHTED_SEG_LOSS:
                    loss_seg = torch.mean(criterion_seg(output_seg_mask, seg_masks_) * seg_loss_masks_)
                else:
                    loss_seg = criterion_seg(output_seg_mask, seg_masks_)
                loss_dec = criterion_dec(decision, is_pos_) # 這個地方有疑問

                total_loss_seg += loss_seg.item()
                total_loss_dec += loss_dec.item()

                total_correct += (decision > 0.0).item() == is_pos_.item()
                loss = weight_loss_seg * loss_seg + weight_loss_dec * loss_dec # 對結果進行加權
  else:
                loss_dec = criterion_dec(decision, is_pos_)
                total_loss_dec += loss_dec.item()

                total_correct += (decision > 0.0).item() == is_pos_.item()
                loss = weight_loss_dec * loss_dec

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM