A park security risk early warning system, method and device
Patent Information
- Application Number
- CN202611215431.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-10-30
AI Technical Summary
该类方式在楼宇走廊、地下车库、设备间、外立面区域和公共活动区域中应用较多,但其触发条件通常依赖烟雾扩散、温度积累或人工识别,难以在火焰初生、烟雾尚未明显扩散或局部温升尚不明显时及时发现风险
[0062]本发明通过将园区楼宇图像序列中的红、绿、蓝通道日志色度差异与同时间戳帧差灰度映射共同构建为谱-热联合特征张量,并将谱-热联合特征张量与改进HQ-SAM网络中的多尺度视觉Token嵌入集合进行特征对齐与融合,使火焰候选区域提取不再仅依赖单帧图像中的红黄色外观、亮度峰值或局部纹理,而是同时利用火焰目标在谱梯度变化、帧间热响应变化和视觉结构边界上的联合特征;能够在火焰初生、烟雾尚未明显扩散、监控画面存在低照度或局部反光的情况下更稳定地提取疑似火焰区域;通过基于高响应连通域自动生成框提示嵌入、点提示嵌入和粗掩膜提示嵌入,使改进HQ-SAM网络能够围绕谱-热响应集中的区域进行提示约束解码,减少人工提示依赖,降低灯光反射、电子屏幕、车辆灯光仅具有局部高亮但缺少谱-热一致性的干扰目标被分割为火焰候选区域的概率,使火焰候选区域掩膜在复杂园区楼宇场景中具有更连续的边界、更完整的区域轮廓和更稳定的逐帧分割结果。
Smart Images

