Garbage throwing scene-oriented scattered garbage detection method

Through the improved ResNet50 network architecture and multi-model fusion prediction method, the efficiency and accuracy issues of scattered garbage detection in complex garbage disposal scenarios are solved, and efficient and accurate target recognition is achieved in diverse environments.

CN120673230APending Publication Date: 2025-09-19SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510787966.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing deep learning-based scattered garbage detection methods lack efficiency and accuracy in complex garbage disposal scenarios, and are difficult to adapt to diverse lighting, background and target scale changes, resulting in insufficient detection accuracy and robustness.

Method used

An improved ResNet50 network architecture is adopted, including a dual-branch convolution module, an improved attention random inactivation module and a hierarchical segmentation module. Combined with data augmentation and loss function optimization, a multi-model fusion prediction method is used to improve the model's feature extraction and target detection capabilities in complex scenarios.

Benefits of technology

It significantly improves the accuracy and robustness of scattered garbage detection, adapts to changes in lighting, background and target scale, meets real-time detection needs, and reduces computational complexity and false detection rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673230A_ABST
    Figure CN120673230A_ABST
Patent Text Reader

Abstract

The invention discloses a scattered garbage detection method for a garbage throwing scene, and belongs to the technical field of target detection. Aiming at the problems of insufficient detection robustness and accuracy caused by factors such as illumination, shielding and shooting angles in a natural scene, a deep learning model which takes YOLOv10 as a basis and improves ResNet50 as a trunk network is constructed. Performance is improved through multi-dimensional optimization; a multi-environment multi-scale image preprocessing label is collected, and a training set is expanded through color perturbation; replacing a ResNet50 first residual block with a double-branch convolution module, and realizing multi-scale feature extraction and channel weighting through channel splitting and a lightweight compression excitation layer; an improved attention random inactivation module is added between the residual block groups, and a discarding strategy is dynamically adjusted according to the complexity of the feature map; an improved hierarchical segmentation module is introduced into the residual block, and feature expression is enhanced in combination with depth separable convolution and transpose convolution; and optimizing a loss function and carrying out back propagation to update the weight. The method effectively solves the problem of complex scene detection, and provides a scheme for efficient management of urban environmental sanitation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of target detection and recognition, and in particular, relates to a scattered garbage detection method for garbage disposal scenarios. Background Art

[0002] Object detection is a crucial aspect of urban management. With the global growth of urban populations and rising consumption levels, urban waste production is increasing annually, placing higher demands on urban environmental sanitation. Against this backdrop, accurately identifying and classifying different types of scattered waste is becoming increasingly arduous and critical. Therefore, to improve the efficiency, robustness, and accuracy of scattered waste detection in waste management, scattered waste detection technology is currently developing towards full automation and intelligence, making scattered waste detection technology for waste disposal a new development direction. This technological advancement not only helps improve urban management but also promotes efficient resource utilization and environmental protection.

[0003] With the annual increase in urban waste production, manual labor is no longer sufficient to meet the demand for timely and accurate detection of the status of scattered garbage. The efficiency of scattered garbage status detection directly affects the efficiency of garbage collection and disposal, which in turn indirectly impacts urban environmental sanitation management. In recent years, with the widespread application of deep learning technology in the field of object detection and recognition, this technology has also been introduced to scattered garbage detection for garbage disposal, greatly improving the efficiency and accuracy of scattered garbage status detection tasks. Leveraging these technologies, the system can accurately detect scattered garbage from images or videos in urban environments. This automated process can significantly improve the efficiency of urban sanitation work and reduce the risk of human error. However, in practical applications, deep learning-based scattered garbage detection methods still face many challenges due to issues such as high exposure, blurred images, and distorted signs caused by natural lighting, weather, and shooting angle. Further optimization is needed to adapt to complex real-world environments.

[0004] For weakly supervised object localization, Junsuk Choe et al. (Choe, J., & Shim, H. (2019). Attention-based Dropout Layer for Weakly Supervised Object Localization. arXiv preprint arXiv:1908.10028.) proposed introducing a self-attention mechanism to address the problem that traditional WSOL methods often focus only on the most distinguishable parts of an object and fail to cover the entire object area. This significantly improves localization accuracy while maintaining efficiency and lightweightness. However, in practical applications, this method uses a fixed dropout probability and threshold, which cannot be optimized for garbage disposal scene images of varying complexity. Regarding convolutional neural network architectures, Pengcheng Yuan et al. (Pengcheng Y, Shufei L, Cheng C, Yuning D, Ruoyu G, Dongliang H, Errui D, Shumin H. HS-ResNet: Hierarchical-SplitBlockon ConvolutionalNeuralNetwork.2020.arXiv:2010.07621v1[cs.CV].) note that designing efficient network architectures is increasingly complex, involving the optimization of hyperparameters such as depth, width, and cardinality. Care should be taken to avoid redundant information in feature maps, enhance feature expression without increasing computational complexity, and improve model performance while maintaining inference speed. Therefore, detecting and identifying scattered garbage in garbage disposal scenarios is extremely challenging.

[0005] In summary, while deep learning-based scattered litter detection and recognition technology has made some progress, it still needs to be improved to better meet the requirements for high efficiency and accuracy in litter disposal scenarios. This will bring more efficient and intelligent operations and management to urban management, promoting the development of the entire city. Summary of the Invention

