Search

CN-117392501-B - Real-time violation flag detection method based on YOLOV target detection algorithm

CN117392501BCN 117392501 BCN117392501 BCN 117392501BCN-117392501-B

Abstract

The invention relates to a real-time violation flag detection method based on YOLOV target detection algorithm, which comprises the following steps: collecting a violation flag picture through a crawler, determining the detection characteristics of the violation flag, marking the collected picture by using a picture marking tool, manufacturing a violation flag data set, and meanwhile, collecting a normal flag with similar characteristics to the violation flag, and manufacturing an confusion characteristic flag data set; optimizing a model algorithm, and improving YOLOV target detection algorithm based on focus and global target detection distillation to obtain a self-adaptive twin distillation YOLOV-tiniy target detection algorithm model; compared with the prior art, the method has the advantages that the obfuscated characteristic flag data set is manufactured, the offending flag recognition capability is improved, the YOLOV target detection algorithm is improved based on focus and global target detection distillation, the twin distillation YOLOV-tiny target detection algorithm model is obtained, the detection precision is improved, and real-time detection can be achieved.

Inventors

  • ZHANG ZHENCHANG
  • LIU JINQIANG
  • XUE HONGHUI
  • LIN JIAXIANG
  • LIN QINGBO
  • LI XIAOLIN
  • CHEN HONGFANG

Assignees

  • 福建农林大学

Dates

Publication Date
20260505
Application Date
20230330

Claims (9)

  1. 1. A real-time offence flag detection method based on YOLOV target detection algorithm is characterized by comprising the following steps: data set generation Collecting a violation flag picture by writing a crawler, determining the detection characteristics of the violation flag, marking the collected picture by using a picture marking tool, manufacturing a violation flag data set, collecting a normal flag with similar characteristics to the violation flag, manufacturing an confusion characteristic flag data set, sampling and reorganizing the violation flag data set and the confusion characteristic flag data set according to a specific proportion, and manufacturing a training set and a verification set; Optimizing model algorithms Based on the focus and global target detection distillation, improving YOLOV target detection algorithm to obtain a self-adaptive twin distillation YOLOV-tiny target detection algorithm model; Model training Carrying out twin distillation training on the YOLOV-tiny target detection algorithm model by using the prepared data set to obtain a preliminary target flag detection model self-adaptive twin distillation YOLOV-tiny; Model optimization Optimizing the preliminary target flag detection model through experiments and various strategies, and optimizing the robustness of the target flag detection model in an actual application scene to obtain a violation flag detection model for deployment, wherein the training and optimization of the violation flag detection model are completed at a server side; In the step of model optimization, the preliminary violation flag detection model is optimized by adopting the following strategies: Carrying out random mapping processing by adopting a self-adaptive mapping strategy, randomly selecting a flag picture to cut a flag target area, randomly selecting a background picture to serve as a mapping background, randomly attaching the cut picture to the background picture, randomly attaching each picture for 3-5 times, ensuring that the mapping position is not overlapped with other target areas, adopting a dynamic mapping method instead of static attaching, inputting network training, and carrying out basic mapping along with each iteration in the training process; the confidence level grading data retraining mechanism is used for reasoning and detecting the pictures of the compliance flag dataset according to the originally trained model results, grading the false detection pictures according to the confidence level scores of the false detection, manufacturing a model performance enhancement dataset, and putting the manufactured dataset into a network for retraining; optimizing the model by adopting a strategy of quantized perception training; Model deployment Carrying out quantization processing on the violation flag detection model for deployment, and deploying the violation flag detection model to an AI edge computing equipment development board; Video detection And carrying out frame extraction processing on the video input by the development board, inputting frame extraction pictures into a deployed violation flag detection model for detection, and carrying out filtering processing or alarm prompting on the detected pictures containing the violation flags so as to ensure the compliance of video scenes.
  2. 2. The method for detecting the violation flag in real time based on YOLOV's target detection algorithm according to claim 1, wherein in the step of creating the dataset, when the collected picture is marked by using a picture marking tool, the violation flag feature and the corresponding LOGO thereof are selected at the same time, and then the violation flag target and the corresponding LOGO thereof appearing in the picture are marked by using the picture marking tool, so as to create the violation flag dataset.
  3. 3. The method for real-time offence flag detection based on YOLOV's target detection algorithm of claim 2, wherein in the step of data set generation, feature comparison is performed on various offence flags and various political party flags in all countries of the world, flag pictures with similar features to the various offence flags are collected, and a confusing feature flag data set is generated.
  4. 4. The real-time offence flag detection method based on YOLOV's 7 target detection algorithm according to claim 1, wherein in the step of optimizing the model algorithm, by taking YOLOV7 as a teacher model, simultaneously performing focus global distillation on a feature map output by a main network of a YOLOV model and a feature map output by a head, in the early stage of model training, based on the main network feature distillation, convergence of a student model can be accelerated, in the later stage of model training, the feature output by the head of the teacher model can better guide the student model to achieve higher detection precision, and simultaneously distill the output features of the main network and the head of the YOLOV-tini target detection algorithm model, and design adaptive weights for the two features.
  5. 5. The method for real-time offence flag detection based on YOLOV's 7 target detection algorithm according to claim 1, wherein in the step of model training, first, training YOLOV model with the fabricated dataset to obtain a teacher model, and then performing adaptive twin distillation training on YOLOV-tiny target detection algorithm model to obtain preliminary target flag detection model adaptive twin distillation YOLOv-tiny.
  6. 6. The method for real-time offence flag detection based on YOLOV's 7 target detection algorithm of claim 5, wherein in the step of model training, if it is found that the target area containing the flag is cropped, the stitching process is performed again until the enhanced picture meets the requirement of not damaging the flag area.
  7. 7. The method for real-time offending flag detection based on YOLOV's 7 target detection algorithm of claim 6, wherein the color enhanced data rate decreases with the cosine of the training number of models by means of a progressive annealing color enhancement.
  8. 8. The method for real-time offence flag detection based on YOLOV's 7 target detection algorithm of claim 1, wherein in the step of model deployment, the offence flag detection model is deployed on an AI-edge computing device development board, and offence flag pictures in video can be detected in real-time in an offline or local area network state.
  9. 9. The method for detecting real-time offence flags based on YOLOV's 7 target detection algorithm according to claim 1, wherein in the step of video detection, frames are extracted from the video input from the development board frame by frame, and then the frame is sent to a trained offence flag detection model for detection.

