Department of Food Engineering and Technology, School of Food Engineering, University of Campinas, Campinas, SP, Brazil.
University of Trieste, Trieste, Italy.
Food Res Int. 2024 Sep;192:114836. doi: 10.1016/j.foodres.2024.114836. Epub 2024 Jul 25.
The classification of carambola, also known as starfruit, according to quality parameters is usually conducted by trained human evaluators through visual inspections. This is a costly and subjective method that can generate high variability in results. As an alternative, computer vision systems (CVS) combined with deep learning (DCVS) techniques have been introduced in the industry as a powerful and an innovative tool for the rapid and non-invasive classification of fruits. However, validating the learning capability and trustworthiness of a DL model, aka black box, to obtain insights can be challenging. To reduce this gap, we propose an integrated eXplainable Artificial Intelligence (XAI) method for the classification of carambolas at different maturity stages. We compared two Residual Neural Networks (ResNet) and Visual Transformers (ViT) to identify the image regions that are enhanced by a Random Forest (RF) model, with the aim of providing more detailed information at the feature level for classifying the maturity stage. Changes in fruit colour and physicochemical data throughout the maturity stages were analysed, and the influence of these parameters on the maturity stages was evaluated using the Gradient-weighted Class Activation Mapping (Grad-CAM), the Attention Maps using RF importance. The proposed approach provides a visualization and description of the most important regions that led to the model decision, in wide visualization follows the models an importance features from RF. Our approach has promising potential for standardized and rapid carambolas classification, achieving 91 % accuracy with ResNet and 95 % with ViT, with potential application for other fruits.
杨桃的分类,也被称为星果,通常根据质量参数,由经过培训的人类评估员通过目视检查进行。这是一种昂贵且主观的方法,可能会导致结果高度可变。作为替代方案,计算机视觉系统 (CVS) 与深度学习 (DCVS) 技术已在行业中引入,作为一种快速、非侵入性的水果分类的强大而创新的工具。然而,验证 DL 模型的学习能力和可信度,即黑盒,以获得洞察力可能具有挑战性。为了缩小这一差距,我们提出了一种用于不同成熟阶段杨桃分类的综合可解释人工智能 (XAI) 方法。我们比较了两个残差神经网络 (ResNet) 和视觉转换器 (ViT),以识别随机森林 (RF) 模型增强的图像区域,目的是在特征级别提供更详细的信息,以分类成熟阶段。分析了整个成熟阶段水果颜色和物理化学数据的变化,并使用梯度加权类激活映射 (Grad-CAM)、基于 RF 重要性的注意力图评估这些参数对成熟阶段的影响。所提出的方法提供了模型决策的最重要区域的可视化和描述,在广泛的可视化中,紧随模型从 RF 中提取的重要特征。我们的方法具有标准化和快速杨桃分类的巨大潜力,ResNet 达到 91%的准确率,ViT 达到 95%的准确率,对其他水果也具有潜在应用。