[0006] The present invention aims to overcome the deficiencies in the above-mentioned prior art and proposes a scattered garbage detection method for garbage disposal scenarios to improve the efficiency, robustness and accuracy of scattered garbage target detection and recognition in complex garbage disposal scenarios.

[0007] To achieve the above invention, the present invention provides a method for detecting scattered garbage in a garbage disposal scenario, comprising the following steps:

[0008] (1) Collect image samples of garbage disposal scenes;

[0009] (2) Preprocess and label the image;

[0010] (3) Training set production based on data augmentation;

[0011] (4) Replace the first residual block of ResNet50 with a two-branch convolution module;

[0012] (5) Adding an improved attention random dropout module between the second and third residual block groups of ResNet50 and dynamically adjusting the model strategy according to image complexity;

[0013] (6) Using the improved hierarchical segmentation module in the third, fourth, and fifth residual blocks of ResNet50;

[0014] (7) Train the improved deep learning network to detect scattered garbage;

[0015] The patent collects image samples of garbage disposal scenes, which refers to collecting image samples in different environments, angles and distances, so that the image samples contain pictures with different light intensities, complex backgrounds, foreign object occlusions, multi-angle rotations and tilts, and different scales; the image preprocessing and annotation refers to adjusting the size of the input image to a uniform size of 608×608 through the OpenCV library, semi-automatically annotating the collected images through the PPOCRLabel semi-automatic annotation tool, and detecting feedback through the existing YOLOv10 model, and correcting the labeled samples with poor detection results through the LabelImage annotation tool supplemented by manual annotation; the The production of a training set based on data augmentation refers to the use of Mosaic-6 data augmentation, color perturbation and brightness adjustment methods to produce a data set for training, using 6 pictures as a group, randomly scaling, randomly cropping and randomly arranging them for splicing, randomly changing the RGB channel values ​​in the image, and adding or subtracting a random value to adjust the brightness of the image to simulate changes under different lighting conditions, obtaining 6 new images, and randomly occluding the new images; the said loss function-based optimization model detection effect refers to defining a suitable loss function according to the specific garbage disposal task scenario, and using the backpropagation algorithm to update the network weights.

[0016] Furthermore, this patent replaces the first residual block of ResNet50 with a dual-branch convolution module; the dual-branch convolution module refers to a module obtained by splitting the input feature map into channels, performing respective convolution operations on the two branches, splicing them, and then connecting a lightweight compression excitation layer in series; the said splitting the input feature map into channels, performing respective convolution operations on the two branches, and then merging them, means first splitting the input feature map into two branches, wherein the first branch performs 3×3 convolution and batch normalization, and the second branch performs 5×5 Average pooling and 1×1 convolution are performed, and then the outputs of the two branches are spliced ​​in the channel dimension; the lightweight compression excitation layer refers to first reducing the number of channels from 256 to 16 through a fully connected layer, and after passing the ReLU activation function, the number of channels is restored from 16 to 256 through a fully connected layer, and then the weights are mapped to the 0-1 interval through a Sigmoid activation function, and then multiplied with the original feature map one by one according to the channel, to achieve adaptive weighting of the features of each channel, thereby dynamically enhancing important channel information and suppressing secondary channel information. The spatial dimension and number of channels of the feature map remain unchanged throughout the process.

[0017] Furthermore, the improved attention random deactivation module of the present patent refers to first adding a feature map complexity analysis layer to the existing attention random deactivation module to dynamically adjust the probability of selecting to generate a discard mask operation or generate an importance map operation according to the complexity, and then generate a discard mask operation, and then dynamically adjust the discard mask threshold according to the complexity; the feature map complexity analysis layer refers to first calculating the variance C of the image pixel values ​​of the 8 input feature maps respectively, thereby obtaining C i , where i = 1, 2, 3, ..., 8, and then use the value range of C [C min ,C max ] Normalize C to get C norm ,in, Finally, C norm As the output, it is passed to the next layer to reflect the complexity of the image. The dynamic adjustment of the probability of generating the discard mask operation or the importance map operation according to the complexity refers to the weight formula in the random selection stage. and Calculate the weights for selecting the generated importance map and the production dropout mask, where the initial weights and are all 0.5, and the value of the adjustment coefficient α defaults to 0.2; the above-mentioned operation of generating a discard mask dynamically adjusts the threshold of the discard mask according to the complexity, which means that according to the formula The discard coefficient D is calculated and multiplied by the highest pixel value of the image to obtain the threshold of the discard mask.

[0018] Furthermore, this patent replaces the 3×3 convolutions of the third, fourth, and fifth residual blocks of ResNet50 with an improved hierarchical segmentation module; the improved hierarchical segmentation module refers to a strategy of dynamically adjusting the grouping operation and changing the original standard convolution operation; the strategy of dynamically adjusting the grouping operation refers to the number of groups s in the grouping stage according to the formula s=r×(s max -s min )+s min Calculated, where s max Indicates the maximum number of groups, the default setting is 8, s min Represents the minimum number of groups, which is set to 2 by default. r is the reference coefficient. The number of channels, height, and width of the input feature map are calculated according to the formula r = (w × h × c) × α, where α is the adjustment coefficient and the default value is 0.1. The change of the original standard convolution operation refers to the operation of replacing the original standard convolution with a series operation of depth-wise separable convolution and transposed convolution when performing the convolution operation on the grouped feature map. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of an embodiment of the present invention;

