Kitchen open fire hidden danger early warning model based on YOLO lightweight

By employing YOLO lightweight model preprocessing, structured pruning, and layer fusion quantization techniques, the deployment challenges of traditional sensors and deep learning models in kitchens have been solved, achieving stable flame recognition and real-time response, thus improving kitchen fire safety.

CN121962849APending Publication Date: 2026-05-01ZHEJIANG GONGSHANG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG GONGSHANG UNIVERSITY
Filing Date
2026-01-15
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, traditional sensor-based open flame warning solutions have response delays and are easily affected by kitchen fumes and steam. Deep learning image recognition models have large parameter scales, making them difficult to deploy on low-cost terminals. Furthermore, the complex kitchen environment affects recognition stability, making it difficult to adapt to the needs of actual scenarios.

Method used

A lightweight kitchen open flame hazard early warning model based on YOLO is adopted. The image is enhanced by denoising through preprocessing algorithm, the YOLOv5 model is pruned in a structured manner, and an efficient inference engine is built by combining layer fusion and quantization calibration to realize flame recognition and real-time early warning.

Benefits of technology

It enhances the anti-interference capability of flame recognition, reduces hardware deployment costs, ensures immediate response and accurate early warning, adapts to complex kitchen environments, and improves the level of fire safety protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962849A_ABST
    Figure CN121962849A_ABST
Patent Text Reader

Abstract

The invention discloses a kitchen open fire hidden danger early warning model based on YOLO lightweight, and relates to the technical field of artificial intelligence, and the model comprises the following steps: S1, obtaining an original monitoring image of a kitchen environment, employing a preprocessing algorithm fusing bilateral filtering and adaptive histogram equalization, carrying out the denoising and enhancement of the original monitoring image, and outputting a standardized image; and S2, based on the standardized image, applying a structured pruning strategy to a pre-trained YOLOv5 model, and removing redundant convolutional layers and channels in a backbone network of the pre-trained YOLOv5 model. According to the kitchen open fire hidden danger early warning model based on YOLO lightweight, through a preprocessing mode of fusing bilateral filtering and adaptive histogram equalization, image noise is removed, flame edges and key features are completely reserved at the same time, the anti-interference capability of flame recognition in a complex kitchen environment is greatly improved, and the method is suitable for popularization and application. Clear risk guidance is provided for the user, the hidden danger can be quickly handled, and the kitchen fire protection level is comprehensively improved.
Need to check novelty before this filing date? Find Prior Art

Description

A lightweight kitchen open flame hazard early warning model based on YOLO Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically to a lightweight kitchen open flame hazard early warning model based on YOLO. Background Technology

[0002] As the core area for open flame use in homes and restaurants, kitchens are frequently exposed to open flames, making them prone to fires and threatening lives and property. With the development of intelligent security technology, open flame detection has evolved from traditional temperature and smoke sensor detection to computer vision-based intelligent recognition. The YOLO series models, due to their fast detection speed and high accuracy, are widely used in target detection scenarios such as flames. Lightweight technology, through model optimization, reduces computational requirements, adapting to the offline operation and real-time response needs of edge devices, providing a technological foundation for accurate monitoring of open flame hazards in kitchens.

[0003] Current open flame warning technologies suffer from limitations in response time and sensitivity to early-stage hazards. Traditional sensor-based solutions are susceptible to interference from environmental factors such as kitchen fumes and steam. While deep learning-based image recognition solutions improve accuracy, some models have large parameter sets, requiring significant hardware resources and hindering efficient deployment on commonly used low-cost kitchen terminals. Furthermore, complex kitchen environments, such as varying lighting and flame obstruction, can affect the stability of some technologies, making them unsuitable for diverse real-world applications. To address these challenges, we propose a lightweight YOLO-based kitchen open flame hazard warning model. Summary of the Invention

[0004] To address the aforementioned technical issues, a lightweight kitchen open flame hazard early warning model based on YOLO is provided. This technical solution solves the problems of high response latency and susceptibility to interference from kitchen fumes and steam in traditional sensor-based solutions; large parameter scale of some deep learning image recognition models, high hardware resource requirements, and difficulty in adapting to low-cost terminals; and the fact that changes in lighting and flame obstruction in complex kitchen environments can affect recognition stability and make it difficult to fully adapt to the needs of real-world scenarios.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] The YOLO-based lightweight kitchen open flame hazard early warning model includes the following steps:

[0007] S1. Obtain the original monitoring image of the kitchen environment, and use a preprocessing algorithm that combines bilateral filtering and adaptive histogram equalization to denoise and enhance the original monitoring image, and output a standardized image.

[0008] S2. Based on the standardized image, a structured pruning strategy is applied to the pre-trained YOLOv5 model to remove redundant convolutional layers and channels in its backbone network, while retaining the key layers used for extracting flame color, texture and dynamic features, thus constructing a lightweight flame recognition model.

[0009] S3. Deploy the lightweight flame recognition model on the target embedded platform, and use the neural network inference framework of the platform to perform layer fusion and quantization calibration to generate a platform-optimized high-efficiency inference engine.

[0010] S4. Utilize the high-efficiency inference engine to parse the real-time video stream. When a flame target is detected, trigger a graded early warning signal based on its bounding box position and confidence level.

[0011] Preferably, acquiring the original monitoring image of the kitchen environment specifically involves:

[0012] Based on the network camera hardware deployed in the kitchen, the fixed installation location and field of view range were determined to cover the stove, range hood and fuel storage area;

[0013] Set the image acquisition parameters of the network camera, including resolution, frame rate and white balance, and establish a network connection between it and the edge computing device;

[0014] The system receives encoded video streams from the network camera via a real-time streaming protocol, parses and decodes the data packets, and restores them to a continuous sequence of original image frames.

[0015] The original image frame sequence is timestamped and its integrity is verified. Damaged frames caused by network jitter are removed, and a uniform original monitoring image sequence is output.

[0016] Preferably, the output standardized image specifically comprises:

[0017] The original monitoring image is subjected to a bilateral filtering algorithm. By combining spatial proximity and pixel intensity similarity weights, the image noise is smoothed while the flame edge details are preserved, resulting in a denoised image.

[0018] Based on the denoised image, it is converted from RGB color space to YUV color space, and the luminance component channel is separated.

[0019] An adaptive histogram equalization algorithm is applied to the brightness component channel. By calculating the histogram distribution of local areas of the image and performing contrast transformation, the visibility of the overall image and local dark areas is improved, resulting in an enhanced image.

[0020] The luminance component of the enhanced image is merged with the original chrominance component and converted back to the RGB color space. Finally, pixel value normalization is performed to output a standardized image with uniform size and numerical range.

[0021] Preferably, the method for constructing the pre-trained YOLOv5 model comprises the following steps:

[0022] Based on the publicly available MS COCO general object detection dataset, we obtained and loaded the baseline network structure and initial weights of the YOLOv5 model as the basic pre-trained model.

[0023] A dedicated dataset of flame images for kitchen scenarios is constructed, which includes labeled flame images collected under various lighting conditions, oil fume concentrations, and occlusion conditions.

[0024] The basic pre-trained model is iteratively trained on the flame image dataset using a transfer learning method.

[0025] During training, the weights of the first few layers of the model backbone network are frozen, and the parameters of the subsequent network layers and the detection head are updated only to adapt the model to flame features.

[0026] The model performance is evaluated using a validation set. Training stops when the average accuracy of the flame category reaches a preset threshold, resulting in a pre-trained YOLOv5 model specifically designed for flame recognition.

[0027] Preferably, S2 includes:

[0028] Obtain the pre-trained YOLOv5 model, and calculate and evaluate the importance score of each channel based on the L1 norm of the output channels of each convolutional layer of its network.

[0029] Based on the computing power and memory constraints of the target embedded platform, a global pruning ratio threshold is set, and redundant channels with scores lower than the corresponding layer threshold are identified based on the importance score.

[0030] The identified redundant channels are pruned using a structured pruning method. They are removed from the network computation graph, and their corresponding convolutional kernel weights and the input channels of the next layer are removed simultaneously to obtain the pruned sparse network structure.

[0031] The pruned sparse network structure is subjected to channel rearrangement and connectivity reconstruction to generate a lightweight network model to be fine-tuned.

[0032] Preferably, S2 further includes:

