Gas station flame smoke recognition and early warning system and method
By using the YOLOv7 object detection algorithm model in the gas field station for flame smoke recognition, combined with the convolutional fusion feature map by channel, the problem of the accuracy and efficiency of flame smoke detection in the existing technology is solved, and efficient fire monitoring is achieved and early warning have improved the level of safety management.
Patent Information
- Application Number
- CN202411338133.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-17
AI Technical Summary
The existing flame smoke detection methods of gas field stations have problems such as complex installation, high cost, low accuracy and misjudgment of sensors, low manual inspection efficiency, and large detection accuracy and errors of existing artificial intelligence technology in complex scenarios. .
Using the YOLOv7 object detection algorithm model, combining the backbone feature extraction network Backbone, strengthening feature extraction network FPN, classifier and regressor YOLO Head, the SCF module is introduced for channel-by-channel convolution fusion, extract feature maps of different scales, and real-time use image acquisition modules Receive video data, determine identification frames at different angles, and perform flame smoke recognition and early warning.
It improves the accuracy of fire detection, reduces the cumbersomeness of the feature extraction process, realizes real-time and automatic monitoring, improves the safety management efficiency and quality of gas stations, and can promptly detect potential fire hazards and avoid major accidents.
Smart Images

Figure CN119323747A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of flame and smoke recognition in a gas station, and in particular to a flame and smoke recognition and early warning system and method for a gas station. Background Art
[0002] There are many sources of danger during the construction and production of gas stations, among which flame is the main factor causing safety accidents. Fires occur frequently in people's daily lives and cause great harm. When a fire occurs, if it can be discovered and reported in time, the loss can be minimized. Existing fire detection methods mainly include sensor detection method and image detection method.
[0003] The sensor detection method mainly uses sensors to monitor the temperature of the detection area, but the installation process and detection range of the sensor are restricted by space. When conducting indoor detection, sensors need to be arranged at multiple points and in the full range to ensure that no corner is missed. Even the flame can only be detected when it has formed a certain scale. The monitoring is not timely, the arrangement is troublesome, the installation requirements are high and the cost is high. When conducting outdoor detection, the measurement accuracy of the sensor is affected by the distance from the fire point, the reliability is low, and there is the possibility of false alarms. For example, a high-temperature car engine and a car tire that runs at high speed in summer and causes the temperature to be too high. Although the temperature reaches the ignition temperature, no fire has occurred. At this time, the alarm cannot produce practical value.
[0004] At present, most of the inspections of flames in gas stations are carried out by manual inspection, but this method is time-consuming, labor-intensive, inefficient, and cannot detect flames in the first place. There are also flame and smoke detection methods using artificial intelligence, such as the Chinese invention patent with patent number 202211687237.2, which discloses a flame and smoke recognition method applied to gas stations. The flame and smoke model is obtained by inputting yolov5 for training, but there are technical problems such as low detection accuracy and large errors in simultaneous flame and smoke detection in complex scenes.
[0005] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention
[0006] In view of the problems in the related art, the present invention proposes a flame and smoke identification and early warning system and method for a gas station to overcome the above-mentioned technical problems existing in the existing related art.
[0007] The technical solution of the present invention is achieved in this way:
[0008] In one aspect, the present invention:
[0009] A flame and smoke recognition and early warning method for a gas station comprises the following steps:
[0010] Receiving video data sent by a collection device in real time in advance, extracting multiple image frames from the video data, and determining recognition frames at different angles from the multiple image frames;
[0011] The recognition frame is sent to a preset flame smoke recognition model for detection, a current frame containing a detection frame is obtained, and the detection frame is used as a flame smoke recognition frame to obtain a detection result, wherein the flame smoke recognition model is a YOLOv7 target detection algorithm model, and the YOLOv7 target detection algorithm model includes: a backbone feature extraction network Backbone, an enhanced feature extraction network FPN and a classifier and regressor YOLO Head, and the enhanced feature extraction network FPN introduces an SCF module for channel-by-channel convolution to fuse channels of feature maps of different scales and extract feature maps of different scales;
[0012] Send warning information based on the detection results.
[0013] The step of determining the recognition frames at different angles in the plurality of image frames comprises the following steps:
[0014] Obtain the previous frame, current frame and next frame of video data, and determine whether the acquisition device is rotating, wherein;
[0015] If the current frame is the same as the previous frame and the current frame is different from the next frame, it means that the acquisition device is rotated, and the current frame is represented as an identification frame of different angles among the multiple image frames;
[0016] Determine whether the current recognition frame is the last frame of the video data, wherein;
[0017] If the current recognition frame is the last frame of the video data, the current recognition frame is input into the flame and smoke recognition model for detection;
[0018] If the current recognition frame is not the last frame of the video data, then continue to acquire the next recognition frame until the current recognition frame is the last frame of the video data.
[0019] The step of obtaining the current frame containing the detection frame comprises the following steps:
[0020] Eliminate the wrong circle marks on the current frame containing the detection frame according to the preset false alarm elimination algorithm;
[0021] The current frame containing the detection frame after the erroneous circle marks are removed is used as the flame and smoke recognition frame.
[0022] The step of extracting feature maps of different scales includes the following steps:
[0023] Get the features of the convolution branch and the Transformer branch respectively;
[0024] For the features of the Transformer branch, use the rearrange operation to convert them from the token form to the general feature form c×h×w;
[0025] Concatenate the converted Transformer features and convolutional features in the channel dimension;
[0026] The features are further fused through channel-wise fusion operations, including: using 1×1 convolution to process the concatenated features, applying ReLU activation function to increase nonlinearity, and adding the processed features to the original concatenated features through residual connection to obtain the mixed features mi;
[0027] Mi is split from the channel dimension to obtain two parts of features. The two parts of features pass through the conv layer and the MLP layer respectively as the input of the next CNN / Transformer block.
[0028] Another aspect of the present invention is:
[0029] A flame and smoke identification and early warning system for a gas station, comprising:
[0030] An image acquisition module is used to receive video data sent by a collection device in real time, extract multiple image frames from the video data, and determine recognition frames at different angles from the multiple image frames;
[0031] The flame smoke recognition module sends the recognition frame to a preset flame smoke recognition model for detection, obtains a current frame containing a detection frame, and uses the detection frame as a flame smoke recognition frame to obtain a detection result, wherein the flame smoke recognition model is a YOLOv7 target detection algorithm model, and the enhanced feature extraction network FPN of the YOLOv7 target detection algorithm model introduces an SCF module for channel-by-channel convolution to fuse channels of feature maps of different scales and extract feature maps of different scales;
[0032] The early warning module sends early warning information based on the detection results.
[0033] Furthermore, the image acquisition module includes: an identification frame acquisition module, which is used to calibrate the rotation of the acquisition device and acquire the current frame represented as an identification frame of different angles in multiple image frames.
[0034] Furthermore, the image acquisition module is a camera with adjustable angle, a CCD imaging unit or a CMOS imaging unit.
[0035] Furthermore, the flame and smoke recognition module includes: a detection frame elimination module, which is used to eliminate erroneous circle marks on the current frame containing the detection frame according to a preset false alarm elimination algorithm.
[0036] Beneficial effects of the present invention:
[0037] The flame and smoke recognition and early warning system and method of the gas station of the present invention receive video data sent by an acquisition device in real time in advance, extract multiple image frames in the video data, determine recognition frames at different angles in the multiple image frames, send the recognition frames to a preset flame and smoke recognition model for detection, obtain a current frame containing a detection frame, and use the detection frame as a flame and smoke recognition frame to obtain a detection result, and send early warning information according to the detection result. It can effectively reduce the number of channels by fusing channels of feature maps of different scales using a channel-by-channel convolution operation, thereby improving the representation ability of the feature map, effectively reducing the amount of parameters and calculations, and more effectively extracting feature maps of different scales to realize flame and smoke recognition and early warning of the gas station, which can not only avoid the cumbersome feature extraction process and improve the accuracy of fire detection, but also can monitor the current area in real time and automatically, thereby improving the safety management efficiency and quality of the gas station, which is of great significance for ensuring the safe operation of the gas station, can timely discover potential fire hazards, and assist relevant personnel to take measures quickly to avoid the occurrence of major accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 This is a principle block diagram of a flame and smoke identification and early warning system for a gas station according to an embodiment of the present invention;
[0040] Figure 2 The present invention is a flowchart of a method for identifying and warning flame and smoke in a gas station according to an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0042] According to an embodiment of the present invention, a flame and smoke recognition and early warning method for a gas station is provided.
[0043] like Figure 1 As shown, the flame and smoke recognition and early warning method for a gas station according to an embodiment of the present invention includes the following steps:
[0044] Step S1, receiving video data sent by a collection device in real time in advance, extracting multiple image frames from the video data, and determining recognition frames at different angles from the multiple image frames;
[0045] The step of determining the recognition frames at different angles in the plurality of image frames comprises the following steps:
[0046] Obtain the previous frame, current frame and next frame of video data, and determine whether the acquisition device is rotating, wherein;
[0047] If the current frame is the same as the previous frame and the current frame is different from the next frame, it means that the acquisition device is rotated, and the current frame is represented as an identification frame of different angles among the multiple image frames;
[0048] Determine whether the current recognition frame is the last frame of the video data, wherein;
[0049] If the current recognition frame is the last frame of the video data, the current recognition frame is input into the flame and smoke recognition model for detection;
[0050] If the current recognition frame is not the last frame of the video data, then continue to acquire the next recognition frame until the current recognition frame is the last frame of the video data.
[0051] The present technical solution, specifically, a method for determining the rotation of a collection device, comprises the following steps:
[0052] Select four judgment areas at the same positions in the current frame and the previous frame, the four corners of the current frame, each area size is 100×100, and perform chi-square distance calculation on each judgment area of the current frame and each corresponding judgment area of the previous frame. If three or more chi-square distances exceed the preset threshold, the camera is judged to be in a rotating state, otherwise it is in a stationary state.
[0053] Specifically, the current frame rotated by the acquisition device can be used as the identification frame of different angles in the multiple image frames.
[0054] In addition, the calculation method of chi-square distance is expressed as:
[0055]
[0056] Among them, a i is the observed frequency of a at level i, e i is the expected frequency of e at level i, k is the total frequency, p i is the expected frequency of level i. i Equal to the total frequency k × the expected probability p of level i i .
[0057] Specifically, the closer the observed frequency is to the expected frequency, the smaller the difference between the two is, and the smaller the chi-square value is; conversely, the greater the difference between the observed frequency and the expected frequency, the larger the chi-square value is.
[0058] Step S2, sending the recognition frame to a preset flame smoke recognition model for detection, obtaining a current frame containing a detection frame, and using the detection frame as a flame smoke recognition frame to obtain a detection result, wherein the flame smoke recognition model is a YOLOv7 target detection algorithm model, and the YOLOv7 target detection algorithm model includes: a backbone feature extraction network Backbone, an enhanced feature extraction network FPN and a classifier and regressor YOLO Head, and the enhanced feature extraction network FPN introduces an SCF module for channel-by-channel convolution to fuse channels of feature maps of different scales to extract feature maps of different scales;
[0059] Step S3, sending warning information according to the detection results.
[0060] Specifically, when the system is used, an alarm is automatically triggered when abnormal smoke or flames appear in the screen. The alarm signal can be displayed on the monitoring client interface, pushed to the mobile phone, and linked to the on-site warning lights, audio and other equipment. At the same time, the alarm information will be stored in the server database in a timely manner, including time, location, snapshots, videos, etc., to facilitate subsequent inquiries and on-demand playback, so as to trace historical records and quickly find the responsible person.
[0061] In addition, the step of obtaining the current frame containing the detection frame includes the following steps:
[0062] Eliminate the wrong circle marks on the current frame containing the detection frame according to the preset false alarm elimination algorithm;
[0063] The current frame containing the detection frame after the erroneous circle marks are removed is used as the flame and smoke recognition frame.
[0064] This technical solution, for the above-mentioned false alarm elimination algorithm, includes the following steps:
[0065] If the current frame is the first frame containing a detection frame, the detection frame contained in the current frame is used as the historical detection frame;
[0066] If it is not the first frame, the number of detection frames contained in the current frame is compared with the number of historical detection frames. If the number is the same, the intersection-over-union ratio of the detection frame contained in the current frame and the historical detection frame is calculated; if the intersection-over-union ratio is greater than the preset IoU threshold, the corresponding detection frame in the current frame is eliminated, and the detection frame in the current frame is re-used as the historical detection frame, otherwise the detection frame in the current frame is used as the remaining detection frame.
[0067] Specifically, the calculation of the Intersection over Union (IoU) value is based on the intersection and union of the predicted box and the true box, expressed as:
[0068]
[0069] The intersection area is the area of the overlap between the predicted box and the true box, and the union area is the total area of the two. The IoU value range is between 0 and 1. The larger the value, the higher the overlap between the predicted box and the true box, that is, the better the detection effect.
[0070] When the technical solution is applied, an IoU threshold is set, for example, 0.5. When the intersection over union ratio is greater than the IoU threshold, the corresponding detection box in the current frame is eliminated.
[0071] In addition, the step of extracting feature maps of different scales includes the following steps:
[0072] Get the features of the convolution branch (cnn_feature) and the Transformer (transformer_feature) branch respectively;
[0073] For the features of the Transformer branch, use the rearrange operation to convert them from the token form to the general feature form c×h×w (number of channels×height×width);
[0074] Concatenate the converted Transformer features and convolutional features in the channel dimension;
[0075] The features are further fused through the channel-wise fusion operation, including: 1×1 convolution, ReLU function and residual connection.
[0076] Specifically, the following steps are included: using 1×1 convolution to process the concatenated features, applying ReLU activation function to increase nonlinearity, adding the processed features to the original concatenated features through residual connection, and obtaining the mixed features mi;
[0077] Mi is split from the channel dimension to obtain two parts of features. The two parts of features pass through the conv layer and the MLP layer respectively as the input of the next CNN / Transformer block.
[0078] This technical solution introduces the SCF module into the enhanced feature extraction network FPN. The SCF module can effectively reduce the number of channels by using channel-by-channel convolution operations to fuse the channels of feature maps of different scales. This can improve the representation ability of the feature maps, effectively reduce the amount of parameters and calculations, and more effectively extract feature maps of different scales.
[0079] In addition, when applied, the specific implementation of the rearrange operation will vary depending on the original form of the Transformer feature and the form of the desired transformation. In addition, the specific parameters and settings of the 1×1 convolution, ReLU function, and residual connection in channel-wise fusion may also need to be adjusted and optimized according to actual conditions to achieve the best fusion effect.
[0080] In addition, for the above YOLOv7 target detection algorithm model, the details are as follows:
[0081] Data preparation: First, you need to prepare a dataset containing flames and smoke. The images in these datasets should be annotated with the location information of flames and smoke (usually in the form of bounding boxes).
[0082] Model training: Use the prepared data set to train the YOLOv7 target detection algorithm model. The network structure of the YOLOv7 target detection algorithm model includes a backbone feature extraction network (Backbone), a reinforced feature extraction network (FPN), and a classifier and regressor (YOLO Head).
[0083] During the training process, the model learns to extract features from the image and adjusts the model's parameters based on the annotation information so that the model can accurately identify the location of flames and smoke.
[0084] Backbone is used to extract features from the input image and obtain multiple feature layers. FPN performs feature fusion on these feature layers and combines feature information of different scales to better capture the characteristics of flames and smoke. YOLO Head judges the feature points, determines whether the prior box on each feature point contains an object, and predicts the category and location of the object.
[0085] According to an embodiment of the present invention, a flame and smoke identification and warning system for a gas station is provided.
[0086] like Figure 2 As shown, a flame and smoke identification and early warning system for a gas station according to an embodiment of the present invention includes:
[0087] The image acquisition module 1 is used to receive the video data sent by the acquisition device in real time, extract multiple image frames from the video data, and determine the recognition frames at different angles in the multiple image frames;
[0088] The flame smoke recognition module 2 sends the recognition frame to a preset flame smoke recognition model for detection, obtains a current frame containing a detection frame, and uses the detection frame as a flame smoke recognition frame to obtain a detection result, wherein the flame smoke recognition model is a YOLOv7 target detection algorithm model, and the enhanced feature extraction network FPN of the YOLOv7 target detection algorithm model introduces an SCF module for channel-by-channel convolution to fuse channels of feature maps of different scales and extract feature maps of different scales;
[0089] The early warning module 3 sends early warning information according to the detection results.
[0090] In addition, the image acquisition module 1 includes: an identification frame acquisition module 11, which is used to calibrate the rotation of the acquisition device and acquire the current frame represented as an identification frame of different angles in multiple image frames.
[0091] In addition, the image acquisition module 1 is a camera with adjustable angle, a CCD imaging unit or a CMOS imaging unit.
[0092] In addition, the flame and smoke recognition module 2 includes: a detection frame elimination module 21, which is used to eliminate the wrong circle mark of the current frame containing the detection frame according to a preset false alarm elimination algorithm.
[0093] In summary, with the help of the above technical scheme of the present invention, by pre-receiving the video data sent by the acquisition device in real time, and extracting multiple image frames in the video data, determining the recognition frames at different angles in the multiple image frames, sending the recognition frames to the preset flame smoke recognition model for detection, obtaining the current frame containing the detection frame, and using the detection frame as the flame smoke recognition frame to obtain the detection result, and sending the warning information according to the detection result, it can effectively reduce the number of channels by using the channel-by-channel convolution operation to fuse the channels of the feature maps of different scales, so that the representation ability of the feature map can be improved, the amount of parameters and the amount of calculation can be effectively reduced, and the feature maps of different scales can be more effectively extracted to realize the flame smoke recognition warning of the gas station, which can not only avoid the cumbersome feature extraction process, but also improve the accuracy of fire detection, and can monitor the current area in real time and automatically, and improve the safety management efficiency and quality of the gas station, which is of great significance for ensuring the safe operation of the gas station, and can timely discover potential fire hazards, assist relevant personnel to take measures quickly, and avoid major accidents.
[0094] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. After considering the disclosure of the specification and the examples, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and the examples are only regarded as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.
[0095] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for identifying and warning flame and smoke in a gas station, characterized in that: The following steps are involved: Receiving video data sent by a collection device in real time in advance, extracting multiple image frames from the video data, and determining recognition frames at different angles from the multiple image frames; The recognition frame is sent to a preset flame smoke recognition model for detection, a current frame containing a detection frame is obtained, and the detection frame is used as a flame smoke recognition frame to obtain a detection result, wherein the flame smoke recognition model is a YOLOv7 target detection algorithm model, and the YOLOv7 target detection algorithm model includes: a backbone feature extraction network Backbone, an enhanced feature extraction network FPN and a classifier and regressor YOLO Head, and the enhanced feature extraction network FPN introduces an SCF module for channel-by-channel convolution to fuse channels of feature maps of different scales and extract feature maps of different scales; Send warning information based on the detection results.
2. The method for identifying and warning flame and smoke in a gas station according to claim 1, characterized in that: The step of determining the identification frames at different angles in the plurality of image frames comprises the following steps: Obtain the previous frame, current frame and next frame of video data, and determine whether the acquisition device is rotating, wherein; If the current frame is the same as the previous frame and the current frame is different from the next frame, it means that the acquisition device is rotated, and the current frame is represented as an identification frame of different angles among the multiple image frames; Determine whether the current recognition frame is the last frame of the video data, wherein; If the current recognition frame is the last frame of the video data, the current recognition frame is input into the flame and smoke recognition model for detection; If the current recognition frame is not the last frame of the video data, then continue to acquire the next recognition frame until the current recognition frame is the last frame of the video data.
3. The method for identifying and warning flame and smoke in a gas station according to claim 2 is characterized in that: The step of obtaining the current frame containing the detection frame includes the following steps: Eliminate the wrong circle marks on the current frame containing the detection frame according to the preset false alarm elimination algorithm; The current frame containing the detection frame after the erroneous circle marks are removed is used as the flame and smoke recognition frame.
4. The method for identifying and warning flame and smoke in a gas station according to claim 1, characterized in that: The steps of extracting feature maps of different scales include the following steps: Get the features of the convolution branch and the Transformer branch respectively; For the features of the Transformer branch, use the rearrange operation to convert them from the token form to the general feature form c×h×w; Concatenate the converted Transformer features and convolutional features in the channel dimension; The features are further fused through channel-wise fusion operations, including: using 1×1 convolution to process the concatenated features, applying ReLU activation function to increase nonlinearity, and adding the processed features to the original concatenated features through residual connection to obtain the mixed features mi; Mi is split from the channel dimension to obtain two parts of features. The two parts of features pass through the conv layer and the MLP layer respectively as the input of the next CNN / Transformer block.
5. A flame and smoke recognition and early warning system for a gas station, used as an early warning system for the flame and smoke recognition and early warning method for a gas station according to any one of claims 1 to 4, characterized in that: include: An image acquisition module (1) is used to receive video data sent by a collection device in real time, extract multiple image frames from the video data, and determine recognition frames at different angles from the multiple image frames; The flame smoke recognition module (2) sends the recognition frame to a preset flame smoke recognition model for detection, obtains a current frame containing a detection frame, and uses the detection frame as a flame smoke recognition frame to obtain a detection result, wherein the flame smoke recognition model is a YOLOv7 target detection algorithm model, and the enhanced feature extraction network FPN of the YOLOv7 target detection algorithm model introduces an SCF module for channel-by-channel convolution to fuse channels of feature maps of different scales, thereby extracting feature maps of different scales; The early warning module (3) sends early warning information according to the detection results.
6. The flame and smoke identification and early warning system for a gas station according to claim 5 is characterized in that: The image acquisition module (1) comprises: an identification frame acquisition module (11) for calibrating the rotation of the acquisition device and acquiring identification frames of different angles in a plurality of image frames representing the current frame.
7. The flame and smoke identification and early warning system for a gas station according to claim 6 is characterized in that: The image acquisition module (1) is a camera with adjustable angle, a CCD imaging unit or a CMOS imaging unit.
8. The flame and smoke identification and early warning system for a gas station according to claim 5 is characterized in that: The flame and smoke recognition module (2) comprises: a detection frame elimination module (21) for eliminating erroneous circle marks on a current frame containing a detection frame according to a preset false alarm elimination algorithm.
Citation Information
Patent Citations
Flame smoke identification method applied to gas field station
CN115861898A