Light smoking detection method and system
By building a lightweight smoking detection model and utilizing the DW-CSP-Net and PANet networks, the problems of the existing smoking detection algorithms being complex, computationally intensive, and costly are resolved. This enables smoking detection with lower computational complexity and parameter counts, reducing the loss and cost of hardware equipment.
Patent Information
- Application Number
- CN202210945760.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-08
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-08-08
AI Technical Summary
Existing smoking detection algorithms are complex, computationally intensive, and costly, resulting in high performance requirements and high costs for hardware equipment.
The DW-CSP-Net residual network, which integrates the depthwise separable convolutional network DW and the cross-stage local network CSPNet, is used as the backbone feature extraction network. Combined with the path aggregation network PANet and the multi-scale feature extraction network of DW-CSP-Net, a lightweight smoking detection model is constructed. The image is processed by random rotation, distortion, scaling and mosaic data augmentation to reduce the amount of computation and parameters.
It achieves lightweight smoking detection, reduces the computing cost and loss of hardware equipment, while maintaining high detection accuracy and wide applicability.
Smart Images

Figure CN115240118B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image detection technology, and in particular to a light smoking detection method and system. Background Art
[0002] Smoking in public places is not only harmful to one's own health, but also affects the health of others, especially the elderly, children and those who are allergic to tobacco.
[0003] Supervision and control will be implemented in inappropriate places such as internet cafes, waiting rooms, and forest areas. Currently, the supervision of smoking behavior mainly relies on manual inspections or video surveillance. This supervision model consumes a lot of labor costs and has a high risk of missed detections.
[0004] In recent years, with the emergence of large-scale data samples and high-performance hardware, artificial intelligence (AI) has rapidly developed. Using AI to automatically detect smoking behavior can effectively replace traditional detection methods. Furthermore, AI-based automated detection technology enables seamless 24-hour monitoring with a low rate of missed detection, effectively regulating citizens' smoking behavior. This is particularly true for large, flammable areas like forests, where it can effectively mitigate the shortcomings of manual inspections and reduce safety incidents caused by smoking.
[0005] However, considering that long-term smoking detection will occupy a large amount of hardware memory, and the existing smoking detection algorithm is complex and computationally intensive, it is easy to cause damage to the hardware equipment. Therefore, the performance requirements of the hardware equipment are high, and the cost of implementing smoking detection is high. Summary of the Invention
[0006] To address the above-mentioned deficiencies in the prior art, the present invention provides a light smoking detection method and system, which solves the problems of complex, computationally intensive, and costly existing smoking detection algorithms, thereby achieving lightweight smoking detection.
[0007] In a first aspect, the present disclosure provides a method for detecting light smoking:
[0008] A light smoking detection method comprising:
[0009] Acquire a number of smoking images showing smoking behaviors and pre-process the smoking images;
[0010] Labeling smoking behaviors in smoking images, using a number of labeled smoking images as training sample sets, and training a preset smoking detection model; wherein the preset smoking detection model is constructed by: building a backbone feature extraction network; building a multi-scale feature extraction network; and splicing the built backbone feature extraction network with the multi-scale feature extraction network to obtain the preset smoking detection model;
[0011] Acquire surveillance video frames in real time and use the trained smoking detection model to determine whether there is smoking behavior in the video frames.
[0012] A further technical solution is to pre-process the smoking image, including:
[0013] First, the smoking image is randomly rotated, distorted, and scaled;
[0014] Secondly, Mosaic data enhancement technology is used to process smoking images;
[0015] Finally, the smoking images are normalized to the same size.
[0016] A further technical solution is to use a labeling tool to label the smoking behavior in the preprocessed smoking image. Among them, five parameters are used to determine all smoking behaviors, namely: category parameter, target center coordinate parameter, and target width and height parameter.
[0017] A further technical solution is that the backbone feature extraction network is a DW-CSP-Net residual network that integrates the deep separable convolutional network DW and the cross-stage local network CSPNet. The residual network adopts a dual-channel feature transfer network. In channel one, convolution is used to reduce the number of channels by half; in channel two, convolution is first used to reduce the number of channels by half, and then deep separable convolution is used to operate on the input image to extract the image smoking features; the output features obtained from the two channels are connected to obtain the feature map output by the residual network.
[0018] A further technical solution is that the multi-scale feature extraction network is a fusion path aggregation network PANet and a DW-CSP-Net network, which adopts a top-down and bottom-up dual-path feature fusion method to output a multi-scale feature map.
[0019] In a second aspect, the present disclosure provides a light smoking detection system, comprising:
[0020] a smoking image preprocessing module, used to obtain a number of smoking images showing smoking behaviors and preprocess the smoking images;
[0021] The smoking detection model training module is used to label smoking behaviors in smoking images and use a number of labeled smoking images as training sample sets to train a preset smoking detection model. The preset smoking detection model is constructed by: building a backbone feature extraction network; building a multi-scale feature extraction network; and combining the built backbone feature extraction network with the multi-scale feature extraction network to obtain the preset smoking detection model.
[0022] The smoking detection module is used to obtain surveillance video frames in real time and use the trained smoking detection model to determine whether smoking behavior occurs in the video frames.
[0023] A further technical solution is that the backbone feature extraction network is a DW-CSP-Net residual network that integrates the deep separable convolutional network DW and the cross-stage local network CSPNet. The residual network adopts a dual-channel feature transfer network. In channel one, convolution is used to reduce the number of channels by half; in channel two, convolution is first used to reduce the number of channels by half, and then deep separable convolution is used to operate on the input image to extract the image smoking features; the output features obtained from the two channels are connected to obtain the feature map output by the residual network.
[0024] A further technical solution is that the multi-scale feature extraction network is a fusion path aggregation network PANet and a DW-CSP-Net network, which adopts a top-down and bottom-up dual-path feature fusion method to output a multi-scale feature map.
[0025] In a third aspect, the present disclosure further provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the steps of the method described in the first aspect are completed.
[0026] In a fourth aspect, the present disclosure further provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps of the method described in the first aspect.
[0027] One or more of the above technical solutions have the following beneficial effects:
[0028] The present invention provides a method and system for detecting light smoking. By constructing a light smoking detection model, namely, using a DW-CSP-Net residual network that fuses a deep separable convolutional network (DW) and a cross-stage local network (CSPNet) as the backbone feature extraction network, and a network that fuses a path aggregation network (PANet) and DW-CSP-Net as the multi-scale feature extraction network, the present invention achieves lower computational complexity and parameter requirements for smoking detection, reduces hardware equipment loss, and solves the problems of existing smoking detection algorithms such as complexity, high computational complexity, and high cost, thereby realizing lightweight smoking detection with wide applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0030] Figure 1This is a flow chart of the light smoking detection method according to the first embodiment of the present invention;
[0031] Figure 2 The network structure of the backbone feature extraction network of the smoking detection model in the method described in Example 1 of the present invention;
[0032] Figure 3 The network structure of the multi-scale feature extraction network of the smoking detection model in the method described in Example 1 of the present invention;
[0033] Figure 4 The comparison results of the smoking detection algorithm in the method described in Example 1 of the present invention with the YOLO v3 algorithm and the YOLO v51 algorithm in terms of mAP0.5 indicator are shown;
[0034] Figure 5 The comparison results of the smoking detection algorithm in the method described in Example 1 of the present invention with the YOLO v3 algorithm and the YOLO v51 algorithm in terms of mAP0.5:0.95 indicators. DETAILED DESCRIPTION
[0035] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0036] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0037] Example 1
[0038] This embodiment provides a method for detecting light smoking. Figure 1 As shown, including:
[0039] Acquire a number of smoking images showing smoking behaviors and pre-process the smoking images;
[0040] Label the smoking behavior in the smoking images, use several labeled smoking images as training sample sets, and train the preset smoking detection model;
[0041] Acquire surveillance video frames in real time and use the trained smoking detection model to determine whether there is smoking behavior in the video frames.
[0042] In this embodiment, 5,700 smoking images showing smoking behaviors are first obtained. These smoking images are all color images stored in JPG format. These color smoking images are preprocessed using traditional image processing techniques and Mosaic data enhancement techniques to improve the quality of the smoking images and increase the image reading speed. Specifically, the following steps are performed:
[0043] First, existing image processing techniques are used to process smoking images, where the image processing techniques include but are not limited to random rotation, distortion, scaling, etc., to enhance the quality of the dataset and improve the generalization ability of the model. Second, Mosaic data augmentation technology is used to process smoking images to improve the reading speed of smoking images. Finally, the smoking images are normalized to the same size. In this embodiment, the smoking images are normalized to a 416×416 format to facilitate subsequent unified processing.
[0044] Afterwards, a labeling tool was used to label the smoking behavior in the preprocessed smoking images. The word "smoke" was annotated in the upper left corner of the image, and the smoking behavior was outlined with a square frame. Five parameters were used to determine the smoking behavior: category, target center coordinates (x, y), and target width and height (w, h). The target center coordinates and width and height were determined relative to the entire image. The label file for the smoking image data was converted to a txt format and stored. Several labeled smoking images were used as training samples to train the pre-set smoking detection model.
[0045] As another implementation, 10% of the smoking images are selected to form a validation set, 10% of the smoking images are selected to form a test set, and 80% of the smoking images are selected to form a training set. A labeling tool is used to label the smoking behavior in the smoking images in the training set, and the training set is used to train the preset smoking detection model.
[0046] The construction process of the above-mentioned preset smoking detection model specifically includes:
[0047] Build a backbone feature extraction network;
[0048] Build a multi-scale feature extraction network;
[0049] The constructed backbone feature extraction network is spliced with the constructed multi-scale feature extraction network, and the spliced network is trained using the training sample set to obtain the final converged network model.
[0050] The smoking detection algorithm in the existing technology usually adopts the YOLO v3 network structure, and the YOLO v3 network structure includes a backbone feature extraction network and a multi-scale feature extraction network.
[0051] In the YOLO v3 network architecture, the Darknet53 backbone feature extraction network is a massive structure, consisting of 53 traditional convolutional modules stacked with 23 residual networks. As the network deepens, image gradient information gradually disappears. To address this, Darknet53 employs a skip-connected DW-CSP-Net residual network. Within this residual network, a stacking strategy of residual blocks in a "1, 2, 8, 8, 4" pattern is employed. Each residual network is connected via 3x3 downsampling, gradually reducing image size and increasing the receptive field.
[0052] Taking into account the large number of stacking of the above-mentioned residual blocks leads to complex computational costs and memory usage, in order to further reduce the computational cost of the backbone network, in this embodiment, the DW-CSP-Net residual network is optimized and improved, and a fusion of a deep separable convolutional network and a cross-stage local network CSPNet is adopted to form a new DW-CSP-Net residual network. To address the problem of excessive computational complexity caused by traditional convolution, this embodiment adopts deep separable convolution instead of traditional convolution, effectively reducing the computational cost of the model; CSPNet is used to divert the gradient information of the backbone network, so that only a part of the channels participate in the calculation of the residual network, and the gradient information of the dual channels ensures the differentiated characteristics of the gradient information, effectively improving the generalization ability of the network.
[0053] like Figure 2As shown, a smoking image marked with smoking behavior is input into the backbone feature extraction network, where Cx represents the number of input channels, H and W represent the height and width of the smoking image, and Cx, H and W represent the input feature map. In this embodiment, the backbone feature extraction network adopts the above-mentioned novel DW-CSP-Net residual network. The DW-CSP-Net residual network adopts a dual-channel feature transfer network. In channel one, a 1x1 convolution is used to reduce the number of channels by half. Conv(Cx, Cy / / 2,1,1) represents a convolution operation, where the parameters represent (input channel number, output channel number, convolution kernel size, step size), and Cy / / 2 means that the output channel number is halved; in channel two, a 1x1 convolution is first used to reduce the number of channels by half. Secondly, in order to reduce the computational cost, a 3x3 depthwise separable convolution is used to operate on the input image to extract the image smoking features, where Conv(Cy,Cy / / 2,3,1)g=Cy / / 2 represents a depthwise separable convolution operation, where the depthwise separability metric is Cy / / 2. The output feature maps from the two channels are concatenated using the "concat" method, and the feature maps from channels 1 and 2 are concatenated in the channel direction to produce the feature map output by the DW-CSP-Net residual network. By varying the number of channels in the feature map through the aforementioned backbone feature extraction network, feature maps for different channels are obtained.
[0054] In addition, this embodiment abandons the original "1, 2, 8, 8, 4" residual block stacking method of the YOLO v3 network structure and adopts the "1, 2, 2, 2, 2" stacking method. Through the improved stacking method, the lightweight operation is achieved while ensuring little loss in the final recognition accuracy. The stacking refers to the repeated occurrence and sequential operation of the above-mentioned depth-wise separable convolution operation. For example, "1" represents Figure 2 The depthwise separable convolutional network in the dashed box in channel two is run once, and “2” indicates Figure 2 The network in the dotted box in channel 2 is repeated and run twice in sequence. This stacking method effectively reduces the computational cost of the model.
[0055] In the YOLO v3 network structure, the multi-scale feature extraction network Neck draws on the propagation concept of FPN. The FPN module channel fuses information of different scales and outputs multiple new feature maps. It uses high-level semantic information after passing through the top-down model to increase the resolution of the feature map, making it more effective for detecting small targets. In addition, the reverse optimization method (i.e., the backpropagation loss function) used by YOLOv3 mainly includes center coordinate prediction, confidence prediction, and classification prediction. Among them, the center coordinate prediction uses the Sigmoid function to limit the output value to between 0 and 1, which is conducive to the optimization of output parameters. The confidence prediction and classification prediction use binary cross entropy for backpropagation prediction.
[0056] In this embodiment, in order to further improve the effect of feature extraction and reduce the amount of calculation, Figure 3 As shown in the figure, for the multi-scale feature extraction network, the path aggregation network PANet and the DW-CSP-Net backbone network structure are integrated to form a lightweight multi-scale feature extraction network PAN-DCN-Net.
[0057] PAN-DCN-Net uses a dual-path feature fusion approach, top-down and bottom-up, to enhance the fusion of deep and shallow information and improve feature extraction. Instead of stacking a large number of traditional convolutions, PAN-DCN-Net uses a DW-CSP-Net network to replace redundant convolution operations.
[0058] Afterwards, the solution described in this embodiment still uses the YOLO v3 reverse optimization method to perform center coordinate prediction, confidence prediction, and classification prediction.
[0059] In this embodiment, the annotated image is input into the backbone feature extraction network, which outputs three feature maps F1, F2, and F3 of different channels. These three feature maps are then input into the multi-scale feature extraction network to obtain feature maps f1, f2, and f3 of different scales. Each grid in feature maps f1, f2, and f3 contains three prediction boxes, each with six channels. The first channel is the confidence prediction result, which is a probability value. Channels 2-5 are the center coordinate prediction results, which output the prediction box relative to the entire feature map. The sixth channel is the classification prediction result, which is also a probability value.
[0060] After the backbone feature extraction network and the multi-scale feature extraction network are built, the built backbone feature extraction network is spliced with the built multi-scale feature extraction network. That is, the multi-scale feature extraction network PAN-DCN-Net uses the 3rd, 4th, and 5th output feature maps of the backbone network as input. The output feature maps are different. After the convolution operation of PAN-DCN-Net, three detection feature maps are output. The feature maps include: a 13x13 scale feature map for detecting large targets, a 26x26 scale feature map for detecting medium targets, and a 52x52 scale feature map for detecting small targets.
[0061] The preset smoking detection model is trained based on the training sample set. Under the premise of ensuring that there is no overfitting or underfitting, the smoking detection model is fully trained until the loss function no longer converges. The optimal weight file is retained to complete the training.
[0062] In fact, the above-mentioned smoking detection model in this embodiment includes three parts: an input layer, an intermediate layer, and an output layer. The images in the training sample set are input into the input layer of the detection model. The intermediate layer includes a backbone network and a multi-scale feature extraction network. Among them, the backbone network stacks the DW-CSP-Net network structure. The multi-scale feature extraction network includes top-down and bottom-up feature fusion methods. Feature extraction is performed through the intermediate layer, and finally three feature maps of different scales are output at the output layer to determine whether the input training image contains smoking behavior and the probability of smoking behavior.
[0063] Finally, the surveillance video frames are acquired in real time, and the trained smoking detection model is used to determine whether there is smoking behavior in the video frames, and the probability of smoking behavior is output.
[0064] To fully demonstrate the effectiveness of the detection method described above in this embodiment, this embodiment trains the YOLO v3 algorithm and the YOLO v5 algorithm under the same experimental environment, and obtains the corresponding mAP0.5 (the value when the IoU threshold is greater than 0.5, the higher the value, that is, the larger the threshold, the lower the accuracy), mAP0.5:0.95 (the average mAP at different IoU thresholds, that is, from 0.5 to 0.95 with a step size of 0.05), and computational and parameter amount indicators (the lower the parameter and computational amount, the simpler the operation and the lower the computational cost) to prove the effectiveness of the improved solution proposed in this embodiment.
[0065] In order to demonstrate the superiority of the smoking detection algorithm described in this embodiment in terms of comprehensive performance, a comparative experiment was conducted on the detection effect and computational cost of the smoking detection algorithm, YOLOv3, and YOLOv51. The results are shown in Table 1 below. Figure 4 and Figure 5Analysis shows that the smoke detection algorithm proposed in this embodiment uses only 31.7% and 29.5% of the parameters and computational complexity of YOLOv3, respectively. The mAP0.5 performance index is improved by 1.0%, and the mAP0.5:0.95 performance index is reduced by only 2.2%. Compared to YOLOv5l, the parameters and computational complexity of the smoke detection algorithm proposed in this embodiment are only 42.3% and 42.4% of those of YOLOv5l. Furthermore, the detection performance of the smoke detection algorithm proposed in this embodiment significantly exceeds that of YOLOv5l, with mAP0.5 and mAP0.5:0.95 performance indexes improved by 3.3% and 0.3%, respectively. This experiment demonstrates that the smoke detection algorithm proposed in this embodiment has more technical effectiveness and can significantly reduce computational costs. At less than half the computational cost of existing algorithms, it maintains detection accuracy comparable to existing algorithms.
[0066] Table 1 Comparison of the detection effect and computational cost of the smoking detection algorithm described in this embodiment with YOLOv3 and YOLOv51
[0067]
[0068]
[0069] In summary, this embodiment provides a light smoking detection method that solves the problems of complex, computationally intensive, and costly existing smoking detection algorithms, thereby achieving lightweight smoking detection.
[0070] Example 2
[0071] This embodiment provides a light smoking detection system, including:
[0072] a smoking image preprocessing module, used to obtain a number of smoking images showing smoking behaviors and preprocess the smoking images;
[0073] The smoking detection model training module is used to label smoking behaviors in smoking images and use a number of labeled smoking images as training sample sets to train the preset smoking detection model;
[0074] The smoking detection module is used to obtain surveillance video frames in real time and use the trained smoking detection model to determine whether smoking behavior occurs in the video frames.
[0075] Furthermore, the construction process of the above-mentioned preset smoking detection model specifically includes:
[0076] Build a backbone feature extraction network;
[0077] Build a multi-scale feature extraction network;
[0078] The constructed backbone feature extraction network is spliced with the constructed multi-scale feature extraction network, and the spliced network is trained using the training sample set to obtain the final converged network model.
[0079] Example 3
[0080] This embodiment provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the light smoking detection method described above are completed.
[0081] Example 4
[0082] This embodiment further provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps in the light smoking detection method described above are completed.
[0083] The steps involved in the above embodiments 2 to 4 correspond to those in the method embodiment 1. For detailed implementation, please refer to the relevant description of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media that includes one or more instruction sets; it should also be understood to include any medium that can store, encode, or carry an instruction set for execution by a processor and cause the processor to perform any method of the present invention.
[0084] Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computer device. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0085] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
[0086] Although the above describes the specific embodiments of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without any creative work are still within the scope of protection of the present invention.
Claims
1. A method for detecting light smoking, characterized in that: include: Acquire a number of smoking images showing smoking behaviors and pre-process the smoking images; Labeling smoking behaviors in smoking images, using a number of labeled smoking images as training sample sets, and training a preset smoking detection model; wherein the preset smoking detection model is constructed by: building a backbone feature extraction network; building a multi-scale feature extraction network; and splicing the built backbone feature extraction network with the multi-scale feature extraction network to obtain the preset smoking detection model; Acquire surveillance video frames in real time and use the trained smoking detection model to determine whether smoking behavior exists in the video frames; Among them, the backbone feature extraction network is a DW-CSP-Net residual network that integrates the deep separable convolutional network DW and the cross-stage local network CSPNet; The residual network adopts a dual-channel feature transfer network. In channel one, convolution is used to reduce the number of channels by half. In channel two, convolution is first used to reduce the number of channels by half, and then depthwise separable convolution is used to operate on the input image to extract the smoking features of the image. The output features obtained from the two channels are connected to obtain the feature map output by the residual network. The residual network adopts the residual block stacking mode of "1, 2, 2, 2, 2", where "1" means that the depthwise separable convolutional network in channel 2 is run once, and "2" means that the depthwise separable convolutional network in channel 2 is repeated and run twice in sequence; The multi-scale feature extraction network is a fusion path aggregation network PANet and a DW-CSP-Net network. The network adopts a top-down and bottom-up dual-path feature fusion method to output a multi-scale feature map.
2. A light smoking detection method according to claim 1, characterized in that: Preprocess the smoking image, including: First, the smoking image is randomly rotated, distorted, and scaled; Secondly, Mosaic data enhancement technology is used to process smoking images; Finally, the smoking images are normalized to the same size.
3. A light smoking detection method according to claim 1, characterized in that: The labeling tool is used to label the smoking behavior in the preprocessed smoking image. For all smoking behaviors, five parameters are used to determine the label, which are: category parameter, target center coordinate parameter, and target width and height parameter.
4. A light smoking detection system, characterized in that: include: a smoking image preprocessing module, used to obtain a number of smoking images showing smoking behaviors and preprocess the smoking images; The smoking detection model training module is used to label smoking behaviors in smoking images and use a number of labeled smoking images as training sample sets to train a preset smoking detection model. The preset smoking detection model is constructed by: building a backbone feature extraction network; building a multi-scale feature extraction network; and combining the built backbone feature extraction network with the multi-scale feature extraction network to obtain the preset smoking detection model. The smoking detection module is used to obtain surveillance video frames in real time and use the trained smoking detection model to determine whether smoking behavior exists in the video frames; Among them, the backbone feature extraction network is a DW-CSP-Net residual network that integrates the deep separable convolutional network DW and the cross-stage local network CSPNet; The residual network adopts a dual-channel feature transfer network. In channel one, convolution is used to reduce the number of channels by half. In channel two, convolution is first used to reduce the number of channels by half, and then depthwise separable convolution is used to operate on the input image to extract the smoking features of the image. The output features obtained from the two channels are connected to obtain the feature map output by the residual network. The residual network adopts the residual block stacking mode of "1, 2, 2, 2, 2", where "1" means that the depthwise separable convolutional network in channel 2 is run once, and "2" means that the depthwise separable convolutional network in channel 2 is repeated and run twice in sequence; The multi-scale feature extraction network is a fusion path aggregation network PANet and a DW-CSP-Net network. The network adopts a top-down and bottom-up dual-path feature fusion method to output a multi-scale feature map.
5. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of a light smoking detection method according to any one of claims 1 to 3 are completed.
6. A computer-readable storage medium, characterized in that Used to store computer instructions, which, when executed by a processor, complete the steps of a light smoking detection method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Vehicle detection method and system based on SF-YOLOv4 network model, and storage medium
CN113033604A
Illegal behavior target detection method and device, equipment and storage medium
CN114782892A