[0020] Figure 2 A network structure diagram of an embodiment of the present invention;

[0021] Figure 3 This is a structural diagram of a dual-branch convolution module according to an embodiment of the present invention;

[0022] Figure 4 This is a structural diagram of an improved attention random deactivation module according to an embodiment of the present invention;

[0023] Figure 5 This is a flow chart of an improved hierarchical segmentation module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The technical approach of the present invention is further described in detail below through specific embodiments and drawings.

[0025] like Figures 1 to 4 As shown, an embodiment of the scattered garbage detection method for garbage disposal scenarios based on deep learning of the present invention includes the following steps:

[0026] 1. Collect image samples of garbage disposal scenes

[0027] We collected images of garbage disposal activities in a variety of real-world environments, encompassing diverse lighting conditions (such as strong light, low light, and shadows), complex background interference, obstruction by foreign objects, and a variety of shooting angles and distances. The collected image samples should include objects in different postures, tilted and rotated in multiple directions, and at different scales to ensure the dataset is both generalizable and representative.

[0028] 2. Preprocess and label the image

[0029] During image preprocessing, all input images were resized to 608×608 pixels using the OpenCV image processing library to accommodate subsequent model training and inference. Subsequently, the images were semi-automatically labeled using the PPOCRLabel tool. This tool, combined with the existing YOLOv10 model, performs preliminary detection and feedback on objects in the image. For samples with poor detection results, the LabelImage tool is used for manual correction and refinement, improving the accuracy and consistency of the annotations.

[0030] When using PPOCRLabel for labeling, it is recommended to load a pre-trained model suitable for the current task (such as an OCR recognition model optimized for a specific field or a general object detection model) to significantly improve the accuracy of the initial labeling and reduce the workload of subsequent manual corrections.

[0031] 3. Use Mosaic-6 data augmentation, color perturbation, and brightness adjustment methods to create a dataset for training.

[0032] To enhance the model's robustness in complex environments, a variety of image enhancement methods, including the Mosaic-6 data augmentation strategy, color perturbation, and brightness adjustment, were used to generate diverse training samples. The Mosaic-6 augmentation method combines six images into a composite image through random scaling, cropping, and splicing, thereby simulating real-world scenarios with multiple targets. Color perturbation simulates different color shifts by randomly varying the RGB channel values ​​of the image. Brightness adjustment modifies the overall brightness of the image by adding or subtracting a random value to simulate visual differences under different lighting conditions. Furthermore, random occlusion is introduced into the enhanced images to simulate the interference that smoke, dust, and other factors that may occur in real-world scenarios can have on the identification of scattered debris. The number of images generated remains consistent with the original input, effectively improving the diversity of the training data and the model's generalization capabilities.

[0033] 4. Replace the first residual block of ResNet50 with a two-branch convolution module

[0034] In order to overcome the problem that the first residual block in the original ResNet50 network only uses a single-scale convolution kernel, which may not be able to fully capture the complex background and large-scale changes in the features of the target in the garbage disposal scene, the present invention proposes to replace the first residual block of ResNet50 with a dual-branch convolution module. In the garbage disposal scene, scattered garbage may appear under different lighting conditions, complex backgrounds (such as trees, pedestrians, vehicles, etc.), and different shooting angles and distances, resulting in a high diversity of target scales and feature expressions. A single-scale convolution kernel is difficult to effectively adapt to this diversity, so the present invention designs a dual-branch convolution module, which significantly improves the model's ability to detect scattered garbage targets through multi-scale feature extraction and dynamic weighting of channel information.

[0035] The dual-branch convolution module is implemented as follows: First, the input feature map is split into two branches, each performing independent convolution operations to capture feature information at different scales. The first branch uses a 3×3 convolution kernel combined with batch normalization to focus on extracting local details of scattered garbage, such as edges and textures. The second branch extracts global contextual information through a 5×5 average pooling operation combined with a 1×1 convolution kernel, capturing the spatial relationship between the scattered garbage and the background, as well as the overall contour characteristics. The outputs of the two branches are concatenated along the channel dimension, combining multi-scale features to form a richer feature representation.

[0036] In the design of the dual-branch convolutional module, a channel splitting strategy effectively reduces computational complexity. Simultaneously, by processing different convolution operations in parallel, the model's ability to perceive multi-scale features is enhanced. The 3×3 convolution kernel efficiently extracts local features of scattered debris while maintaining a small receptive field, making it suitable for detecting small or partially occluded debris. The 5×5 average pooling combined with the 1×1 convolution expands the receptive field to capture the overall characteristics of scattered debris against a complex background, making it particularly suitable for processing distant or large-scale targets. This branched structure design strikes a balance between computational efficiency and feature representation, making it suitable for resource-constrained embedded devices or real-time detection scenarios.

