HGCS-Det: A Deep Learning-Based Solution for Localizing and Recognizing Household Garbage in Complex Scenarios

Houkui Zhou, Chen Chang, Zhongyi Xia, Qifeng Ding, Qingbo Liao, Qun Wang, Huimin Yu, Haoji Hu, Guangqun Zhang, Junguo Hu, Tao HeSensors 2025 · DOI

TL;DR

This paper introduces HGCS-Det, a novel deep learning model built upon YOLOv8, designed to tackle the challenging task of identifying and localizing household garbage in complex, real-world environments. By integrating enhanced attention mechanisms, boundary reinforcement, and a specialized loss function, HGCS-Det achieves state-of-the-art accuracy and efficiency, making it suitable for practical deployment in automated waste management systems.

What Problem Does This Paper Address?

The increasing volume of urban waste necessitates efficient and accurate garbage classification. However, current automated systems struggle with the inherent complexities of real-world scenarios: cluttered backgrounds, varying illumination, diverse object shapes, and occlusions. These factors lead to "attention bias" in models, where they focus on irrelevant environmental noise rather than the garbage itself, resulting in poor detection accuracy and real-time performance. Existing methods often fall short in either precision or speed, hindering their practical application in resource-constrained environments like embedded devices.

Methods

HGCS-Det is an enhanced version of the YOLOv8n architecture, incorporating several novel modules to address the aforementioned challenges:

  • Normalization Attention Module (NAM): This module calibrates the model's attention by using batch normalization to identify salient features and suppress background noise. It helps the model focus on critical target features.
  • Attention Feature Fusion (AFF) Module: To better utilize the attention features, AFF adaptively integrates attention weights across different channels. It uses Channel Shuffle and Adaptive Instance Normalization (AdaIN) to synthesize these contributions, leading to a more pronounced focus on targets.
  • Instance Boundary Reinforcement (IBR) Module: This module aims to improve the extraction of fine-grained features, particularly for irregularly shaped garbage. It fuses gradient-based boundary cues with semantic information by employing a shared convolution and a gradient-difference mechanism, enhancing object contour representation.
  • Slide Loss Function: To handle the imbalance between "easy" and "hard" samples (e.g., occluded or low-contrast objects), Slide Loss dynamically reweights hard samples during training. This allows the model to pay more attention to difficult-to-classify instances, improving overall recognition accuracy.

Datasets

The primary dataset used for training and evaluation in this study is HGI30. This dataset comprises 18,178 images of household garbage, covering 30 common types, captured in diverse natural scenarios. The images exhibit characteristics like complex backgrounds, variable lighting, and multi-scale objects, making it a challenging benchmark for real-world garbage detection. The dataset was split into training and testing sets with an 8:2 ratio.

Key Insights and Ideas

  • Attention is not enough, fusion is key: While attention mechanisms are crucial for focusing on relevant features, simply applying them can be computationally expensive and might not fully leverage all available information. The AFF module demonstrates that intelligently fusing attention features from different channels can significantly boost performance without a proportional increase in computational cost.
  • Boundary matters for irregular objects: Garbage objects are often irregularly shaped. The IBR module highlights the importance of explicitly reinforcing boundary information by combining gradient and semantic features, which is critical for accurate localization and classification of such objects.
  • Hard samples are the bottleneck: In complex scenarios, a significant portion of errors stems from misclassifying "hard" samples. The Slide Loss function's adaptive weighting strategy effectively addresses this by prioritizing learning from these challenging instances, leading to a more robust model.
  • Lightweight doesn't mean less accurate: The study shows that by carefully designing modules and integrating them into a lightweight backbone like YOLOv8n, it's possible to achieve state-of-the-art performance without the computational burden of larger models.

Key Results

HGCS-Det achieved a mean average precision (mAP) of 93.6% on the HGI30 dataset, which is a 3.33% improvement over YOLOv12 and outperforms other state-of-the-art methods. The model maintains a lightweight architecture with only 3.02M parameters and achieves 86 FPS, demonstrating a strong balance between accuracy and real-time performance. Ablation studies showed that each proposed module contributed positively to the overall performance, with the combined HGCS-Det model outperforming individual component additions. Qualitative analysis using Grad-CAM visualized HGCS-Det's improved focus on target objects and suppression of background noise.

Limitations and Future Work

The authors acknowledge that the attention mechanisms in HGCS-Det, while effective, involve matrix multiplication that can impact real-time performance on highly constrained hardware. Future work will focus on model compression techniques to further enhance applicability. Additionally, they plan to explore domain adaptation and semi-supervised learning to extend the model's capabilities to new waste types and deployment scenarios, including mobile applications and robotic systems. They also aim to investigate more efficient garbage detection methods for broader object detection tasks.

Summary updated

Abstract

With the rise of deep learning technology, intelligent garbage detection provides a new idea for garbage classification management. However, due to the interference of complex environments, coupled with the influence of the irregular features of garbage, garbage detection in complex scenarios still faces significant challenges. Moreover, some of the existing research suffer from shortcomings in either their precision or real-time performance, particularly when applied to complex garbage detection scenarios. Therefore, this paper proposes a model based on YOLOv8, namely HGCS-Det, for detecting garbage in complex scenarios. The HGCS-Det model is designed as follows: Firstly, the normalization attention module is introduced to calibrate the model's attention to targets and to suppress the environmental noise interference information. Additionally, to weigh the attention-feature contributions, an Attention Feature Fusion module is employed to complement the attention weights of each channel. Subsequently, an Instance Boundary Reinforcement module is established to capture the fine-grained features of garbage by combining strong gradient information with semantic information. Finally, the Slide Loss function is applied to dynamically weight hard samples arising from the complex detection environments to improve the recognition accuracy of hard samples. With only a slight increase in parameters (3.02M), HGCS-Det achieves a 93.6% mean average precision (mAP) and 86 FPS on the public HGI30 dataset, which is a 3.33% higher mAP value than from YOLOv12, and outperforms the state-of-the-art (SOTA) methods in both efficiency and applicability. Notably, HGCS-Det maintains a lightweight architecture while enhancing the detection accuracy, enabling real-time performance even in resource-constrained environments. These characteristics significantly improve its practical applicability, making the model well suited for deployment in embedded devices and real-world garbage classification systems. This method can serve as a valuable technical reference for the engineering application of garbage classification.
BibTeX
@inproceedings{zhou2025hgcs,
  author = {Houkui Zhou and Chen Chang and Zhongyi Xia and Qifeng Ding and Qingbo Liao and Qun Wang and Huimin Yu and Haoji Hu and Guangqun Zhang and Junguo Hu and Tao He},
  title = {{HGCS-Det: A Deep Learning-Based Solution for Localizing and Recognizing Household Garbage in Complex Scenarios}},
  booktitle = {Sensors},
  year = {2025},
  doi = {10.3390/s25123726},
}
Figure