[0033] After applying structured pruning, the key initial convolutional layers responsible for extracting low-level semantic information, the key intermediate layers that complete cross-layer feature fusion structures, and the key high-level layers near the detection head in the backbone network are identified and preserved.

[0034] Based on the network skeleton formed by the retained key layers, the lightweight network model to be fine-tuned is trained on a dedicated dataset of flame images, and finally a lightweight flame recognition model is constructed.

[0035] Preferably, the method for deploying the lightweight flame recognition model on the target embedded platform is as follows:

[0036] Identify the continuous linear computation layer and nonlinear activation layer in the lightweight flame recognition model;

[0037] Based on the neural network inference framework supported by the target embedded platform, the continuous linear computation layer and nonlinear activation layer are merged into a single composite computation node.

[0038] Based on the computation graph of the reconstructed model using the composite computing nodes, intermediate cache tensors are removed to generate an intermediate model optimized by layer fusion.

[0039] Preferably, the quantization calibration using the neural network inference framework of the platform includes:

[0040] The intermediate model optimized by layer fusion is obtained, and a subset of the flame image-specific dataset is collected as a calibration dataset.

[0041] The calibration data is input into the intermediate model, and the numerical distribution range of the output activation values ​​of each network layer is statistically analyzed.

[0042] Based on the numerical distribution range and the fixed-point support accuracy of the target embedded platform, a scaling factor and integer zeros are calculated and assigned to each network layer.

[0043] Based on the scaling factor and integer zeros, the floating-point weights of each convolutional layer and fully connected layer in the model are converted into fixed-point representations to generate the platform-optimized high-efficiency inference engine.

[0044] Preferably, the step of using the high-efficiency inference engine to parse the real-time video stream specifically involves:

[0045] The system acquires real-time encoded video streams from a webcam, performs real-time decoding and frame extraction to obtain continuous image frames.

[0046] The image frame is scaled and pixel normalized to match the input requirements of the efficient inference engine.

[0047] The processed image frame is input into the high-efficiency inference engine to perform forward inference calculations and obtain raw detection data containing the coordinates of the flame target bounding box, category confidence, and category label.

[0048] Preferably, the step of triggering a graded early warning signal based on the bounding box position and confidence level specifically involves:

[0049] Set the base confidence threshold and high-risk threshold for flame target detection;

[0050] When there are flame targets in the original detection data with a category confidence level higher than the basic threshold, it is determined that a potential open flame hazard has been detected.

[0051] If the confidence level of the flame target category is higher than the high-risk threshold, a level one warning signal is triggered;

[0052] If the confidence level of the flame target category is between the basic threshold and the high-risk threshold, a secondary warning signal is triggered;

[0053] Based on the bounding box position and the warning signal level, a warning command containing location information is generated and sent to the linkage alarm device.

[0054] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0055] This invention proposes a lightweight YOLO-based early warning model for open flame hazards in kitchens. Through a preprocessing approach that integrates bilateral filtering and adaptive histogram equalization, it removes image noise while preserving the flame edges and key features, significantly improving the anti-interference capability of flame recognition in complex kitchen environments and adapting to different lighting, smoke, and occlusion scenarios. Optimizing the YOLOv5 model using a structured pruning strategy removes redundant network layers and channels while retaining core feature extraction layers, achieving lightweight design while maintaining recognition accuracy. This allows for flexible deployment on various embedded terminals, reducing hardware deployment costs. A highly efficient inference engine built using layer fusion and quantization calibration techniques significantly improves real-time video stream parsing efficiency, ensuring immediate response to hazard detection. A tiered early warning mechanism accurately triggers warning signals based on flame confidence and location information, providing users with clear risk guidance, facilitating rapid hazard handling, and comprehensively improving kitchen fire safety. Attached Figure Description

[0056] Figure 1 is a flowchart of the method of the present invention. Detailed Implementation

[0057] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.

[0058] Referring to Figure 1, the YOLO-based lightweight kitchen open flame hazard early warning model includes the following steps:

[0059] S1. Obtain the original monitoring image of the kitchen environment, and use a preprocessing algorithm that combines bilateral filtering and adaptive histogram equalization to denoise and enhance the original monitoring image, and output a standardized image.

[0060] The acquisition of the original monitoring images of the kitchen environment specifically involves:

[0061] Based on the network camera hardware deployed in the kitchen, the fixed installation location and field of view range were determined to cover the stove, range hood and fuel storage area;

[0062] Set the image acquisition parameters of the network camera, including resolution, frame rate and white balance, and establish a network connection between it and the edge computing device;

[0063] The system receives encoded video streams from the network camera via a real-time streaming protocol, parses and decodes the data packets, and restores them to a continuous sequence of original image frames.

[0064] The original image frame sequence is timestamped and its integrity is verified. Damaged frames caused by network jitter are removed, and a uniform original monitoring image sequence is output.

[0065] The output standardized image is specifically:

[0066] A bilateral filtering algorithm is applied to the original monitoring image, combining spatial proximity and pixel intensity similarity weights to achieve filtering. This smooths image noise while preserving flame edge details, resulting in a denoised image. The spatial proximity weights are calculated using a Gaussian function, with the following formula:

[0067]

[0068] in The current pixel coordinates, For the neighboring pixel coordinates, The spatial standard deviation is used to control the influence range of spatial proximity; the pixel intensity similarity weight is also calculated using a Gaussian function, with the formula as follows:

[0069]

[0070] in and These are the grayscale values ​​of the current pixel and its neighboring pixels, respectively. The standard deviation of intensity is used to measure the degree of influence of pixel grayscale differences. Regarding parameter selection, The value range is 2-5. The value range is 20-50. When the concentration of oil fumes in the kitchen is high, resulting in noticeable noise, the value can be increased appropriately. To improve noise reduction, reduce the value to 4-5. When the details at the edge of the flame are blurry, the value should be reduced. Up to 20-30 to enhance edge retention capabilities;

[0071] Based on the denoised image, it is converted from RGB color space to YUV color space, and the luminance component channel is separated.

[0072] An adaptive histogram equalization algorithm is applied to the brightness component channel. By calculating the histogram distribution of local image regions and performing contrast transformation, the visibility of the overall image and locally dark areas is improved, resulting in an enhanced image. The size of the local region is determined by the image size and the minimum flame recognition size, using an 8×8 or 16×16 rectangular region to ensure that the local region can completely cover the minimum feature unit of the flame while avoiding noise amplification caused by an excessively small region. The mathematical expression for the contrast transformation is:

[0073]

[0074] in These are the original luminance component values. and These are the minimum and maximum values ​​of the brightness component within the current local region, respectively. To balance the overall and local enhancement effects of the image and avoid introducing noise through excessive enhancement, an adaptive histogram equalization strategy with contrast limitation is adopted. The contrast limitation threshold is set to 2-4. When the cumulative probability of the histogram in a local region exceeds this threshold, the gray values ​​of the pixels exceeding this threshold are evenly distributed to other gray levels to ensure that the gray range of the enhanced image is reasonable.

[0075] The luminance component of the enhanced image is merged with the original chrominance component and converted back to the RGB color space. Finally, pixel value normalization is performed to output a standardized image with uniform size and numerical range.

[0076] S2. Based on the standardized image, a structured pruning strategy is applied to the pre-trained YOLOv5 model to remove redundant convolutional layers and channels in its backbone network, while retaining the key layers used for extracting flame color, texture and dynamic features, thus constructing a lightweight flame recognition model.

[0077] The construction steps of the pre-trained YOLOv5 model are as follows:

[0078] Based on the publicly available MS COCO general object detection dataset, we obtained and loaded the baseline network structure and initial weights of the YOLOv5 model. We selected YOLOv5s as the baseline network structure because it has the characteristics of fewer parameters and faster inference speed, and is more suitable for subsequent lightweight modification as a basic pre-trained model.

[0079] A dedicated dataset of flame images for kitchen scenarios is constructed, which includes labeled flame images collected under various lighting conditions, oil fume concentrations, and occlusion conditions.

[0080] The basic pre-trained model is iteratively trained on the flame image dataset using a transfer learning method.

[0081] During training, the weights of the first 8 layers of the model backbone network are frozen. The reason for choosing this number of layers is that the first 8 layers of the YOLOv5s backbone network are mainly responsible for extracting common low-level features of the image, such as edges and textures. These features are common to both general objects and flame targets. Freezing them can avoid overfitting due to the limited size of the dataset, while reducing the number of training parameters and improving training efficiency. Only the parameters of subsequent network layers and the detection head are updated to make the model adapt to flame features.