[0037] The concatenated feature maps are further processed through a lightweight compression-excitation layer to dynamically enhance important channel information and suppress secondary channel information. The lightweight compression-excitation layer is specifically implemented as follows: first, the number of channels is reduced from 256 to 16 through a fully connected layer, significantly reducing the amount of computation; then, it is processed through the ReLU activation function, introducing nonlinear transformations; then, the number of channels is restored from 16 to 256 through another fully connected layer; finally, the weights are mapped to the 0-1 range through the Sigmoid activation function and multiplied with the original feature map on a channel-by-channel basis. This process achieves adaptive weighting of each channel feature, dynamically enhancing important channel information related to the scattered garbage target while suppressing secondary information such as background noise.

[0038] The lightweight compressed excitation layer further optimizes feature representation through an adaptive weighting mechanism while maintaining the spatial dimensions and number of channels in the feature map. Compared to traditional channel weighting methods, this layer significantly improves the model's sensitivity to scattered garbage features through a combination of two fully connected operations and an activation function. For example, in scenes with large lighting variations, the compressed excitation layer can enhance the weights of channels related to the outline and color of scattered garbage, thereby improving detection robustness. Furthermore, the layer's lightweight design ensures low computational overhead, making it suitable for deployment on edge devices.

[0039] The combination of a dual-branch convolutional module and a lightweight compressed excitation layer significantly improves the model's object detection performance in garbage disposal scenarios. In real-world applications, scattered garbage can have incomplete features due to occlusion, background interference, or tilted camera angles. The dual-branch structure simultaneously captures both local and global information through multi-scale feature extraction, compensating for the shortcomings of a single convolution kernel. The compressed excitation layer further optimizes feature selection through channel weighting, reducing the impact of background noise on detection results. This design demonstrates greater robustness and accuracy in complex scenarios.

[0040] Compared with the existing technology, the dual-branch convolution module of the present invention has the following advantages: First, through channel splitting and multi-scale convolution operations, the model's ability to extract features of scattered garbage of different scales is enhanced, which is particularly suitable for scenarios with large scale changes; second, the lightweight compressed excitation layer dynamically optimizes the expressive power of channel features without significantly increasing the computational complexity; finally, the module is seamlessly integrated with the overall architecture of the YOLOv10 network, making full use of the neck network and head network of YOLOv10, further improving the accuracy of target positioning and classification.

[0041] In the specific implementation process, the input feature map of the dual-branch convolution module is usually a 608×608×3 RGB image. After processing by the initial convolution layer, a high-dimensional feature map is generated, which then enters the dual-branch convolution module. The parameter settings of the module (such as convolution kernel size, channel split ratio, etc.) can be fine-tuned according to specific task requirements. For example, in the task of detecting small scattered garbage, the number of channels of the 3×3 convolution branch can be appropriately increased to enhance local feature extraction; in the task of long-distance detection, the weight of the 5×5 pooling branch can be increased to capture more global information. This flexibility enables the dual-branch convolution module to adapt to a variety of garbage disposal scenarios.

[0042] To verify the effectiveness of the dual-branch convolutional module, the present invention conducted experiments on a dataset of garbage disposal scenarios encompassing a variety of lighting conditions, background complexities, and target scales. The experimental results show that, compared to the original ResNet50 network, replacing the dual-branch convolutional module improves the mean average precision (mAP) of the model in the scattered garbage detection task by approximately 5.2%, while reducing the false detection rate by approximately 3.8% in complex backgrounds. The lightweight compressed excitation layer further keeps computational overhead within an acceptable range, with inference speed decreasing by only approximately 2%, meeting the requirements of real-time detection.

[0043] In summary, the dual-branch convolutional module significantly improves the robustness and accuracy of scattered garbage detection in complex scenarios by combining channel splitting, multi-scale feature extraction, and a lightweight compressed excitation layer. This module design not only optimizes feature representation but also strikes a good balance between computational efficiency and model performance, providing efficient and reliable technical support for intelligent management of garbage disposal scenarios.

[0044] 5. Add an improved attention random deactivation module between the second and third residual block groups of ResNet50 and dynamically adjust the model strategy according to image complexity

[0045] To improve the model's generalization and localization accuracy in complex waste disposal environments, this paper introduces an improved attention dropout module between the second and third residual blocks of ResNet50. This module optimizes the original Attention-based Dropout Layer (ADL) by incorporating a specially designed mechanism that adaptively controls image complexity. This allows the model to dynamically decide whether to drop or enhance saliency in feature regions, avoiding the degradation in classification accuracy caused by the fixed mask strategy in traditional ADL.

[0046] The improved attention dropout module in this patent consists of three main parts: a feature map complexity analysis layer, a dynamic mask selection mechanism, and a spatial mask application layer. The overall process is as follows: first, the complexity of the current input image is evaluated through the feature map complexity analysis layer. Then, based on the evaluation results, the weighted distribution probability of the dropout and enhancement operations is calculated. Finally, based on the selected operation type, the corresponding dropout mask or importance map is generated and applied to the input feature map to suppress or enhance spatial attention.

[0047] Furthermore, the feature map complexity analysis layer is specifically implemented as follows: for each image in a batch of input feature maps, usually 8 images as a batch, its pixel variance C is calculated to obtain C i , where i = 1, 2, 3, ..., 8, and normalize to get the complexity evaluation value C norm , the normalization process is as follows:

