With the rapid development of deep learning technology, many algorithms for mask-wearing detection have achieved remarkable results. However, the detection effect still needs to be improved when dealing with mask-wearing in some complex scenes where the targets are too dense or partially occluded. This paper proposes a new mask-wearing detection model: YOLOv7-CPCSDSA. Based on YOLOv7, this model replaces some convolutions of the original model, CatConv, with FasterNet’s partial convolution (PConv) to form a CatPConv (CPC) structure, which can reduce computational redundancy and memory access. In the case of an increase in the network layer, the parameters are reduced instead. The Small Detection (SD) module is added to the model, which includes structures such as upsampling, concat convolution, and MaxPooling to enhance the ability to capture small targets, thereby improving detection accuracy. In addition, the Shuffle Attention (SA) mechanism is introduced, which enables the model to adaptively focus on important local information, thereby improving the accuracy of detecting mask-wearing. This paper uses comparative and ablation experiments in the mask dataset (including many images in complex scenarios) to verify the model’s effectiveness. The results show that the mean average precision@0.5 (mAP@0.5) of YOLOv7-CPCSDSA reaches 88.4%, which is 1.9% higher than that of YOLOv7, and its frames per second (FPS) rate reaches 75.8 f/s, meeting the real-time detection requirements. Therefore, YOLOv7-CPCSDSA is suitable for detecting mask-wearing in complex scenarios.
As the global population grows and urbanization accelerates, the garbage that is generated continues to increase. This waste causes serious pollution to the ecological environment, affecting the stability of the global environmental balance. Garbage detection technology can quickly and accurately identify, classify, and locate many kinds of garbage to realize the automatic disposal and efficient recycling of waste, and it can also promote the development of a circular economy. However, the existing garbage detection technology has some problems, such as low precision and a poor detection effect in complex environments. Although YOLOv5 has achieved good results in garbage detection, the detection results cannot meet the requirements in complex scenarios, so this paper proposes a garbage detection model, YOLOv5-OCDS, based on an improved YOLOv5. Replacing the partial convolution in the neck with Omni-Dimensional Dynamic Convolution (ODConv) improves the expressiveness of the model. The C3DCN structure is constructed, and parts of the C3 structures in the neck are replaced by C3DCN structures, allowing the model to better adapt to object deformation and target scale change. The decoupled head is used for classification and regression tasks so that the model can learn each class’s characteristics and positioning information more intently, and flexibility and extensibility can be improved. The Soft Non-Maximum Suppression (Soft NMS) algorithm can better retain the target’s information and effectively avoid the problem of repeated detection. The self-built garbage classification dataset is used for related experiments, and the mAP@50 of the YOLOv5-OCDS model is 5.3% higher than that of the YOLOv5s; the value of mAP@50:95 increases by 12.3%. In the experimental environment of this study, the model’s Frames Per Second (FPS) was 61.7 f/s. In practical applications, when we use some old GPU, such as the GTX1060, it can still reach 50.3 f/s, so that real-time detection can be achieved. Thus, the improved model suits garbage detection tasks in complex environments.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.