[0082] The model performance was evaluated using a validation set. The training iterations were set to 300 epochs, employing a cosine annealing learning rate adjustment strategy. The initial learning rate was set to 0.001, and in each training epoch, the learning rate decreased according to a cosine function with the number of iterations. After 150 iterations, the learning rate decreased to 0.1 of the initial value, and after 300 iterations, it decreased to 0.01 of the initial value. This strategy effectively balances the model's convergence speed and generalization ability. Training stopped when the average accuracy for flame categories reached a preset threshold of 0.95. This threshold was set based on the safety requirements of kitchen open flame detection scenarios. Statistical experimental data showed that when the average accuracy reached 0.95, the model's false negative rate could be controlled below 3%, while the false positive rate was below 5%, meeting the detection accuracy requirements of practical applications. This resulted in a pre-trained YOLOv5 model specifically for flame recognition.

[0083] S2 includes:

[0084] Obtain the pre-trained YOLOv5 model, and calculate and evaluate the importance score of each channel based on the L1 norm (L1 Norm, i.e., the sum of the absolute values ​​of all elements in the vector) of the output channels of each convolutional layer. Specifically, calculate the mean L1 norm of each channel of the output feature map of each convolutional layer, i.e.:

[0085]

[0086] in The importance score for the c-th channel. and These represent the height and width of the feature map, respectively. For the feature map of the c-th channel in The larger the mean L1 norm of the pixel value at a location, the richer the effective feature information contained in that channel, and the higher its importance.

[0087] Based on the computing power and memory constraints of the target embedded platform, a global pruning ratio threshold is set. The quantification relationship is as follows: when the target platform's computing power is below 1 TOPS and memory is less than 512MB, the global pruning ratio threshold is set to 60%; when the computing power is between 1 and 2 TOPS and memory is between 512MB and 1GB, the pruning ratio threshold is set to 40%; and when the computing power is greater than 2 TOPS and memory is greater than 1GB, the pruning ratio threshold is set to 20%. Based on the importance score, the channel scores of each convolutional layer are sorted in descending order. After sorting, the last N% of channels are considered redundant channels with scores below the corresponding layer threshold, where N is the global pruning ratio threshold.

[0088] The identified redundant channels are subjected to structured pruning. The technical details are as follows: First, a channel mask is generated for each convolutional layer. The mask value corresponding to the redundant channel is set to 0, and the mask value corresponding to the effective channel is set to 1. Then, the convolutional kernel weights are multiplied element by element with the channel mask to reset the convolutional kernel weights corresponding to the redundant channels to zero. Subsequently, the zeroed convolutional kernels and their corresponding input channels are removed. At the same time, the number of input channels of subsequent network layers is adjusted to ensure the coherence of the network structure and obtain the pruned sparse network structure.

[0089] The pruned sparse network structure is subjected to channel rearrangement and connectivity reconstruction. The specific steps are as follows: First, the number and position of effective channels in each layer are counted. The channels are reordered from high to low according to the importance score of the effective channels. Then, the connection relationship between each layer is reconstructed, the input and output dimension information of the network layer is updated, and an inter-layer connection relationship table is generated. Finally, the network computation graph is reconstructed based on the connection relationship table to generate a lightweight network model to be fine-tuned.

[0090] S2 further includes:

[0091] After applying structured pruning, the key initial convolutional layers responsible for extracting low-level semantic information, the key intermediate layers that complete cross-layer feature fusion structures, and the key high-level layers near the detection head in the backbone network are identified and preserved.

[0092] Based on the network skeleton formed by the retained key layers, the lightweight network model to be fine-tuned is trained on a dedicated dataset of flame images, and finally a lightweight flame recognition model is constructed.

[0093] S3. Deploy the lightweight flame recognition model on the target embedded platform, and use the neural network inference framework of the platform to perform layer fusion and quantization calibration to generate a platform-optimized high-efficiency inference engine.

[0094] The method for deploying the lightweight flame recognition model on the target embedded platform is as follows:

