Computer vision-based car washing machine construction real-time fire smoke detection and identification system
By using computer vision technology and multi-dimensional feature fusion, a dynamic background reference frame and a predefined mask are constructed, which solves the problem of high false alarm rate in the construction environment of car wash machines and realizes accurate identification and real-time detection of flames and smoke.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 建研防火科技有限公司
- Filing Date
- 2026-01-21
- Publication Date
- 2026-06-05
Smart Images

Figure CN121640394B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, specifically to a computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction. Background Technology
[0002] The construction environment of car wash machines, especially the interior and surrounding areas of automated tunnel car wash machines, presents a series of unique fire hazards. These environments are typically characterized by high humidity, strong water mist, frequent changes in lighting, and the accumulation of volatile gases from various chemical cleaning agents. Traditional fire detection technologies based on smoke and heat sensors are severely hampered in such environments. Water mist is easily misinterpreted as smoke, and the high temperature and humidity also affect sensor sensitivity, resulting in extremely low reliability of existing technologies for fire detection in car wash machine construction scenarios.
[0003] The existing technology has the following shortcomings:
[0004] Traditional fire detection methods suffer from extremely high false alarm rates in special industrial environments such as car washes, characterized by high humidity, strong water mist, and periodic mechanical movement. The continuous high-pressure water mist in the car wash environment is visually very similar to real smoke, and the regular movements of equipment such as brush rollers and conveyor belts are easily misinterpreted as dynamic flame characteristics. This leads to a large number of false alarms in detection systems based on ordinary video analysis or traditional sensors, severely impacting the reliability and practicality of the detection system. Summary of the Invention
[0005] The purpose of this invention is to provide a computer vision-based real-time fire and smoke detection and identification system for car wash machine construction, in order to solve the problems mentioned above.
[0006] The objective of this invention can be achieved through the following technical solutions:
[0007] A computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction includes:
[0008] The image acquisition and preprocessing module is used to acquire real-time monitoring video streams of the car wash machine construction area and perform image enhancement processing on the video streams to obtain preprocessed image sequences.
[0009] The dynamic interference suppression and foreground segmentation module is used to perform background modeling and foreground analysis on the preprocessed image sequence. By calculating the difference between the current frame and the background reference frame, and combining it with the predefined car wash machine inherent moving part mask for filtering, the real moving foreground region caused by potential fire smoke is segmented.
[0010] A multimodal suspected region generation module is used to extract suspected flame regions and suspected smoke regions in parallel from a real moving foreground region;
[0011] The multi-dimensional feature fusion module is used to extract static texture features and dynamic shape change features of suspected flame areas to form flame feature vectors, and to extract color statistical features and gradient direction features of suspected smoke areas to form smoke feature vectors.
[0012] The fire and smoke identification and result output module is used to input the flame feature vector and smoke feature vector into the pre-trained fire and smoke classification model, and output the fire probability value and smoke probability value. When any probability value exceeds the corresponding threshold, it is determined that there is a fire or smoke. The probability value includes the fire probability value and the smoke probability value, and outputs a structured identification result containing category and location information.
[0013] As a further aspect of the present invention: the process for identifying the real moving foreground region is as follows:
[0014] For the preprocessed image sequence, a method based on the statistical distribution of pixel values in the time domain is adopted to establish and maintain a sample set containing multiple possible background values for each pixel, and to incorporate scene illumination changes through a random update strategy to generate a dynamic background reference frame;
[0015] Calculate the color and brightness differences between the current frame and the dynamic background reference frame at each pixel position to obtain the preliminary binarized motion region; perform a logical subtraction operation between the preliminary binarized motion region and the predefined car wash machine inherent moving part mask to obtain the candidate real motion foreground region;
[0016] Multi-scale motion consistency verification is performed on the candidate real moving foreground regions. The consistency of motion vectors in the internal regions between consecutive frames is analyzed, and the region color uniformity judgment is integrated to eliminate small and discrete false motion regions caused by water splashes and local reflections. Finally, the real moving foreground regions are output.
[0017] As a further aspect of the present invention: obtaining the preliminary binarized motion region specifically includes:
[0018] Calculate the absolute differences between the current frame and the dynamic background reference frame on multiple color channels, and then weight and fuse the absolute differences to generate a comprehensive difference map.
[0019] Based on the local contrast within the neighborhood of each pixel in the comprehensive difference map, the difference threshold of the corresponding pixel is dynamically calculated to generate an initial binarized motion region that can suppress texture noise.
[0020] Using the connected region with the largest difference value in the initial binarized motion region as the seed point, region growing is performed based on the similarity of the difference values between adjacent pixels. Internal holes and discrete artifacts are eliminated in the grown region, and finally a preliminary binarized motion region is obtained.
[0021] As a further aspect of the present invention: the extraction of suspected flame areas and suspected smoke areas specifically includes:
[0022] In the RGB color space, verify whether the red component of each pixel in the real moving foreground region is simultaneously greater than the green and blue components, and in the HSV color space, verify whether the saturation of each pixel in the real moving foreground region is higher than the dynamically calculated saturation threshold; define the set of pixels that simultaneously meet the color rules and whose brightness change rate exceeds the preset threshold as the initial flame candidate region.
[0023] Calculate the dark channel image of the real moving foreground region, and initially identify the region with dark channel value below a first preset threshold as a potential smoke region; perform chromaticity clustering analysis on the real moving foreground region in the YUV color space, and identify the region with chromaticity value concentrated in the preset smoke characteristic chromaticity range as a chromaticity candidate region; define the intersection of the potential smoke region and the chromaticity candidate region as the initial smoke candidate region.
[0024] Perform morphological opening operations on the initial flame candidate region and the initial smoke candidate region respectively, and then perform morphological closing operations to output the suspected flame region and the suspected smoke region.
[0025] As a further aspect of the present invention: the process of generating the flame feature vector is as follows:
[0026] Within the suspected flame area, local binary texture statistics are calculated for each window using sliding windows of different sizes. By statistically analyzing the distribution histograms of different texture patterns within each window, multi-scale texture features characterizing the roughness and contrast of the flame texture are obtained.
[0027] In a continuous frame sequence, calculate the area change rate and contour fluctuation index of the suspected flame region;
[0028] Multi-scale texture features, area change rate, and contour fluctuation index are normalized and then spliced together in a preset order to form a flame feature vector that characterizes the static texture characteristics and dynamic shape change characteristics of the flame.
[0029] As a further aspect of the present invention: the calculation of the area change rate and contour fluctuation index of the suspected flame region specifically includes:
[0030] In a continuous frame sequence, connected component analysis is performed on the suspected flame region, and the total number of pixels in each connected component is counted as the region area of the corresponding continuous frame, thus constructing a sequence data of area change over time.
[0031] Based on the sequential data of area changing over time, the relative change in area between adjacent frames is calculated, and a weighted moving average is applied to the change between multiple consecutive frames. The average of the processed change is used as the area change rate.
[0032] Extract the minimum bounding rectangle of the suspected flame region in each consecutive frame, calculate the displacement of the center point of the minimum bounding rectangle between adjacent frames and the change in the aspect ratio, and use the product of the displacement and the change in aspect ratio as the contour fluctuation index.
[0033] As a further aspect of the present invention: the formation of the smoke feature vector specifically includes:
[0034] The suspected smoke area is divided into multiple non-overlapping sub-blocks. The numerical distribution of pixels in each sub-block across multiple color channels is calculated. By statistically analyzing the similarity and distribution width between the color distribution histograms of each sub-block, color statistical features characterizing the uniformity and diffusion properties of smoke color are obtained.
[0035] Calculate the gradient magnitude and direction of the suspected smoke region, divide the direction range into multiple intervals, count the sum of magnitudes in each gradient direction interval, and obtain the gradient direction feature that characterizes the degree of disorder of the smoke texture direction by calculating the ratio of the standard deviation to the mean of the sum of magnitudes in each interval.
[0036] After normalizing the color statistical features and gradient direction features, they are concatenated and combined according to a preset dimensional order to form a smoke feature vector that simultaneously contains the smoke color distribution characteristics and texture direction characteristics.
[0037] As a further aspect of the present invention: the step of inputting the flame feature vector and the smoke feature vector into a pre-trained fire and smoke classification model, and outputting the fire probability value and the smoke probability value, specifically includes:
[0038] Flame feature vectors and smoke feature vectors are used as independent inputs to a fire and smoke classification model built on support vector machines. The training objective of the fire and smoke classification model is to minimize the cross-entropy loss between the predicted probability value and the true labeled probability value. The fire and smoke classification model is trained, and the corresponding fire probability value and smoke probability value are output according to the trained fire and smoke classification model.
[0039] As a further aspect of the present invention: the construction process of the fire smoke classification model is as follows:
[0040] Flame and smoke feature vectors from historical monitoring data were collected and combined with manually labeled real fire and smoke states as target labels to construct a historical training dataset. The entire dataset was divided into training and validation subsets according to a preset ratio for parameter learning and performance validation of the fire and smoke classification model, respectively. The support vector machine algorithm was used to construct the fire and smoke classification model, and the kernel function type, penalty factor, and kernel function parameters were set as key hyperparameters. During training, the support vectors were solved using the sequence minimum optimization algorithm to determine the optimal classification hyperplane, and nonlinear mapping was performed in the feature space to handle complex feature distributions. The particle swarm optimization algorithm was introduced to automatically optimize the hyperparameters of the fire and smoke classification model. After each training iteration, the cross-entropy loss between the predicted result and the real label was calculated. When the cross-entropy loss on the validation subset tended to stabilize and reached a preset threshold, the training of the fire and smoke classification model was completed. The trained fire and smoke classification model was deployed to the car wash machine construction monitoring system, which received input data composed of flame and smoke feature vectors in real time and output the corresponding fire probability value and smoke probability value.
[0041] The beneficial effects of this invention are:
[0042] (1) To address the complex conditions unique to car wash machine construction areas, such as water mist interference, mechanical motion interference, and changes in lighting, this invention effectively distinguishes between real fire situations and conventional environmental interference by constructing a dual filtering mechanism of dynamic background reference frames and predefined moving part masks. Specifically, a background modeling method based on pixel temporal distribution statistics is adopted, combined with a random update strategy to adapt to changes in lighting. Then, periodic motion interference from brush rollers, conveyor belts, etc., is filtered out through moving part masks. Finally, multi-scale motion consistency verification and color uniformity judgment are used to eliminate water splashes and local reflection interference. This multi-level interference suppression system enables the system to maintain high sensitivity while keeping the false alarm rate at an extremely low level, solving the technical problem of poor applicability of traditional detection methods in complex industrial environments.
[0043] (2) This invention overcomes the limitations of single feature detection and constructs a complete feature engineering system. Multi-dimensional feature extraction schemes are designed to address the different physical characteristics of flames and smoke: static texture features and dynamic shape change features are extracted from the flame region to capture its irregular jumping characteristics; for the smoke region, color statistical features and gradient direction features are combined to characterize its diffusion and semi-transparency. A support vector machine model is used to process the 57-dimensional smoke feature vector and the 44-dimensional flame feature vector in parallel, achieving accurate classification of fire smoke. This multi-modal feature fusion method not only improves the recognition accuracy but also ensures the real-time performance of the system through feature dimensionality reduction and optimization, providing technical support for rapid response in industrial environments. Attached Figure Description
[0044] The invention will now be further described with reference to the accompanying drawings.
[0045] Figure 1 This is a system block diagram of the present invention. Detailed Implementation
[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] Please see Figure 1 As shown, this invention is a computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction, comprising:
[0048] The image acquisition and preprocessing module is used to acquire real-time monitoring video streams of the car wash machine construction area and perform image enhancement processing on the video streams to obtain preprocessed image sequences.
[0049] The dynamic interference suppression and foreground segmentation module is used to perform background modeling and foreground analysis on the preprocessed image sequence. By calculating the difference between the current frame and the background reference frame, and combining it with the predefined car wash machine inherent moving part mask for filtering, the real moving foreground region caused by potential fire smoke is segmented.
[0050] A multimodal suspected region generation module is used to extract suspected flame regions and suspected smoke regions in parallel from a real moving foreground region;
[0051] The multi-dimensional feature fusion module is used to extract static texture features and dynamic shape change features of suspected flame areas to form flame feature vectors, and to extract color statistical features and gradient direction features of suspected smoke areas to form smoke feature vectors.
[0052] The fire and smoke identification and result output module is used to input the flame feature vector and smoke feature vector into the pre-trained fire and smoke classification model, and output the fire probability value and smoke probability value. When any probability value exceeds the corresponding threshold, it is determined that there is a fire or smoke. The probability value includes the fire probability value and the smoke probability value, and outputs a structured identification result containing category and location information.
[0053] In the image acquisition and preprocessing module, the image acquisition equipment deployment steps are as follows: High-definition network cameras, mounted on fixed brackets on both sides and the top of the car wash tunnel, continuously capture video of the construction area. These cameras are equipped with wide dynamic range image sensors, capable of simultaneously capturing image details in both brightly lit and shadowed areas. The cameras transmit uncompressed raw video data in real time.
[0054] Image denoising and color correction steps: First, bilateral filtering is performed on the acquired raw video data to reduce image noise while preserving edge features. Then, adaptive contrast enhancement is performed on the luminance component in the LAB color space, and non-linear stretching is applied to the pixel values in the highlight and shadow areas respectively.
[0055] Image sequence generation steps: Arrange the denoised and color-corrected image frames in chronological order to construct a continuous preprocessed image sequence. Each image frame is accompanied by a timestamp and camera location identifier, forming an image data set with spatiotemporal correlation.
[0056] In the dynamic interference suppression and foreground segmentation module, the dynamic background reference frame generation step involves: for each pixel in the preprocessed image sequence, establishing and maintaining a sample set containing 50 historical pixel values. The sample set is constructed as follows: from the first 100 frames of the video sequence, 50 pixel values at different time points are randomly selected as initial samples for each pixel. In subsequent processing, for each new frame where a pixel is not identified as foreground, its current pixel value is added to its own sample set with a 1% probability, and its pixel value is also randomly added to the sample sets of neighboring pixels with a 1% probability. The sample set is updated using a first-in, first-out (FIFO) strategy, maintaining a constant sample size of 50. The dynamic background reference frame is obtained by calculating the median value of the sample set corresponding to each pixel; that is, after sorting the 50 sample values for each pixel, the 25th sample value is taken as the background reference value for that pixel.
[0057] Binarized motion region acquisition steps: Calculate the absolute differences between the current frame and the dynamic background reference frame in the red, green, and blue color channels. Weight the differences in the three channels with weights of 0.3, 0.6, and 0.1 respectively, and sum them to generate a comprehensive difference map. Based on the standard deviation of pixel values within an 11×11 neighborhood of each pixel in the comprehensive difference map, dynamically calculate the difference threshold for that pixel. The threshold calculation formula is: base threshold 0.15 plus the neighborhood standard deviation multiplied by a coefficient of 0.05. Mark the regions in the comprehensive difference map where pixel values are greater than the corresponding threshold as foreground, thus obtaining the initial binarized motion region.
[0058] Motion interference filtering steps: The predefined inherent moving part mask of the car wash machine is obtained as follows: A video sequence of 100 frames continuously being captured under fire-free conditions showing the car wash machine operating normally is obtained. The frequency of each pixel being identified as a moving region is counted, and pixel regions with a frequency exceeding 80% are marked as inherent moving part regions. A logical subtraction operation is performed between the initial binarized motion region and the inherent moving part mask, that is, all pixels located within the inherent moving part mask are removed from the initial binarized motion region to obtain candidate real moving foreground regions.
[0059] Region refinement processing steps: For the candidate true moving foreground regions obtained after interference filtering, calculate the motion vector of each connected region within it over 5 consecutive frames. The motion vector is obtained by calculating the centroid displacement of the same connected region between adjacent frames, and the centroid coordinates are calculated by averaging the coordinates of all pixels within the region. For each connected region, analyze the standard deviation of its internal pixels in the red channel. If the standard deviation is less than 15 and the change in motion vector direction exceeds 60 degrees, the region is determined to be a true moving foreground region. The final output true moving foreground region must meet the conditions of having an area greater than 100 pixels and motion lasting for more than 3 frames.
[0060] In the multimodal suspected region generation module, the specific process of extracting suspected flame regions from the real moving foreground region is as follows: First, each pixel is judged in the RGB color space, requiring that the red component R is greater than the green component G, and the green component G is not less than the blue component B. Simultaneously, the saturation S of each pixel is calculated in the HSV color space, and the saturation threshold is determined by statistically analyzing the 70th percentile of the saturation values of all pixels in the current frame. The brightness change rate is calculated using a sequence of brightness values from five consecutive frames, and the slope is obtained through linear regression. Pixels with a slope greater than 0.05 are considered to meet the brightness change condition. The set of pixels that simultaneously meet the color rule and the brightness change condition is used as the initial flame candidate region.
[0061] The extraction of suspected smoke regions is based on dark channel prior theory and chromaticity analysis. The calculation formula for dark channel images is: ;in, Represents the pixel values of the dark channel image. Represented in pixels A 15×15 neighborhood centered on the center, Indicates in color channel pixel values on Representing the red channel, Represents a green channel. This represents the blue channel. A first preset threshold is set to 0.25, and regions with dark channel values below this threshold are marked as potential smoke regions. In the YUV color space, chromaticity clustering analysis uses the K-means algorithm, with 3 clusters. Regions whose cluster centers fall within the intervals Cb∈[100,120] and Cr∈[130,150] are selected as chromaticity candidate regions. The intersection of potential smoke regions and chromaticity candidate regions is defined as the initial smoke candidate region.
[0062] Morphological processing was performed on the initial flame and smoke candidate regions respectively. First, an opening operation was performed using a 3×3 circular structuring element to eliminate isolated regions with an area smaller than 7 pixels. The mathematical expression for the opening operation is: ;in Indicates the input image. Represents a structural element. This indicates a corrosion operation. This represents the expansion operation. Then, the same structuring element is used for the closing operation to fill the holes inside the region. The mathematical expression for the closing operation is: After morphological optimization, the final suspected flame area and suspected smoke area are output.
[0063] In the multi-dimensional feature fusion module, texture features are extracted within the suspected flame region using sliding windows of three different sizes: 3×3, 7×7, and 15×15 pixels. For each window location, its local binary mode value is calculated using the following formula: ;in Indicates the number of neighboring pixels. Represents the neighborhood radius. The grayscale value of the center pixel. For each neighboring pixel grayscale value, a histogram of all LBP values is plotted for each window size. The histograms of the three sizes are then concatenated to form a 36-dimensional feature vector. Simultaneously, the contrast feature of each pixel value within the window is calculated using the following formula: ;in The standard deviation of the pixel values within the window. The mean, This is used to avoid division by zero errors. The final result is a 42-dimensional multi-scale texture feature vector containing texture mode and contrast information.
[0064] In a five-frame image sequence, each suspected flame region is labeled with connected components. The total number of pixels within each connected component is counted as the region area for that frame, constructing an area sequence A1, A2, ..., A5. The relative change in area between adjacent frames is calculated as the ratio of the absolute value of the difference in area between adjacent frames to the previous frame. A weighted moving average is used to process the change sequence, with weight coefficients [0.1, 0.2, 0.4, 0.2, 0.1], to obtain the area change rate feature. Simultaneously, the minimum bounding rectangle of the region in each frame is extracted, and the displacement of the center point of the rectangle between adjacent frames is calculated. and aspect ratio change Contour fluctuation index The calculation formula is: ; where displacement Scale change in pixels It is a dimensionless ratio. Indicates the first frame.
[0065] Multi-scale texture features, area change rate, and contour fluctuation index are normalized. Texture features are normalized using maximum-minimum normalization, calculated as the ratio of the difference between the current value and the minimum value to the difference between the maximum and minimum values. Dynamic features are normalized using Z-score normalization, calculated as the ratio of the difference between the current value and the feature mean to the standard deviation. The normalized features are concatenated in the following order: the first 42 dimensions are texture features, the 43rd dimension is the area change rate, and the 44th dimension is the contour fluctuation index, forming a 44-dimensional flame feature vector.
[0066] The suspected smoke area is divided into 4×4 non-overlapping sub-blocks, with the size of each sub-block adaptively adjusted according to the total area of the region. For each sub-block, the distribution characteristics of the three color channels are calculated in the RGB color space. First, the mean and standard deviation of each channel are calculated; simultaneously, the Baumel coefficient between the color distribution histograms of each sub-block is calculated using the following formula: ;in , This is a normalized color histogram of adjacent sub-blocks. The number of bins in the histogram. Indicates the first Histogram bin This represents the Bartholomew's coefficient. The final result is a 48-dimensional color statistical feature including mean, standard deviation, and similarity.
[0067] To calculate the gradient magnitude and direction of the suspected smoke region, the Sobel operator is first used. This operator contains two convolution templates: the coefficients of the horizontal convolution template, from left to right and top to bottom, are -1, 0, 1, -2, 0, 2, -1, 0, 1; the coefficients of the vertical convolution template, from left to right and top to bottom, are -1, -2, -1, 0, 0, 0, 1, 2, 1. These two convolution templates are then convolved with the input image to obtain the horizontal and vertical gradient values.
[0068] The gradient magnitude is calculated as follows: square the horizontal and vertical gradient values of each pixel, sum them, and then take the square root of the sum. The gradient direction is calculated as follows: for each pixel, use a two-parameter arctangent function, with the vertical gradient value as the first parameter and the horizontal gradient value as the second parameter. The result is expressed in radians and then converted to angles.
[0069] The 360-degree directional range is evenly divided into 8 intervals, each covering 45 degrees. The gradient magnitude of all pixels within each directional interval is summed to obtain 8 gradient direction statistics. The standard deviation and arithmetic mean of these 8 statistics are calculated, and the gradient direction distribution ratio is obtained by dividing the standard deviation by the arithmetic mean. Finally, the 8 gradient direction statistics and the gradient direction distribution ratio together constitute a 9-dimensional gradient direction feature.
[0070] The 48-dimensional color statistical features and the 9-dimensional gradient direction features were subjected to maximum and minimum value normalization. The normalization method is to subtract the minimum value of the feature values of the dimension from all feature values of the dimension, and then divide by the difference between the maximum and minimum values of the feature values of the dimension.
[0071] Before feature concatenation, the distribution similarity component in the color statistical features undergoes a logarithmic transformation. The transformation method involves adding 1 to the original feature value and then taking the natural logarithm. This process enhances the discriminative power of the features.
[0072] The processed 48-dimensional color statistical features and 9-dimensional gradient direction features are concatenated in the order of color features first, followed by gradient features, to form a 57-dimensional smoke feature vector. This feature vector contains both the color distribution characteristics and texture direction characteristics of the smoke, which are used for subsequent classification and recognition processing.
[0073] In the fire and smoke recognition and output module, the flame feature vector and the smoke feature vector are used as independent inputs to the fire and smoke classification model built on support vector machine. The cross-entropy loss between the predicted probability value and the true labeled probability value is used as the training objective of the fire and smoke classification model. The fire and smoke classification model is trained, and the corresponding fire probability value and smoke probability value are output according to the trained fire and smoke classification model.
[0074] The construction process of the fire smoke classification model is as follows:
[0075] Flame and smoke feature vectors from historical monitoring data were collected and combined with manually labeled real fire and smoke states as target labels to construct a historical training dataset. The entire dataset was divided into training and validation subsets according to a preset ratio for parameter learning and performance validation of the fire and smoke classification model, respectively. The support vector machine algorithm was used to construct the fire and smoke classification model, and the kernel function type, penalty factor, and kernel function parameters were set as key hyperparameters. During training, the support vectors were solved using the sequence minimum optimization algorithm to determine the optimal classification hyperplane, and nonlinear mapping was performed in the feature space to handle complex feature distributions. The particle swarm optimization algorithm was introduced to automatically optimize the hyperparameters of the fire and smoke classification model. After each training iteration, the cross-entropy loss between the predicted result and the real label was calculated. When the cross-entropy loss on the validation subset tended to stabilize and reached a preset threshold, the training of the fire and smoke classification model was completed. The trained fire and smoke classification model was deployed to the car wash machine construction monitoring system, which received input data composed of flame and smoke feature vectors in real time and output the corresponding fire probability value and smoke probability value.
[0076] The thresholds for determining the probability values of fire and smoke were determined through historical data statistics. The fire probability threshold was 0.85, and the smoke probability threshold was 0.75. A fire was determined to exist when the fire probability value was greater than or equal to 0.85; smoke was determined to exist when the smoke probability value was greater than or equal to 0.75. If both conditions were met simultaneously, both fire and smoke categories were recorded in the structured recognition results. The probability values were compared frame-by-frame independently, ensuring that the processing results of each video frame did not affect each other.
[0077] A mapping relationship is established between the probability values of identifying a fire or smoke and the corresponding suspected areas. The coordinates of the minimum bounding rectangle of each suspected area are obtained using a region labeling algorithm, and the coordinates of the top-left vertex (x1, y1) and bottom-right vertex (x2, y2) of the rectangle are recorded. Simultaneously, the centroid coordinates of the area are calculated, obtained by the arithmetic mean of the coordinates of all pixels within the area. For areas containing both fire and smoke, the probability values and location information corresponding to each category are recorded separately.
[0078] The recognition results are encapsulated in JSON format and include the following fields: category label ("fire" or "smoke"), probability value (a floating-point number between 0.85 and 1.00), timestamp (accurate to milliseconds), and location information (including centroid coordinates and bounding box coordinates). In the location information, the centroid coordinates are represented as {"center_x": value, "center_y": value}, and the bounding box coordinates are represented as {"x1": value, "y1": value, "x2": value, "y2": value}. All coordinate values are integers, representing the pixel position in the image.
[0079] The structured recognition results are sent to the designated data receiving interface. Each recognition result is transmitted as an independent data packet. Simultaneously, a complete recognition result, including image frame number, processing time, recognition result, and other detailed information, is recorded in a local log file. The log file is automatically updated every 24 hours.
[0080] The working principle of this invention is as follows: High-definition network cameras deployed inside the car wash tunnel continuously capture video streams of the construction area. Image enhancement processing is performed on the video streams to obtain a preprocessed image sequence. Dynamic background modeling combined with predefined masks of the car wash's inherent moving parts is used for foreground segmentation to extract the real moving foreground region. Based on color space analysis and dark channel theory, suspected flame and smoke regions are extracted in parallel from the moving foreground region. Static texture features and dynamic shape change features of the flame region are extracted to form a flame feature vector. Color statistical features and gradient direction features of the smoke region are used to form a smoke feature vector. The feature vectors are input into a support vector machine classification model to obtain fire and smoke probability values. When the probability value exceeds a set threshold, a structured recognition result containing category labels, confidence levels, and location information is output.
[0081] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction, characterized in that, include: The image acquisition and preprocessing module is used to acquire real-time monitoring video streams of the car wash machine construction area and perform image enhancement processing on the video streams to obtain preprocessed image sequences. The dynamic interference suppression and foreground segmentation module is used to perform background modeling and foreground analysis on the preprocessed image sequence. By calculating the difference between the current frame and the background reference frame, and combining it with a predefined mask of the inherent moving parts of the car wash machine for filtering, the module segments out the real moving foreground region caused by potential fire smoke. The process of identifying the real moving foreground region is as follows: For the preprocessed image sequence, a method based on the statistical distribution of pixel values in the time domain is adopted to establish and maintain a sample set containing multiple possible background values for each pixel, and to incorporate scene illumination changes through a random update strategy to generate a dynamic background reference frame; Calculate the color and brightness differences between the current frame and the dynamic background reference frame at each pixel position to obtain the preliminary binarized motion region; The initial binarized motion region is logically subtracted from the predefined mask of the car wash machine's inherent moving parts to obtain the candidate real motion foreground region; Multi-scale motion consistency verification is performed on the candidate real moving foreground regions. The consistency of motion vectors in their internal regions between consecutive frames is analyzed. The region color uniformity judgment is integrated to eliminate small and discrete false motion regions caused by water splashes and local reflections. Finally, the real moving foreground regions are output. The process of obtaining the initial binarized motion region specifically includes: Calculate the absolute differences between the current frame and the dynamic background reference frame on multiple color channels, and then weight and fuse the absolute differences to generate a comprehensive difference map. Based on the local contrast within the neighborhood of each pixel in the comprehensive difference map, the difference threshold of the corresponding pixel is dynamically calculated to generate an initial binarized motion region that can suppress texture noise. Using the connected region with the largest difference value in the initial binarized motion region as the seed point, region growth is performed based on the similarity of the difference values between adjacent pixels. Internal holes and discrete artifacts are eliminated in the grown region, and finally a preliminary binarized motion region is obtained. A multimodal suspected region generation module is used to extract suspected flame regions and suspected smoke regions in parallel from a real moving foreground region; The multi-dimensional feature fusion module is used to extract static texture features and dynamic shape change features of suspected flame areas to form flame feature vectors, and to extract color statistical features and gradient direction features of suspected smoke areas to form smoke feature vectors. The fire and smoke identification and result output module is used to input the flame feature vector and smoke feature vector into the pre-trained fire and smoke classification model, and output the fire probability value and smoke probability value. When any probability value exceeds the corresponding threshold, it is determined that there is a fire or smoke. The probability value includes the fire probability value and the smoke probability value, and outputs a structured identification result containing category and location information.
2. The computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction as described in claim 1, characterized in that, The extraction of suspected flame areas and suspected smoke areas specifically includes: In the RGB color space, verify whether the red component of each pixel in the real moving foreground region is simultaneously greater than the green and blue components, and in the HSV color space, verify whether the saturation of each pixel in the real moving foreground region is higher than the dynamically calculated saturation threshold; define the set of pixels that simultaneously meet the color rules and whose brightness change rate exceeds the preset threshold as the initial flame candidate region. Calculate the dark channel image of the real moving foreground region, and initially identify the region with dark channel value below a first preset threshold as a potential smoke region; perform chromaticity clustering analysis on the real moving foreground region in the YUV color space, and identify the region with chromaticity value concentrated in the preset smoke characteristic chromaticity range as a chromaticity candidate region; define the intersection of the potential smoke region and the chromaticity candidate region as the initial smoke candidate region. Perform morphological opening operations on the initial flame candidate region and the initial smoke candidate region respectively, and then perform morphological closing operations to output the suspected flame region and the suspected smoke region.
3. The computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction as described in claim 1, characterized in that, The process of generating the flame feature vector is as follows: Within the suspected flame area, local binary texture statistics are calculated for each window using sliding windows of different sizes. By statistically analyzing the distribution histograms of different texture patterns within each window, multi-scale texture features characterizing the roughness and contrast of the flame texture are obtained. In a continuous frame sequence, calculate the area change rate and contour fluctuation index of the suspected flame region; Multi-scale texture features, area change rate, and contour fluctuation index are normalized and then spliced together in a preset order to form a flame feature vector that characterizes the static texture characteristics and dynamic shape change characteristics of the flame.
4. The computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction as described in claim 3, characterized in that, The calculation of the area change rate and contour fluctuation index of the suspected flame region specifically includes: In a continuous frame sequence, connected component analysis is performed on the suspected flame region, and the total number of pixels in each connected component is counted as the region area of the corresponding continuous frame, thus constructing a sequence data of area change over time. Based on the sequential data of area changing over time, the relative change in area between adjacent frames is calculated, and a weighted moving average is applied to the change between multiple consecutive frames. The average of the processed change is used as the area change rate. Extract the minimum bounding rectangle of the suspected flame region in each consecutive frame, calculate the displacement of the center point of the minimum bounding rectangle between adjacent frames and the change in the aspect ratio, and use the product of the displacement and the change in aspect ratio as the contour fluctuation index.
5. The computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction as described in claim 1, characterized in that, The formation of the smoke feature vector specifically includes: The suspected smoke area is divided into multiple non-overlapping sub-blocks. The numerical distribution of pixels in each sub-block across multiple color channels is calculated. By statistically analyzing the similarity and distribution width between the color distribution histograms of each sub-block, color statistical features characterizing the uniformity and diffusion properties of smoke color are obtained. Calculate the gradient magnitude and direction of the suspected smoke region, divide the direction range into multiple intervals, count the sum of magnitudes in each gradient direction interval, and obtain the gradient direction feature that characterizes the degree of disorder of the smoke texture direction by calculating the ratio of the standard deviation to the mean of the sum of magnitudes in each interval. After normalizing the color statistical features and gradient direction features, they are concatenated and combined according to a preset dimensional order to form a smoke feature vector that simultaneously contains the smoke color distribution characteristics and texture direction characteristics.
6. The computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction as described in claim 1, characterized in that, The step of inputting the flame feature vector and smoke feature vector into a pre-trained fire and smoke classification model, and outputting fire probability values and smoke probability values, specifically includes: Flame feature vectors and smoke feature vectors are used as independent inputs to a fire and smoke classification model built on support vector machines. The training objective of the fire and smoke classification model is to minimize the cross-entropy loss between the predicted probability value and the true labeled probability value. The fire and smoke classification model is trained, and the corresponding fire probability value and smoke probability value are output according to the trained fire and smoke classification model.
7. The computer vision-based real-time fire and smoke detection and recognition system for car wash machine construction as described in claim 6, characterized in that, The construction process of the fire smoke classification model is as follows: Flame feature vectors and smoke feature vectors from historical monitoring data are collected and combined with manually labeled real fire and smoke conditions as target labels to construct a historical training dataset. The entire dataset is divided into a training subset and a validation subset according to a preset ratio, which are used for parameter learning and performance validation of the fire and smoke classification model, respectively. A support vector machine (SVM) algorithm was used to construct a fire and smoke classification model, with kernel function type, penalty factor, and kernel function parameters set as key hyperparameters. During training, the support vectors were solved using a sequence minimum optimization algorithm to determine the optimal classification hyperplane, and a nonlinear mapping was performed in the feature space to handle complex feature distributions. A particle swarm optimization algorithm was introduced to automatically optimize the hyperparameters of the fire and smoke classification model. After each training iteration, the cross-entropy loss between the predicted results and the true labels was calculated. When the cross-entropy loss on the validation subset tended to stabilize and reached a preset threshold, the training of the fire and smoke classification model was completed. The trained fire and smoke classification model was deployed to a car wash machine construction monitoring system, which received input data consisting of flame feature vectors and smoke feature vectors in real time and output the corresponding fire probability value and smoke probability value.