昆虫学报 ›› 2025, Vol. 68 ›› Issue (2): 223-230.doi: 10.16380/j.kcxb.2025.02.010

• 研究论文 • 上一篇    下一篇

融合中心损失和焦点损失的蝴蝶自动识别

李小林1, 李建祥1, 陈彬彬1, 王荣2, 张飞萍2,3, 黄世国1,3,*   

  1. (1. 福建农林大学计算机与信息学院, 福州 350002; 2. 福建农林大学林学院,福州 350002; 3. 生态公益重大有害生物防控福建省高校重点实验室, 福州 350002)
  • 出版日期:2025-02-20 发布日期:2025-03-27

Automatic butterfly recognition with center loss and focal loss fused

LI Xiao-Lin1, LI Jian-Xiang1, CHEN Bin-Bin1, WANG Rong2, ZHANG Fei-Ping2,3, HUANG Shi-Guo1,3,*   

  1. (1. College of Computer and Information Sciences, Fujian Agriculture and Forestry University, Fuzhou 350002, China; 2. College of Forestry, Fujian Agriculture and Forestry University, Fuzhou 350002, China; 3. Key Laboratory of Integrated Pest Management in Ecological Forests, Fujian Province University, Fuzhou 350002, China)
  • Online:2025-02-20 Published:2025-03-27

摘要: 【目的】针对蝴蝶样本存在类间和类内分布不平衡导致识别性能下降的问题,探索一种多损失融合的蝴蝶自动识别方法。【方法】利用开源的Butterfly-200图像数据集作为实验数据。该数据集包括200种蝴蝶,每种蝴蝶的图像数量从30~885不等。以交叉熵损失(cross-entropy loss)为基准损失,分别叠加对比损失(contrastive loss)、焦点损失(focal loss)、类平衡损失(class-balanced loss)、采样(sampling)、logit调整(logit adjustment),比较算法的识别性能。在此基础上,利用中心损失(center loss)有助于缓解类内不平衡而焦点损失有助于缓解类内和类间不平衡的特点,开展消融实验分析叠加中心损失和焦点损失对识别性能的影响,提出了融合上述这两种损失的蝴蝶自动识别新方法。【结果】交叉熵损失与其他单一损失(对比损失除外)结合时,算法的识别性能基本上呈现不同程度的下降。我们的算法在交叉熵损失基础上结合中心损失和焦点损失后,其识别性能均超过交叉熵损失及其与其他损失的组合, 准确率、 F1分值、查准率和召回率分别91.67%, 90.68%, 91.68%和90.38%。消融试验进一步证实了中心损失和焦点损失的互补性,同时使用这两种损失能明显提升识别性能。此外,不同权重的损失组合对识别性能也有明显影响。【结论】研究结果证明融合中心损失和焦点损失在一定程度上缓解了类间和类内分布不均衡的问题,能够有效提高蝴蝶识别的准确性,为生态环境监测提供了一种有效的辅助手段。

关键词: 蝴蝶, 分布不均衡, 交叉熵损失, 中心损失, 焦点损失, 图像分类

Abstract: 【Aim】 To address the issue of inter-taxon and intra-taxon distribution imbalance leading to the decreased recognition performance in butterfly samples, a multi-loss fused automatic butterfly recognition method is explored. 【Methods】 We used the open source image dataset Butterfly-200, including 200 species of butterflies with the number of images of per species ranging from 30 to 885, as the experimental data. Using cross-entropy loss as the baseline loss, we compared the recognition performance of the algorithms by adding contrastive loss, focal loss, class-balanced loss, sampling, and logit adjustment, respectively. Further, we conducted an ablation study to analyze the effects of combining center loss and focal loss, which mitigated intra-taxon imbalance and inter-taxon imbalance, respectively, on recognition performance. Finally, we proposed a new automatic butterfly recognition method integrating these two types of losses. 【Results】 When the cross-entropy loss was combined with other single losses (except contrastive loss) the algorithms generally exhibited a decline in recognition performance, compared to the cross-entropy loss. Our algorithm, which combined center loss and focal loss with cross-entropy loss, outperformed cross-entropy loss and its combinations with other losses. The accuracy, F1-score, precision, and recall of our algorithm were 91.67%, 90.68%, 91.68% and 90.38%, respectively. An ablation study further confirmed the complementarity of center loss and focal loss, demonstrating that the simultaneous use of these two losses obviously enhanced recognition performance. Additionally, loss combinations with different weights also had a noticeable impact on recognition performance.【Conclusion】 The results of this study demonstrate that the integration of center loss and focal loss alleviate the issues of inter-taxon and intra-taxon distribution imbalance to a certain extent, thereby effectively improving the accuracy of butterfly recognition, and providing an effective auxiliary method for ecological environment monitoring.

Key words: Butterfly, distribution imbalance, cross-entropy loss, center loss, focal loss, image classification