This work introduces an attention mechanism for image classifiers and the corresponding deep neural network (DNN) architecture, dubbed ISNet. During training, the ISNet uses segmentation targets to learn how to find the image's region of interest and concentrate its attention on it. The proposal is based on a novel concept, background relevance minimization in LRP explanation heatmaps. It can be applied to virtually any classification neural network architecture, without any extra computational cost at run-time. Capable of ignoring the background, the resulting single DNN can substitute the common pipeline of a segmenter followed by a classifier, being faster and lighter. We tested the ISNet with three applications: COVID-19 and tuberculosis detection in chest X-rays, and facial attribute estimation. The first two tasks employed mixed training databases, which fostered background bias and shortcut learning. By focusing on lungs, the ISNet reduced shortcut learning, improving generalization to external (out-of-distribution) test datasets. When training data presented background bias, the ISNet's test performance significantly surpassed standard classifiers, multi-task DNNs (performing classification and segmentation), attention-gated neural networks, Guided Attention Inference Networks, and the standard segmentation-classification pipeline. Facial attribute estimation demonstrated that ISNet could precisely focus on faces, being also applicable to natural images. ISNet presents an accurate, fast, and light methodology to ignore backgrounds and improve generalization, especially when background bias is a concern.
翻译:本文提出了一种面向图像分类器的注意力机制及其对应的深度神经网络(DNN)架构,命名为ISNet。在训练过程中,ISNet利用分割目标学习如何定位图像中的感兴趣区域,并集中注意力于该区域。该方案基于一个新颖概念——在LRP解释热力图中最小化背景相关性。该方法可应用于几乎任何分类神经网络架构,且运行时无需额外计算开销。由于具备忽略背景的能力,所获得的单一DNN可替代传统的"分割器-分类器"级联流程,兼具更快的速度与更轻量的特性。我们在三个应用场景中测试了ISNet:胸部X光片的COVID-19与肺结核检测,以及面部属性估计。前两项任务采用混合训练数据库,这种数据特性容易引发背景偏差与捷径学习。通过聚焦于肺部区域,ISNet减少了捷径学习,提升了对外部(分布外)测试数据集的泛化能力。当训练数据存在背景偏差时,ISNet的测试性能显著优于标准分类器、多任务DNN(同时执行分类与分割)、注意力门控神经网络、引导注意力推断网络以及标准的分割-分类级联流程。面部属性估计实验表明,ISNet能够精准聚焦于面部区域,同样适用于自然图像。ISNet提供了一种精确、快速且轻量的方法论,可在背景偏差问题突出时有效忽略背景并提升泛化能力。