Description

Real-time violation flag detection method based on YOLOV target detection algorithm Technical Field The invention relates to the technical field of computer vision and the technical field of edge intelligent computing, in particular to a real-time violation flag detection method based on YOLOV target detection algorithm. Background In the present era, internet technology is very new and different, the propagation speed and breadth of information are exclamatory, image data is one of main sources for people to acquire information, and no time is needed in our lives. Smart phones, computers, large screen broadcasts and the like provide various video image information for people, so that people can live in various roles. However, while the technology brings convenience to us, it also brings challenges, where network security has been a hotspot for people to study. There are some pictures in the network that contain offending content that would have an extremely bad effect by virtue of their dramatic propagation speed and breadth if not detected and filtered. The flag is extremely sensitive data, and is particularly important to detect the flag in real time. At present, the screening and filtering of illegal pictures are mainly concentrated on a server side, namely, image data transmitted in a network are collected to a cloud end, and then detection and identification are carried out by adopting a certain method. For example, each large video and social platform is monitored by manual examination and a method based on user report. These methods have the following disadvantages: 1. The manual detection method has very low detection precision and detection efficiency, very high false detection rate and great consumption of human resources; 2. The cloud detection is too dependent on the network, the delay is larger, real-time detection cannot be achieved, and potential safety hazards of the network and the possibility of being attacked exist through the cloud detection method. The deep learning technology is rapidly developed, the target detection technology is used as a basic task of computer vision, and is widely applied to production and life of people, such as security monitoring, unmanned operation, intelligent manufacturing and the like, the body shadow of the target detection technology can be seen, the edge calculation requires a target detection model to have fewer model parameters due to the limitation of calculation force, the detection speed is higher to realize the function of real-time detection, and the YOLO series target detection algorithm is widely applied to an edge intelligent scene due to the higher detection speed. More information about the above solutions can also be found in the following documents: The patent with the publication number of CN114092743B discloses a method, a device, a storage medium and equipment for detecting compliance of a sensitive picture, and belongs to the technical field of picture processing. The method is used in a compliance detection network, the compliance detection network comprises a target detection network and at least one detection branch, each detection branch corresponds to a compliance detection strategy, the method comprises the steps of obtaining a sensitive picture to be detected, identifying a sensitive area and a sensitive category from the sensitive picture by the aid of the target detection network, wherein the sensitive area contains a sensitive target, the sensitive category is the category to which the sensitive target belongs, selecting a target detection branch corresponding to the sensitive category from the at least one detection branch, and detecting whether the sensitive picture is compliance or not by the aid of the compliance detection strategy of the target detection branch. In the process of realizing the invention, the inventor finds that the following problems exist in the prior art: In the prior art, no confusion characteristic flag data set is manufactured, the recognition capability of the violation flag is poor, the detection precision of a YOLO series target detection algorithm is poor, and meanwhile, the real-time detection cannot be achieved at the edge equipment due to the slow model reasoning speed. Disclosure of Invention In view of the above problems, the application provides a real-time offence flag detection method based on YOLOV target detection algorithm, which is used for solving the problems that in the prior art, an confusion characteristic flag data set is not manufactured, offence flag identification capability is poor, and meanwhile, real-time detection cannot be achieved at edge equipment due to low model reasoning speed. To achieve the above object, in a first aspect, the present inventors provide a real-time offence flag detection method based on YOLOV target detection algorithm, comprising the steps of: data set generation Collecting a violation flag picture by writing a crawler, determining the detection