论文传送门:Faster R-CNN: Towards Real-Time ObjectDetection with Region Proposal Networks、Fast R-CNN
FasterRCNN的损失:
①RPN损失:根据anchor和RPN输出的scores和regs计算所得,使网络更好的根据scores和regs对anchor进行调整,得到proposals。
RPN损失由分类损失 L c l s L_{cls} Lcls和回归损失 L r e g L_{reg} Lreg构成, L c l s L_{cls} Lcls使用BCE损失函数计算, L r e g L_{reg} Lreg使用smooth L1损失函数计算。
式中, N c l s N_{cls} Ncls代表选取anchor样本数,设为512, N r e g N_{reg} Nreg为anchor的位置个数,约为2400, λ λ λ取10,从而对公式进行简化,将两个损失的系数项去掉。
②RCNN损失:根据proposals和Head输出的scores和regs计算所得,使网络更好的根据scores和regs对proposals进行调整,得到最终的cls和bbox。
RCNN损失由分类损失 L c l s L_{cls} Lcls和回归损失 L l o c L_{loc} Lloc构成, L c l s L_{cls} Lcls使用CE损失函数计算, L l o c L_{loc} Lloc