[0048]

[0049] Among them, C min and C max The minimum and maximum variances in the current batch are respectively. This score reflects the complexity of texture, lighting, and structural changes in the image. A higher value indicates a more complex image.

[0050] In the mask operation selection stage, the sampling probabilities of the "discard" and "enhancement" operations are dynamically updated according to formulas ② and ③:

[0051]

[0052]

[0053] Among them, α is an adjustable coefficient that controls the influence of complexity on mask selection, and the default value is . According to this mechanism, when the image complexity is high, it is more inclined to perform the discarding operation to avoid the model overfitting to the salient area; when the image is relatively simple, it is more inclined to perform importance enhancement to ensure classification accuracy.

[0054] If the final result is to execute the "discard mask" strategy, the discard coefficient D is calculated according to formula ④:

[0055]

[0056] The discarding coefficient is multiplied by the maximum pixel value of the input feature map to obtain the threshold of the discarding mask. Finally, the positions where the pixel value is greater than the threshold are set to 0, and the positions where the pixel value is less than the threshold are set to 1 to form a binary discarding mask.

[0057] Finally, the mask is applied to the input feature map through point-by-point multiplication in the spatial dimension to shield the strong response areas, forcing the model to learn secondary feature areas to enhance positioning capabilities.

[0058] If "Importance Map Enhancement" is selected, a Sigmoid activation is directly applied to the self-attention map to generate an importance map, representing the importance weight of each position. This importance map is then multiplied pixel by pixel with the input feature map to enhance the response of salient regions and improve the model's classification ability.

[0059] The improved attention random deactivation module described in the present invention achieves intelligent scheduling of discarding and enhancing strategies by introducing image complexity analysis and mask selection probability control mechanisms, significantly optimizing the original ADL's balance between positioning and classification tasks. For example, in situations where illumination changes drastically or background is complex and obscured, the module can effectively shield highly responsive but ineffective background areas; while in clear images with the target centered, it can enhance salient areas, thereby improving the overall performance of detection and classification. This module is not only lightweight and can be deployed in parallel on multiple feature layers, but also does not introduce additional parameter learning, making it suitable for efficient deployment on mobile or embedded devices.

[0060] To further enhance the model's ability to extract multi-scale features and adapt to complex backgrounds in waste disposal scenarios, this paper replaces the original 3×3 convolutions in the third, fourth, and fifth residual blocks of ResNet50 with an improved hierarchical segmentation module. This module is an optimization of the existing Hierarchical-Split Block module. By dynamically adjusting the grouping strategy and replacing the standard convolution operation, it significantly enhances the model's ability to express multi-scale features while maintaining efficient computational performance and robustness in complex waste disposal scenarios.

[0061] The original hierarchical segmentation module works as follows: As described in the paper, the hierarchical segmentation module generates multi-scale feature representations by segmenting the input feature map into multiple groups along the channel dimension. The input feature map is evenly divided into s groups, each with w channels (width). Only the first group of feature maps is directly connected to the next layer, while subsequent groups of feature maps are processed through a series of 3×3 convolution operations. The convolution output y of each group is i It is further split into two subgroups y1 and y2, where y1 is directly connected to the final output, while y2 is concatenated with the next set of input feature maps along the channel dimension and serves as the input for the next set of convolutions. This process is repeated until all input feature map groups have been processed. Finally, all y1s are concatenated along the channel dimension and the number of channels is restored through a 1×1 convolution to generate the final output feature map.

[0062] This invention improves upon the existing hierarchical segmentation module in two key aspects: first, a dynamic adjustment strategy for grouping operations; and second, replacing standard convolution with a cascade of depthwise separable and transposed convolutions. These improvements aim to further optimize the module's performance in garbage disposal scenarios, addressing challenges posed by complex backgrounds, varying lighting conditions, and diverse object scales.

[0063] In the original hierarchical segmentation module, the number of groups s and channel width w are fixed, which may lead to feature extraction inadaptability when faced with the highly diverse image complexity in garbage disposal scenarios. This invention proposes to dynamically adjust the number of groups s based on the attributes of the input feature map. Specifically, the number of groups s is calculated according to formula ⑤:

[0064] s=r×(s max -s min )+s min ⑤

[0065] where s max Indicates the maximum number of groups, the default setting is 8, s min Indicates the minimum number of groups, the default setting is 2, r is the reference coefficient, and the number of channels, height, and width of the input feature map are calculated according to the formula r = (w × h × c) × α, where α is the adjustment coefficient and the default value is 0.1.

[0066] This dynamic adjustment strategy adaptively determines the number of groups based on the complexity of the feature map (reflected by the number of channels and spatial dimensions). For example, when the input feature map has more channels or a larger spatial dimension, the r value increases, and s tends to be larger, thereby enhancing multi-scale feature extraction capabilities. Conversely, in simple scenes, the number of groups is reduced to reduce computational complexity. This dynamic grouping mechanism enables the module to flexibly adapt to garbage disposal scene images of varying complexity. For example, in scenes with complex backgrounds or small objects, the number of groups is increased to capture more detailed features.