[0095] The lightweight flame recognition model identifies continuous linear computation layers and nonlinear activation layers. The linear computation layers include convolutional layers, batch normalization layers, and fully connected layers, while the nonlinear activation layers include ReLU, SiLU, etc.

[0096] Based on the neural network inference frameworks supported by the target embedded platform, continuous linear computation layers and nonlinear activation layers are merged into a single composite computation node. Supported neural network inference frameworks include TensorRT, ONNX Runtime, and MNN. The configuration methods for different frameworks are as follows:

[0097] When using TensorRT, the network is created by calling the createNetwork function in its API. Linear layers and activation layers are added sequentially using the addConvolutionNd, addBatchNormNd, and addActivation functions. Then, inter-layer connections are implemented using network->getLayer(i)->setInput(0, network->getLayer(j)->getOutput(0)). Finally, the buildEngineWithConfig function is called to complete the merging and optimization of composite nodes.

[0098] When using the ONNX Runtime, the model is transformed using the ONNX model optimization tool. Setting the `optimization_level` to `ORT_ENABLE_EXTENDED` automatically identifies and merges consecutive linear layers and activation layers. When using MNN, a session is created using the `createSession` function of the Interpreter. In the session configuration, `forwardType` is set to `MNN_FORWARD_CPU`, enabling the layer fusion optimization option and constructing a composite computation node. Through layer fusion, consecutive layers of convolution, batch normalization, and ReLU are merged into a single composite computation node, reducing the overhead of inter-layer data transfer and improving computational efficiency.

[0099] Based on the computation graph of the reconstructed model using the composite computing nodes, intermediate cache tensors are removed to generate an intermediate model optimized by layer fusion.

[0100] The quantization calibration using the neural network inference framework of this platform includes:

[0101] The intermediate model optimized by layer fusion is obtained, and a subset of the flame image dataset is collected as a calibration dataset. The selection criteria are to cover all lighting conditions, oil fume concentration and occlusion scenes in the dataset. 20-30 images are selected for each scene, and the total number of calibration datasets is controlled at 200-300 images to ensure that the calibration data can fully reflect the actual input distribution of the model.

[0102] The calibration data is input into the intermediate model, and the numerical distribution range of the output activation values ​​of each network layer is statistically analyzed. The calculation process is as follows: first, the output activation value of each network layer under all calibration data inputs is recorded; then, the activation values ​​are sorted, and outliers of 0.5% each (maximum and minimum) are removed. The minimum value of the remaining activation values ​​is taken as the minimum value. The maximum value is used as , This refers to the range of numerical distribution of the activation values ​​output by this layer;

[0103] Based on the numerical distribution range and the fixed-point accuracy supported by the target embedded platform, scaling factors and integer zeros are calculated and assigned to each network layer. The derivation formula is as follows:

[0104] Let the precision of the target fixed-point number be int8 (8-bit integer), and its value range be... Then the scaling factor Integer zeros ,in This is a rounding function. The scaling factor calculated by this formula and the integer zero point can accurately map the floating-point activation value to the int8 fixed-point range.

[0105] Based on the scaling factor and integer zeros, the floating-point weights of each convolutional and fully connected layer in the model are converted into fixed-point representations. The specific mapping relationship is as follows:

[0106]

[0107] in It is a floating-point weight value (32-bit or 64-bit floating-point number). The converted fixed-point weight values ​​(8-bit integers) are then verified to ensure that their values ​​are within the range of the target number of fixed points, thereby generating the platform-optimized high-efficiency inference engine.

[0108] S4. Utilize the high-efficiency inference engine to parse the real-time video stream. When a flame target is detected, trigger a graded early warning signal based on its bounding box position and confidence level.

[0109] The specific steps of using the high-efficiency inference engine to parse the real-time video stream are as follows:

[0110] The system acquires real-time encoded video streams from a webcam, performs real-time decoding and frame extraction to obtain continuous image frames.

[0111] The image frame is scaled and pixel normalized to match the input requirements of the efficient inference engine.

[0112] The processed image frame is input into the high-efficiency inference engine to perform forward inference calculations and obtain raw detection data containing the coordinates of the flame target bounding box, category confidence, and category label.

[0113] The specific steps for triggering graded early warning signals based on the bounding box position and confidence level are as follows:

