Convolutional neural networks (CNNs) perform a pivotal role in agricultural vision applications. The CNN-based BlazeBlock has been previously proposed as a building block of lightweight BlazeFace models for face detection tasks on mobile GPUs. Thus, the utilization of BlazeBlock is often advantageous in order to offer mobile and edge computing vision services in precision farming. Moreover, the Convolutional Block Attention Module (CBAM) enhances the representational power of CNNs by emphasizing important features through the use of channel attention and spatial attention modules. Although CBAM uses a convolutional layer to generate a spatial attention map on the feature descriptor in spatial attention, it is spatially local in nature. Moreover, employing self-attention on the feature descriptor is beneficial to learn the global representation. Hence, a MobileViT-based self-attention module can substitute the prior spatial attention module. In this paper, we present an attention-based BlazeBlock that uses the Convolutional Block with Spatial Self-Attention Module (CBwSSAM) by harnessing the CBAM channel attention and a MobileViT-based spatial self-attention. CBwSSAM can be integrated into any CNN architecture seamlessly. We analyze the effectiveness of the attention-based BlazeBlock in image classification and semantic segmentation. Our evaluation results on six datasets for image classification and transfer learning, and three datasets for semantic segmentation exemplify the efficacy of the proposed enhanced BlazeBlock in such agricultural vision application contexts.
Chowdhury et al. (2026) studied this question.