[0067] The 3×3 convolution operation in the original hierarchical segmentation module may generate redundant calculations when processing high-resolution or complex background images, and has limited modeling capabilities for global context. The present invention replaces the original standard 3×3 convolution with a series operation of depthwise separable convolution and transposed convolution when performing convolution operations on the grouped feature maps. The specific implementation is as follows: first, depthwise separable convolution is applied to each group of feature maps. This operation separates the intra-channel convolution and point-by-point convolution, significantly reducing the number of parameters and computational complexity while retaining rich feature information; then, the feature map is upsampled through transposed convolution to expand the receptive field to capture a wider range of contextual information. This series operation not only reduces the computational overhead, but also enhances the module's ability to detect scattered garbage targets at long distances or in complex backgrounds.

[0068] Compared with the existing technology, the improved hierarchical segmentation module of the present invention has the following advantages: First, the dynamic grouping strategy adaptively adjusts the number of groups according to the complexity of the input feature map, thereby enhancing the module's adaptability to diverse target scales and backgrounds in garbage disposal scenarios; second, the serial operation of depthwise separable convolution and transposed convolution reduces computational complexity while expanding the receptive field, thereby improving the detection capability of distant or partially occluded scattered garbage.

[0069] To validate the effectiveness of the improved hierarchical segmentation module, experiments were conducted on a dataset of garbage disposal scenarios encompassing a variety of lighting conditions, background complexity, and object scales. The results show that, compared to the original ResNet50 network, the model using the improved hierarchical segmentation module performs significantly better in terms of average precision, false positive rate, and computational overhead in the scattered garbage detection task, meeting the requirements of real-time detection.

[0070] In summary, the improved hierarchical segmentation module significantly enhances the multi-scale feature extraction and robustness of scattered garbage detection in complex scenarios through a dynamic grouping strategy and the cascade of depthwise separable and transposed convolutions. While maintaining efficient computational performance, this module optimizes feature representation, providing reliable technical support for intelligent management of garbage disposal scenarios.

[0071] Taking into account the fact that the scattered garbage detection task in the garbage disposal scenario involved in the present invention needs to accurately identify scattered garbage targets under different scales, angles and lighting conditions in a complex environment, and in order to weaken the differences between data sets during the training process, the present invention proposes a multi-model fusion prediction method based on loss function optimization. Specifically, the loss function is replaced by EIOU LOSS from CIOU LOSS to improve the accuracy and convergence speed of bounding box regression; at the same time, the CTC loss function is introduced to optimize the alignment of the target detection sequence. In addition, based on the self-service sampling of the training set, it is divided into 5 sub-training sets, and 5 homogeneous models are obtained by independent training. The prediction results of the 5 models are fused by the WBF (weighted bounding box fusion) method to obtain the final detection result. Subsequently, the prediction results are used to adjust the parameters of each model, and combined with the improved ResNet50 backbone network, dual-branch convolution module, attention random inactivation module and hierarchical segmentation module in YOLOv10, the feature extraction capability is further optimized until the loss function of each model converges, the model training is completed, and the final strong learner is obtained to achieve the effect of multi-model collaborative decision-making. Finally, the output results of the multi-model fusion prediction are threshold filtered and bounding box corrected. The classification confidence threshold is set, and only the prediction results above the threshold are retained. The predicted bounding box is then fine-tuned to reduce false detections and improve the accuracy of scattered garbage detection.

[0072] Considering that there is no strong dependency between the models, a series of individual learners can be generated in parallel. The present invention uses Bagging (guided aggregation algorithm) for homogeneous integration, and its working mechanism is as follows:

[0073] (1) The training set was randomly sampled five times using the bootstrap sampling method, and each sampling resulted in a sampling set of 10 samples.

[0074] (2) For these n sampling sets, 5 base learners are trained independently;

[0075] (3) The five base learners are fused through the ensemble strategy to obtain the final strong learner.

[0076] Among them, the self-service sampling method adopts a sampling method with replacement. Compared with the average division sampling method, it can more realistically simulate the diversity of image samples in garbage disposal scenes, such as scattered garbage images under different lighting, background complexity and occlusion conditions.

[0077] Subsequently, the predictions from the five homogeneous models trained based on data partitioning are fused using the WBF weighted bounding box method. This fusion process comprehensively considers the bounding box positions and confidence levels of each model's predictions to generate the final litter detection results. The fused predictions are then used to adjust model parameters to optimize detection performance, particularly in complex scenarios, to improve the accuracy of litter location and classification.

[0078] Deep learning models offer high flexibility but are sensitive to the details of the training data, which can lead to high variance. This is particularly true in waste disposal scenarios, where the diversity of image samples (e.g., multiple angles and scales) can lead to fluctuations in model performance. This invention effectively reduces model variance and improves generalization capabilities in complex waste disposal scenarios through multi-model fusion prediction based on data partitioning.

[0079] The loss function was replaced with EIOU LOSS, which accelerates model convergence and improves bounding box regression accuracy by splitting the width-height loss term. EIOU LOSS is better suited for bounding box prediction of scattered garbage objects at different scales, such as detecting small pieces of scattered garbage at long distances or large pieces at close range. The CTC loss function was introduced to optimize the alignment of target sequences, making the model more adaptable to the multi-scale and multi-angle characteristics of scattered garbage detection tasks, especially in the presence of partial occlusion or background interference.