[0114] The confidence thresholds for flame target detection were set at a base level and a high-risk threshold. These thresholds were determined based on extensive kitchen open flame simulation data. 1000 experiments were conducted under different lighting, fumes, and obstruction scenarios to statistically analyze the model's false positive and false negative rates. When the base threshold was set to 0.5, the model's false positive rate was 4.2% and its false negative rate was 2.8%, effectively identifying potential open flame hazards. When the high-risk threshold was set to 0.8, the model's flame target detection accuracy reached 98.5%, classifying it as a deterministic open flame risk, requiring no further verification.

[0115] When there are flame targets in the original detection data with a category confidence level higher than the basic threshold, it is determined that a potential open flame hazard has been detected.

[0116] If the confidence level of the flame target category is higher than the high-risk threshold, a level one warning signal is triggered;

[0117] If the confidence level of the flame target category is between the basic threshold and the high-risk threshold, a secondary warning signal is triggered;

[0118] Based on the bounding box location and the warning signal level, a warning command containing location information is generated and sent to the linked alarm device. The communication protocol adopted is MQTT, which is lightweight, low-power, and highly reliable, and adapts to the communication requirements of embedded platforms. The data format is JSON. During the transmission process, the QoS level is set to 1 to ensure that the warning command can be accurately delivered to the linked alarm device, ensuring the reliability of the system's linkage response.

[0119] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.

Claims

1. A lightweight kitchen open flame hazard early warning model based on YOLO, characterized in that, Includes the following steps: S1. Obtain the original monitoring image of the kitchen environment, and use a preprocessing algorithm that combines bilateral filtering and adaptive histogram equalization to denoise and enhance the original monitoring image, and output a standardized image. S2. Based on the standardized image, a structured pruning strategy is applied to the pre-trained YOLOv5 model to remove redundant convolutional layers and channels in its backbone network, while retaining the key layers used for extracting flame color, texture, and dynamic features, thus constructing a lightweight flame recognition model; S3. The lightweight flame recognition model is deployed on the target embedded platform, and the neural network inference framework of the platform is used for layer fusion and quantization calibration to generate a platform-optimized high-efficiency inference engine; S4. Utilize the high-efficiency inference engine to parse the real-time video stream. When a flame target is detected, trigger a graded early warning signal based on its bounding box position and confidence level.

2. The lightweight kitchen open flame hazard early warning model based on YOLO as described in claim 1, characterized in that, The acquisition of raw monitoring images of the kitchen environment specifically involves: based on the network camera hardware deployed in the kitchen, determining a fixed installation location and a field of view covering the stove, range hood, and fuel storage area; setting the image acquisition parameters of the network camera, including resolution, frame rate, and white balance, and establishing a network connection between it and the edge computing device; receiving the encoded video stream from the network camera via a real-time streaming protocol, parsing and decoding the data packets to restore a continuous sequence of raw image frames; performing timestamp alignment and integrity verification on the raw image frame sequence, removing corrupted frames caused by network jitter, and outputting a raw monitoring image sequence with a uniform format.

3. The lightweight kitchen open flame hazard early warning model based on YOLO as described in claim 1, characterized in that, The output standardized image is specifically obtained by: applying a bilateral filtering algorithm to the original monitoring image, and by combining spatial proximity and pixel intensity similarity weights, smoothing image noise while preserving flame edge details to obtain a denoised image; based on the denoised image, converting it from RGB color space to YUV color space, and separating the luminance component channel. An adaptive histogram equalization algorithm is applied to the luminance component channel. By calculating the histogram distribution of local areas of the image and performing contrast transformation, the visibility of the overall image and local dark areas is improved, resulting in an enhanced image. The luminance component of the enhanced image is merged with the original chrominance component and converted back to the RGB color space. Finally, pixel value normalization is performed to output a standardized image with uniform size and numerical range.

