Multi-stage-based stove flameout protection small target detection method and device
Through the multi-stage object detection method, the improved neural network model is used to detect the fire-off protection area of the gas stove, which solves the problems of low efficiency of traditional artificial quality inspection and difficulty in intelligent identification, and realizes high-precision fire-off protection recognition of the gas stove.
Patent Information
- Application Number
- CN202510706008.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-08-15
AI Technical Summary
In the field of gas security inspection, the fire extinguishing protection of gas stoves is difficult to identify, especially in complex gas use environments, traditional artificial quality inspection is low efficiency, intelligent identification is difficult, and the fire extinguishing protection target is small and easy to be blocked.
The multi-stage object detection method is adopted, firstly using the yolov11 model to detect the stove area, then using the improved neural network model to detect the fire-off protection area, and the small object detection accuracy is improved by adding a fourth detection head, and the model performance is optimized by combining specific loss functions and module structures.
The recognition accuracy of the gas stove fire extinguishing protection area has been improved, and the AP0.95 and AP0.5 indicators on the self-built image set have been increased by 6.2% and 7.9% respectively, improving the accuracy and efficiency of intelligent recognition.
Smart Images

Figure CN120495844A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of gas safety inspection, and in particular to a method and device for small target detection of stove flameout protection based on multi-stage. Background Art
[0002] In the field of gas safety inspections, the installation of flameout protection for gas stoves is a prerequisite for ensuring gas safety. However, the frequent occurrence of gas accidents has become a major hidden danger that needs to be addressed urgently. Traditional gas inspections require manual batch quality checks of historical inspection photos. These photos of gas usage and conditions are uploaded to the backend for manual verification. This workload is significant, necessitating the implementation of 24 / 7, fully automated, and fully covered, continuous intelligent batch quality inspections. Therefore, gas safety inspections urgently need to introduce intelligent inspection technologies to improve accuracy and efficiency.
[0003] However, intelligent identification is a challenge for intelligent security inspections. During intelligent identification, gas stoves face complex operating environments, with years of use resulting in little difference between the color of the stove and the flameout protection indicator. This also creates blurred ambient lighting, and the flameout protection indicator is small and often obscured. These factors contribute to the difficulty of identifying flameouts. Therefore, effectively identifying flameouts in stove images (including those captured manually during gas inspections or from real-time camera monitoring) has become a pressing issue in this field. Summary of the Invention
[0004] The present application provides a method and device for detecting small targets for stove flameout protection based on multiple stages, the purpose of which is to effectively identify the flameout protection area in a stove image.
[0005] In order to achieve the above objectives, this application provides the following technical solutions:
[0006] A method for detecting small targets for stove flameout protection based on multiple stages, comprising:
[0007] Using a pre-trained first target detection model, target detection is performed on the image to be tested to determine a target area of the image to be tested that contains a cooker; the first target detection model includes a yolov11 model;
[0008] Cutting the target area in the image to be tested to obtain a corresponding cooker image;
[0009] A pre-trained second target detection model is used to perform target detection on the stove image to determine the flameout protection area in the stove image. The second target detection model includes a neural network model with an improved structure. The improved structure includes a fourth detection head, which is used to detect targets with a feature scale of 160×160 and a corresponding number of output channels of 32.
[0010] Optionally, the improved structure also includes an upsample module, a concat module and a c3k2 module; wherein the upsample module is used to upsample the 256×80×80 feature map detected in the neural network model to obtain a 64×160×160 feature map; the concat module is used to combine the 64×160×160 feature map detected in the neural network model with the 64×160×160 feature map output by the upsample module to obtain a 128×160×160 feature map; the c3k2 module is used to downsample the 128×160×160 feature map output by the concat module to obtain a 32×160×160 feature map, and input the obtained 32×160×160 feature map into the fourth detection head.
[0011] Optionally, the neural network model also includes a first detection head, a second detection head and a third detection head; wherein, the first detection head is used to detect targets with a feature scale of 80×80, and the corresponding number of output channels is 64; the second detection head is used to detect targets with a feature scale of 40×40, and the corresponding number of output channels is 128; the third detection head is used to detect targets with a feature scale of 20×20, and the corresponding number of output channels is 256.
[0012] Optionally, the target detection result of the second target detection model is determined based on the combined result of the output information of the first detection head, the second detection head, the third detection head and the fourth detection head, and the output information includes the location, category and confidence of the target.
[0013] Optionally, the total loss function used in the training process of the second target detection model is ,in, represents the confidence loss, represents the bounding box regression loss, represents the classification loss, and Both use binary cross entropy loss function, and Both use the intersection-over-union loss function, and The bounding box size is smaller than The bounding box size of .
[0014] Optionally, the size of the stove image is 640×640. The bounding box size is less than 32×32, the The bounding box size is greater than or equal to 32×32.
[0015] Optionally, the neural network model includes a yolov11 model, and the yolov11 model includes a backbone part, a neck part and a head part; wherein the backbone part includes 11 network layers, the neck part includes 12 network layers, and the head part includes three detection heads.
[0016] A device for small target detection based on multi-stage stove flameout protection, comprising:
[0017] A cooker detection unit is configured to perform target detection on the image to be tested using a pre-trained first target detection model to determine a target area in the image to be tested that contains a cooker; the first target detection model includes a YOLOv11 model;
[0018] an image cutting unit, configured to cut the target area in the image to be measured to obtain a corresponding cooker image;
[0019] A region detection unit is configured to perform target detection on the cooktop image using a pretrained second target detection model to determine a flameout protection region in the cooktop image; the second target detection model includes a neural network model with an improved structure; the improved structure includes a fourth detection head configured to detect targets with a feature scale of 160×160 and corresponding to 32 output channels.
[0020] A storage medium includes a stored program, wherein the program is executed by a processor to execute the method for small target detection based on multi-stage stove flameout protection.
[0021] An electronic device comprising: a processor, a memory, and a bus; the processor and the memory are connected via the bus;
[0022] The memory is used to store a program, and the processor is used to run the program, wherein the program is executed by the processor to execute the method for small target detection based on multi-stage stove flameout protection.
[0023] The technical solution provided by the present application utilizes a pre-trained first target detection model to perform target detection on the image to be tested to determine the target area containing the stove in the image to be tested. The target area in the image to be tested is cut to obtain the corresponding stove image. The pre-trained second target detection model is used to perform target detection on the stove image to determine the flameout protection area in the stove image. The present application detects the stove area from the image to be tested based on the first target detection model, then cuts the stove area out of the image to be tested, and uses the second target detection model to perform flameout protection area detection on the cut stove image. The improved structure based on the second target detection model achieves higher-precision small target detection, ensuring the accuracy of the flameout protection area detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0025] Figure 1 A flowchart of a method for detecting a small target for stove flameout protection based on multiple stages provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of the network architecture of a second target detection model provided in an embodiment of the present application;
[0027] Figure 3 A schematic diagram of an image to be measured provided in an embodiment of the present application;
[0028] Figure 4 A schematic diagram of a stove image and detection results provided in an embodiment of the present application;
[0029] Figure 5 A schematic diagram of the architecture of a device for small target detection based on multi-stage stove flameout protection provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0031] In this application, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or apparatus comprising the element.
[0032] like Figure 1 , which is a flow chart of a method for small target detection based on multi-stage stove flameout protection provided in an embodiment of the present application, including the following steps.
[0033] S101: Using a pre-trained first target detection model, perform target detection on the image to be tested to determine a target area containing a cooker in the image to be tested.
[0034] Among them, the first target detection model includes the yolov11 model.
[0035] In some examples, the yolov11 model can be trained using pre-prepared training samples (for example, a sample image containing a stove, and the sample image is pre-annotated with an area containing the stove using an annotation tool) to obtain a first object detection model.
[0036] In some examples, the type of cooktop includes, but is not limited to, a gas cooktop.
[0037] S102: Cutting the target area in the image to be tested to obtain a corresponding stove image.
[0038] An image cropping tool (such as OpenCV) may be used to crop the target area in the image to be tested to obtain a corresponding cooker image.
[0039] In a possible implementation, the size (usually pixel value) of the stove image may be 640×640.
[0040] S103: Using a pre-trained second object detection model, perform object detection on the stove image to determine a flameout protection area in the stove image.
[0041] Among them, the second target detection model includes a neural network model with a newly added improved structure. The improved structure includes a fourth detection head. The fourth detection head is used to detect targets with a feature scale of 160×160, and the corresponding number of output channels is 32.
[0042] In some examples, the feature vector dimension corresponding to the fourth detection head is 32 × 160 × 160. The fourth detection head can be used to detect small target objects with high-resolution feature maps.
[0043] It is understandable that the targets (large targets, medium targets, and small targets) detected by the second target detection model indicate the flameout protection area (ie, the area where the flameout protection device in the cooker is located in the cooker image).
[0044] It should be noted that the detection head is the core component in the field of target detection. Its working principle is to process the feature map through a convolutional neural network to output the target's location, category, and confidence information. Generally speaking, the detection head includes a bounding box prediction layer (used to predict the precise location of the target), a category judgment layer (used to classify the target), and a confidence layer (used to evaluate the accuracy of the prediction box).
[0045] Optionally, the improved structure also includes an upsample module, a concat module and a c3k2 module; wherein the upsample module is used to upsample the 256×80×80 feature map detected in the neural network model to obtain a 64×160×160 feature map; the concat module is used to combine the 64×160×160 feature map detected in the neural network model with the 64×160×160 feature map output by the upsample module to obtain a 128×160×160 feature map; the c3k2 module is used to downsample the 128×160×160 feature map output by the concat module to obtain a 32×160×160 feature map, and input the obtained 32×160×160 feature map into the fourth detection head.
[0046] Optionally, the neural network model also includes a first detection head, a second detection head and a third detection head; wherein, the first detection head is used to detect targets with a feature scale of 80×80, and the corresponding number of output channels is 64; the second detection head is used to detect targets with a feature scale of 40×40, and the corresponding number of output channels is 128; the third detection head is used to detect targets with a feature scale of 20×20, and the corresponding number of output channels is 256.
[0047] In some examples, the dimension of the feature vector corresponding to the first detection head is 64×80×80, the dimension of the feature vector corresponding to the second detection head is 128×40×40, and the dimension of the feature vector corresponding to the first detection head is 256×20×20.
[0048] In a possible implementation, the first detection head may be suitable for detecting small targets, the second detection head may be suitable for detecting medium targets, and the third detection head may be suitable for detecting large targets. By adding an additional fourth detection head, the feature perception layer for small target detection in the second target detection model is increased, thereby improving the small target detection capability of the second target detection model.
[0049] It can be understood that based on the first detection head, the second detection head, the third detection head and the fourth detection head, the second target detection model can have target detection capabilities in multiple stages (multiple size dimensions). For a 640×640 stove image, it can ensure that each feature point in the stove image can detect a 4×4 target object.
[0050] Optionally, the target detection result of the second target detection model is determined based on the combined result of the output information of the first detection head, the second detection head, the third detection head and the fourth detection head, and the output information includes the location, category and confidence of the target.
[0051] Optionally, the total loss function used in the training process of the second target detection model is ,in, represents the confidence loss, represents the bounding box regression loss, represents the classification loss, and Both use binary cross entropy loss function, and Both use the intersection-over-union loss function, and The bounding box size is smaller than The bounding box size of .
[0052] In a possible implementation, and The bounding box of can be understood as the bounding box in the detection head. In addition, 、 as well as is the coefficient to be measured.
[0053] In some examples, in Can be set to 3, in Can be set to 1 to increase the parameter size of small target detection so that the total loss function Converge to small goals.
[0054] In some examples, for the bounding box regression loss in the loss function, the small target is assigned a separate loss function, the intersection-over-union loss function is calculated separately for the medium and large targets and the small target, and the scaling factor of the small target function is increased. The scaling factor is recorded as .
[0055] Optionally, the size of the stove image is 640×640, The bounding box size is less than 32×32, The bounding box size is greater than or equal to 32×32.
[0056] In some examples, objects in the stove image with a size smaller than 32×32 may be considered small objects, and objects with a size greater than or equal to 32×32 may be considered medium-large objects (including medium objects and large objects).
[0057] Optionally, the neural network model includes a yolov11 model, and the yolov11 model includes a backbone part, a neck part, and a head part; wherein the backbone part includes 11 network layers, the neck part includes 12 network layers, and the head part includes three detection heads.
[0058] In some examples, the yolov11 model adopts a PAN structure to downsample 1 / 2, 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the stove image, and outputs corresponding eigenvalues (which can be understood as feature maps) on the first detection head, the second detection head, and the third detection head, respectively.
[0059] In some examples, the specific network layer architecture of the second target detection model can be found in Figure 2 shown. Figure 2 The CBS module shown in is the basic convolution module for feature extraction. Figure 2 The SPPF module shown in is an improved spatial pyramid pooling technology for multi-scale feature extraction. Figure 2 The C2PSA module shown in
[15] is a feature fusion module that combines the CSP structure and the attention mechanism. Figure 2 The upsample module shown in is used to implement upsampling, the concat module is used to implement eigenvalue fusion, and the c3k2 module is used to implement downsampling.
[0060] It can be understood that based on the first object detection module and the second object detection model, end-to-end flameout protection detection can be achieved. The first stage of stove detection and the second stage of flameout protection area detection are connected in series to achieve end-to-end flameout protection detection. Specifically, the first object detection model is used to crop the stove parts detected as flameout protection training data, greatly enriching the training samples. Finally, the flameout protection area detection coordinate frame (detection results) is mapped back to the stove image.
[0061] In a possible embodiment, see Figure 3 The image to be tested is shown in FIG. 1 , and the first target detection model is used to obtain Figure 4 The stove image shown is used, and the flameout protection area in the stove image is marked using the second object detection model.
[0062] In a possible implementation, in gas inspection scenarios, the flameout protection targets on stoves are small and difficult to identify. This approach, on the one hand, reduces the difficulty of target detection by using a multi-stage target detection approach. On the other hand, by modifying the YOLOv11 model structure and loss function, the accuracy of small target detection is increased, significantly improving recognition accuracy. On a self-built gas stove image dataset, AP0.95 increased from 83.3% to 89.5%, a 6.2% improvement. AP0.5 increased from 87.6% to 95.5%, a 7.9% improvement. Gas flameout protection recognition has now been implemented in real-world scenarios, significantly improving production efficiency.
[0063] In the process shown in S101-S103 above, the cooker area is detected from the image to be tested based on the first target detection model. The cooker area is then cut out from the image to be tested. The cut cooker image is then subjected to flameout protection area detection using the second target detection model. The improved structure of the second target detection model enables higher-precision small target detection, ensuring the accuracy of the flameout protection area detection results.
[0064] like Figure 5 , which is a schematic diagram of the architecture of a device for small target detection based on multi-stage stove flameout protection provided by an embodiment of the present application, including the units shown below.
[0065] The cooker detection unit 100 is used to perform target detection on the image to be tested using a pre-trained first target detection model to determine a target area in the image to be tested that contains a cooker; the first target detection model includes a YOLOv11 model.
[0066] The image cutting unit 200 is used to cut the target area in the image to be tested to obtain a corresponding cooker image.
[0067] The region detection unit 300 is used to perform target detection on the cooktop image using a pretrained second target detection model to determine the flameout protection region in the cooktop image. The second target detection model includes a neural network model with an improved structure. The improved structure includes a fourth detection head, which is used to detect targets with a feature scale of 160×160 and a corresponding number of output channels of 32.
[0068] Optionally, the improved structure also includes an upsample module, a concat module and a c3k2 module; wherein the upsample module is used to upsample the 256×80×80 feature map detected in the neural network model to obtain a 64×160×160 feature map; the concat module is used to combine the 64×160×160 feature map detected in the neural network model with the 64×160×160 feature map output by the upsample module to obtain a 128×160×160 feature map; the c3k2 module is used to downsample the 128×160×160 feature map output by the concat module to obtain a 32×160×160 feature map, and input the obtained 32×160×160 feature map into the fourth detection head.
[0069] Optionally, the neural network model also includes a first detection head, a second detection head and a third detection head; wherein, the first detection head is used to detect targets with a feature scale of 80×80, and the corresponding number of output channels is 64; the second detection head is used to detect targets with a feature scale of 40×40, and the corresponding number of output channels is 128; the third detection head is used to detect targets with a feature scale of 20×20, and the corresponding number of output channels is 256.
[0070] Optionally, the target detection result of the second target detection model is determined based on the combined result of the output information of the first detection head, the second detection head, the third detection head and the fourth detection head, and the output information includes the location, category and confidence of the target.
[0071] Optionally, the total loss function used in the training process of the second target detection model is ,in, represents the confidence loss, represents the bounding box regression loss, represents the classification loss, and Both use binary cross entropy loss function, and Both use the intersection-over-union loss function, and The bounding box size is smaller than The bounding box size of .
[0072] Optionally, the size of the stove image is 640×640, The bounding box size is less than 32×32, The bounding box size is greater than or equal to 32×32.
[0073] Optionally, the neural network model includes a yolov11 model, and the yolov11 model includes a backbone part, a neck part, and a head part; wherein the backbone part includes 11 network layers, the neck part includes 12 network layers, and the head part includes three detection heads.
[0074] The units shown above detect the stove area from the image to be tested based on the first target detection model. The stove area is then cut out from the image to be tested. The cut stove image is then subjected to flameout protection area detection using the second target detection model. The improved structure based on the second target detection model achieves higher-precision small target detection, ensuring the accuracy of the flameout protection area detection results.
[0075] The present application also provides a computer-readable storage medium, which includes a stored program, wherein the program executes the method for small target detection based on multi-stage stove flameout protection provided by the present application.
[0076] The present application also provides an electronic device comprising: a processor, a memory, and a bus. The processor and the memory are connected via the bus, the memory being used to store a program, and the processor being used to run the program. When the program is run, the method for detecting a small target based on multi-stage stove flameout protection provided in the present application is executed.
[0077] Although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0078] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the disclosure herein is not limited to technical solutions formed by specific combinations of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the aforementioned disclosure. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A method for detecting small targets for stove flameout protection based on multiple stages, characterized in that: include: Using a pre-trained first target detection model, perform target detection on the image to be tested to determine a target area in the image to be tested that contains a cooker; The first target detection model includes a yolov11 model; Cutting the target area in the image to be tested to obtain a corresponding cooker image; A pre-trained second target detection model is used to perform target detection on the stove image to determine the flameout protection area in the stove image. The second target detection model includes a neural network model with an improved structure. The improved structure includes a fourth detection head, which is used to detect targets with a feature scale of 160×160 and a corresponding number of output channels of 32.
2. The method according to claim 1, characterized in that The improved structure also includes an upsample module, a concat module and a c3k2 module; wherein the upsample module is used to upsample the 256×80×80 feature map detected in the neural network model to obtain a 64×160×160 feature map; the concat module is used to combine the 64×160×160 feature map detected in the neural network model with the 64×160×160 feature map output by the upsample module to obtain a 128×160×160 feature map; the c3k2 module is used to downsample the 128×160×160 feature map output by the concat module to obtain a 32×160×160 feature map, and input the obtained 32×160×160 feature map into the fourth detection head.
3. The method according to claim 1, characterized in that The neural network model also includes a first detection head, a second detection head and a third detection head; wherein the first detection head is used to detect targets with a feature scale of 80×80, and the corresponding number of output channels is 64; the second detection head is used to detect targets with a feature scale of 40×40, and the corresponding number of output channels is 128; the third detection head is used to detect targets with a feature scale of 20×20, and the corresponding number of output channels is 256.
4. The method according to claim 3, characterized in that The target detection result of the second target detection model is determined based on the combined result of the output information of the first detection head, the second detection head, the third detection head and the fourth detection head, and the output information includes the location, category and confidence of the target.
5. The method according to claim 1, wherein The total loss function used in the training process of the second target detection model is ,in, represents the confidence loss, represents the bounding box regression loss, represents the classification loss, and Both use binary cross entropy loss function, and Both use the intersection-over-union loss function, and The bounding box size is smaller than The bounding box size of .
6. The method according to claim 5, characterized in that The size of the stove image is 640×640. The bounding box size is less than 32×32, the The bounding box size is greater than or equal to 32×32.
7. The method according to claim 1, characterized in that The neural network model includes a yolov11 model, and the yolov11 model includes a backbone part, a neck part and a head part; wherein the backbone part includes 11 network layers, the neck part includes 12 network layers, and the head part includes three detection heads.
8. A device for small target detection based on multi-stage stove flameout protection, characterized in that: include: a cooker detection unit, configured to perform target detection on the image to be tested using a pre-trained first target detection model to determine a target area in the image to be tested that contains a cooker; The first target detection model includes a yolov11 model; an image cutting unit, configured to cut the target area in the image to be measured to obtain a corresponding cooker image; an area detection unit, configured to perform object detection on the stove image using a pre-trained second object detection model to determine a flameout protection area in the stove image; The second target detection model includes a neural network model with a newly added improved structure; the improved structure includes a fourth detection head, which is used to detect targets with a feature scale of 160×160, and the corresponding number of output channels is 32.
9. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program is executed by a processor to execute the method for small target detection based on multi-stage stove flameout protection according to any one of claims 1 to 7.
10. An electronic device, characterized in that include: processor, memory, and bus; The processor is connected to the memory via the bus; The memory is used to store a program, and the processor is used to run the program, wherein the program, when run by the processor, executes the method for small target detection based on multi-stage stove flameout protection according to any one of claims 1 to 7.