[0080] In summary, the present invention significantly improves the performance and efficiency of the scattered garbage detection method for garbage disposal scenarios through a series of innovative improvements. Specifically, when constructing a deep learning neural network based on YOLOv10 and with an improved ResNet50 as the backbone network, the present invention introduces a number of key technical optimizations, including a dual-branch convolution module, an improved attention random inactivation module, an improved hierarchical segmentation module, data augmentation and preprocessing methods, and loss function optimization. These improvements work together to enable the present invention to achieve significant advantages in the scattered garbage detection task, which are specifically reflected in the following aspects:

[0081] The dual-branch convolutional module significantly improves feature extraction capabilities. This invention replaces the first residual block of ResNet50 with a dual-branch convolutional module. Through channel splitting and multi-scale feature extraction, the model enhances its ability to detect scattered garbage of varying scales. This module extracts local detail features, such as the edges and texture of scattered garbage, through 3×3 convolutions. It combines 5×5 average pooling and 1×1 convolutions to capture global contextual information, such as the spatial relationship between the scattered garbage and the background. Dynamic feature weighting is achieved through a lightweight compressed excitation layer. This design excels in complex scenarios, such as those characterized by changing lighting, background interference, or when shooting from a distance. The model can still accurately identify scattered garbage. Compared to the traditional ResNet50, the dual-branch convolutional module offers superior performance in average precision, false positive rate, and computational overhead, without significantly increasing computational complexity, meeting the requirements of real-time detection. This multi-scale feature extraction capability is particularly well-suited to the diverse scales and shapes of scattered garbage in garbage disposal scenarios.

[0082] An improved attention dropout module enhances robustness in complex scenarios. An improved attention dropout module is added between the second and third residual block groups of ResNet50. Through feature map complexity analysis and a dynamic mask selection mechanism, intelligent scheduling of dropout and enhancement strategies is achieved. This module dynamically adjusts the dropout probability based on image complexity, avoiding the accuracy degradation caused by traditional attention mechanisms. Compared with traditional methods, this module requires no additional parameters, maintaining a lightweight design, while improving positioning accuracy by masking invalid background areas. For example, in garbage disposal scenarios with strong lighting or complex backgrounds, this module can effectively focus on scattered garbage targets, enhancing model robustness. It is also computationally efficient and suitable for deployment on resource-constrained devices.

[0083] Improved hierarchical segmentation module optimizes multi-scale detection performance The present invention introduces an improved hierarchical segmentation module in the third, fourth and fifth residual blocks of ResNet50, and adopts a dynamic grouping strategy and the serial operation of depth-wise separable convolution and transposed convolution to significantly improve the multi-scale feature extraction capability. The module adaptively adjusts the number of groups according to the complexity of the feature map, and expands the receptive field while maintaining computational efficiency. Combined with the hierarchical segmentation idea in the document "HS-ResNet: Hierarchical-Split Blockon Convolutional Neural Network", the present invention further optimizes the grouping convolution strategy to make it more suitable for the detection of scattered garbage at a distance or partially occluded in garbage disposal scenarios. Experiments show that this module enables the model to have better performance in terms of average accuracy, false detection rate, computational overhead, etc., and exhibits higher detection accuracy and robustness under complex backgrounds.

[0084] Data augmentation and preprocessing improve the generalization ability of the model. By using Mosaic-6 data augmentation, color perturbation and brightness adjustment methods to create training sets, the present invention significantly enhances the generalization ability of the model. These methods increase the diversity of training samples by simulating different lighting, background and occlusion conditions, enabling the model to adapt to the complex changes in actual garbage disposal scenarios. Compared with traditional data augmentation, Mosaic-6 provides richer training data by splicing and randomly processing 6 pictures, effectively improving the model's ability to recognize scattered garbage at multiple angles and scales. This method ensures that the model is exposed to a variety of scenes during training, thereby improving the accuracy and stability of detection.

[0085] Loss function optimization improves detection accuracy and training efficiency. The present invention optimizes the loss function according to the characteristics of the garbage disposal scene, replaces CIOU LOSS with EIOU LOSS, and introduces the CTC loss function to further improve the bounding box regression accuracy and model convergence speed. Paragraph 0069 of the specification mentions that this optimization design is adapted to the multi-scale and multi-angle target characteristics, especially in the case of occlusion or background interference. Combined with multi-model fusion prediction methods, such as Bagging and WBF weighted bounding box fusion, the present invention effectively reduces the model variance and improves the accuracy and robustness of detection. Experimental results show that the optimized loss function accelerates the training process, while significantly improving the bounding box regression accuracy, providing reliable protection for scattered garbage detection in complex scenes.

[0086] These advantages not only improve the intelligence level of scattered garbage detection tasks, but also provide efficient and reliable solutions for the field of urban management, and have important practical value and promotion potential.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the specific implementation methods of the present invention can still be modified or replaced without departing from the spirit and scope of the present invention. Any modification or replacement should be included within the scope of protection of the claims of the present invention.

Claims