Figure CN123016295A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of park security technology, and in particular to a park security risk early warning system, method and equipment. Background Technology
[0002] With the increase in the number of buildings in the park, the density of personnel flow, and the complexity of electrical equipment, the park's security risk early warning has gradually expanded from simple access control, inspection and smoke alarms to comprehensive monitoring of fire, abnormal open flames and building safety hazards.
[0003] In existing park security systems, fire risk warnings typically rely on smoke detectors, temperature sensors, fire alarm control panels, or manual monitoring. These systems primarily trigger alarms when smoke concentration increases, ambient temperature becomes abnormal, or an open flame is detected manually. While this approach is commonly used in building corridors, underground parking garages, equipment rooms, exterior facades, and public activity areas, its triggering conditions usually depend on smoke diffusion, temperature accumulation, or manual identification. This makes it difficult to detect risks in their early stages, before smoke has significantly spread, or when localized temperature increases are not yet apparent.
[0004] Existing video-based flame recognition methods for campuses mostly rely on color, brightness, or flickering features in single-frame images to identify flame targets. In complex campus environments, these methods are easily affected by factors such as cigarettes, lighters, light reflections, electronic screens, vehicle lights, low-light noise, and camera shake, leading to false fire targets being misidentified as security risks. Furthermore, existing methods lack stable analysis of the persistence, area changes, boundary perturbations, and brightness fluctuations of flame candidate regions in consecutive frames, making it difficult to establish a tiered early warning system suitable for campus security platforms. Summary of the Invention
[0005] One objective of this invention is to propose a campus security risk early warning system, method, and device. This invention enables the flame candidate region mask to have more continuous boundaries, more complete region contours, and more stable frame-by-frame segmentation results in complex campus building scenes.
[0006] A campus security risk early warning method according to an embodiment of the present invention is characterized by comprising:
[0007] Collect continuous video frames from the park's building surveillance system and perform preprocessing on the continuous video frames to generate a sequence of park building images;
[0008] The first spectral gradient feature map and the second spectral gradient feature map are generated based on the building image sequence in the park. A thermal response feature map is generated with the same timestamp frame and then spliced together to form a spectral-thermal joint feature tensor.
[0009] The building image sequence in the park is input into the improved HQ-SAM network to obtain a multi-scale visual token embedding set. The spectral-thermal joint feature tensor is aligned and fused with the multi-scale visual token embedding set to obtain a fused visual feature set and corresponding feature uncertainty weights.
[0010] Saliency extraction is performed based on the spectrum-thermal joint feature tensor, generating box cue embedding, point cue embedding and coarse mask cue embedding, which are then input together with the fused visual feature set into a multi-level mask decoder to obtain a set of flame candidate region masks corresponding to each frame of the park building image sequence.
[0011] Establish the temporal trajectory of the flame candidate region based on the flame candidate region mask set, and record the continuous frame number, pixel area sequence, boundary contour sequence and average brightness sequence in the order of the flame candidate region temporal trajectory.
[0012] Based on the continuous frame count, pixel area sequence, boundary contour sequence and average brightness sequence, the area change rate, boundary perturbation amplitude, brightness fluctuation amplitude and duration are calculated to generate a set of temporal evolution features of flame candidate regions.
[0013] The temporal evolution feature set of flame candidate regions is input into the Hidden Markov Evolutionary Model. Combined with the feature uncertainty weights, the fire probability of each flame candidate region is dynamically predicted, and graded security risk warning information is generated for each flame candidate region. When the graded security risk warning information reaches the high risk threshold, a linkage command is pushed to the park security platform, and the fire extinguishing equipment is controlled to perform fire extinguishing operations.
[0014] Optionally, the preprocessing includes brightness normalization, color correction, noise suppression, image stabilization, reflection reduction, and low-light enhancement preprocessing.
[0015] Optionally, the step of generating a first spectral gradient feature map and a second spectral gradient feature map based on the building image sequence of the park, and generating a thermal response feature map by mapping the grayscale difference of the same timestamp frame difference, includes:
[0016] Based on the image sequence of buildings in the park, calculate the chromaticity values of the red channel, green channel, and blue channel.
[0017] Calculate the red channel log chroma, green channel log chroma, and blue channel log chroma using the red channel chroma value, green channel chroma value, and blue channel chroma value;
[0018] The first spectral gradient feature map and the second spectral gradient feature map are obtained by using the red channel log chroma, the green channel log chroma, and the blue channel log chroma.
[0019] The weighted sum of the normalized pixel values of the red channel, green channel, and blue channel is used to obtain the grayscale mapping value.
[0020] A thermal response feature map is generated by mapping the grayscale difference between frames with the same timestamp.
[0021] The first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map corresponding to the same frame image are concatenated according to the channel dimension to generate the spectral-thermal joint feature tensor corresponding to the frame image.
[0022] Optionally, inputting the building image sequence into the improved HQ-SAM network includes:
[0023] The current frame image from the building image sequence in the park is input into the backbone visual coding trunk of the improved HQ-SAM network to obtain a set of image blocks;
[0024] Perform linear embedding and positional embedding on the image patch set to obtain the initial visual token embedding matrix;
[0025] Input the initial visual token embedding matrix into the coding layer of the corresponding scale level in the main visual coding trunk to obtain the hierarchical visual token embedding matrix.
[0026] The visual token embedding matrices of all levels are used to form the multi-scale visual token embedding set corresponding to the current frame image.
[0027] Input the spectrum-thermal joint feature tensor into the spectrum-thermal joint sensing branch to obtain the spectrum-thermal token embedding matrix;
[0028] A query matrix is generated using a visual token embedding matrix, a key matrix and a value matrix are generated using a spectral-hot token embedding matrix, and a spectral-hot attention response matrix and a spectral-hot alignment feature matrix are calculated.
[0029] The spectral-hot aligned feature matrix and the visual token embedding matrix are fused to obtain a fused visual feature matrix, and the fused visual feature matrices corresponding to all scale levels are combined to form a fused visual feature set.
[0030] Calculate the feature uncertainty weights based on the spectral-thermal attention response matrix.
[0031] Optionally, the saliency extraction based on the spectral-thermal joint feature tensor generates box cue embeddings, point cue embeddings, and coarse mask cue embeddings, which are then input into a multi-level mask decoder along with the fused visual feature set. This includes:
[0032] The first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map are weighted and summed to obtain the spectral-thermal joint response map.
[0033] Calculate the high response screening threshold based on the spectrum-thermal joint response map, and generate a high response binary map based on the high response screening threshold;
[0034] Perform connected component labeling on the high-response binary graph to obtain the high-response connected components corresponding to the current frame image;
[0035] Generate corresponding bounding box coordinates based on the pixel coordinate range of each high-response connected component;
[0036] Generate corresponding point cue coordinates based on the pixel position with the largest spectral-thermal joint response value in each high-response connected region, and generate corresponding coarse mask cue map based on each high-response connected region.
[0037] Input the box cue coordinates, point cue coordinates, and coarse mask cue map into the cue encoder of the improved HQ-SAM network to generate box cue embeddings, point cue embeddings, and coarse mask cue embeddings, respectively.
[0038] The multi-level mask decoder of the improved HQ-SAM network is input together with the box hint embedding, dot hint embedding, coarse mask hint embedding and fused visual feature set. The coarse mask generation and fine iterative repair are performed in sequence to obtain the fine candidate mask.
[0039] The refined candidate mask and the fused visual feature set are input into the boundary pixel-level refinement layer to obtain the flame candidate region mask, and then organized into a set of flame candidate region masks corresponding to each frame of the building image sequence in the park.
[0040] Optionally, establishing the temporal trajectory of the flame candidate region based on the flame candidate region mask set includes:
[0041] Based on the flame candidate region mask sets corresponding to the current frame image and the previous frame image, determine the flame candidate region pixel set corresponding to each flame candidate region in the current frame image and the previous frame image respectively;
[0042] Based on the set of pixels of each flame candidate region in the current frame image and the previous frame image, calculate the spatial overlap relationship between candidate regions and obtain the spatial overlap degree.
[0043] Based on the spatial overlap, candidate matching regions are selected for each flame candidate region in the current frame image to obtain the candidate matching regions and candidate matching overlap.
[0044] Based on the candidate matching overlap, determine the trajectory matching result of each flame candidate region in the current frame image;
[0045] Based on the trajectory matching results of each flame candidate region in the current frame image, establish the temporal trajectory of the flame candidate region;
[0046] Based on the temporal trajectory of the flame candidate region, record the number of consecutive frames, pixel area sequence, and average brightness sequence;
[0047] Based on the temporal trajectory of the flame candidate region, the boundary contour sequence is recorded, and the continuous frame number, pixel area sequence, boundary contour sequence and average brightness sequence are organized according to the trajectory number of the temporal trajectory of the flame candidate region.
[0048] Optionally, the set of temporal evolution features for generating flame candidate regions includes:
[0049] Calculate the rate of change of area based on the pixel area sequence;
[0050] Calculate the boundary disturbance amplitude based on the boundary profile sequence;
[0051] Calculate the brightness fluctuation amplitude based on the average brightness sequence;
[0052] Calculate the duration based on the number of consecutive frames;
[0053] A set of temporal evolution features of flame candidate regions is generated based on the area change rate, boundary disturbance amplitude, brightness fluctuation amplitude, and duration.
[0054] Optionally, inputting the set of temporal evolution features of the flame candidate region into the hidden Markov evolution model includes:
[0055] Based on the temporal evolution feature set of flame candidate regions, an observation feature sequence of the hidden Markov evolution model is generated;
[0056] Based on the feature uncertainty weight, the regional feature confidence level corresponding to each flame candidate region time-series trajectory is calculated;
[0057] The observed feature sequence and regional feature confidence are input into the Hidden Markov Evolutionary Model. The observed likelihood probability is corrected based on the regional feature confidence, and the fire probability of each flame candidate region is dynamically predicted.
[0058] Based on the fire failure probability of each flame candidate region, output the fire failure probability prediction result;
[0059] Based on the fire probability prediction results and the temporal evolution feature set of flame candidate areas, hierarchical security risk early warning information is generated;
[0060] When the graded security risk warning information reaches the high-risk threshold, a linkage instruction is pushed to the park's security platform, and the fire extinguishing equipment is controlled to perform fire extinguishing operations.
[0061] The beneficial effects of this invention are:
[0062] This invention constructs a spectral-thermal joint feature tensor by combining the chromaticity differences of the red, green, and blue channels in the building image sequence with the grayscale mapping of the frame difference at the same timestamp. This spectral-thermal joint feature tensor is then aligned and fused with the multi-scale visual token embedding set in the improved HQ-SAM network. This allows flame candidate region extraction to no longer rely solely on the red and yellow appearance, brightness peaks, or local textures in a single frame image, but instead utilizes the joint features of the flame target on spectral gradient changes, inter-frame thermal response changes, and visual structural boundaries. This enables the extraction of flame candidate regions when flames are in their initial stages, smoke has not yet significantly spread, and the monitoring screen contains... The improved HQ-SAM network can extract suspected flame regions more stably under low illumination or localized reflective conditions. By automatically generating bounding box cue embedding, dot cue embedding, and coarse mask cue embedding based on high-response connected components, the network can perform cue constraint decoding around regions with concentrated spectral-thermal responses. This reduces reliance on manual cueing and lowers the probability that interfering targets such as light reflections, electronic screens, and vehicle lights, which only have localized high brightness but lack spectral-thermal consistency, are segmented as flame candidate regions. As a result, the flame candidate region mask has more continuous boundaries, more complete region contours, and more stable frame-by-frame segmentation results in complex campus building scenes.
[0063] This invention matches the same flame candidate region in consecutive frames by spatial overlap and incorporates the number of consecutive frames, pixel area changes, boundary contour disturbances, and average brightness fluctuations into a time-series evolution feature set. This can preserve the dynamic change information of real flames in continuous monitoring images, while reducing the impact of short-term, isolated, boundary-stable, or abnormally bright non-fire interference targets on early warning judgment, thereby improving the ability of the park security platform to distinguish between early fire risks and ordinary visual interference targets. Attached Figure Description
[0064] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0065] Figure 1 This is a flowchart of a park security risk early warning method proposed in this invention;
[0066] Figure 2 This is a schematic diagram of the improved HQ-SAM network structure of a campus security risk early warning method proposed in this invention;
[0067] Figure 3 This is a structural diagram of a park security risk early warning device proposed in this invention;
[0068] Figure 4 This is a comparison image of the masking results under the same continuous frame in Embodiment 4 of the park security risk early warning system, method and equipment proposed in this invention. Detailed Implementation
[0069] Example 1: Reference Figures 1-2 A method for early warning of security risks in industrial parks, comprising:
[0070] Collect continuous video frames from the park's building surveillance system and perform preprocessing on the continuous video frames to generate a sequence of park building images;
[0071] In this embodiment, the preprocessing includes brightness normalization, color correction, noise suppression, image stabilization, reflection reduction, and low-light enhancement preprocessing.
[0072] The first spectral gradient feature map and the second spectral gradient feature map are generated based on the building image sequence in the park. A thermal response feature map is generated with the same timestamp frame and then spliced together to form a spectral-thermal joint feature tensor.
[0073] In this embodiment, a first spectral gradient feature map and a second spectral gradient feature map are generated based on the building image sequence of the park, and a thermal response feature map is generated by mapping the grayscale difference of the same timestamp frame difference, including:
[0074] Based on the image sequence of buildings in the park, calculate the chromaticity values of the red channel, green channel, and blue channel.
[0075] In Example 1, the normalized pixel values of the red channel, green channel, and blue channel corresponding to the same pixel position in the building image sequence of the park are summed with the stability constant to obtain the total channel intensity. The normalized pixel value of the red channel is divided by the total channel intensity to obtain the chromaticity value of the red channel. Similarly, the chromaticity values of the green channel and the blue channel are calculated.
[0076] Calculate the red channel log chroma, green channel log chroma, and blue channel log chroma using the red channel chroma value, green channel chroma value, and blue channel chroma value;
[0077] The first spectral gradient feature map and the second spectral gradient feature map are obtained by using the red channel log chroma, the green channel log chroma, and the blue channel log chroma.
[0078] In Example 1, the log chromaticity of the red channel is subtracted from the log chromaticity of the green channel to obtain the first spectral gradient feature value of the corresponding pixel position in the first spectral gradient feature map.
[0079] Subtracting the blue channel log chromaticity from the red channel log chromaticity yields the second spectral gradient feature value at the corresponding pixel location in the second spectral gradient feature map.
[0080] The first spectral gradient feature map is generated based on the first spectral gradient feature values corresponding to all pixel positions, and the second spectral gradient feature map is generated in the same way.
[0081] The weighted sum of the normalized pixel values of the red channel, green channel, and blue channel is used to obtain the grayscale mapping value.
[0082] A thermal response feature map is generated by mapping the grayscale difference between frames with the same timestamp.
[0083] In Example 1, when the current frame image is the first frame image in the sequence of building images in the park, the thermal response feature values of all pixel positions in the thermal response feature map corresponding to the current frame image are set to zero.
[0084] When the current frame image is not the first frame image in the building image sequence of the park, the grayscale mapping value of the current frame image is subtracted from the grayscale mapping value of the previous frame image and the absolute value is taken to obtain the frame difference grayscale value of the current frame image and the previous frame image at the same pixel position.
[0085] Determine the maximum frame difference gray value from the frame difference gray values corresponding to all pixel positions in the current frame image and the previous frame image. Divide the frame difference gray value corresponding to each pixel position by the maximum frame difference gray value to obtain the thermal response feature value. Generate a thermal response feature map according to the thermal response feature values corresponding to all pixel positions.
[0086] The first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map corresponding to the same frame image are concatenated according to the channel dimension to generate the spectral-thermal joint feature tensor corresponding to the frame image.
[0087] In Example 1, the feature height of the spectral-thermal joint feature tensor is consistent with the image height of the corresponding frame image, the feature width of the spectral-thermal joint feature tensor is consistent with the image width of the corresponding frame image, and the number of channels of the spectral-thermal joint feature tensor is three. The three channels correspond to the first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map, respectively. The spectral-thermal joint feature tensors corresponding to all frame images are arranged according to the frame number to obtain the spectral-thermal joint feature tensor.
[0088] The building image sequence in the park is input into the improved HQ-SAM network to obtain a multi-scale visual token embedding set. The spectral-thermal joint feature tensor is aligned and fused with the multi-scale visual token embedding set to obtain a fused visual feature set and corresponding feature uncertainty weights.
[0089] In this embodiment, the sequence of building images in the park is input into the improved HQ-SAM network, including:
[0090] The current frame image from the building image sequence in the park is input into the backbone visual coding trunk of the improved HQ-SAM network to obtain a set of image blocks;
[0091] In Example 1, the current frame image is scale-mapped and divided into image blocks according to the scale level in the main visual coding trunk, so as to obtain the image block set corresponding to each scale level.
[0092] Perform linear embedding and positional embedding on the image patch set to obtain the initial visual token embedding matrix;
[0093] In Example 1, the image patch set is expanded into an image patch matrix. The image patch matrix is input into the linear embedding matrix at the corresponding scale level to obtain the visual content embedding result. The visual content embedding result is added to the position embedding matrix at the corresponding scale level to obtain the initial visual token embedding matrix, which is used to maintain the spatial positional relationship of the image patch set in the building image sequence of the park.
[0094] Input the initial visual token embedding matrix into the coding layer of the corresponding scale level in the main visual coding trunk to obtain the hierarchical visual token embedding matrix.
[0095] The visual token embedding matrices of all levels are used to form the multi-scale visual token embedding set corresponding to the current frame image.
[0096] Input the spectrum-thermal joint feature tensor into the spectrum-thermal joint sensing branch to obtain the spectrum-thermal token embedding matrix;
[0097] In Example 1, the spectrum-thermal joint sensing branch includes a channel splitting layer, a spectral gradient coding path, a thermal response coding path, a scale alignment layer, a cross-channel gating fusion layer, and a token mapping layer.
[0098] The first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map are extracted from the spectral-thermal joint feature tensor through a channel splitting layer. The first and second spectral gradient feature maps are then input into the spectral gradient coding path to obtain the spectral gradient coding feature map. The thermal response feature map is then input into the thermal response coding path to obtain the thermal response coding feature map. The spectral gradient coding feature map and the thermal response coding feature map are then input into a scale alignment layer. According to the scale level in the main visual coding trunk, the spectral gradient coding feature map and the thermal response coding feature map are aligned in terms of feature height, feature width, and channel dimension to obtain the scale-aligned spectral gradient map and the scale-aligned thermal response map.
[0099] The scale-aligned spectral gradient map and the scale-aligned thermal response map are input into the cross-channel gated fusion layer for weighted fusion to obtain the spectral-thermal fusion feature map. The spectral-thermal fusion feature map corresponding to each scale level is input into the token mapping layer. The spectral-thermal fusion feature map is expanded into image blocks and mapped to channels according to the token space arrangement of the corresponding scale level to obtain the spectral-thermal token embedding matrix.
[0100] A query matrix is generated using a visual token embedding matrix, a key matrix and a value matrix are generated using a spectral-hot token embedding matrix, and a spectral-hot attention response matrix and a spectral-hot alignment feature matrix are calculated.
[0101] In Example 1, the relevance calculation is performed on the query matrix and the key matrix. The relevance calculation result is scaled and normalized by the channel dimension of the query matrix and the key matrix. The scaled and normalized relevance calculation result is then normalized along the spectrum-hot token dimension to obtain the spectrum-hot attention response matrix.
[0102] By performing a weighted mapping between the spectral-thermal attention response matrix and the value matrix, the spectral-thermal alignment feature matrix is obtained.
[0103] The spectral-hot aligned feature matrix and the visual token embedding matrix are fused to obtain a fused visual feature matrix, and the fused visual feature matrices corresponding to all scale levels are combined to form a fused visual feature set.
[0104] In Example 1, the spectral-hot aligned feature matrix and the visual token embedding matrix are dimensionally aligned. The dimensionally aligned spectral-hot aligned feature matrix and the visual token embedding matrix are then added element by element. The element-by-element addition result is then normalized to obtain the fused visual feature matrix.
[0105] Calculate the feature uncertainty weights based on the spectral-thermal attention response matrix.
[0106] In Example 1, the attention entropy value corresponding to each visual token is obtained by multiplying the attention response value between each visual token and all spectral-hot tokens in the spectral-hot attention response matrix with the logarithm of the attention response value after adding the stabilization constant, summing the product results corresponding to all spectral-hot tokens and taking the negative number.
[0107] Divide the attention entropy value corresponding to each visual token by the logarithm of the number of spectral-hot tokens to obtain the feature uncertainty weight.
[0108] Saliency extraction is performed based on the spectrum-thermal joint feature tensor, generating box cue embedding, point cue embedding and coarse mask cue embedding, which are then input together with the fused visual feature set into a multi-level mask decoder to obtain a set of flame candidate region masks corresponding to each frame of the park building image sequence.
[0109] In this embodiment, saliency extraction is performed based on the spectral-thermal joint feature tensor to generate bounding box cue embeddings, point cue embeddings, and coarse mask cue embeddings, which are then input into a multi-level mask decoder along with the fused visual feature set. This includes:
[0110] The first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map are weighted and summed to obtain the spectral-thermal joint response map.
[0111] Calculate the high response screening threshold based on the spectrum-thermal joint response map, and generate a high response binary map based on the high response screening threshold;
[0112] In Example 1, the mean value of the spectral-thermal joint response is obtained by summing the spectral-thermal joint response values corresponding to all pixel positions in the current frame image and dividing by the total number of pixel positions.
[0113] The high-response screening threshold is obtained by multiplying the mean of the spectral-thermal joint response by the standard deviation of the spectral-thermal joint response and the threshold intensity coefficient. The threshold intensity coefficient is a coefficient that controls the intensity of the high-response screening threshold and can be determined manually.
[0114] When the spectral-thermal joint response value corresponding to a pixel position is greater than or equal to the high response screening threshold, the high response binary result corresponding to the pixel position is set to one.
[0115] When the spectral-thermal joint response value corresponding to a pixel position is less than the high response screening threshold, the high response binary result corresponding to the pixel position is set to zero; a high response binary map is generated according to the high response binary results corresponding to all pixel positions.
[0116] Perform connected component labeling on the high-response binary graph to obtain the high-response connected components corresponding to the current frame image;
[0117] Generate corresponding bounding box coordinates based on the pixel coordinate range of each high-response connected component;
[0118] In Example 1, the minimum coordinates in the image width direction, the minimum coordinates in the image height direction, the maximum coordinates in the image width direction, and the maximum coordinates in the image height direction are determined from all pixel positions of each high-response connected region to form the bounding box coordinates corresponding to the high-response connected region.
[0119] Generate corresponding point cue coordinates based on the pixel position with the largest spectral-thermal joint response value in each high-response connected region, and generate corresponding coarse mask cue map based on each high-response connected region.
[0120] In Example 1, the pixel position with the largest spectral-thermal joint response value is determined from all pixel positions of each high-response connected region. The coordinates of the pixel position in the image width direction and the coordinates in the image height direction are used to form the point cue coordinates corresponding to the high-response connected region.
[0121] When a pixel location belongs to the corresponding high-response connected component, the coarse mask hint value corresponding to the corresponding pixel location is set to one; when a pixel location does not belong to the corresponding high-response connected component, the coarse mask hint value corresponding to the corresponding pixel location is set to zero.
[0122] Generate coarse mask cue maps corresponding to high-response connected components based on the coarse mask cue values corresponding to all pixel positions.
[0123] Input the box cue coordinates, point cue coordinates, and coarse mask cue map into the cue encoder of the improved HQ-SAM network to generate box cue embeddings, point cue embeddings, and coarse mask cue embeddings, respectively.
[0124] In Example 1, the cue encoder includes a box cue coding branch, a dot cue coding branch, and a coarse mask cue coding branch.
[0125] The bounding box encoding branch reads the minimum coordinates in the image width direction, the minimum coordinates in the image height direction, the maximum coordinates in the image width direction, and the maximum coordinates in the image height direction from the bounding box coordinates. It then normalizes these four coordinates to obtain normalized bounding box coordinates. Position encoding is then performed on the top-left and bottom-right coordinates of the normalized bounding box coordinates to obtain top-left and bottom-right position encoding vectors, respectively. These vectors are then concatenated with the bounding box type identifier vector and input into the bounding box mapping layer to obtain the bounding box embedding. Similarly, the point hint embedding is calculated.
[0126] The coarse mask cue encoding branch aligns the feature height and feature width of the coarse mask cue image to the mask decoding input size corresponding to the fused visual feature set, resulting in a scale-aligned coarse mask cue image. Channel mapping and spatial convolutional encoding are then performed on the scale-aligned coarse mask cue image to obtain a coarse mask cue feature map. The coarse mask cue feature map is then input into the coarse mask cue mapping layer to obtain the coarse mask cue embedding.
[0127] The multi-level mask decoder of the improved HQ-SAM network is input together with the box hint embedding, dot hint embedding, coarse mask hint embedding and fused visual feature set. The coarse mask generation and fine iterative repair are performed in sequence to obtain the fine candidate mask.
[0128] In Example 1, the multi-level mask decoder includes a cue fusion layer, a visual feature reading layer, a coarse mask generation layer, and a fine iterative repair layer.
[0129] The cue fusion layer aligns the bounding box cue embedding, point cue embedding, and coarse mask cue embedding according to the cue source. The feature-aligned bounding box cue embedding, point cue embedding, and coarse mask cue embedding are then concatenated and mapped to obtain the candidate region cue fusion embedding.
[0130] The visual feature reading layer uses candidate region cue fusion embedding as a cue constraint to read the candidate region visual features corresponding to the high-response connected component from the fused visual feature set, thus obtaining the candidate region decoding features.
[0131] The coarse mask generation layer performs channel compression, spatial upsampling, and mask probability mapping on the decoded features of the candidate regions to obtain an initial candidate mask probability map. A mask threshold determination is then performed on the initial candidate mask probability map.
[0132] The mask determination threshold is obtained by subtracting the standard deviation of the candidate foreground probability from the mean candidate foreground probability and the threshold adjustment coefficient.
[0133] When the mask probability value corresponding to the pixel position in the initial candidate mask probability map is greater than or equal to the mask determination threshold, and the pixel position is within the area limited by the box prompt coordinates, the initial candidate mask value corresponding to the pixel position is set to one.
[0134] When the mask probability value corresponding to a pixel position in the initial candidate mask probability map is less than the mask determination threshold, or when the pixel position is outside the area limited by the box prompt coordinates, the initial candidate mask value corresponding to the pixel position is set to zero.
[0135] The initial candidate mask is generated based on the initial candidate mask values corresponding to all pixel positions.
[0136] In each fine-refinement iteration, the repair layer reads the candidate mask obtained from the previous fine-refinement iteration, calculates the local response difference between the candidate mask obtained from the previous fine-refinement iteration and the decoding features of the candidate region, and generates a mask residual correction map based on the local response difference.
[0137] The mask residual correction map is superimposed on the candidate mask obtained in the previous fine-tuning iteration to obtain the candidate mask after the current fine-tuning iteration. The candidate mask after the current fine-tuning iteration is used as the input candidate mask for the next fine-tuning iteration, until the preset number of fine-tuning iterations are completed.
[0138] The candidate mask output from the last fine-tuning iteration is used as the fine-tuning candidate mask.
[0139] The refined candidate mask and the fused visual feature set are input into the boundary pixel-level refinement layer to obtain the flame candidate region mask, and then organized into a set of flame candidate region masks corresponding to each frame of the building image sequence in the park.
[0140] In Example 1, the boundary pixel-level refinement layer reads the foreground pixel position with a mask value of one and the background pixel position with a mask value of zero in the refinement candidate mask, and determines the foreground pixel position adjacent to the background pixel position as the candidate foreground boundary pixel position.
[0141] The boundary pixel-level refinement layer takes the candidate foreground boundary pixel position as the center, reads the boundary local visual features corresponding to the fused visual feature set in the neighborhood of the candidate foreground boundary pixel position, and calculates the boundary attribution response value of each neighborhood pixel position relative to the candidate foreground boundary pixel position based on the boundary local visual features. This value is used to represent the probability response that the neighborhood pixel position belongs to the inside of the true boundary of the flame candidate region.
[0142] The boundary pixel positions of the refined candidate mask are corrected based on the boundary attribution response value. When the boundary attribution response value corresponding to the neighboring pixel position reaches the boundary preservation threshold, the mask value corresponding to the corresponding neighboring pixel position is set to one; when the boundary attribution response value corresponding to the neighboring pixel position does not reach the boundary preservation threshold, the mask value corresponding to the corresponding neighboring pixel position is set to zero.
[0143] The boundary retention threshold is obtained by statistically analyzing all boundary assignment response values within the neighborhood of the candidate foreground boundary pixel location.
[0144] Perform a boundary continuity check on the corrected mask, incorporate isolated boundary break pixel positions into the flame candidate region according to the connectivity of adjacent foreground pixel positions, and remove isolated boundary pixel positions that are not connected to the main body of the flame candidate region from the corrected mask to obtain the flame candidate region mask.
[0145] The flame candidate region masks corresponding to all high-response connected components in the current frame image are arranged in the order of the high-response connected components to form the flame candidate region mask set corresponding to the current frame image. The flame candidate region mask sets corresponding to all frames in the park building image sequence are arranged by frame number to obtain the flame candidate region mask set.
[0146] The improved HQ-SAM network includes a main visual coding backbone, a spectral-thermal joint perception branch, a cross-layer attention fusion layer, a cue encoder, a multi-level mask decoder, and a boundary pixel-level refinement layer. The input includes a sequence of building images within the campus and a spectral-thermal joint feature tensor. In this embodiment, the input size of each frame in the building image sequence is 1024×1024×3, and the input size of the spectral-thermal joint feature tensor is also 1024×1024×3. The three channels correspond to the first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map, respectively. The main visual coding backbone employs a 12-layer visual Transformer coding layer, dividing each frame into image blocks to generate a multi-scale visual token embedding set. The spectral-thermal joint perception branch maps the spectral-thermal joint feature tensor into a spectral-thermal token embedding matrix. The cross-layer attention fusion layer aligns and fuses the spectral-thermal token embedding matrix with the multi-scale visual token embedding set, outputting a fused visual feature set and corresponding feature uncertainty weights. The cue encoder converts the box cue coordinates, point cue coordinates, and coarse mask cue map automatically generated by the high-response connected components into box cue embeddings, point cue embeddings, and coarse mask cue embeddings. The multi-level mask decoder outputs refined candidate masks, and the boundary pixel-level refinement layer performs boundary pixel-level correction on the refined candidate masks based on the fused visual feature set. Finally, it outputs a set of flame candidate region masks corresponding to each frame of the park building image sequence.
[0147] In this embodiment, the improved HQ-SAM network has a total of 12 layers in the main visual coding trunk, 6 layers in the spectral-thermal joint perception branch, 2 layers in the cross-layer attention fusion layer, 3 branches in the cue encoder, 4 layers in the multi-level mask decoder, and 1 layer in the boundary pixel-level refinement layer. The parameter scale is 90M-130M, and the schematic parameter scale is 112M. The training method adopts a staged training approach. First, the main visual coding trunk is frozen and the spectral-thermal joint perception branch, the cross-layer attention fusion layer, the cue encoder, and the multi-level mask decoder are trained. The multi-level mask decoder and the boundary pixel-level refinement layer are jointly fine-tuned. The training loss includes mask cross-entropy loss, Dice loss, boundary consistency loss, and feature uncertainty constraint loss. The training data sources include video frames from building surveillance in the park, manually annotated flame candidate region masks, manually annotated non-fire interference samples, and spectral-thermal joint feature tensors generated from continuous video frames. The non-fire interference samples include image samples corresponding to cigarettes, lighters, light reflections, electronic screens, and vehicle lights.
[0148] Compared with the existing HQ-SAM network, the improved HQ-SAM network introduces a spectrum-thermal joint sensing branch to enhance the spectral gradient response and frame difference thermal response of the initial flame when the smoke has not spread significantly. It also introduces an automatic prompt generation mechanism based on high-response connected components to reduce reliance on manual prompts, introduces feature uncertainty weights to reduce the interference of low-confidence visual regions on fire probability prediction, and introduces a boundary pixel-level refinement layer to improve the continuity of flame candidate region boundaries and mask integrity. This enhances the early warning capability of fires in campus buildings and reduces the false alarm rate caused by light reflection, electronic screens, and short-term ignition targets.
[0149] Establish the temporal trajectory of the flame candidate region based on the flame candidate region mask set, and record the continuous frame number, pixel area sequence, boundary contour sequence and average brightness sequence in the order of the flame candidate region temporal trajectory.
[0150] In this embodiment, establishing the temporal trajectory of the flame candidate region based on the flame candidate region mask set includes:
[0151] Based on the flame candidate region mask sets corresponding to the current frame image and the previous frame image, determine the flame candidate region pixel set corresponding to each flame candidate region in the current frame image and the previous frame image respectively;
[0152] In Example 1, all pixel positions of the mask of each flame candidate region in the current frame image are read, and the pixel positions with a mask value of one are determined as the foreground pixel positions of the corresponding flame candidate region in the current frame image. The flame candidate region pixel set of the corresponding flame candidate region in the current frame image is composed of all the foreground pixel positions of the corresponding flame candidate region in the current frame image.
[0153] Based on the set of pixels of each flame candidate region in the current frame image and the previous frame image, calculate the spatial overlap relationship between candidate regions and obtain the spatial overlap degree.
[0154] In Example 1, the spatial overlap is obtained by dividing the number of intersection pixels between the set of flame candidate region pixels corresponding to a flame candidate region in the current frame image and the set of flame candidate region pixels corresponding to a flame candidate region in the previous frame image by the number of union pixels between the set of flame candidate region pixels corresponding to the flame candidate region in the current frame image and the set of flame candidate region pixels corresponding to the flame candidate region in the previous frame image.
[0155] Based on the spatial overlap, candidate matching regions are selected for each flame candidate region in the current frame image to obtain the candidate matching regions and candidate matching overlap.
[0156] In Example 1, for a flame candidate region in the current frame image, the flame candidate region with the largest spatial overlap is selected from all flame candidate regions corresponding to the previous frame image as the candidate matching region corresponding to the flame candidate region, and the spatial overlap between the flame candidate region and the candidate matching region is used as the candidate matching overlap.
[0157] Based on the candidate matching overlap, determine the trajectory matching result of each flame candidate region in the current frame image;
[0158] In Example 1, when the overlap of a candidate matching region corresponding to a flame candidate region in the current frame image is greater than or equal to a preset overlap matching threshold, the flame candidate region in the current frame image is matched to the temporal trajectory of the flame candidate region corresponding to the candidate matching region in the previous frame image.
[0159] When the overlap of candidate matching corresponding to a flame candidate region in the current frame image is less than the preset overlap matching threshold, the flame candidate region in the current frame image is established as a new flame candidate region temporal trajectory.
[0160] Trajectory matching is performed sequentially on all candidate flame regions in the current frame image to obtain the trajectory matching results corresponding to all candidate flame regions in the current frame image.
[0161] The preset overlap matching threshold is obtained by statistically analyzing the spatial overlap of adjacent frames that are manually labeled as the same flame candidate region in the image sequence of buildings in the park. The mean spatial overlap is reduced by 0.5 times the standard deviation of spatial overlap and then limited to a value range of 0.3-0.75. In this embodiment, when the mean spatial overlap is 0.62 and the standard deviation of spatial overlap is 0.16, the preset overlap matching threshold is 0.54.
[0162] Based on the trajectory matching results of each flame candidate region in the current frame image, establish the temporal trajectory of the flame candidate region;
[0163] In Example 1, when a flame candidate region in the current frame image matches an existing flame candidate region temporal trajectory, the flame candidate region mask in the current frame image is appended to the corresponding existing flame candidate region temporal trajectory, and the frame number of the current frame image is used as the latest frame number of the flame candidate region temporal trajectory.
[0164] When a flame candidate region in the current frame image is established as a new flame candidate region temporal trajectory, the flame candidate region mask in the current frame image is used as the first trajectory node of the new flame candidate region temporal trajectory, and the frame number of the current frame image is used as the starting frame number of the new flame candidate region temporal trajectory.
[0165] Based on the temporal trajectory of the flame candidate region, record the number of consecutive frames, pixel area sequence, and average brightness sequence;
[0166] In Example 1, the pixel area is obtained by counting the number of pixel positions in the pixel set of the associated flame candidate region in the frame image.
[0167] The average brightness is obtained by summing the grayscale values corresponding to all pixel positions in the associated flame candidate region pixel set in the image frame and dividing by the pixel area.
[0168] Based on the temporal trajectory of the flame candidate region, the boundary contour sequence is recorded, and the continuous frame number, pixel area sequence, boundary contour sequence and average brightness sequence are organized according to the trajectory number of the temporal trajectory of the flame candidate region.
[0169] Based on the continuous frame count, pixel area sequence, boundary contour sequence and average brightness sequence, the area change rate, boundary perturbation amplitude, brightness fluctuation amplitude and duration are calculated to generate a set of temporal evolution features of flame candidate regions.
[0170] In this embodiment, the generation of a temporal evolution feature set of flame candidate regions includes:
[0171] Calculate the rate of change of area based on the pixel area sequence;
[0172] In Example 1, when the number of continuous frames corresponding to the temporal trajectory of the flame candidate region is greater than one, the pixel area corresponding to two adjacent trajectory nodes in the pixel area sequence is read sequentially, and the pixel area corresponding to the next trajectory node is subtracted from the pixel area corresponding to the previous trajectory node to obtain the change in pixel area between adjacent trajectory nodes.
[0173] The total change in pixel area is obtained by summing the changes in pixel area between all adjacent trajectory nodes. The area change rate is obtained by dividing the total change in pixel area by the number of consecutive frames minus one.
[0174] When the number of continuous frames corresponding to the temporal trajectory of the flame candidate region is equal to one, the area change rate is set to zero.
[0175] Calculate the boundary disturbance amplitude based on the boundary profile sequence;
[0176] In Example 1, the number of boundary pixels in the boundary contours corresponding to two adjacent trajectory nodes that do not both belong to the two boundary contours is divided by the number of boundary pixels in the boundary contours corresponding to two adjacent trajectory nodes that belong to at least one boundary contour to obtain the boundary contour perturbation value between adjacent trajectory nodes.
[0177] The boundary contour disturbance values between all adjacent trajectory nodes are summed to obtain the total boundary contour disturbance value. The boundary contour disturbance amplitude is obtained by dividing the total boundary contour disturbance value by the number of continuous frames minus one.
[0178] When the number of continuous frames corresponding to the temporal trajectory of the flame candidate region is equal to one, the boundary perturbation amplitude is set to zero.
[0179] Calculate the brightness fluctuation amplitude based on the average brightness sequence;
[0180] In Example 1, the average brightness corresponding to all trajectory nodes in the average brightness sequence is summed, and the summation result is divided by the number of continuous frames to obtain the trajectory average brightness.
[0181] Subtract the average brightness of the trajectory from the average brightness of each trajectory node to obtain the brightness deviation value of each trajectory node. Square the brightness deviation value of each trajectory node to obtain the squared brightness deviation value of each trajectory node.
[0182] The summation of the squared brightness deviation values corresponding to all trajectory nodes is then performed. The summation result is divided by the number of consecutive frames to obtain the mean squared brightness deviation. The square root of the mean squared brightness deviation is then taken to obtain the brightness fluctuation amplitude.
[0183] Calculate the duration based on the number of consecutive frames;
[0184] A set of temporal evolution features of flame candidate regions is generated based on the area change rate, boundary disturbance amplitude, brightness fluctuation amplitude, and duration.
[0185] The temporal evolution feature set of flame candidate regions is input into the Hidden Markov Evolutionary Model. Combined with the feature uncertainty weights, the fire probability of each flame candidate region is dynamically predicted, and graded security risk warning information is generated for each flame candidate region. When the graded security risk warning information reaches the high risk threshold, a linkage command is pushed to the park security platform, and the fire extinguishing equipment is controlled to perform fire extinguishing operations.
[0186] In this embodiment, the temporal evolution feature set of the flame candidate region is input into the hidden Markov evolution model, including:
[0187] Based on the temporal evolution feature set of flame candidate regions, an observation feature sequence of the hidden Markov evolution model is generated;
[0188] In Example 1, the area change rate, boundary disturbance amplitude, brightness fluctuation amplitude, and duration of the temporal trajectory of the same flame candidate region are arranged in a fixed field order for each trajectory update to obtain an observation feature vector.
[0189] Based on the feature uncertainty weight, the regional feature confidence level corresponding to each flame candidate region time-series trajectory is calculated;
[0190] In Example 1, the corresponding visual token is determined based on the image position covered by the flame candidate region mask, and the feature uncertainty weight of the corresponding visual token is read.
[0191] The feature uncertainty weights of all corresponding visual tokens within the mask coverage area of the flame candidate region are averaged to obtain the region feature uncertainty weights.
[0192] The result after subtracting the regional feature uncertainty weight from 1 is limited to a value range of zero to 1, thus obtaining the regional feature credibility.
[0193] The observed feature sequence and regional feature confidence are input into the Hidden Markov Evolutionary Model. The observed likelihood probability is corrected based on the regional feature confidence, and the fire probability of each flame candidate region is dynamically predicted.
[0194] In Example 1, the hidden Markov evolution model includes non-arson hidden state, suspected fire point hidden state, continuous combustion hidden state, and high-risk arson hidden state.
[0195] Hidden Markov evolution models pre-configure state feature centers, state feature discrete ranges, initial state probabilities, and state transition probabilities for each hidden state.
[0196] The difference between each observed feature vector in the observed feature sequence and the state feature center corresponding to the non-fire hidden state, suspected fire hidden state, continuous burning hidden state, and high-risk fire hidden state is calculated. Combined with the corresponding state feature discrete range, the hidden state with smaller difference and more concentrated state feature discrete range is assigned a higher original observation likelihood probability, and the hidden state with larger difference and more obvious deviation from state feature discrete range is assigned a lower original observation likelihood probability.
[0197] Normalize all the original observation likelihood probabilities corresponding to the same observation feature vector to obtain the observation likelihood probabilities corresponding to the observation feature vector in the non-fire hidden state, the suspected fire hidden state, the continuous burning hidden state, and the high-risk fire hidden state.
[0198] When the reliability of regional features is high, the observation likelihood probability corresponding to the current observation feature vector is maintained or enhanced, so that the Hidden Markov Evolutionary Model (HMM) judges the hidden state of the temporal trajectory of the flame candidate region more based on the current observation feature vector; when the reliability of regional features is low, the observation likelihood probability corresponding to the current observation feature vector is reduced, so that the HMM judges the hidden state of the temporal trajectory of the flame candidate region more based on the posterior probability of the hidden state and the state transition probability at the previous trajectory update time.
[0199] The observed likelihood probability, adjusted for regional feature confidence, is normalized again to obtain the corrected observed likelihood probability.
[0200] At the trajectory update time corresponding to the first observed feature vector, the initial state probability is multiplied by the corrected observation likelihood probability and normalized to obtain the posterior probability of the non-fire hidden state, the posterior probability of the suspected fire point hidden state, the posterior probability of the continuous burning hidden state, and the posterior probability of the high-risk fire hidden state corresponding to the first trajectory update time.
[0201] At each trajectory update time after the first observed feature vector, the posterior probabilities of the non-fire-causing hidden state, the suspected fire-causing hidden state, the continuous burning hidden state, and the high-risk fire-causing hidden state corresponding to the previous trajectory update time are calculated, along with the state transition probability. The predicted state probability corresponding to the current trajectory update time is then multiplied by the corrected observation likelihood probability corresponding to the current observed feature vector and normalized to obtain the posterior probabilities of the non-fire-causing hidden state, the suspected fire-causing hidden state, the continuous burning hidden state, and the high-risk fire-causing hidden state corresponding to the current trajectory update time.
[0202] The posterior probabilities of the suspected fire point hidden state, the posterior probabilities of the continuous burning hidden state, and the posterior probabilities of the high-risk fire hidden state corresponding to the current trajectory update time are accumulated to obtain the fire failure probability of each flame candidate area at the current trajectory update time.
[0203] Based on the fire failure probability of each flame candidate region, output the fire failure probability prediction result;
[0204] In Example 1, based on the first fire probability threshold, the second fire probability threshold, and the high-risk threshold, the following prediction results are defined: non-fire prediction result, suspected fire point prediction result, continuous combustion prediction result, and high-risk fire prediction result:
[0205] Non-fire prediction result: The probability of fire is less than the first fire probability threshold;
[0206] Suspected fire point prediction results: The probability of fire is greater than or equal to the first fire probability threshold and less than the second fire probability threshold;
[0207] Continuous combustion prediction results: The probability of fire is greater than or equal to the second probability threshold of fire and less than the high-risk threshold;
[0208] High-risk fire prediction result: The probability of fire is greater than or equal to the high-risk threshold.
[0209] The first fire probability threshold, the second fire probability threshold, and the high-risk threshold were obtained by statistically analyzing the fire probability distributions corresponding to non-fire prediction results, suspected fire point prediction results, continuous combustion prediction results, and high-risk fire prediction results in the labeled samples of building images in the park. The first fire probability threshold was the sum of the mean fire probability of the non-fire sample and one standard deviation, limited to a value range of 0.2-0.4. The second fire probability threshold was the sum of the mean fire probability of the suspected fire point sample and one standard deviation, limited to a value range of 0.45-0.65. The high-risk threshold was the sum of the mean fire probability of the continuous combustion sample and one standard deviation, limited to a value range of 0.7-0.9.
[0210] In the embodiment, when the mean fire probability of non-accidental fire samples is 0.24 and the standard deviation is 0.07, the first fire probability threshold is set at 0.31; when the mean fire probability of suspected fire point samples is 0.49 and the standard deviation is 0.08, the second fire probability threshold is set at 0.57; and when the mean fire probability of continuous burning samples is 0.72 and the standard deviation is 0.09, the high-risk threshold is set at 0.81.
[0211] Based on the fire probability prediction results and the temporal evolution feature set of flame candidate areas, hierarchical security risk early warning information is generated;
[0212] In Example 1, the tiered security risk warning information includes no warning information, suspected fire point warning information, continuous burning warning information, and high-risk fire warning information:
[0213] No warning information: The fire probability prediction result is not a fire prediction result, or the duration is less than the minimum duration threshold;
[0214] Suspected fire warning information: The fire probability prediction result is the same as the suspected fire prediction result, and the duration is greater than or equal to the minimum duration threshold;
[0215] Continuous combustion warning information: The fire probability prediction result is the continuous combustion prediction result, and at least one of the following—area change rate, boundary disturbance amplitude, or brightness fluctuation amplitude—reaches the corresponding continuous combustion judgment threshold.
[0216] High-risk fire warning information: The fire probability prediction result is a high-risk fire prediction result, and the duration is greater than or equal to the high-risk duration threshold, and at least one of the area change rate, boundary disturbance amplitude or brightness fluctuation amplitude reaches the corresponding high-risk judgment threshold.
[0217] The minimum duration threshold is obtained by statistically analyzing the duration of samples manually labeled as real fire points in the building image sequence of the park, and then subtracting 0.5 times the standard deviation of the real fire point sample duration from the mean of the real fire point sample duration, and limiting it to a range of 1-3 seconds.
[0218] The threshold for determining continuous burning was obtained by statistically analyzing the area change rate, boundary disturbance amplitude, and brightness fluctuation amplitude of manually marked targets for continuous burning. The corresponding mean values were subtracted by 0.5 times the corresponding standard deviation and then limited to the range of 10-60 pixels / frame, 0.15-0.45, and 0.05-0.2, respectively. In this embodiment, the threshold for determining continuous burning based on the area change rate was 25 pixels / frame, the threshold for determining continuous burning based on the boundary disturbance amplitude was 0.28, and the threshold for determining continuous burning based on the brightness fluctuation amplitude was 0.11.
[0219] The high-risk duration threshold is obtained by statistically analyzing the duration of samples manually marked as high-risk fire targets, and then subtracting 0.5 times the standard deviation of the high-risk fire sample duration from the mean of the high-risk fire sample duration, and limiting the value to a range of 3-8 seconds.
[0220] The high-risk determination thresholds are obtained by statistically analyzing the area change rate, boundary disturbance amplitude, and brightness fluctuation amplitude of manually marked high-risk fire targets. The corresponding mean values are subtracted by 0.5 times the corresponding standard deviation and then limited to the range of 40-120 pixels / frame, 0.30-0.70, and 0.12-0.35, respectively. In this example, the high-risk determination threshold for area change rate is 70 pixels / frame, the high-risk determination threshold for boundary disturbance amplitude is 0.48, and the high-risk determination threshold for brightness fluctuation amplitude is 0.22.
[0221] When the graded security risk warning information reaches the high-risk threshold, a linkage instruction is pushed to the park's security platform, and the fire extinguishing equipment is controlled to perform fire extinguishing operations.
[0222] When the graded security risk warning information is a high-risk fire warning information, a linkage instruction is generated. The linkage instruction includes the trajectory number of the temporal trajectory of the flame candidate area, the frame number of the current frame image, the fire probability prediction result, the graded security risk warning information, and the corresponding flame candidate area mask.
[0223] The linkage command is pushed to the park's security platform. Based on the monitoring location corresponding to the current frame image, the pre-associated fire extinguishing equipment is invoked, and a fire extinguishing start command is sent to the fire extinguishing equipment, so that the fire extinguishing equipment can perform fire extinguishing operations on the park building area corresponding to the flame candidate area.
[0224] Example 2: A park security risk early warning system, comprising:
[0225] The acquisition module is used to acquire continuous video frames from the park's building monitoring system and perform preprocessing to generate a sequence of park building images.
[0226] The generation module is used to generate a first spectral gradient feature map, a second spectral gradient feature map, and a thermal response feature map based on the image sequence of buildings in the park, and then splice them into a spectral-thermal joint feature tensor.
[0227] The fusion module is used to input the sequence of building images in the park into the improved HQ-SAM network to obtain a multi-scale visual token embedding set, and fuse it with the spectral-thermal joint feature tensor to obtain a fused visual feature set and feature uncertainty weights;
[0228] The decoding module is used to generate box hint embeddings, dot hint embeddings, and coarse mask hint embeddings, and input them into a multi-level mask decoder to obtain a set of flame candidate region masks;
[0229] The tracking module is used to establish the temporal trajectory of the flame candidate region and record the number of continuous frames, pixel area sequence, boundary contour sequence and average brightness sequence;
[0230] The evolution module is used to generate a set of temporal evolution features of flame candidate regions;
[0231] The early warning module is used to dynamically predict the probability of fire, generate graded security risk early warning information, and push linkage instructions and control fire extinguishing equipment to extinguish fires when the high risk threshold is reached.
[0232] Example 3, Reference Figure 3 This embodiment also provides a computer device, including a system memory 1005 and a processor 1001. The system memory 1005 stores a computer program, and the processor 1001 executes the computer program to implement the steps of any of the methods described above.
[0233] It should be noted that the processor 1001 is used to execute the steps in the above method embodiments according to the instructions in the program code. Alternatively, when the processor 1001 executes the computer program, it implements the functions of each module / unit in the above system / device embodiments.
[0234] Specifically, in this embodiment, the computer program can be divided into one or more modules / units, which are stored in the system memory 1005 and executed by the processor 1001 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the terminal device.
[0235] The terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor 1001 and a system memory 1005. Those skilled in the art will understand that this does not constitute a limitation on the terminal device; it may include more or fewer components than shown in the figures, or a combination of certain components, or different components. For example, the terminal device may also include an input / output device 1003, a network access device 1002, a bus 1006, etc.
[0236] The processor 1001 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0237] System memory 1005 can be an internal storage unit of the terminal device, such as a hard drive or RAM. System memory 1005 can also be a storage device 1004 of the terminal device, such as an external hard drive, SmartMedia Card (SMC), Secure Digital (SD) card, or FlashCard. Furthermore, system memory 1005 can include both internal storage units and storage device 1004. System memory 1005 is used to store computer programs and other programs and data required by the terminal device. System memory 1005 can also be used to temporarily store data that has been output or will be output.
[0238] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0239] Example 4: Reference Figure 4 As shown, the park's security platform connects to a fixed monitoring screen in an external passageway of an equipment room. One side of the area is the equipment room door, and the other side contains cable trays and temporarily placed packaging materials. The screen also shows reflections from metal cabinets, reflections from passageway lighting, and partial obstructions caused by people passing by. The system continuously receives video streams from this monitoring point; the original video frame resolution is 1920×1080, and the frame rate is 25 frames per second. During playback testing, the implementers found that from relative time T0 to T0+2.0 seconds, the screen only showed normal lighting and reflections from the metal cabinets. Smoke and heat sensors were not triggered. The traditional color thresholding method generated three suspected flame-like bright frames at the reflected locations, with the largest bright frame having an area of 1840 pixels. However, the spatial overlap of this bright frame varied from 0.12 to 0.21 in consecutive frames, failing to form a stable target.
[0240] Upon receiving consecutive video frames, the system of this invention performs brightness normalization, color correction, noise suppression, image stabilization, reflection reduction, and low-light enhancement processing on the consecutive video frames to form a sequence of building images in the park. Taking a frame at a relative time T0+2.4 seconds as an example, before preprocessing, the average brightness of the image is 0.31, the maximum brightness in the local reflective area is 0.94, and the standard deviation of the background noise is 0.087; after preprocessing, the average brightness of the image is adjusted to 0.46, the maximum brightness in the local reflective area is suppressed to 0.72, the standard deviation of the background noise is reduced to 0.041, and the image jitter offset between consecutive frames is reduced from an average of 2.8 pixels to 0.6 pixels. This processing result ensures that the subsequent calculation of the spectral-thermal joint feature tensor is not significantly affected by single-frame brightness abrupt changes or slight image jitter.
[0241] At a relative time T0+3.2 seconds, a small yellow-orange bright spot appeared on the edge of the packaging material under the cable tray. The system extracted the normalized pixel values of the red, green, and blue channels from the building image sequence in the park and calculated the first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map. Within the bright spot area, the normalized mean value of the red channel was 0.71, the normalized mean value of the green channel was 0.42, the normalized mean value of the blue channel was 0.19, the mean value of the first spectral gradient feature map was 0.48, the mean value of the second spectral gradient feature map was 0.63, and the mean value of the thermal response feature map formed by the frame difference grayscale mapping at the same timestamp was 0.34. At the same time, in the reflective area of the metal cabinet on the right side of the image, the normalized mean value of the red channel was 0.67, the normalized mean value of the green channel was 0.65, the normalized mean value of the blue channel was 0.61, the mean value of the first spectral gradient feature map was 0.03, the mean value of the second spectral gradient feature map was 0.07, and the mean value of the thermal response feature map was 0.05. Therefore, although the reflective area is brighter, its spectral gradient difference and thermal response change are lower than those of the suspected fire point area. The system concatenates the first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map into a 1024×1024×3 spectral-thermal joint feature tensor.
[0242] The system inputs the current building image sequence into an improved HQ-SAM network. The backbone visual coding branch outputs a multi-scale visual token embedding set, and the spectral-thermal joint feature tensor enters the spectral-thermal joint perception branch. For suspected fire points, the mean attention response of the spectral-thermal token and visual token is 0.78, and the feature uncertainty weight is 0.16; for reflective areas of metal cabinets, the mean attention response is 0.31, and the feature uncertainty weight is 0.52; for indicator light areas of electronic devices, the mean attention response is 0.27, and the feature uncertainty weight is 0.49. Based on this, the system obtains a fused visual feature set and retains the feature uncertainty weight corresponding to each candidate region. This data shows that suspected fire points have both strong spectral-thermal responses and low uncertainty, while reflective areas and indicator light areas, although bright, have weak spectral-thermal consistency and high uncertainty.
[0243] The system performs saliency extraction based on the spectral-thermal joint feature tensor. The mean spectral-thermal joint response of the current frame image is 0.118, the standard deviation of the spectral-thermal joint response is 0.076, the threshold intensity coefficient is 1.6, and the high response screening threshold is 0.240. Within the suspected fire area, 312 pixel locations have spectral-thermal joint response values greater than or equal to 0.240, forming a high-response connected component. Although the reflective area of the metal cabinet has high brightness, only 27 pixel locations meet the spectral-thermal joint response condition, and no stable connected component is formed. The system generates bounding box coordinates based on the pixel coordinate range of the high-response connected region of the suspected fire point. The minimum coordinates of the bounding box coordinates are 486 in the image width direction, 618 in the image height direction, 527 in the image width direction, and 657 in the image height direction. Point coordinates are generated based on the pixel position with the largest spectral-thermal joint response value within the connected region. The point coordinates are 506 and 637. A coarse mask hint map is generated based on the high-response connected region, in which the number of pixels with a coarse mask hint value of 1 is 312.
[0244] After the bounding box coordinates, point cue coordinates, and coarse mask cue map are input into the cue encoder, the bounding box cue embedding, point cue embedding, and coarse mask cue embedding are obtained. The multi-level mask decoder reads the corresponding fused visual feature set and generates an initial candidate mask probability map. In the probability map, the average mask probability value for the suspected fire point core region is 0.84, the average mask probability value for the edge region is 0.61, and the average mask probability value for the surrounding packaging material background region is 0.18. Based on the candidate foreground probability mean of 0.73, the candidate foreground probability standard deviation of 0.11, and a threshold adjustment coefficient of 0.6, the system obtains a mask determination threshold of 0.664; pixels with a mask probability value greater than or equal to 0.664 and located within the bounding box coordinate defined area are set as foreground pixels. The initial candidate mask area was 286 pixels. After fine-tuning and iterative repair, the area was 341 pixels. The boundary pixel-level refinement layer further incorporated the boundary breakage area into the flame candidate area, finally obtaining a flame candidate area mask with an area of 356 pixels. The comparison results of the same consecutive frames show that the original HQ-SAM single-frame segmentation method has a mask area of about 286 pixels at a relative time T0+3.2 seconds, while the method of this invention has a mask area of about 356 pixels at the same time, and the flame boundary coverage is more complete.
[0245] In subsequent consecutive frames, the system establishes a temporal trajectory of the flame candidate regions based on the flame candidate region mask set. The pixel areas of the flame candidate regions corresponding to relative times T0+3.2 seconds, T0+4.0 seconds, and T0+4.8 seconds are 356, 716, and 1276 pixels, respectively. In the same consecutive frame, the mask areas corresponding to the original HQ-SAM single-frame segmentation method are approximately 286, 650, and 1180 pixels, respectively, with local gaps or outward drift at the lower edge and right outer edge of the flame. Between relative times T0+3.2 seconds and T0+4.8 seconds, the spatial overlap of the flame candidate regions corresponding to the method of this invention in the consecutive frames remains between 0.58 and 0.74, satisfying the preset overlap matching threshold of 0.54. Therefore, the aforementioned flame candidate regions are matched as the same temporal trajectory of the flame candidate regions. During the same period, the candidate area of the reflective area of the metal cabinet in consecutive frames was 1840, 923, 2110, 602, and 1588 pixels, respectively, and the spatial overlap of adjacent frames was 0.18, 0.09, 0.22, and 0.13, respectively. Since the preset overlap matching threshold was not reached, a stable temporal trajectory of the flame candidate area was not formed.
[0246] The system records the duration of frames, pixel area sequence, boundary contour sequence, and average brightness sequence according to the temporal trajectory of the flame candidate region. Within a 1.6-second segment corresponding to the relative time T0+3.2 seconds to T0+4.8 seconds, the trajectory is actually recorded continuously for 41 frames. The pixel area sequences corresponding to the three trajectory nodes selected in the comparison image of the same continuous frame are 356, 716, and 1276; the average brightness sequences are 0.58, 0.68, and 0.77; and the number of boundary pixels in the boundary contours are 82, 121, and 173, respectively. The system further calculates that the total change in pixel area is 920 pixels. Converted to the 40 inter-frame intervals corresponding to this 1.6-second segment, the area change rate is 23.0 pixels / frame. The adjacent boundary contour perturbation values are 0.31 and 0.41, respectively, with a boundary perturbation amplitude of 0.36. The average brightness of the trajectory corresponding to the average brightness sequence is 0.677, with a brightness fluctuation amplitude of 0.078. Converted at 25 frames / second, the duration is 1.6 seconds. At this point, the system identifies it as a continuous combustion warning state, but it has not yet reached the high-risk fire conditions.
[0247] At a relative time T0+6.4 seconds, the flame candidate region continued to expand. The system recorded this trajectory for 80 consecutive frames, lasting for 3.2 seconds. The pixel area at the end of the sequence increased from 1276 pixels to 3896 pixels. The area change rate of the last 20 frames was 118.9 pixels / frame, the boundary perturbation amplitude was 0.46, and the brightness fluctuation amplitude was 0.17. After receiving the temporal evolution feature set of the flame candidate region, the Hidden Markov Evolutionary Model (HMM) dynamically predicted the region by combining the uncertainty weight of 0.14. The model output the posterior probability of the non-arrested hidden state as 0.04, the posterior probability of the suspected fire point hidden state as 0.12, the posterior probability of the continuous burning hidden state as 0.31, the posterior probability of the high-risk arrested hidden state as 0.53, and the arrested probability as 0.96. Because the fire probability exceeds the high-risk threshold of 0.81, the duration exceeds the high-risk duration threshold of 3.0 seconds, and the area change rate, boundary disturbance amplitude, and brightness fluctuation amplitude all reach the high-risk judgment threshold, the system generates a high-risk fire warning and pushes a linkage command to the park security platform. The linkage command includes the monitoring point number, the temporal trajectory number of the flame candidate area, the current frame number, the flame candidate area mask, the fire probability of 0.96, and the high-risk fire warning information. After receiving the linkage command, the park security platform calls the fire extinguishing equipment associated with the monitoring point and sends a fire extinguishing activation command to the fire extinguishing equipment.
[0248] To verify the difference between the method of this invention and traditional methods, the traditional smoke detection triggering method, the traditional color threshold combined with frame difference method, the original HQ-SAM single-frame segmentation method, and the method of this invention were run simultaneously in the same simulated event. The traditional smoke detection method reached the alarm condition at a relative time T0+17.8 seconds, and the traditional temperature detection method reached the alarm condition at a relative time T0+23.6 seconds. The traditional color threshold combined with frame difference method output a suspected flame at a relative time T0+3.0 seconds, but simultaneously outputted the reflective areas of the metal cabinet and the reflected areas of the channel lighting as suspected flames, resulting in two false alarm targets. The original HQ-SAM single-frame segmentation method output candidate mask areas of approximately 286, 650, and 1180 pixels at relative times T0+3.2 seconds, T0+4.0 seconds, and T0+4.8 seconds, respectively. However, the mask boundary has local gaps and outer edge drift. The mask area of the flame candidate region output by the method of the present invention at the corresponding time is about 356, 716 and 1276 pixels respectively, the mask boundary is more continuous and the coverage of the flame body is more complete. The method of the present invention generates a suspected fire point warning information at a relative time T0+3.2 seconds, a continuous burning warning information at a relative time T0+4.8 seconds, and a high-risk fire warning information at a relative time T0+6.4 seconds. It does not identify the reflection of metal cabinets, the indicator lights of electronic devices and the short-term bright spots of lighters held by people as high-risk fire targets.
[0249] Regarding training and testing samples, the training samples used in this embodiment include 3200 real flame samples, 1100 cigarette lighting samples, 950 lighter samples, 1300 vehicle light samples, 900 electronic screen samples, 1250 light reflection samples, and 1800 normal background samples; the validation samples include 640 real flame samples and 980 non-fire interference samples; and the testing samples include 710 real flame samples and 1060 non-fire interference samples. Test results show that the traditional color thresholding combined with frame difference method has a recall rate of 82.4% for real flame samples and a false alarm rate of 27.9% for non-fire interference samples; the original HQ-SAM single-frame segmentation method has a recall rate of 88.6% for real flame samples and a false alarm rate of 15.7% for non-fire interference samples; and the method of this invention has a recall rate of 95.1% for real flame samples and a false alarm rate of 5.8% for non-fire interference samples. Regarding the mask quality for flame candidate regions, the average Dice coefficient of the traditional color thresholding combined with frame difference method is 0.704, the average Dice coefficient of the original HQ-SAM single-frame segmentation method is 0.851, and the average Dice coefficient of the method of this invention is 0.916. Regarding temporal trajectories, the trajectory breakage rate of the original HQ-SAM single-frame segmentation method is 18.3%, while the trajectory breakage rate of the method of this invention is 6.9%.
[0250] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for early warning of security risks in a park, characterized in that, include: Collect continuous video frames from the park's building surveillance system and perform preprocessing on the continuous video frames to generate a sequence of park building images; The first spectral gradient feature map and the second spectral gradient feature map are generated based on the building image sequence in the park. A thermal response feature map is generated with the same timestamp frame and then spliced together to form a spectral-thermal joint feature tensor. The sequence of building images in the park is input into the improved HQ-SAM network to obtain a multi-scale visual token embedding set. It is then aligned and fused with the spectral-thermal joint feature tensor to obtain a fused visual feature set and corresponding feature uncertainty weights. Saliency extraction is performed based on the spectrum-thermal joint feature tensor, generating box cue embedding, point cue embedding and coarse mask cue embedding, which are then input together with the fused visual feature set into a multi-level mask decoder to obtain a set of flame candidate region masks corresponding to each frame of the park building image sequence. Establish the temporal trajectory of the flame candidate region based on the flame candidate region mask set, and record the continuous frame number, pixel area sequence, boundary contour sequence and average brightness sequence in the order of the flame candidate region temporal trajectory. Based on the continuous frame count, pixel area sequence, boundary contour sequence and average brightness sequence, the area change rate, boundary perturbation amplitude, brightness fluctuation amplitude and duration are calculated to generate a set of temporal evolution features of flame candidate regions. The temporal evolution feature set of flame candidate regions is input into the Hidden Markov Evolutionary Model. Combined with the feature uncertainty weights, the fire probability of each flame candidate region is dynamically predicted, and graded security risk warning information is generated for each flame candidate region. When the graded security risk warning information reaches the high risk threshold, a linkage command is pushed to the park security platform, and the fire extinguishing equipment is controlled to perform fire extinguishing operations.
2. The method for early warning of security risks in a park according to claim 1, characterized in that, The preprocessing includes brightness normalization, color correction, noise suppression, image stabilization, reflection reduction, and low-light enhancement preprocessing.
3. The method for early warning of security risks in a park according to claim 1, characterized in that, The step of generating a first spectral gradient feature map and a second spectral gradient feature map based on the building image sequence of the park, and generating a thermal response feature map by mapping the frame difference grayscale with the same timestamp, includes: Based on the image sequence of buildings in the park, calculate the chromaticity values of the red channel, green channel, and blue channel. Calculate the red channel log chroma, green channel log chroma, and blue channel log chroma using the red channel chroma value, green channel chroma value, and blue channel chroma value; The first spectral gradient feature map and the second spectral gradient feature map are obtained by using the red channel log chroma, the green channel log chroma, and the blue channel log chroma. The weighted sum of the normalized pixel values of the red channel, green channel, and blue channel is used to obtain the grayscale mapping value. A thermal response feature map is generated by mapping the grayscale difference between frames with the same timestamp. The first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map corresponding to the same frame image are concatenated according to the channel dimension to generate the spectral-thermal joint feature tensor corresponding to the frame image.
4. The park security risk early warning method according to claim 3, characterized in that, The step of inputting the building image sequence into the improved HQ-SAM network includes: The current frame image from the building image sequence in the park is input into the backbone visual coding trunk of the improved HQ-SAM network to obtain a set of image blocks; Perform linear embedding and positional embedding on the image patch set to obtain the initial visual token embedding matrix; Input the initial visual token embedding matrix into the coding layer of the corresponding scale level in the main visual coding trunk to obtain the hierarchical visual token embedding matrix. The visual token embedding matrices of all levels are used to form the multi-scale visual token embedding set corresponding to the current frame image. Input the spectrum-thermal joint feature tensor into the spectrum-thermal joint sensing branch to obtain the spectrum-thermal token embedding matrix; A query matrix is generated using a visual token embedding matrix, a key matrix and a value matrix are generated using a spectral-hot token embedding matrix, and a spectral-hot attention response matrix and a spectral-hot alignment feature matrix are calculated. The spectral-hot aligned feature matrix and the visual token embedding matrix are fused to obtain a fused visual feature matrix, and the fused visual feature matrices corresponding to all scale levels are combined to form a fused visual feature set. Calculate the feature uncertainty weights based on the spectral-thermal attention response matrix.
5. The park security risk early warning method according to claim 4, characterized in that, The saliency extraction based on the spectral-thermal joint feature tensor generates box cue embeddings, point cue embeddings, and coarse mask cue embeddings, which are then input into a multi-level mask decoder along with the fused visual feature set. The first spectral gradient feature map, the second spectral gradient feature map, and the thermal response feature map are weighted and summed to obtain the spectral-thermal joint response map. Calculate the high response screening threshold based on the spectrum-thermal joint response map, and generate a high response binary map based on the high response screening threshold; Perform connected component labeling on the high-response binary graph to obtain the high-response connected components corresponding to the current frame image; Generate corresponding bounding box coordinates based on the pixel coordinate range of each high-response connected component; Generate corresponding point cue coordinates based on the pixel position with the largest spectral-thermal joint response value in each high-response connected region, and generate corresponding coarse mask cue map based on each high-response connected region. Input the box cue coordinates, point cue coordinates, and coarse mask cue map into the cue encoder of the improved HQ-SAM network to generate box cue embeddings, point cue embeddings, and coarse mask cue embeddings, respectively. The multi-level mask decoder of the improved HQ-SAM network is input together with the box hint embedding, dot hint embedding, coarse mask hint embedding and fused visual feature set. The coarse mask generation and fine iterative repair are performed in sequence to obtain the fine candidate mask. The refined candidate mask and the fused visual feature set are input into the boundary pixel-level refinement layer to obtain the flame candidate region mask, and then organized into a set of flame candidate region masks corresponding to each frame of the building image sequence in the park.
6. The park security risk early warning method according to claim 5, characterized in that, The step of establishing the temporal trajectory of the flame candidate region based on the set of flame candidate region masks includes: Based on the flame candidate region mask sets corresponding to the current frame image and the previous frame image, determine the flame candidate region pixel set corresponding to each flame candidate region in the current frame image and the previous frame image respectively; Based on the set of pixels of each flame candidate region in the current frame image and the previous frame image, calculate the spatial overlap relationship between candidate regions and obtain the spatial overlap degree. Based on the spatial overlap, candidate matching regions are selected for each flame candidate region in the current frame image to obtain the candidate matching regions and candidate matching overlap. Based on the overlap of candidate matches, the trajectory matching result of each flame candidate region in the current frame image is determined; Based on the trajectory matching results of each flame candidate region in the current frame image, establish the temporal trajectory of the flame candidate region; Based on the temporal trajectory of the flame candidate region, record the number of consecutive frames, pixel area sequence, and average brightness sequence; Based on the temporal trajectory of the flame candidate region, the boundary contour sequence is recorded, and the continuous frame number, pixel area sequence, boundary contour sequence and average brightness sequence are organized according to the trajectory number of the temporal trajectory of the flame candidate region.
7. The park security risk early warning method according to claim 6, characterized in that, The set of temporal evolution features for generating flame candidate regions includes: Calculate the rate of change of area based on the pixel area sequence; Calculate the boundary disturbance amplitude based on the boundary profile sequence; Calculate the brightness fluctuation amplitude based on the average brightness sequence; Calculate the duration based on the number of consecutive frames; A set of temporal evolution features of flame candidate regions is generated based on the area change rate, boundary perturbation amplitude, brightness fluctuation amplitude, and duration.
8. The park security risk early warning method according to claim 7, characterized in that, The step of inputting the temporal evolution feature set of flame candidate regions into the hidden Markov evolution model includes: Based on the temporal evolution feature set of flame candidate regions, an observation feature sequence of the hidden Markov evolution model is generated; Based on the feature uncertainty weight, the regional feature confidence level corresponding to each flame candidate region time-series trajectory is calculated; The observed feature sequence and regional feature confidence are input into the Hidden Markov Evolutionary Model. The observed likelihood probability is corrected based on the regional feature confidence, and the fire probability of each flame candidate region is dynamically predicted. Based on the fire failure probability of each flame candidate region, output the fire failure probability prediction result; Based on the fire probability prediction results and the temporal evolution feature set of flame candidate areas, hierarchical security risk early warning information is generated; When the graded security risk warning information reaches the high-risk threshold, a linkage instruction is pushed to the park's security platform, and the fire extinguishing equipment is controlled to perform fire extinguishing operations.
9. A park security risk early warning system, used to execute the park security risk early warning method according to any one of claims 1-8, characterized in that, include: The acquisition module is used to acquire continuous video frames from the park's building monitoring system and perform preprocessing to generate a sequence of park building images. The generation module is used to generate a first spectral gradient feature map, a second spectral gradient feature map, and a thermal response feature map based on the image sequence of buildings in the park, and then splice them into a spectral-thermal joint feature tensor. The fusion module is used to input the sequence of building images in the park into the improved HQ-SAM network to obtain a multi-scale visual token embedding set, and fuse it with the spectral-thermal joint feature tensor to obtain a fused visual feature set and feature uncertainty weights; The decoding module is used to generate box hint embeddings, dot hint embeddings, and coarse mask hint embeddings, and input them into a multi-level mask decoder to obtain a set of flame candidate region masks; The tracking module is used to establish the temporal trajectory of the flame candidate region and record the number of continuous frames, pixel area sequence, boundary contour sequence and average brightness sequence; The evolution module is used to generate a set of temporal evolution features of flame candidate regions; The early warning module is used to dynamically predict the probability of fire, generate graded security risk early warning information, and push linkage instructions and control fire extinguishing equipment to extinguish fires when a high-risk threshold is reached.
10. A computer device, characterized in that, The computer device includes: a memory storing at least one instruction; and a processor executing the instructions stored in the memory to implement the method as described in any one of claims 1-8.
