A method for detecting and identifying human behavior
By combining the improved SEResNet 18 network and YOLO-X algorithm with head detection to identify smoking behavior, the problem of false and missed detection of smoking behavior in catering establishments has been solved, achieving efficient and accurate smoking identification, reducing equipment costs and enhancing the system's adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEWLAND DIGITAL TECH CO LTD
- Filing Date
- 2022-12-29
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies have high false positive and false negative rates when detecting smoking behavior in catering establishments. In particular, they are difficult to accurately identify smoking behavior with a hand or a cigarette in the mouth in complex backgrounds and high temperature and humidity environments. Moreover, existing equipment is costly to deploy and difficult to maintain.
A modified SEResNet 18 network based on ResNet 18, combined with the IoU loss function and the YOLO-X algorithm, is used for head detection. Smoking behavior is identified by using the temporal information of the video stream, cigarettes are detected by using the head image region, a judgment threshold is set, and an alarm is output.
It improves the accuracy of smoking behavior recognition, reduces the false detection rate, adapts to complex indoor scenarios, reduces equipment costs, supports the deployment of multiple monitoring devices, and has flexibility and scalability.
Smart Images

Figure CN116978111B_ABST
Abstract
Description
Technical Field
[0001] This invention is applied to the field of behavior detection and recognition, specifically a method for detecting and recognizing human behavior. Background Technology
[0002] In recent years, with the development of smart cities and new infrastructure, the integration and application of artificial intelligence technology and digital equipment have gradually moved from the laboratory into society, shining brightly in fields such as payment, education, engineering, security, smart parks, and digital towns, empowering industries, streamlining processes, and safeguarding social security. The detection and identification of specific behaviors of certain individuals has become a hot technology trend. For example, since 2014, the State Food and Drug Administration has deployed the "Transparent Kitchen" project, encouraging catering businesses to establish open kitchens for public supervision of food processing. After eight years of development, from standardizing open kitchen structures such as glass enclosures, low partitions, and open windows, to widely displaying kitchen surveillance videos at the front desk, and piloting live streaming of the entire food preparation process on food delivery platforms, the basic hardware infrastructure for "Transparent Kitchen" is relatively complete. However, irregular behaviors in the kitchen often occur briefly, and supervision through on-site inspections or searching surveillance videos is time-consuming and laborious. Therefore, the method of using artificial intelligence technology to analyze abnormal kitchen behaviors based on surveillance camera videos has recently become a hot topic in the industry. Among the many non-compliant behaviors in kitchens, failure to wear chef's hats, uniforms, and masks as required is easily noticeable, and related AI-based alarm systems are relatively mature. However, smoking is intermittent, covert, and brief, and because cigarettes are small, detection is much more difficult. Therefore, smoking in the food service workplace poses a greater risk to food safety than other non-compliant behaviors, thus urgently requiring a precise identification method for supervision.
[0003] Currently, the detection technologies for smoking behavior are mainly divided into three categories:
[0004] 1. Detection based on third-party hardware devices such as sensors. Common methods include using smoke sensors and infrared cameras to monitor smoke and fire generated by smoking and outputting alarm information. This type of solution requires additional physical equipment deployment in specific locations, adding extra burden in terms of cost and equipment maintenance. Furthermore, the sensors require a sufficient concentration of smoke to trigger a response, which is difficult to achieve with cigarette smoke. Moreover, the high temperature and humidity environment in kitchens, often accompanied by open flames and smoke from cooking, can severely interfere with detection.
[0005] 2. AI-based target detection methods based on single images are used to detect and identify cigarette targets or smoke ignition targets. A common approach involves extracting frames from the surveillance camera video stream and using target detection technology on the extracted frames to identify cigarette or smoke targets and trigger an alarm. This type of solution is simple to deploy, runs quickly, and is highly flexible. However, because cigarette and smoke targets are very small and the kitchen background space is complex, detection is difficult, prone to false positives and false negatives, resulting in low performance. Furthermore, detecting cigarettes alone is insufficient to capture images of people smoking in progress or fixed locations.
[0006] 3. A joint detection method for human key points and cigarettes based on video streams. This commonly involves using target detection technology to detect key points on a person's hands and mouth, as well as cigarettes, in frame-by-frame images of the surveillance video. The positional relationship of these three elements determines whether smoking has occurred. Simultaneously, preceding and following frames are used to confirm and fixate the smoking behavior. This type of solution offers high detection accuracy and can stably output alarm images when smoking occurs. However, its limitations include: it cannot detect smoking when the target person is not holding a cigarette (e.g., with a cigarette in their mouth); it detects a large number of targets, resulting in slow operation in densely populated scenes; and it is significantly affected by angle, occlusion, and image clarity, making it prone to missed detections. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to provide a method for detecting and recognizing human behavior, which addresses the shortcomings of the existing technology.
[0008] To solve the above-mentioned technical problems, the present invention provides a method for detecting and recognizing human behavior, which specifically includes the following steps:
[0009] Acquire video stream data and extract single-frame images from it as input images;
[0010] Perform head detection on the input image and output the cropped head image;
[0011] Train a behavior recognition model to identify human head images and obtain behavioral information of the people in each human head image;
[0012] The behavioral information includes at least one of the probability of a specific behavior occurring and the probability of the existence of the behavioral object;
[0013] Set judgment thresholds for personnel behavior information; if the threshold is exceeded, the behavior is judged to have occurred.
[0014] As one possible implementation, further, the step of training the behavior recognition model to recognize head images and obtain the behavior information of the person in each head image specifically includes:
[0015] An attention module was added to the ResNet 18 network, which was then improved to become the SEResNet 18 network.
[0016] The SEResNet 18 network was pre-trained using the training set;
[0017] Add an action object detection branch to the fully connected layer of the SEResNet 18 network;
[0018] The behavior recognition and classification network is obtained by adding the calibrated behavior object coordinates to the training set and retraining the SEResNet 18 network.
[0019] As one possible implementation, the step of training the behavior recognition model to recognize head images and obtain behavioral information of the person in each head image further includes:
[0020] Introducing the IoU loss function for training:
[0021] Where IOUloss is the IOU loss function; ln is the natural logarithm; BOX1 and BOX2 are bounding boxes; intersection is the intersection ∩, representing the overlapping area of the two bounding boxes; and union is the union ∪, representing the area covered by the two bounding boxes together.
[0022] As one possible implementation, the step of performing head detection on the input image and outputting the cropped head image specifically includes:
[0023] The YOLO-X algorithm was used to pre-train the pre-detector using an open-source dataset;
[0024] The pre-detector is trained using a local multi-scene head training set to obtain the head detector;
[0025] The input image is used to input a head detector, and the output is the coordinates and confidence score of the head image.
[0026] The confidence level is compared with a preset threshold, and the images of heads with confidence levels higher than the threshold and their coordinates are output based on the coordinates.
[0027] As one possible implementation, obtaining the preset threshold specifically includes the following steps:
[0028] Filter out detection results with small pixels, setting it to remove results smaller than n*n pixels;
[0029] Filter out test results with low confidence levels, and remove results with a confidence level below 0.6.
[0030] As one possible implementation, the method further includes the following step: identifying and alarming specific behaviors in the video stream time sequence; specifically:
[0031] Store the current frame and the extracted frames of the next K consecutive frames, and save the corresponding specific behavior recognition output results;
[0032] When more than I frames are identified as having a specific behavior, a specific behavior alarm is output, and a continuous image is returned, highlighting the person whose specific behavior occurred based on their head coordinates.
[0033] As one possible implementation, the selectable value range of I is [K / 2, K-1]; the selectable value range of K is [5, 20].
[0034] A personnel behavior detection and recognition system, specifically comprising:
[0035] The image acquisition module includes a camera covering the monitored area for capturing video streams;
[0036] The image processing module uses terminal hardware decoding and interval frame extraction to acquire images from the video stream of the image acquisition module;
[0037] The head detection module is used to detect human heads in the images acquired by the image processing module, obtain the coordinates and confidence scores of the human head images, and output the images and coordinates of human heads with confidence scores higher than the threshold based on the coordinates.
[0038] The smoking recognition module identifies smoking behavior from the head image input by the head detection module and outputs the confidence score of the smoking behavior occurrence, cigarette coordinates, and detection confidence score.
[0039] The output module is used to uniformly manage the threshold settings of the head detection module and the smoking detection module;
[0040] The video stream time-series smoking behavior recognition module is used to store the current frame and the subsequent K consecutive frames of the frame image, save the corresponding specific behavior recognition output results, and output a specific behavior alarm when more than I frames are identified as having occurred.
[0041] The present invention adopts the above technical solution and has the following beneficial effects:
[0042] 1. This solution can adapt to complex indoor scenes and eliminate the influence of background smoke, firelight and other interfering factors.
[0043] 2. This solution can trigger an alarm for various smoking behaviors, including holding a cigarette in one's hand and having a cigarette in one's mouth, and is not limited by the person's actions or state.
[0044] 3. Utilizing the timing information of video streams can reduce false detections and enhance the accuracy of smoking recognition, while also capturing images of when smoking occurs.
[0045] 4. A joint judgment method based on head image-based smoking recognition and cigarette detection is adopted. Head detection technology based on original surveillance images is mature, easy to implement, and effective. Simultaneously, detecting cigarettes based on head image regions narrows the detection range, solving the problem of cigarettes being too small to detect relative to the entire image. Combining head image-based smoking recognition and cigarette detection effectively complements each other, increasing the accuracy of recognition. In summary, this method simplifies detection difficulty, controls the number of objects to be detected, and improves the accuracy of smoking recognition.
[0046] 5. Utilizing cameras and terminal computing devices, this system effectively leverages existing surveillance equipment. A single computing terminal can support multiple monitoring channels, resulting in high cost-effectiveness. Furthermore, the head detection module can be reused in conjunction with algorithms for mask recognition, safety helmet recognition, etc., offering flexible deployment and strong scalability. Attached Figure Description
[0047] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0048] Figure 1 This is a schematic diagram of part of the method of an embodiment of the present invention;
[0049] Figure 2 This is a schematic diagram of part of the system process in an embodiment of the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0051] Example 1
[0052] This invention provides a method for detecting and recognizing human behavior, which specifically includes the following steps:
[0053] Acquire video stream data and extract single-frame images from it as input images;
[0054] Perform head detection on the input image and output the cropped head image;
[0055] Train a behavior recognition model to identify human head images and obtain behavioral information of the people in each human head image;
[0056] The behavioral information includes at least one of the probability of a specific behavior occurring and the probability of the existence of the behavioral object;
[0057] Set judgment thresholds for personnel behavior information; if the threshold is exceeded, the behavior is judged to have occurred.
[0058] As one possible implementation, further, the step of training the behavior recognition model to recognize head images and obtain the behavior information of the person in each head image specifically includes:
[0059] An attention module was added to the ResNet 18 network, which was then improved to become the SEResNet 18 network.
[0060] The SEResNet 18 network was pre-trained using the training set;
[0061] Add an action object detection branch to the fully connected layer of the SEResNet 18 network;
[0062] The behavior recognition and classification network is obtained by adding the calibrated behavior object coordinates to the training set and retraining the SEResNet 18 network.
[0063] As one possible implementation, the step of training the behavior recognition model to recognize head images and obtain behavioral information of the person in each head image further includes:
[0064] Introducing the IoU loss function for training:
[0065] Where IOUloss is the IOU loss function; ln is the natural logarithm; BOX1 and BOX2 are bounding boxes; intersection is the intersection ∩, representing the overlapping area of the two bounding boxes; and union is the union ∪, representing the area covered by the two bounding boxes together.
[0066] As one possible implementation, the step of performing head detection on the input image and outputting the cropped head image specifically includes:
[0067] The YOLO-X algorithm was used to pre-train the pre-detector using an open-source dataset;
[0068] The pre-detector is trained using a local multi-scene head training set to obtain the head detector;
[0069] The input image is used to input a head detector, and the output is the coordinates and confidence score of the head image.
[0070] The confidence level is compared with a preset threshold, and the images of heads with confidence levels higher than the threshold and their coordinates are output based on the coordinates.
[0071] As one possible implementation, obtaining the preset threshold specifically includes the following steps:
[0072] Filter out detection results with small pixels, setting it to remove results smaller than n*n pixels;
[0073] Filter out test results with low confidence levels, and remove results with a confidence level below 0.6.
[0074] As one possible implementation, the method further includes the following step: identifying and alarming specific behaviors in the video stream time sequence; specifically:
[0075] Store the current frame and the extracted frames of the next K consecutive frames, and save the corresponding specific behavior recognition output results;
[0076] When more than I frames are identified as having a specific behavior, a specific behavior alarm is output, and a continuous image is returned, highlighting the person whose specific behavior occurred based on their head coordinates.
[0077] As one possible implementation, the selectable value range of I is [K / 2, K-1]; the selectable value range of K is [5, 20].
[0078] A personnel behavior detection and recognition system, specifically comprising:
[0079] The image acquisition module includes a camera covering the monitored area for capturing video streams;
[0080] The image processing module uses terminal hardware decoding and interval frame extraction to acquire images from the video stream of the image acquisition module;
[0081] The head detection module is used to detect human heads in the images acquired by the image processing module, obtain the coordinates and confidence scores of the human head images, and output the images and coordinates of human heads with confidence scores higher than the threshold based on the coordinates.
[0082] The smoking recognition module identifies smoking behavior from the head image input by the head detection module and outputs the confidence score of the smoking behavior occurrence, cigarette coordinates, and detection confidence score.
[0083] The output module is used to uniformly manage the threshold settings of the head detection module and the smoking detection module;
[0084] The video stream time-series smoking behavior recognition module is used to store the current frame and the subsequent K consecutive frames of the frame image, save the corresponding specific behavior recognition output results, and output a specific behavior alarm when more than I frames are identified as having occurred.
[0085] Example 2
[0086] A video stream-based method and system for detecting and identifying smoking behavior by personnel is provided. This system detects and identifies smoking behavior in monitored areas such as kitchens and outputs an alarm graph showing the smoking behavior. The implementation logic of this system is as follows:
[0087] Image acquisition module: A camera is installed in the area to be monitored to acquire video stream data;
[0088] Image processing module: decodes the video stream, extracts frames according to preset rules, obtains single-frame images, and uniformly scales them to a fixed size for output;
[0089] Head detection module: Trains a head detection model to detect images input from the image processing module, obtains the position coordinates and probability of each head in the image, and outputs the head image by enlarging and cropping it according to a fixed ratio based on the position coordinates when the probability is greater than a set threshold.
[0090] Smoking Recognition Module: Trains a smoking recognition model to identify head images input from the head detection module, obtaining the probability of a person smoking in each image, as well as the probability and location coordinates of a cigarette in each head image;
[0091] The discrimination output module: This section sets the thresholds for head detection and smoking recognition. It also combines the smoking recognition results from the smoking recognition module with the cigarette detection results to determine the individual's smoking behavior.
[0092] Video stream time-series smoking behavior recognition module: It obtains smoking recognition results through video stream time-series information. For the frame images of smoking behavior from the discrimination output module, it stores the subsequent K frames according to the frame sampling frequency to recognize the occurrence of smoking behavior. If the number of frames judged by recognition is I, then when I:K exceeds a fixed ratio, a smoking alarm is output, and continuous images of people smoking behavior and time location are given.
[0093] The detailed technical aspects of this solution are described in detail below:
[0094] Image acquisition steps and modules:
[0095] The method relies on surveillance video stream data. Therefore, camera installation should ensure coverage of the monitored area, provide clear images of people's heads, and cover as many angles as possible. In kitchen scenarios, cameras deployed through open kitchen projects can be used to collect video streams. Due to the large amount of oil fumes in kitchens, camera lenses are prone to getting dirty and require regular cleaning and maintenance to maintain image clarity.
[0096] Image processing steps and modules:
[0097] For the acquired surveillance video stream, the method employs terminal hardware decoding and interval frame extraction to obtain images. Generally, the frame extraction frequency is set to extract one frame every two frames to reduce resource consumption while ensuring image continuity. This project can also be configured according to specific requirements. For the acquired images, the longer side is scaled to 960 pixels, and the shorter side is scaled proportionally, serving as the input image to accelerate algorithm processing.
[0098] Head detection steps and modules:
[0099] The head detection algorithm uses the YOLO-X algorithm as a baseline. Detector D is pre-trained on the MSCOCO 2017 open-source dataset and then fine-tuned on a local multi-scene head training set to obtain head detector D′. It detects heads in input images, obtains head image coordinates and confidence scores, and outputs images and coordinates of heads with confidence scores above a threshold. The threshold is set using the following guidelines:
[0100] To ensure the quality of the output head image, excessively small detection results will be filtered out. The selectable range can be freely set within the image pixel range. Generally, the method is set to remove results smaller than 15*15 pixels.
[0101] To ensure the accuracy of the output head detection, detection results with low confidence are filtered out. The selectable range can be freely set between 0 and 0.99. Generally, the method is set to remove results with a confidence level below 0.6.
[0102] For the obtained head coordinates, the module will enlarge them by a factor of one from the center of the input image to include the smoking behavior in the background within the head image. If the enlarged head image coordinates exceed the pixel boundaries of the input image, the excess area will be filled with black pixels. The head image will then be scaled proportionally to 96*96 pixels, and any insufficient areas will be filled with black pixels. Finally, the head image and its corresponding confidence score will be output.
[0103] Smoking detection steps and modules:
[0104] The smoking recognition algorithm uses ResNet18 as the baseline and is trained using a classifier approach to identify smoking behavior from input head images. To improve accuracy and recall, this method improves the model network by incorporating a channel attention mechanism and a cigarette detection module. Channel attention makes the model more sensitive to features near the mouth, enhancing its ability to recognize smoking behavior. Detecting cigarettes based on the head image reduces the detection range and simultaneously improves the robustness and accuracy of the smoking recognition model. The improved algorithm is used to identify smoking behavior, obtaining image-based confidence scores, cigarette coordinates, and detection confidence scores, with the final output being the results.
[0105] Preferably, the training process of this algorithm is as follows:
[0106] This paper improves upon the ResNet 18 network by adding a channel attention mechanism, resulting in the SEResNet 18 network. Channel attention (Squeeze-and-Excitation, SE) helps the model better focus on features of the target region while downplaying unimportant background features. In this method, the SE module helps the model focus on features near the mouth, making it more sensitive to smoking behavior and increasing classification accuracy. The SE module typically consists of a Squeeze operation and an Excitation operation. Features in convolutional neural networks iterate in local space, leading to weak correlation of global information and a lack of extra attention to key regions. The Squeeze operation uses global average pooling to extract spatial features from different channels in the network, abstracting them into a global receptive field. The Excitation operation learns the nonlinear transformation between different channels through two layers of a multi-layer perceptron (MLP). Finally, a sigmoid function activation is used to strengthen important feature maps and weaken secondary feature maps, essentially performing a channel weighting operation, allowing the model to focus on feature changes in key recognition areas.
[0107] By adding an SE module to each residual structure of the ResNet network to implement channel attention, it is improved into the SEResNet18 network.
[0108] The smoking recognition algorithm trained solely on the SEResNet18 network achieves high accuracy in identifying handheld cigarettes. However, when smoking without holding the cigarette, the features near the mouth show little change, and the cigarette blends closely with the background, resulting in low recall. To improve this, this method adds a cigarette detection branch to the SEResNet18 network. Since the size of the cigarette is sufficiently clear in head images, cigarette detection is used to assist in determining smoking behavior. Manually labeled cigarette location coordinates are added to the training data, and regression training is performed using the SEResNet18 convolutional neural network. A branch for cigarette location and confidence output is added to the fully connected layers of the network, and an IoU loss function is introduced for training. IoU is the union ratio of the intersection of the true predicted bounding box and the manually labeled bounding box; a higher IoU indicates more accurate prediction of the cigarette location. Specifically, considering that the algorithm focuses on the smoking behavior that is in progress, at which time the cigarette is usually located near the mouth, that is, in the lower middle part of the head image, the idea of the YOLO algorithm is introduced: the input head image is divided into a 6*6 grid in the network, and the regression training of cigarette coordinates is only performed on the lower 4*6 grid to further narrow the range of cigarette detection and enhance the accuracy of cigarette detection.
[0109] The improved SEResNet18 network, developed using the above method, possesses both smoking recognition and cigarette detection capabilities. Utilizing the open-source smoking vs. non-smoking training set, a smoking classifier C was pre-trained using a SEResNet18 network without a cigarette detection module, and its parameter weights were initialized. On a local smoking recognition training set, video data of people smoking in various indoor and outdoor scenarios, including kitchens, supermarkets, schools, office buildings, corridors, roadsides, and construction sites, were collected. Specifically, videos of actions such as drinking water, eating snacks, covering the mouth, and picking teeth were artificially added, spanning 1-3 months and encompassing different distances, resolutions, angles, weather conditions, and lighting environments.
[0110] For data annotation, a head detector D′ is used to pre-annotate the local data for heads, and a pre-trained classifier C is used to pre-annotate the local data for smoking identification. These annotations are then adjusted by the annotators. For images showing smoking behavior, the coordinates of the cigarette positions in the images are manually annotated, and the cigarette position coordinates are converted into the corresponding head coordinates. The images of non-smoking heads and images of smoking heads with cigarette coordinates are then cropped to construct the training and test sets.
[0111] Multiple data augmentation methods, such as cropping, mosaicking, Gaussian blurring, horizontal flipping, and color gamut transformation, were employed to enhance the model's generalization ability. The model was trained using head images with and without cigarette coordinates, and finally, a smoking recognition classifier C′ with cigarette detection functionality was trained and fine-tuned.
[0112] The steps and modules for determining the output are as follows:
[0113] This module manages the threshold settings for both head detection and smoking detection modules. Specifically, the threshold settings for the smoking detection module are as follows:
[0114] Smoking is considered to have occurred when the probability of smoking occurs is greater than the threshold of 0.6 and the confidence level for cigarette detection is greater than the threshold of 0.2. The probability threshold for smoking can be freely set between 0.34 and 0.99, and the confidence level threshold for cigarette detection can be freely set between 0 and 0.3.
[0115] When the confidence level for cigarette detection is greater than the threshold of 0.7, smoking is considered to have occurred. The threshold can be freely set between 0.50 and 0.99 depending on the scenario.
[0116] When the output of the smoking detection module meets the threshold requirements, it is determined that smoking has occurred, and the alarm judgment, the head position coordinates of the person who smoked, and the confidence level of the smoking behavior are output.
[0117] Video stream temporal smoking behavior recognition steps and modules:
[0118] In real-world monitoring scenarios, smoking detection algorithms may misjudge single-frame images due to factors such as human body movements, background obstruction, and interference from other objects. Smoking typically lasts for several seconds at a time. To ensure alarm reliability, this module proposes incorporating timing information from the monitoring video stream for judgment. This module sets up a register to store the current frame and K consecutive subsequent frames, while also saving the corresponding smoking detection output. When more than I frames are identified as smoking by the detection module, this module outputs a smoking alarm to the user and returns a continuous image, highlighting the person smoking based on their head coordinates. Generally, I = K / 2, with a selectable value range of [K / 2, K-1]; K = 5, with a selectable value range of [5, 20].
[0119] The above description is an embodiment of the present invention. For those skilled in the art, any equivalent changes, modifications, substitutions and variations made in accordance with the teachings of the present invention without departing from the principles and spirit of the present invention should be covered by the present invention.
Claims
1. A method for detecting and recognizing human behavior, characterized in that, Specifically, the steps include the following: Acquire video stream data and extract single-frame images from it as input images; Perform head detection on the input image and output the cropped head image; Train a behavior recognition model to identify human head images and obtain behavioral information of the people in each human head image; The behavioral information includes at least one of the probability of smoking and the probability of the presence of a cigarette object. Set judgment thresholds for personnel behavior information; if the threshold is exceeded, the behavior is judged to have occurred. The specific steps of training the behavior recognition model to identify human head images and obtain behavioral information of the person in each head image include: An attention module was added to the ResNet 18 network, which was then improved to become the SEResNet 18 network. The SEResNet 18 network was pre-trained using the training set; Manually calibrated cigarette object location coordinates are added to the training data, and regression training is performed using the SEResNet18 convolutional neural network. The location and confidence output branches of the cigarette object are added to the fully connected layer of the network. At the same time, the IoU loss function is introduced for training. The IoU is the intersection and union ratio of the true predicted box and the manually calibrated box. The higher the IoU, the more accurate the model predicts the cigarette location.
2. The method for detecting and recognizing human behavior according to claim 1, characterized in that: The step of training the behavior recognition model to identify human head images and obtain the behavior information of the person in each human head image further includes: Introducing the IoU loss function for training: , Where IOUloss is the IOU loss function; ln is the natural logarithm; BOX1 and BOX2 are bounding boxes; intersection is the intersection ∩, representing the overlapping area of the two bounding boxes; and union is the union ∪, representing the area covered by the two bounding boxes together.
3. The method for detecting and recognizing human behavior according to claim 1, characterized in that: The steps of performing head detection on the input image and outputting the cropped head image specifically include: The YOLO-X algorithm was used to pre-train the pre-detector using an open-source dataset; The pre-detector is trained using a local multi-scene head training set to obtain the head detector; The input image is used to input a head detector, and the output is the coordinates and confidence score of the head image. The confidence level is compared with a preset threshold, and the images of heads with confidence levels higher than the threshold and their coordinates are output based on the coordinates.
4. The method for detecting and recognizing human behavior according to claim 3, characterized in that: The acquisition of the preset threshold specifically includes the following steps: Filter out detection results with small pixels, setting it to remove results smaller than n*n pixels; Filter out test results with low confidence levels, and remove results with a confidence level below 0.
6.
5. The method for detecting and recognizing human behavior according to claim 1, characterized in that, It also includes the following steps: video stream time-series specific behavior recognition and alarm; specifically: Store the current frame and the extracted frames of the next K consecutive frames, and save the corresponding specific behavior recognition output results; When more than I frames are identified as having a specific behavior, a specific behavior alarm is output, and a continuous image is returned, highlighting the person whose specific behavior occurred based on their head coordinates.
6. The method for detecting and recognizing human behavior according to claim 5, characterized in that: The selectable value range of I is [K / 2, K-1]; the selectable value range of K is [5, 20].
7. A personnel behavior detection and recognition system, which applies the personnel behavior detection and recognition method as described in claim 1, characterized in that, Specifically, it includes: The image acquisition module includes a camera covering the monitored area for capturing video streams; The image processing module uses terminal hardware decoding and interval frame extraction to acquire images from the video stream of the image acquisition module; The head detection module is used to detect human heads in the images acquired by the image processing module, obtain the coordinates and confidence scores of the human head images, and output the images and coordinates of human heads with confidence scores higher than the threshold based on the coordinates. The smoking recognition module identifies smoking behavior from the head image input by the head detection module and outputs the confidence score of the smoking behavior occurrence, cigarette coordinates, and detection confidence score. The output module is used to uniformly manage the threshold settings of the head detection module and the smoking detection module; The video stream time-series smoking behavior recognition module is used to store the current frame and the subsequent K consecutive frames of the frame image, save the corresponding specific behavior recognition output results, and output a specific behavior alarm when more than I frames are identified as having occurred.
Citation Information
Patent Citations
Image sensitive content identification method and system based on weak detection mechanism
CN111860545A
Gas station smoking and calling detection method and system based on deep learning
CN114387557A
Smoking behavior detection method, system and device
CN115205767A