# A Hybrid Compact Convolutional Transformer with Bilateral Filtering for Coffee Berry Disease Classification

**Authors:** Biniyam Mulugeta Abuhayi, Andras Hajdu

PMC · DOI: 10.3390/s25133926 · Sensors (Basel, Switzerland) · 2025-06-24

## TL;DR

This paper introduces a lightweight AI model for detecting coffee berry disease, achieving high accuracy with fast performance for use in resource-limited settings.

## Contribution

A novel hybrid model combining convolutional and transformer architectures for efficient coffee berry disease classification.

## Key findings

- The proposed model achieved 97.70% validation accuracy and 100% sensitivity for CBD detection.
- The model outperformed pretrained models with fewer parameters and faster training times.
- CCT features also performed well with traditional classifiers like SVM and Decision Tree.

## Abstract

Coffee berry disease (CBD), caused by Colletotrichum kahawae, significantly threatens global Coffee arabica production, leading to major yield losses. Traditional detection methods are often subjective and inefficient, particularly in resource-limited settings. While deep learning has advanced plant disease detection, most existing research targets leaf diseases, with limited focus on berry-specific infections like CBD. This study proposes a lightweight and accurate solution using a Compact Convolutional Transformer (CCT) for classifying healthy and CBD-affected coffee berries. The CCT model combines parallel convolutional branches for hierarchical feature extraction with a transformer encoder to capture long-range dependencies, enabling high performance on limited data. A dataset of 1737 coffee berry images was enhanced using bilateral filtering and color segmentation. The CCT model, integrated with a Multilayer Perceptron (MLP) classifier and optimized through early stopping and regularization, achieved a validation accuracy of 97.70% and a sensitivity of 100% for CBD detection. Additionally, CCT-extracted features performed well with traditional classifiers, including Support Vector Machine (SVM) (82.47% accuracy; AUC 0.91) and Decision Tree (82.76% accuracy; AUC 0.86). Compared to pretrained models, the proposed system delivered superior accuracy (97.5%) with only 0.408 million parameters and faster training (2.3 s/epoch), highlighting its potential for real-time, low-resource deployment in sustainable coffee production systems.

## Linked entities

- **Diseases:** CBD (MONDO:0010564)
- **Species:** Colletotrichum kahawae (taxon 34407)

## Full-text entities

- **Diseases:** infections (MESH:D007239), leaf diseases (MESH:D004194), CBD (MESH:D002532)
- **Species:** Colletotrichum kahawae (species) [taxon 34407]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12251858/full.md

## Figures

7 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12251858/full.md

## References

45 references — full list in the complete paper: https://tomesphere.com/paper/PMC12251858/full.md

---
Source: https://tomesphere.com/paper/PMC12251858