4. The lightweight kitchen open flame hazard early warning model based on YOLO as described in claim 1, characterized in that, The method steps for constructing the pre-trained YOLOv5 model are as follows: Based on the publicly available MS COCO general object detection dataset, obtain and load the initial weights of the baseline network structure domain of the YOLOv5 model as the basic pre-trained model; construct a dedicated dataset of flame images for kitchen scenes, which includes labeled flame images collected under several lighting conditions, oil fume concentrations, and occlusion conditions. The basic pre-trained model is iteratively trained on the flame image dataset using a transfer learning method. During training, the weights of the first few layers of the model backbone network are frozen, and the parameters of the subsequent network layers and the detection head are updated only to adapt the model to flame features. The model performance is evaluated using a validation set. Training stops when the average accuracy of the flame category reaches a preset threshold, resulting in a pre-trained YOLOv5 model specifically for flame recognition.

5. The lightweight kitchen open flame hazard early warning model based on YOLO according to claim 1, characterized in that, S2 includes: acquiring the pre-trained YOLOv5 model, calculating and evaluating the importance score of each channel based on the L1 norm of the output channels of each convolutional layer of the network; setting a global pruning ratio threshold according to the computing power and memory constraints of the target embedded platform, and identifying redundant channels in each layer whose scores are lower than the corresponding layer threshold based on the importance scores; performing structured pruning operations on the identified redundant channels, removing them from the network computation graph, and simultaneously removing their corresponding convolutional kernel weights and the input channels of the next layer to obtain the pruned sparse network structure; and performing channel rearrangement and connectivity reconstruction on the pruned sparse network structure to generate a lightweight network model to be fine-tuned.

6. The lightweight kitchen open flame hazard early warning model based on YOLO according to claim 1, characterized in that, S2 further includes: after applying structured pruning, identifying and retaining key initial convolutional layers responsible for extracting low-level semantic information, key intermediate layers that complete cross-layer feature fusion structures, and key high-level layers near the detection head in the backbone network; based on the network skeleton formed by the retained key layers, fine-tuning the lightweight network model to be fine-tuned on a dedicated flame image dataset, and finally constructing a lightweight flame recognition model.

7. The lightweight kitchen open flame hazard early warning model based on YOLO according to claim 1, characterized in that, The method for deploying the lightweight flame recognition model on the target embedded platform is as follows: identify the continuous linear computation layer and nonlinear activation layer in the lightweight flame recognition model; Based on the neural network inference framework supported by the target embedded platform, the continuous linear computation layer and nonlinear activation layer are merged into a single composite computation node. Based on the computation graph of the reconstructed model using the composite computing nodes, intermediate cache tensors are removed to generate an intermediate model optimized by layer fusion.

8. The lightweight kitchen open flame hazard early warning model based on YOLO according to claim 1, characterized in that, The quantitative calibration using the neural network inference framework of the platform includes: acquiring the intermediate model optimized by layer fusion, and collecting a subset of the flame image-specific dataset as a calibration dataset; inputting the calibration data into the intermediate model, and statistically analyzing the numerical distribution range of the output activation values ​​of each network layer; calculating and assigning scaling factors and integer zeros to each network layer based on the numerical distribution range and the fixed-point accuracy supported by the target embedded platform; and converting the floating-point weights of each convolutional layer and fully connected layer in the model into fixed-point representations based on the scaling factors and integer zeros, thereby generating the platform-optimized high-efficiency inference engine.

9. The lightweight kitchen open flame hazard early warning model based on YOLO according to claim 1, characterized in that, The process of using the high-efficiency inference engine to parse the real-time video stream specifically involves: acquiring the real-time encoded video stream from the network camera, performing real-time decoding and frame extraction to obtain continuous image frames; The image frame is scaled and pixel normalized to match the input requirements of the efficient inference engine. The processed image frame is input into the high-efficiency inference engine to perform forward inference calculations and obtain raw detection data containing the coordinates of the flame target bounding box, category confidence, and category label.

10. The lightweight kitchen open flame hazard early warning model based on YOLO according to claim 1, characterized in that, The specific steps for triggering graded early warning signals based on the bounding box position and confidence level are as follows: setting a basic confidence threshold and a high-risk threshold for flame target detection; when there are flame targets in the original detection data with a category confidence level higher than the basic threshold, it is determined that a potential open flame hazard has been detected; If the confidence level of the flame target category is higher than the high-risk threshold, a level one warning signal is triggered; If the confidence level of the flame target category is between the basic threshold and the high-risk threshold, a secondary warning signal is triggered; based on the bounding box position and the warning signal level, a warning command containing location information is generated and sent to the linkage alarm device.