1. A method for detecting scattered garbage in garbage disposal scenarios, characterized by A deep learning neural network with YOLOv10 as the backbone network and the original neck network and head network in YOLOv10 was constructed to improve the target positioning and classification capabilities of the neural network in the garbage disposal scene, including the following steps: (1) collecting image samples of the garbage disposal scene; (2) preprocessing and labeling the images; (3) preparing a training set based on data augmentation; (4) replacing the first residual block of ResNet50 with a two-branch convolution module; (5) adding an improved attention random inactivation module between the second and third residual block groups of ResNet50 and dynamically adjusting the model strategy according to the image complexity; (6) using the improved hierarchical segmentation module in the third, fourth and fifth residual blocks of ResNet50; (7) training the improved deep learning network to realize scattered garbage detection; the image samples of the garbage disposal scene mentioned above refer to collecting image samples in different environments, angles and distances, so that the image samples contain different light intensities, complex backgrounds, foreign object occlusions, multi-angle rotation and tilt, and non-uniform distribution of the image. Images of the same scale; the image preprocessing and annotation refers to adjusting the size of the input image to a uniform size of 608×608 through the OpenCV library, semi-automatically annotating the collected images through the PPOCRLabel semi-automatic annotation tool, and detecting feedback through the existing YOLOv10 model, and correcting the labeled samples with poor detection results through the LabelImage annotation tool with manual annotation; the data augmentation-based training set production refers to using Mosaic-6 data augmentation, color perturbation and brightness adjustment methods to produce a data set for training, using 6 pictures as a group, randomly scaling, randomly cropping and randomly arranging them for splicing, randomly changing the RGB channel values ​​in the image, and adding or subtracting a random value to adjust the brightness of the image to simulate changes under different lighting conditions, obtaining 6 new images, and randomly occluding the new images; the loss function-based optimization model detection effect refers to defining a suitable loss function according to the specific garbage disposal task scenario, and using the backpropagation algorithm to update the network weights.

2. The method for detecting scattered garbage in a garbage disposal scenario according to claim 1, characterized in that: The first residual block of ResNet50 is replaced by a dual-branch convolution module; the dual-branch convolution module refers to a module obtained by splitting the input feature map into two channels, performing convolution operations on the two branches, splicing them together, and then connecting a lightweight compression excitation layer in series; the input feature map is split into two channels, performing convolution operations on the two branches, and then merging them, which means that the input feature map is first split into two channels, 3×3 convolution and batch normalization are performed on the first branch, and 5×5 average pooling is performed on the second branch. The lightweight compression excitation layer first reduces the number of channels from 256 to 16 through a fully connected layer, and then restores the number of channels from 16 to 256 through a fully connected layer after a ReLU activation function. The weights are then mapped to the 0-1 interval through a Sigmoid activation function, and then multiplied one-to-one with the original feature map according to the channel, to achieve adaptive weighting of the features of each channel, thereby dynamically enhancing important channel information and suppressing secondary channel information. The spatial dimension and number of channels of the feature map remain unchanged throughout the process.

3. The method for detecting scattered garbage in a garbage disposal scenario according to claim 1, characterized in that: The improved attention random dropout module refers to first adding a feature map complexity analysis layer to the existing attention random dropout module to dynamically adjust the probability of selecting to generate a drop mask operation or generate an importance map operation according to the complexity, and then generate a drop mask operation, and then dynamically adjust the drop mask threshold according to the complexity; the feature map complexity analysis layer refers to first calculating the variance C of the image pixel values ​​of the 8 input feature maps respectively, so as to obtain C i , where i = 1, 2, 3, ..., 8, and then use the value range of C [C min ,C max ] Normalize C to get C norm ,in, Finally, C norm As the output, it is passed to the next layer to reflect the complexity of the image. The dynamic adjustment of the probability of generating the discard mask operation or the importance map operation according to the complexity refers to the weight formula in the random selection stage. and Calculate the weights for selecting the generated importance map and the production dropout mask, where the initial weights and are all 0.5, and the value of the adjustment coefficient α defaults to 0.2; the above-mentioned operation of generating a discard mask dynamically adjusts the threshold of the discard mask according to the complexity, which means that according to the formula The discard coefficient D is calculated and multiplied by the highest pixel value of the image to obtain the threshold of the discard mask.

4. The method for detecting scattered garbage in a garbage disposal scenario according to claim 1, characterized in that: The 3×3 convolution of the third, fourth, and fifth residual blocks of ResNet50 are replaced by an improved hierarchical segmentation module. The improved hierarchical segmentation module adopts a dynamic adjustment strategy when performing grouping operations and changes the original standard convolution operation. The dynamic adjustment strategy adopted when performing grouping operations refers to the number of groups s in the grouping stage according to the formula s=r×(s max -s min )+s min Calculated, where s max Indicates the maximum number of groups, the default setting is 8, s min Represents the minimum number of groups, which is set to 2 by default. r is the reference coefficient. The number of channels, height, and width of the input feature map are calculated according to the formula r = (w × h × c) × α, where α is the adjustment coefficient and the default value is 0.

1. The change of the original standard convolution operation refers to the operation of replacing the original standard convolution with a series operation of depth-wise separable convolution and transposed convolution when performing the convolution operation on the grouped feature map.

Citation Information

Cited By

  • Violation information monitoring method and system based on combination of Beidou positioning and digital simulation

    CN122223666A