Pyrotechnic alerting method
By combining spatially anchored dual-view and visual language model in smoke and fire monitoring, the problem of low accuracy in smoke and fire monitoring has been solved, and more accurate smoke and fire alarms have been achieved.
Patent Information
- Application Number
- CN202611517989.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, smoke and fire monitoring in scenarios such as photovoltaic power plants and energy facilities is easily affected by similar appearances such as lights, reflections, clouds, steam, dust, and the outlines of fixed facilities, which leads to reduced accuracy of smoke and fire monitoring and makes it easy to trigger alarms falsely.
We employ a combination of spatially anchored dual-view and visual language model. By providing location cues through the global view and detailed information through the local view, we ensure that the visual language model can accurately focus on the candidate target, perform semantic-level understanding and judgment, and output the category verification probability.
It improves the accuracy of smoke and fire detection, reduces the false alarm rate, makes the timing of smoke and fire alarm triggering more precise, and avoids misjudgment caused by interference from similar appearances.
Smart Images

Figure CN123161333A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to methods for smoke and fire alarms. Background Technology
[0002] Currently, fixed cameras are commonly used for smoke and fire monitoring at photovoltaic power plants, energy facilities, and factory boundaries. Related technologies employ target detection models to read single images, outputting the location, category, and detection confidence probability of suspected targets. Whether to issue a smoke and fire alarm is then determined based on whether the detection confidence probability reaches a threshold. This method is relatively fast, but the judgment relies heavily on the color, texture, and outline of candidate areas. It is easily affected by similar appearances such as light, reflections, clouds, steam, dust, and the outlines of fixed facilities, leading to reduced accuracy in smoke and fire monitoring and potentially causing false alarms. Summary of the Invention
[0003] The main purpose of this application is to provide a smoke and fire alarm method, which aims to improve the accuracy of smoke and fire monitoring and thus improve the accuracy of the triggering timing of the smoke and fire alarm.
[0004] Firstly, this application proposes a method for detecting fireworks, including: Acquire the target image to be used for fireworks alarm, and detect at least one candidate target in the target image, wherein each candidate target corresponds to a candidate bounding box; For any candidate target, a spatially anchored dual view is constructed on the target image based on the candidate bounding box of the candidate target. The spatially anchored dual view includes a global view and a local view. The global view carries a positional cue to indicate the position of the candidate bounding box in the global view, and the local view includes detailed information of the candidate target. The spatially anchored dual-view input is used to input the visual language model, and the visual language model outputs the category verification probability of the candidate target based on location cues and detailed information. Based on the category verification probability of all candidate targets, execute the corresponding fireworks alarm action.
[0005] Secondly, this application also proposes a fire alarm device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the fire alarm method described above.
[0006] Thirdly, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the smoke alarm method described above.
[0007] To address the technical problem in related technologies where single-frame detection relies on color, texture, and contour, and is susceptible to interference from similar appearances leading to reduced accuracy, this application addresses the issue that the first-stage target detection in this application only handles rapid location of candidate regions. The second-stage visual language model, guided by spatially anchored dual-view mapping, clarifies the current target location based on positional cues, performs semantic-level understanding of the region based on detailed information in the local view, and outputs the category verification probability. Because spatially anchored dual-view mapping ensures that the model can accurately focus on the current candidate target even when multiple similar regions exist in the target image, it avoids incorrect verification results due to focusing on the wrong region. Furthermore, since the visual language model possesses cross-modal semantic understanding capabilities, its judgment is not only based on low-level visual features but also combines contextual semantics to distinguish interference from similar appearances, thereby effectively suppressing misjudgments caused by similar color, texture, and contour. Therefore, the technical solution of this application can improve the ability to distinguish between real fireworks and similar-looking interference objects while maintaining single-frame detection speed, reducing the false alarm rate of fireworks and making the timing of fireworks alarm triggering more accurate. Attached Figure Description
[0008] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0009] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a first flowchart illustrating an embodiment of the smoke and fire alarm method of this application. Figure 2 This is a second flowchart illustrating the first embodiment of the smoke and fire alarm method of this application; Figure 3 This is a schematic diagram of the third process provided in Embodiment 1 of the smoke and fire alarm method of this application; Figure 4 This is a schematic diagram of the fourth process provided in Embodiment 1 of the smoke and fire alarm method of this application; Figure 5 This is a schematic diagram of the structure of the smoke and fire alarm device of this application.
[0011] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0012] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0013] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0014] It should be noted that the executing entity in this embodiment can be a smoke and fire alarm device. The smoke and fire alarm device can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device that can realize the above functions.
[0015] Firstly, embodiments of this application provide a smoke and fire alarm method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the fireworks alarm method of this application. In this embodiment, the fireworks alarm method includes steps S10 to S40: Step S10: Obtain the target image to be used for fireworks alarm, and detect at least one candidate target in the target image, wherein each candidate target corresponds to a candidate box; The target image refers to the original image to be used for smoke and fire alarms, typically acquired by a fixed camera. This image can be real-time monitoring footage from locations such as photovoltaic power plants, energy facilities, or factory boundaries, or it can be historically stored image data. The target image may contain actual smoke and fire targets, as well as distractions such as lights, reflections, clouds, steam, dust, and the outlines of fixed structures that resemble the appearance of smoke and fire.
[0016] Candidate targets refer to areas in a target image that may contain smoke or fire, identified by a target detection model. The target detection model scans the target image and outputs multiple areas where smoke or fire may exist; each area is a candidate target. The number of candidate targets may be one or more, depending on whether there are any areas in the target image that appear to contain smoke or fire.
[0017] Each candidate target corresponds to a candidate bounding box and a detection category. The candidate bounding box is a bounding box used to mark the position of the candidate target in the target image, and can be represented as a rectangle. The candidate bounding box determines its specific position and size in the target image using coordinate information, for example, represented by the coordinates of the top-left and bottom-right corners, or by the center coordinates and width and height. The role of the candidate bounding box is to define the spatial extent of the candidate target in the target image, providing a positional reference for subsequent construction of spatially anchored dual views.
[0018] In one optional approach, after acquiring a target image from a fixed camera, the target image is input into a pre-trained target detection model. The target detection model performs feature extraction and region-by-region scanning on the target image, outputting multiple candidate targets. Each candidate target corresponds to a candidate bounding box, and the candidate bounding box is marked with coordinate information indicating the position and size of the candidate target in the target image. The target detection model can employ a single-stage detection network or a two-stage detection network; this application does not specifically limit the target detection model. The output of the target detection model may include the coordinate information of the candidate bounding box and the corresponding detection category, and may also include the original detection score of the candidate bounding box. This original detection score cannot be directly interpreted as the true alarm probability. The system pre-establishes a monotonic score calibration mapping according to the detection category using calibration data isolated from the training set; at runtime, the original detection score can be mapped to a detection confidence probability, which can be used to subsequently determine the candidate risk of the candidate target.
[0019] In another optional approach, after acquiring the target image and inputting it into a pre-trained target detection model, the image undergoes preprocessing, including size normalization and color space conversion. The preprocessed image is then input into the target detection model, which outputs multiple candidate regions generated on the target image. Each candidate region can be evaluated for confidence, and regions with higher confidence are selected as candidate targets. This allows for subsequent analysis of candidate targets with higher confidence, improving the accuracy of smoke and fire alarms.
[0020] Step S20: For any candidate target, construct a spatially anchored dual view on the target image based on the candidate bounding box of the candidate target. The spatially anchored dual view includes a global view and a local view. The global view carries a positional cue to indicate the position of the candidate bounding box in the global view, and the local view includes detailed information of the candidate target. Spatial anchored dual-view refers to an image pair consisting of a global view and a local view, which is used to provide the visual language model with both the position information of the candidate target in the global view and the detailed information of the candidate target itself. Both views in the spatial anchored dual-view are generated based on the same candidate box, and the global view carries positional cues, enabling the visual language model to clearly identify the position of the target to be reviewed.
[0021] The global view refers to the target image carrying location cues. This global view preserves complete scene information of the target image, including the background environment around the candidate target, other similar regions, and the outlines of fixed structures. By overlaying location cues onto the global view, the visual language model can clearly know the specific location of the candidate box in the scene when observing the complete scene, thus focusing attention on the designated area rather than others. Location cues in the global view refer to the marker information used to indicate the position of the candidate box within the global view. These location cues can take various forms, such as the coordinates of the candidate box in the target image, the region marker corresponding to the candidate box, or visual markers indicating the coverage area of the candidate box. The purpose of these location cues is to eliminate positional ambiguity, enabling the visual language model to clearly identify which candidate target should be focused on even when multiple similar regions exist in the target image.
[0022] The local view refers to an image region containing detailed information about the candidate target. This local view is determined from the target image based on the candidate bounding box and can be obtained by cropping after expanding outwards from the candidate bounding box by a certain range. The purpose of this local view is to provide the visual language model with detailed information about the candidate target and its surrounding context, enabling the visual language model to accurately determine the attributes of the candidate target. The detailed information in the local view refers to the visual content presented by the candidate target and its surrounding area, including the shape, color, texture, and outline of the candidate target, as well as its relative relationship with the surrounding environment. This detailed information is the basis for the visual language model to make semantic judgments. By analyzing this detailed information, the visual language model can distinguish between real fireworks and similar-looking distracting objects.
[0023] In one optional approach, for any candidate target, the position coordinates and size information of the candidate bounding box in the target image are obtained; based on the position coordinates and size information of the candidate bounding box, the relative position of the candidate bounding box in the target image is calculated to generate a position cue; this position cue is overlaid on the target image in the form of a visual marker to obtain a global view, or the position cue can be directly drawn on the target image to obtain a global view. Simultaneously, the cropping range of the local region is determined based on the size of the candidate bounding box, and a local view containing detailed information of the candidate target is cropped from the target image; finally, the global view and the local view are combined to form a spatially anchored dual-view.
[0024] Understandably, compared to related technologies where multiple similar regions exist in the global view, only the global view and a local region are considered. Figure 1When inputting data into the model, the model doesn't know which part of the global view is the candidate object to be reviewed. It might borrow information from other regions for judgment, leading to incorrect review results due to focusing on the wrong region. This application solves the problem of the visual language model being unable to determine the focus position when multiple similar regions coexist in the target image by constructing a spatially anchored dual-view system. The global view marks the position of the candidate box in the global view with positional cues, while the local view provides detailed information about the candidate object. Both are generated based on the same candidate box, and there is a clear candidate correspondence between the global view and the local view. In this way, it ensures that the visual language model can accurately focus its attention on the candidate object to be reviewed when observing the entire scene, avoiding incorrect review results due to focusing on the wrong region.
[0025] Step S30: Input the spatially anchored dual-view into the visual language model, and output the category verification probability of the candidate target based on the location cues and detailed information through the visual language model; A Vision-Language Model (VLM) is a deep learning model capable of processing both visual and linguistic information simultaneously. This application does not specifically limit the type of this VLM. This VLM can understand the correspondence between image content and text semantics, and outputs the corresponding semantic understanding result given an image input. In this application, the input of the VLM is a spatially anchored dual-view image, and the output is the category verification probability of each candidate target. The category verification probability refers to the confidence level of the VLM in that a candidate target belongs to a certain category; this probability characterizes the likelihood of a candidate target belonging to each category; it can represent the probability that a candidate target belongs to the fireworks category, or the probability that it belongs to the interference category, etc.
[0026] In one alternative approach, both the global view and the local view can be input into the visual language model simultaneously. The visual language model first determines the position of the candidate target to be reviewed in the global view based on the positional cues in the global view, and then performs semantic understanding of the candidate target at that position based on the detailed information in the local view. The visual language model can output the category review probability of the candidate target belonging to each category within a preset set of categories. This category review probability reflects the visual language model's judgment result on the candidate target's attributes.
[0027] In another alternative approach, the global view and local views can be concatenated and then input into the visual language model, or they can be input separately into different encoding branches of the visual language model. The visual language model extracts the positional features from the global view and the detail features from the local view, respectively. After fusing the two types of features, it outputs the category approval probability of the candidate target belonging to each category within a preset set of categories.
[0028] Understandably, using a visual language model to perform semantic-level verification of candidate targets elevates the judgment criteria from low-level visual features such as color, texture, and outline to the semantic understanding level. The visual language model can distinguish real fireworks from similar-looking distractors such as lights, reflections, clouds, steam, dust, and the outlines of fixed structures by combining contextual semantics, effectively suppressing misjudgments caused by appearance similarity. Simultaneously, location cues ensure the model focuses on the correct candidate targets, and detailed information ensures the model obtains sufficient judgment criteria; both together guarantee the accuracy of the verification results.
[0029] Step S40: Based on the category verification probability of all candidate targets, execute the corresponding fireworks alarm action.
[0030] Fireworks alarm actions refer to the processing behavior determined based on the category verification probability of candidate targets. These actions can include different forms such as confirming the alarm, canceling the alarm, or retaining the alarm. The specific action executed depends on the comprehensive judgment result of the category verification probability of all candidate targets.
[0031] In one alternative approach, after obtaining the category verification probabilities of all candidate targets, the category verification probability of each candidate target can be comprehensively evaluated. Based on the evaluation results, the corresponding fireworks alarm action for each candidate target can be determined, and then the overall fireworks alarm result for the target image can be determined based on the fireworks alarm actions of all candidate targets. For example, when the category verification probability of a candidate target shows that it has a high probability of belonging to the fireworks category, a confirmation alarm action is executed; when the category verification probabilities of all candidate targets show that they do not belong to the fireworks category, an alarm cancellation action is executed.
[0032] In another alternative approach, after obtaining the category verification probabilities of all candidate targets, the category verification probabilities of each candidate target can be summarized and analyzed; based on the summary analysis results, the overall smoke and fire alarm action for the target image can be determined. For example, when the category verification probability of at least one candidate target exceeds a preset alarm threshold, an alarm confirmation action is executed; when the category verification probabilities of all candidate targets do not exceed the preset alarm threshold, an alarm cancellation action or an alarm retention action is executed.
[0033] Understandably, determining alarm actions based on category verification probabilities avoids the false triggering problem caused by related technologies relying solely on the reliability probability of the first-stage detection for alarms; by comprehensively reviewing the verification results of all candidate targets, the comprehensiveness and accuracy of alarm decisions can be ensured.
[0034] In this embodiment, addressing the technical problem in related technologies where single-frame detection relies on color, texture, and contour, and is susceptible to interference from similar appearances leading to reduced accuracy, the first-stage target detection in this application only handles rapid location of candidate regions. The second-stage visual language model, guided by spatially anchored dual views, clarifies the current target location based on location cues, performs semantic-level understanding of the region based on detailed information in the local view, and outputs the category verification probability. Because the spatially anchored dual views ensure that the model can accurately focus on the current candidate target even when multiple similar regions exist in the target image, it avoids incorrect verification results due to focusing on the wrong region. Furthermore, since the visual language model possesses cross-modal semantic understanding capabilities, its judgment is not only based on low-level visual features but also combines contextual semantics to distinguish interference from similar appearances, thereby effectively suppressing misjudgments caused by similar color, texture, and contour. Therefore, the technical solution of this application can improve the ability to distinguish between real fireworks and similar-looking interference objects while maintaining single-frame detection speed, reducing the false alarm rate of fireworks and making the triggering timing of fireworks alarms more accurate.
[0035] Based on the above, referring to Figure 2 In one feasible implementation, step S20 may include steps S21 to S24: Step S21: Obtain the position information of the candidate bounding box of the candidate target in the target image; In one alternative approach, the coordinate data of the candidate box can be read from the output of the object detection model. When identifying a candidate object, the object detection model outputs the position parameters of the candidate box in the coordinate system of the target image, including the range of the horizontal coordinate and the range of the vertical coordinate, as well as the width and height of the candidate box. These position parameters are directly obtained as the position information of the candidate object in the target image.
[0036] Step S22: Generate location cues based on location information and overlay the location cues onto the target image to obtain a global view; In one alternative approach, corresponding visual markers can be generated based on the coordinate data of the candidate boxes. These visual markers can take the form of candidate box boundary lines, semi-transparent highlights of candidate box regions, or center markers of candidate boxes. After generating location cues, the location cues are overlaid on the target image, so that the location regions corresponding to the candidate boxes in the target image are marked by visual markers, resulting in a global view. In this way, the global view contains both the complete scene content of the target image and the location marker information of the candidate boxes.
[0037] Step S23: Determine local regions from the target image based on the candidate bounding boxes of the candidate targets to obtain a local view; In one alternative approach, an image region containing the candidate target and its surrounding context is determined from the target image, using the candidate bounding box as a reference. This local region can be determined by directly cropping the image region corresponding to the candidate bounding box, or by cropping a larger image region after expanding outwards from the candidate bounding box; the resulting image region is the local view.
[0038] The candidate bounding box coordinates relative to the local view are also preserved. If the candidate is not centered in the local view due to the influence of image edges, the visual language model can still accurately identify the area to be verified in the local view. After construction, the system verifies whether the global view, local view, and relative coordinates can all be restored to the same value through coordinate transformation, and checks the unique identifiers of the three candidates. If the verification passes, a spatially anchored dual view is formed; if the verification fails, the candidate target is marked as an association anomaly, and its negative results cannot be used to suppress alarms in the future. When there are multiple candidate targets in the target image, the basic visual features of the complete target image can be calculated only once, and each candidate target is verified using its own positional cues and local view.
[0039] Step S24: Based on the global view and the local view, a spatial anchoring dual view is formed together.
[0040] In one alternative approach, the obtained global and local views can be associated to form a spatially anchored dual view. The global and local views are generated based on the same candidate bounding box, and there is a corresponding relationship between them. The spatially anchored dual view can be used as a whole input and fed into a visual language model for processing. After receiving the spatially anchored dual view, the visual language model obtains the positional information of the candidate bounding box from the global view and the detailed information of the candidate target from the local view, and combines the two to perform semantic judgment to determine the category approval probability of the candidate target. Each candidate target can obtain its corresponding global and local views through the above method, thereby jointly constructing its corresponding spatially anchored dual view; that is, each candidate target has a corresponding spatially anchored dual view.
[0041] In this embodiment, by acquiring the position information of candidate bounding boxes, a positional cue is generated and overlaid onto the target image to obtain a global view; then, local regions are determined based on the candidate bounding boxes to obtain a local view; finally, the global view and the local view are associated as a spatially anchored dual view, enabling the visual language model to simultaneously acquire the positional information of the candidate target in the global view and the detailed information of the candidate target itself. The spatially anchored dual view solves the problem that the visual language model cannot determine the location of interest when multiple similar regions coexist in the target image, ensuring that the model can accurately focus on the candidate target to be reviewed, providing complete input for subsequent semantic review based on detailed information, thereby improving the accuracy of fireworks monitoring.
[0042] Based on the above, in one feasible implementation, generating a location prompt based on the location information in step S22 may include steps S221-S223: Step S221: Determine the normalized coordinates of the candidate box based on the location information and the image size of the target image. The normalized coordinates are used to indicate the relative position of the candidate box in the target image. Normalized coordinates refer to the relative coordinates obtained by mapping the coordinate position of the candidate box in the target image to a uniform numerical range. Normalized coordinates are obtained by dividing the original coordinates of the candidate box by the width and height of the target image, so that the coordinate values do not depend on the actual size of the target image. The purpose of normalized coordinates is to eliminate the coordinate differences caused by images of different sizes, so that the position cues can describe the relative position of the candidate box in the target image in a uniform way.
[0043] In one alternative approach, the positional information of the candidate bounding box can be obtained. This positional information includes the raw coordinate data of the candidate bounding box in the target image, including the x-coordinate range and y-coordinate range of the candidate bounding box, while also obtaining the width and height of the target image. The normalized coordinates of the candidate bounding box are obtained by dividing the x-coordinate range of the candidate bounding box by the width of the target image and by dividing the y-coordinate range of the candidate bounding box by the height of the target image. The normalized coordinates have a numerical range between 0 and 1 and are used to indicate the relative position of the candidate bounding box in the target image.
[0044] Step S222: Divide the target image into multiple visual patches and calculate the coverage ratio of each visual patch by the candidate box. A visual patch is a small area of an image obtained by dividing a target image according to certain rules. After the target image is divided into multiple visual patches, each visual patch corresponds to a local region in the target image. The function of the visual patch is to provide basic units for calculating the coverage ratio of candidate boxes. By calculating the degree to which each visual patch is covered by the candidate box, positional cues reflecting the position and range of the candidate box are generated.
[0045] When a visual language model processes a target image, it first divides the image into many small visual patches, and then converts each visual patch into a visual feature. Assuming the target image contains multiple chimneys, bright spots, or smoke-like regions, and only the global and local views are input, the visual language model may not know which location in the global view corresponds to the local patch. Therefore, it is necessary to calculate the coverage ratio. The coverage ratio refers to the proportion of the area of each visual patch covered by the candidate bounding box to the total area of that visual patch. This coverage ratio reflects which visual patches the candidate bounding box covers in the target image and the degree of coverage. A higher coverage ratio indicates a greater degree of overlap between the visual patch and the candidate bounding box. The purpose of the coverage ratio is to generate location cues corresponding to the visual patch division method, ensuring that the location cues align with the patch perception method used by the visual language model when processing the image.
[0046] In one optional approach, the target image is divided into multiple visual patches of uniform size according to a preset partitioning rule. The partitioning rule can be a fixed-size grid partitioning, such as dividing the target image into multiple rectangular patches of the same size. After partitioning, the intersection area of each visual patch with the candidate bounding box is calculated. The intersection area is divided by the total area of the visual patch to obtain the coverage ratio of the visual patch being covered by the candidate bounding box. The coverage ratio ranges from 0 to 1, where 0 indicates that the visual patch is not covered by the candidate bounding box at all, and 1 indicates that the visual patch is completely covered by the candidate bounding box. Values between 0 and 1 indicate that the candidate boundary passes through the visual patch. The formula for calculating the coverage ratio can be expressed as: , Indicates the first A visual tile, This represents the i-th candidate bounding box. The total coverage percentages form the candidate location map Mi, which is used to convert candidate bounding boxes into corresponding location cues. Each value in Mi represents the coverage percentage of the corresponding visual tile covered by the current candidate bounding box.
[0047] Step S223: Generate location hints based on normalized coordinates and coverage ratio.
[0048] In one alternative approach, normalized coordinates can be used as a numerical description of the relative position of the candidate bounding box in the target image, and the coverage ratio can be used as a tile-level description of the coverage area of the candidate bounding box. The two are combined to generate a location cue, which can be represented as a combination of information including normalized coordinates and coverage ratio. The normalized coordinates and coverage ratio can be encoded together to obtain the location cue. The generated location cue is used to overlay on the target image so that the visual language model can clearly identify the position of the candidate bounding box in the global view.
[0049] In this embodiment, location cues are generated using normalized coordinates and coverage ratios. These cues contain both the relative position of the candidate bounding box within the target image and its coverage area at the tile level. Normalized coordinates eliminate the impact of image size differences, while the coverage ratio aligns the location cues with the tile-based perception of the visual language model. The combined cues accurately describe the candidate bounding box's position in the global view, enabling the visual language model to clearly identify the current candidate target location even when multiple similar regions exist in the target image.
[0050] Based on the above, in one feasible implementation, step S23 may include steps S231 to S233: Step S231: Obtain the target request expansion ratio of the candidate box of the candidate target; The target request expansion ratio refers to the magnification factor used when expanding the candidate bounding box. The target request expansion ratio determines the extent to which the candidate bounding box expands outward; a larger expansion ratio results in a larger requested bounding box area and contains more contextual information. The purpose of the target request expansion ratio is to determine the clipping range of the local view, ensuring that the local view contains both detailed information about the candidate target and sufficient contextual information for the visual language model to make semantic judgments.
[0051] In one alternative approach, the target request edge expansion ratio can be a preset fixed value or a value dynamically calculated based on the specific circumstances of the candidate target.
[0052] Step S232: Based on the target requested expansion ratio and the size information of the candidate box, expand the candidate box to determine the requested expansion border. The requested border expansion refers to the border area obtained after expanding the candidate box according to the target requested border expansion ratio. The requested border expansion is based on the center of the candidate box and expands outward according to the target requested border expansion ratio. Its center is consistent with the center of the candidate box, and its width and height are the candidate box width and height multiplied by the target requested border expansion ratio, respectively. The purpose of this requested border expansion is to define the clipping range of the local view.
[0053] In one alternative approach, the width and height of the candidate box can be obtained. The width of the candidate box is multiplied by the target requested expansion ratio to obtain the width of the requested expansion border, and the height of the candidate box is multiplied by the target requested expansion ratio to obtain the height of the requested expansion border. The center of the candidate box is used as the center of the requested expansion border, and the range of the requested expansion border is determined according to the calculated width and height of the requested expansion border.
[0054] Step S233: Based on the target pixel resolution of the requested border expansion and the positional relationship between the requested border expansion and the target image, the border range of the requested border expansion is corrected to obtain a local view.
[0055] The target pixel resolution is the resolution required by the visual language model to process the local view; it refers to the pixel size of the requested bounding box after scaling. The target pixel resolution reflects the clarity of the image content within the requested bounding box during visual language model processing. A higher target pixel resolution results in clearer image content, enabling the visual language model to more accurately determine the attributes of the candidate target.
[0056] Positional relationship refers to the relative positional relationship between the requested border expansion and the target image, including whether the requested border expansion is completely within the target image, whether it exceeds the target image boundary, and the degree to which it exceeds the boundary. The purpose of positional relationship is to determine how to correct the requested border expansion. When the requested border expansion exceeds the target image boundary, the border range of the requested border expansion needs to be corrected accordingly.
[0057] In one alternative approach, the resolution of the target pixel in the requested bounding box is checked to ensure it meets the sharpness requirements of the visual language model when processing the image. If the target pixel resolution is insufficient, the requested bounding box is scaled to ensure the candidate target has a sufficient number of pixels in the local view. Simultaneously, the positional relationship between the requested bounding box and the target image is checked. If the requested bounding box extends beyond the boundary of the target image, it is translated or padded to ensure it is completely within the target image or to fill the excess portion. After correction, the region corresponding to the corrected requested bounding box is cropped from the target image to obtain the local view.
[0058] It should be noted that, in this embodiment, for each candidate target, the surrounding scene range required to judge the candidate target is first estimated. The surrounding equipment structure, light source, sky, building edges, or other adjacent objects may be important bases for distinguishing the real target from similar interference. Therefore, the local view cannot be just the candidate box; however, if the surrounding range is too large, the candidate target will become too small in the input of the visual language model. Therefore, this embodiment first calculates the context that is to be preserved, i.e., the requested expansion of the bounding box, and then checks whether the requested expansion of the bounding box will damage the target details. That is, based on the target pixel resolution of the requested expansion of the bounding box and the positional relationship between the requested expansion of the bounding box and the target image, the bounding box range of the requested expansion of the bounding box is corrected to obtain the local view.
[0059] In this embodiment, the requested expansion border is determined by the target's requested expansion ratio, and then corrected according to the target pixel resolution and positional relationship to obtain a local view. This process ensures that the local view contains sufficient contextual information while also ensuring its image quality and integrity. Through this correction process, the problem of candidate targets appearing too blurry in the local view due to insufficient target pixel resolution is avoided, as is the problem of incomplete local views caused by the requested expansion border exceeding the target image boundary. This provides a high-quality local view for the visual language model.
[0060] Furthermore, in an alternative embodiment, step S231 may include steps S2311 to S2312: Step S2311: Obtain the influencing factors of the requested expansion ratio, wherein the influencing factors include at least one of the following: the area ratio of the candidate box of the candidate target in the target image, detection uncertainty, image quality, boundary truncation degree, and basic context prior. In related technologies, a fixed magnification ratio is used for edge expansion, which cannot simultaneously meet the requirements of context and target sharpness. If the expanded edge of the candidate region is too small, the relationship between the candidate region and the sky, buildings, light sources, or fixed facilities cannot be seen; if the expanded edge is too large, small targets will become too small after being scaled to the input size of the visual language model. To address this problem, this application considers different influencing factors and adaptively determines the corresponding target request edge expansion ratio through these influencing factors, so that edge expansion is no longer based on a fixed magnification ratio.
[0061] The influencing factors include at least one of the following: the area ratio of the candidate bounding box in the target image, detection uncertainty, image quality, boundary truncation degree, and basic context prior. The role of these factors is to dynamically adjust the target bounding box expansion ratio based on the specific circumstances of the candidate target, rather than using a fixed value. Specifically, the area ratio refers to the proportion of the candidate bounding box's area to the total area of the target image. The area ratio reflects the spatial size of the candidate target in the target image; a larger area ratio indicates a more prominent candidate target in the image, requiring a smaller expansion range; a smaller area ratio indicates a smaller candidate target in the image, requiring a larger expansion range. Detection uncertainty refers to the degree of uncertainty the target detection model has regarding the detection result of the candidate target. Detection uncertainty reflects the reliability of the detection result; higher uncertainty indicates a less reliable detection result, requiring a larger expansion range to obtain more contextual information for auxiliary judgment; lower uncertainty indicates a more reliable detection result, allowing for a smaller expansion range. Image quality refers to the clarity and usability of the target image itself. Image quality is affected by factors such as lighting conditions, weather conditions, and camera performance. Higher image quality yields richer details and requires a smaller margin expansion range; lower image quality results in blurrier details and necessitates a larger margin expansion range to obtain more information. Boundary truncation refers to the position of the candidate bounding box relative to the target image boundary, i.e., whether the candidate bounding box is close to or partially extends beyond the target image boundary. Boundary truncation reflects the completeness of the candidate target within the target image. A higher truncation level indicates that the candidate target is closer to the target image boundary, resulting in less expansion space and requiring a corresponding adjustment of the margin expansion ratio. Basic context prior refers to a pre-defined context expansion baseline value related to the candidate target detection category. This basic context prior reflects the typical range of contextual information required for candidate targets of different detection categories. For example, some categories require a larger contextual range to assist in judgment, while others only require a smaller contextual range.
[0062] In one alternative approach, the area ratio of the candidate bounding box of the candidate target in the target image is obtained. Detection uncertainty Image quality Degree of boundary truncation Basic context prior At least one of the following. The area ratio is obtained by calculating the ratio of the candidate box area to the target image area; the detection uncertainty is determined from the detection confidence probability of the target detection model, and its calculation formula can be expressed as: ,in For the corresponding threshold, The larger the value, the closer it is to the decision boundary. To detect the probability of confidence, This means that the detection uncertainty is limited to between 0 and 1; the image quality is obtained by quality assessment of the target image, specifically by comprehensively considering sharpness, brightness, local contrast, noise, and compression distortion and normalizing them to a uniform range; the degree of boundary truncation is obtained by analyzing the positional relationship between the candidate box and the boundary of the target image, and the basic context prior is obtained from the preset system operation configuration.
[0063] Step S2312: Determine the target requested expansion ratio of the candidate box based on at least one of the following: area ratio of the candidate box, detection uncertainty, image quality, degree of boundary truncation, and basic context prior.
[0064] In one alternative approach, the acquired influencing factors can be used as input to determine the target requested expansion ratio according to preset calculation rules. For example, when the area of the candidate box is relatively small, the expansion ratio is increased to obtain more contextual information; when the detection uncertainty is high, the expansion ratio is increased to obtain more information to aid judgment; when the image quality is low, the expansion ratio is increased to compensate for the lack of detail information; when the boundary truncation degree is high, the expansion ratio is adjusted according to the expandable space; using the basic context prior as the benchmark value, the benchmark value is adjusted in combination with other influencing factors to obtain the final target requested expansion ratio.
[0065] In this embodiment, the target requested edge expansion ratio is dynamically determined by influencing factors, enabling the expansion ratio to adaptively adjust according to the specific circumstances of the candidate target. Area ratio, detection uncertainty, image quality, boundary truncation degree, and basic contextual priors reflect the candidate target's need for contextual information from different dimensions. The target requested edge expansion ratio determined by comprehensively considering these factors can more accurately match the actual needs of the candidate target, thereby ensuring that the local view contains sufficient contextual information without containing too many irrelevant areas, providing high-quality input for the accurate judgment of the visual language model.
[0066] Furthermore, step S2312 may include steps S23121 to S23123: Step S23121: The area ratio of the candidate box, the detection uncertainty, the image quality, and the degree of boundary truncation are weighted and summed to obtain the first requested expansion ratio. The area ratio of the candidate box and the image quality are negatively correlated with the first requested expansion ratio, while the detection uncertainty and the degree of boundary truncation are positively correlated with the first requested expansion ratio. The formula for calculating the first requested expansion ratio can be expressed as: . Represents the natural logarithm. Positive numbers are set to prevent division by zero. The values and directions of action of each coefficient are determined by verification based on historical data, rather than by fixed assumptions. , , and The coefficients are determined based on previous historical data.
[0067] Step S23122: Determine the second request edge expansion ratio based on the first request edge expansion ratio and the basic context prior; In one alternative approach, the first requested edge expansion ratio can be added to the underlying context prior to obtain the second requested edge expansion ratio.
[0068] Step S23123: Limit the second requested edge expansion ratio to a preset edge expansion ratio range to obtain the target requested edge expansion ratio.
[0069] The preset expansion ratio range can be set according to the actual situation.
[0070] The formula for calculating the target requested edge expansion ratio can be expressed as: .
[0071] in, This means limiting the expansion ratio of the second request to the minimum allowed ratio. and maximum multiplier between.
[0072] In this embodiment, a first requested edge expansion ratio is obtained by weighted summation of various influencing factors. Based on the first requested edge expansion ratio, a second requested edge expansion ratio is obtained by combining the basic context prior. Finally, the second requested edge expansion ratio is restricted to a preset edge expansion ratio range to obtain the final target requested edge expansion ratio. Because weighted summation allows the four influencing factors—area proportion, detection uncertainty, image quality, and boundary truncation degree—to jointly influence the edge expansion ratio according to their respective correlations; the basic context prior ensures that the edge expansion ratio conforms to the general rules of the detection category; and the preset edge expansion ratio range constrains the reasonable value range of the edge expansion ratio, the target requested edge expansion ratio can be adaptively adjusted according to the specific situation of the candidate target while remaining within a reasonable range. This provides accurate edge expansion parameters for the construction of the local view, ensuring that the local view contains sufficient contextual information without containing too many irrelevant areas, providing high-quality input for the accurate judgment of the visual language model.
[0073] Furthermore, in an alternative embodiment, step S233 may include steps S2331 to S2334: Step S2331: Determine the effective pixels of the candidate box after scaling based on the target pixel resolution and the size of the requested bounding box. Effective pixels refer to the number of pixels on any side of the candidate bounding box (either the short or long side) after the requested bounding box has been scaled up to the target resolution. Effective pixels reflect the sharpness of the candidate target in the local view after scaling. A larger effective pixel count indicates a sharper candidate target in the local view, allowing the visual language model to more accurately determine the target's attributes. Conversely, a smaller effective pixel count indicates a blurrier candidate target in the local view, which may prevent the visual language model from accurately determining its attributes.
[0074] In one optional approach, the target pixel resolution of the input image preset by the visual language model, including the target width and target height, can be obtained, along with the width and height of the requested bounding box. Based on the ratio of the target resolution to the requested bounding box size, a scaling factor for the requested bounding box is determined. Then, the effective pixels of the candidate box after scaling are calculated based on the product of the scaling factor and the candidate box size. The determined scaling factor for the requested bounding box can be: a scaling factor for the width of the requested bounding box, a scaling factor for the height of the requested bounding box, or a scaling factor for both the width and height of the requested bounding box. No specific limitations are imposed here.
[0075] Step S2332: In response to the effective pixels being less than the preset lower limit of pixels, the requested border expansion is scaled and corrected, and the scaled and corrected requested border expansion is output. The preset pixel lower limit refers to the minimum allowed number of effective pixels on the shorter side of the candidate bounding box. The purpose of the preset pixel lower limit is to serve as a standard for judging whether the candidate target is sufficiently clear in the local view. When the effective pixels are less than the preset pixel lower limit, it indicates that the candidate target is too blurry in the local view, and the requested bounding box needs to be scaled to increase the scaling ratio, thereby increasing the number of pixels in the candidate target.
[0076] Scaling correction refers to the operation of reducing the area of the requested expansion border. By reducing the width and height of the requested expansion border, it allows for a larger scaling ratio during scaling, thereby increasing the effective pixels of the candidate target in the local view. The purpose of scaling correction is to increase the number of pixels of the candidate target after scaling by reducing the area of the local view when the effective pixels of the candidate target are insufficient.
[0077] In one optional approach, the calculated effective pixels are compared with a preset lower pixel limit. If the effective pixels are less than the preset lower pixel limit, it indicates that the candidate target is too blurry in the local view, and the requested border needs to be scaled down. Scale correction involves gradually reducing the width and height of the requested border, allowing it to achieve a larger scaling ratio during scaling, thereby increasing the number of pixels in the candidate target. After scaling correction is complete, the scaled-down requested border is output.
[0078] Step S2333: In response to the scaling correction request bounding box exceeding the boundary of the target image, fill correction is performed on the exceeding area, or translation correction is performed on the request bounding box so that the request bounding box is located within the target image. Fill correction refers to the operation of filling pixels in areas where the requested border extends beyond the target image boundary. Fill correction fills the excess area with preset pixel values to ensure the integrity of the local view corresponding to the requested border. The purpose of fill correction is to maintain the integrity of the local view and prevent missing areas when the requested border extends beyond the target image boundary.
[0079] Translation correction refers to the operation of moving the requested expansion border to a different position. Translation correction moves the requested expansion border in the opposite direction of the outgoing direction, ensuring that the requested expansion border is completely within the target image. The purpose of translation correction is to prevent the need for padding in areas that exceed the target image boundary by moving the requested expansion border to be entirely within the target image.
[0080] In one alternative approach, the positional relationship between the scaled-corrected requested expansion border and the target image is examined to determine whether the requested expansion border exceeds the boundary of the target image. If the requested expansion border exceeds the boundary of the target image, the excess area can be filled with pixels using preset pixel values to make the local view complete; alternatively, the requested expansion border can be translated, moving it in the opposite direction of the excess direction to ensure it is completely within the target image.
[0081] Step S2334: Expand the border according to the requested scaling correction, and / or fill correction, and / or translation correction to obtain a partial view.
[0082] In one alternative approach, the requested bounding box, after being processed by one or more of scaling, padding, and translation corrections, is used as the final local view cropping range. The image region corresponding to this range is cropped from the target image to obtain the local view. This local view, as a component of the spatially anchored dual-view system, is input into the visual language model along with the global view for verification.
[0083] In this embodiment, the requested border expansion is corrected through steps such as effective pixel determination, scaling correction, filling correction, and translation correction. Effective pixel determination ensures sufficient clarity of the candidate target in the local view; scaling correction addresses the blurring of the candidate target; and filling and translation correction resolve the issue of the requested border expanding beyond the target image boundary. The corrected local view is both clear and complete, providing high-quality input for the visual language model and ensuring that the model can make accurate judgments based on sufficient detailed information.
[0084] Furthermore, in step S2331 above, determining the effective pixels of the candidate box after scaling based on the target pixel resolution and the size of the requested bounding box may include steps S23311~S23313: Step S23311: Obtain the size of the candidate box and the size of the requested expansion border; In one alternative approach, the width and height of the candidate bounding box can be obtained, along with the width and height of the requested expansion border. The size of the candidate bounding box reflects the spatial extent of the candidate target within the target image, while the size of the requested expansion border reflects the cropping range of the local view.
[0085] Step S23312: Determine the scaling ratio of the short side of the requested border based on the ratio of the target pixel resolution to the size of the requested border. The short-side scaling factor refers to the scaling factor when the requested bounding box is scaled according to the target pixel resolution. It is determined by the ratio of the target resolution to the length of the short side of the requested bounding box, reflecting the degree of size change of the requested bounding box after scaling. The short-side scaling factor serves as an intermediate parameter for calculating the effective pixels of the short side of the candidate bounding box.
[0086] In one alternative approach, the width and height of the target resolution, as well as the width and height of the requested border, are obtained. A first ratio of the target resolution width to the requested border width is calculated, and a second ratio of the target resolution height to the requested border height is calculated. The smaller of the first and second ratios is used as the scaling factor for the shorter side. By using the smaller ratio as the scaling factor, it is ensured that the requested border perfectly fits the target resolution after scaling, without exceeding the target resolution's range.
[0087] Step S23313: Determine the effective pixels of the short side of the candidate box after scaling based on the product of the short side scaling ratio and the short side size of the candidate box.
[0088] The shorter side dimension of a candidate bounding box refers to the smaller of its width and height. This dimension reflects the smallest spatial dimension of the candidate target within the local view and is a key indicator of its sharpness. A smaller shorter side dimension indicates a smaller target in a particular direction, requiring a greater scaling factor to maintain sharpness.
[0089] In one alternative approach, the width and height of the candidate bounding box are obtained, and the smaller of these is determined as the shorter side dimension of the candidate bounding box. The shorter side is then scaled by the scaling factor to obtain the effective pixels of the candidate bounding box's shorter side after scaling. This effective pixel count reflects the sharpness of the candidate target after scaling in the local view.
[0090] Set the original candidate box The width and height are respectively and The current request specifies the width and height of the border to be expanded. and When the requested bounding box exceeds the target image, it is preferentially translated back into the image without changing its size. If the image size still limits its size, edge padding can be applied to the missing portion, but the positions of both the real image region and the padding region must be preserved to avoid mistaking the padding pixels for valid context. The requested bounding box expansion ratio alone is insufficient to determine whether the candidate target is sufficiently clear in the visual language model. The system uses the image preprocessing rules actually employed by the visual language model to simulate the size of the current requested bounding box. Assume the target pixel resolution is... Let the width and height of the requested border be respectively... and Short side scaling ratio and the effective pixels of the shorter side of the candidate box after scaling. It can be calculated using the following formula: .
[0091] .
[0092] When the partial view is zoomed out This represents the effective pixels retained by the candidate short side in the model input; when the local view is zoomed in. To ensure that the interpolated magnification does not exceed the actual target pixels in the target image, the interpolation magnification is not mistaken for added detail. If the visual language model processes the image using dynamic resolution or visual tiles, the number of effective visual tiles for candidate coverage is calculated according to its true scaling rules and converted into equivalent effective pixels, while the loop closure determination principle remains unchanged.
[0093] In this embodiment, the effective pixels of the candidate box's short side after scaling are determined by acquiring size data, calculating the scaling ratio, and calculating the effective pixels. The short side scaling ratio is determined by the ratio of the target resolution to the requested bounding box size, and the effective pixels are determined by multiplying the short side scaling ratio by the candidate box's short side size. This calculation process accurately reflects the clarity of the candidate target in the local view.
[0094] Furthermore, the scaling correction of the requested border in step S2332 above, and the output of the scaled-corrected requested border, may include steps S23321~S23322: Step S23321: Obtain the preset scaling step size corresponding to the detection category of the candidate target; The preset shrinkage step size refers to the pre-defined amount of shrinkage for each requested expansion border. The preset shrinkage step size determines the granularity of the shrinkage correction; a smaller step size results in finer shrinkage correction but requires more iterations; a larger step size results in coarser shrinkage correction but requires fewer iterations. The purpose of the preset shrinkage step size is to control the degree of shrinkage at each step during the shrinkage correction process.
[0095] In one alternative approach, the shrinkage step size corresponding to the detection category of the candidate target is obtained from preset configuration data. Different detection categories can correspond to different shrinkage step sizes, and the size of the shrinkage step size can be determined according to the degree of need for contextual information for that type of candidate target.
[0096] Step S23322: Reduce the target request expansion ratio according to the preset scaling step size, and recalculate the effective pixels of the short side of the candidate box after each scaling until the effective pixels are greater than the preset lower limit of pixels, or the target request expansion ratio reaches the preset lower limit of expansion ratio, stop the scaling correction, and output the scaled-corrected request expansion border.
[0097] The preset margin expansion ratio lower limit refers to the minimum allowed margin expansion ratio of the target request. The purpose of the preset margin expansion ratio lower limit is to serve as one of the termination conditions for shrinkage correction. When the target requested margin expansion ratio shrinks to the preset margin expansion ratio lower limit, the shrinkage correction will stop even if there are still insufficient effective pixels, thus avoiding a severe lack of local view context information due to an excessively small target requested margin expansion ratio.
[0098] In one optional approach, during each shrinking iteration, the current target requested border expansion ratio is subtracted from a preset shrinking step size to obtain a new border expansion ratio. The range of the requested border is then redefined based on this new ratio, and the effective pixels of the candidate box's shorter side are recalculated. The recalculated effective pixels are compared to a preset lower limit. If the effective pixels are greater than the preset lower limit, the candidate target is considered sufficiently clear, and the shrinking correction stops. If the effective pixels are still less than the preset lower limit, the next shrinking iteration continues. Simultaneously, it is checked whether the current border expansion ratio has reached the preset lower limit. If it has, the shrinking correction stops even if the effective pixels are still insufficient. After the shrinking correction stops, the shrunken border of the requested box is output.
[0099] In this embodiment, the iterative process of shrinkage correction is controlled by two parameters: a preset shrinkage step size and a preset lower limit for the expansion ratio. The preset shrinkage step size determines the magnitude of each shrinkage, while the preset lower limit for the expansion ratio determines the termination boundary of the shrinkage. Through iterative shrinkage, the clarity of the candidate target in the local view is gradually improved, while ensuring that the local view retains sufficient contextual information. This process achieves a balance between clarity and contextual information in the local view, providing the visual language model with input that is both clear and contains sufficient contextual information.
[0100] In other embodiments, when the target requested margin expansion ratio has reached its minimum value and the effective pixels of the candidate box after scaling are still less than the preset pixel lower limit, it indicates that the candidate in the target image is too small, too blurry, or severely compressed, and further cropping or interpolation cannot restore the true details. The system still generates a local view usable under the current conditions, but writes "target pixel resolution insufficient" into the candidate record and saves the final requested margin expansion, effective pixels, iteration count, boundary fill ratio, and relative coordinates in the candidate box. This state can only reduce the weight of the verification evidence or trigger a conservative alarm in the future; it cannot help the system cancel the alarm.
[0101] Based on the above, referring to Figure 3 In one feasible implementation, step S30 may include steps S31 to S34: Step S31: Assign a corresponding internal decision code to each category in the preset limited category set. The preset limited category set includes fireworks category and at least one interference category. The predefined category set refers to the range of categories that the visual language model is allowed to select when outputting category verification probabilities. The predefined category set includes a "smoke and fire" category and at least one interference category. The "smoke and fire" category indicates that the candidate target is a real fire or fire, while the interference category indicates that the candidate target is a light source, reflection, cloud, steam, dust, fixed structure, or other object that resembles fire or fire but is not a real fire or fire. The purpose of the predefined category set is to constrain the output range of the visual language model, ensuring that the model can only select from the predefined categories, preventing the visual language model from outputting irrelevant content, and ensuring that the verification results can be directly used for subsequent alarm decisions.
[0102] Internal decision codes refer to the coded identifier assigned to each category in a predefined set of categories to represent that category. Each category corresponds to a unique internal decision code. When outputting the verification results, the visual language model represents the probability that a candidate target belongs to that category by outputting the probability value corresponding to the internal decision code. The role of internal decision codes is to convert the semantic information of categories into a coded form that the visual language model can process, enabling the output results of the visual language model to establish a correspondence with specific business categories.
[0103] In one alternative approach, the categories included in a predefined set of categories can be predetermined, including fireworks categories and at least one interference category, such as light categories, reflection categories, cloud and fog categories, steam categories, dust categories, and fixed facility categories. A unique internal decision code is assigned to each category, ensuring a one-to-one correspondence between each category and a code. After assignment, the correspondence between categories and codes is stored as configuration data for use by the visual language model when outputting verification results.
[0104] Step S32: Input the spatially anchored dual-view into the visual language model. Based on location cues and detailed information, the visual language model outputs the coding probability of each category within a preset limited category set. Encoded probability refers to the probability value output by the visual language model that a candidate target belongs to a category corresponding to a certain internal decision code. The encoded probability reflects the degree of confidence the visual language model has in the candidate target belonging to that category; a higher encoded probability indicates that the visual language model is more certain that the candidate target belongs to that category. This encoded probability is between 0 and 1, and the sum of all encoded probabilities equals 1.
[0105] In one alternative approach, a spatially anchored dual-view system, consisting of a global view and a local view, is fed into a visual language model for processing. Based on location cues carried in the global view, the visual language model determines the position of the candidate target to be reviewed within the global view. Based on detailed information carried in the local view, it performs semantic understanding of the candidate target at that position. Within a predefined set of categories, the visual language model outputs the encoded probability of the candidate target belonging to each category, with each encoded probability corresponding to an internal decision code.
[0106] Step S33: Based on the coding probabilities corresponding to each category, determine the verification alarm probability of the candidate target belonging to the fireworks category and the negative verification probability of the candidate target belonging to the interference category; The verification alarm probability refers to the probability that a candidate target belongs to the fireworks category. The verification alarm probability reflects the visual language model's judgment that the candidate target is a real firework; a higher verification alarm probability indicates that the model is more certain that the candidate target is a real firework. The negative verification probability refers to the probability that a candidate target belongs to the interference category. The negative verification probability reflects the visual language model's judgment that the candidate target is an interference object; a higher negative verification probability indicates that the model is more certain that the candidate target is not a real firework but an interference object.
[0107] In one alternative approach, the encoded probabilities corresponding to each category output by the visual language model are obtained. Based on the correspondence between categories and internal decision codes, it is identified which internal decision codes correspond to the fireworks category and which correspond to the interference category. The encoded probabilities corresponding to the fireworks category are summarized to obtain the verification alarm probability; the encoded probabilities corresponding to the interference category are summarized to obtain the negative verification probability. By summarizing the encoded probabilities of each category into two comprehensive indicators—the verification alarm probability and the negative verification probability—the output of the visual language model can reflect the probability that the candidate target belongs to fireworks or interference from both positive and negative dimensions.
[0108] Specifically, the system can obtain the first category subset belonging to the fireworks category and the second category subset belonging to the interference category from the preset limited category set; the sum of the coding probabilities of the candidate target belonging to each category in the first category subset is used as the verification alarm probability; and the sum of the coding probabilities of the candidate target belonging to each category in the second category subset is used as the negative verification probability.
[0109] The first category subset refers to the subset of categories belonging to the fireworks category within the preset set of categories. The first category subset can contain one or more fireworks categories, such as open flames, smoke, etc. The purpose of the first category subset is to define which categories belong to the fireworks category, used to calculate the probability of a repeat alarm. The second category subset refers to the subset of categories belonging to the interference category within the preset set of categories. The second category subset can contain one or more interference categories, such as lights, reflections, clouds / fog, steam, dust, fixed facilities, etc. The purpose of the second category subset is to define which categories belong to the interference category, used to calculate the probability of a negative repeat alarm.
[0110] Step S34: Based on the review alarm probability and the negative review probability, obtain the category review probability.
[0111] In one alternative approach, the larger of the review alarm probability and the negative review probability can be selected as the category review probability.
[0112] In this embodiment, internal decision coding, output coding probabilities, and determination of review alarm probabilities and negative review probabilities are used; finally, these two are used as category review probabilities. Since internal decision coding enables the model's output to establish a correspondence with business categories, the coding probabilities quantify the model's judgment of which candidate targets belong to which category. The review alarm probabilities and negative review probabilities comprehensively reflect the attributes of candidate targets from both positive and negative dimensions. This process transforms the semantic understanding capability of the visual language model into data usable for alarm decision-making, providing a basis for subsequently determining fireworks alarm actions.
[0113] Based on the above, referring to Figure 4 In one feasible implementation, after obtaining the detection reliability probability, review alarm probability, and negative review probability through the above method, the system will not immediately change the detection result simply because the visual language model provides a legitimate category. Instead, it will first determine whether the review evidence has decision-making authority through reliability gating. Specifically, step S40 may include steps S41 to S44: Step S41: For any candidate target, determine the verification gate corresponding to the candidate target. The verification gate includes a closed state or an open state. Verification gating refers to the on / off state that controls whether the verification results of the visual language model are used in risk calculation. Verification gating has two states: closed and open. When verification gating is closed, the verification results of the visual language model are not used, and the candidate risk is determined directly based on the detection confidence probability. When verification gating is open, the verification results of the visual language model are used, and the candidate risk is determined based on both the category verification probability and the detection confidence probability. The detection confidence probability refers to the confidence probability of the target detection model's output for the candidate target in the first stage. The detection confidence probability reflects the confidence level of the target detection model in the candidate target detection results; the higher the detection confidence probability, the more confident the detection model is that the candidate target is a fireworks target.
[0114] In one alternative approach, for each candidate target in the target image, the verification gating state corresponding to that candidate target is determined based on a preset verification reliability condition. If the verification reliability condition is not met, the verification gating is determined to be in the open state, indicating that the verification result of the visual language model is enabled; if the verification reliability condition is met, the verification gating is determined to be in the closed state, indicating that the verification result of the visual language model is not enabled.
[0115] Step S42: Determine the candidate risk of the candidate target based on the review gating, category review probability, and the detection confidence probability of the candidate target; Candidate risk refers to the risk that a candidate target will be identified as a real firework. Candidate risk comprehensively reflects the probability that a candidate target is a real firework; the higher the candidate risk, the more likely the candidate target is to be a real firework, and the more necessary it is to trigger an alarm. The purpose of candidate risk is to serve as the basis for determining the appropriate action to take regarding a candidate target.
[0116] In one optional approach, the review gating state, category review probability, and detection confidence probability of the candidate target are obtained. If the review gating is closed, the detection confidence probability is directly used as the candidate risk of the candidate target; if the review gating is open, the category review probability and the detection confidence probability are weighted and summed to obtain the candidate risk of the candidate target. The candidate risk is determined by integrating information from the target detection model and the visual language model. When the review gating is closed, the candidate risk is based solely on the detection confidence probability, maintaining the original judgment of the detection model; when the review gating is open, the candidate risk incorporates the judgments of both the detection model and the visual language model, making the risk calculation more comprehensive.
[0117] Step S43: Based on the candidate risks, determine the corresponding processing action for the candidate targets. The processing action includes one of confirming the alarm, canceling the alarm, or retaining the alarm. Confirming an alarm refers to the action of confirming a fireworks alarm for a candidate target. When the candidate risk is high, the action of confirming the candidate target is to issue an alarm, indicating that the candidate target is confirmed as a real fireworks event and an alarm is triggered. Canceling an alarm refers to the action of canceling a fireworks alarm for a candidate target. When the candidate risk is low, the action of canceling the alarm for a candidate target is to cancel the alarm, indicating that the candidate target is confirmed as not a real fireworks event and the alarm is canceled. Holding an alarm refers to the action of temporarily holding a fireworks alarm for a candidate target. When the candidate risk is at a medium level, the action of holding the alarm for a candidate target is to hold the alarm, indicating that the alarm is neither confirmed nor canceled, and the current state is maintained pending further processing.
[0118] In one optional approach, candidate risks are compared with preset risk thresholds, and the processing action for the candidate target is determined based on the comparison result. When the candidate risk is higher than the preset alarm confirmation threshold, the processing action is determined to be alarm confirmation; when the candidate risk is lower than the preset alarm cancellation threshold, the processing action is determined to be alarm cancellation; when the candidate risk is between the alarm confirmation threshold and the alarm cancellation threshold, the processing action is determined to be alarm retention.
[0119] In an alternative approach, different judgment principles can be set according to the actual situation. When the corresponding judgment principle is met, the processing action corresponding to the candidate target is determined. Therefore, a mapping table between different judgment principles and their corresponding processing actions can be pre-constructed, and the processing action corresponding to each candidate target can be determined based on this mapping table. For example, this mapping table can be represented as:
[0120] Step S44: Determine the smoke alarm action for the target image based on the processing actions of all candidate targets.
[0121] In one optional approach, the processing actions of all candidate targets in the target image are aggregated, and the overall fireworks alarm action of the target image is determined according to a preset aggregation rule. If at least one candidate target has a processing action of confirming an alarm, the fireworks alarm action of the target image is confirmed; if there are no candidate targets with confirmed alarms but there are candidate targets with retained alarms, the fireworks alarm action of the target image is retained; if the processing actions of all candidate targets are cancel alarms, the fireworks alarm action of the target image is no alarm.
[0122] In this embodiment, a complete decision-making process from category review probability to fireworks alarm action is achieved by determining the review gating, calculating candidate risks, determining processing actions, and summarizing fireworks alarm actions. The review gating controls whether to use the review results of the visual language model. The candidate risks integrate information from the detection model and the visual language model. The processing actions transform the risks into clear alarm decisions. The summarization rules integrate the processing actions of each candidate target into an alarm action at the target image level. This process enables fireworks alarm decision-making to fully utilize the review capabilities of the visual language model while maintaining the original judgment of the detection model when the review results are unreliable, thus improving the accuracy and reliability of alarm decision-making.
[0123] Furthermore, the verification gating corresponding to the candidate target in step S41 above includes steps S411~S412: In response to meeting the preset verification reliability conditions, the verification gate is determined to be in the open state; In response to the failure to meet the preset verification reliability conditions, the verification gate is determined to be in the closed state; The preset reliability conditions for verification include: the effective pixels in the local view reach the preset lower pixel limit and the candidate targets in the local view are clear; the visual language model is running normally; the candidate box, the positional hints in the global view corresponding to the candidate box, and the local view can be restored to at least one of the same candidate targets; among these, the encoding margin refers to the degree of difference between the encoding probabilities of each category output by the visual language model. The encoding margin reflects the clarity of the visual language model's judgment of the candidate target category. The larger the encoding margin, the clearer the model's judgment of a certain category; the smaller the encoding margin, the more ambiguous the model's judgment of each category, and the less reliable the verification results. Normal operation means that the visual language model is in a normal state during operation. Abnormal operation can include model inference timeouts, incorrect model output format, abnormal model resource usage, etc. Normal operation indicates that the visual language model can complete the verification task normally, and its output verification results are reliable.
[0124] Preset reliability conditions for verification may also include: the visual language model returns a valid internal decision code and all category probabilities pass the numerical check; the candidate unique identifier, candidate box, global view position hints and local view can be restored to the same candidate target; the verification inference does not time out and the visual language model, video memory and system are running normally.
[0125] Step S42 above may include steps S421 to S422: Step S421: In response to the verification gate being closed, the detection confidence probability is used as the candidate risk of the candidate target; In one alternative approach, when the review gate is closed, the detection confidence probability of the candidate target is directly obtained, and the value of the detection confidence probability is used as the candidate risk of the candidate target without performing additional weighted calculations.
[0126] Step S422: In response to the verification gating being enabled, the category verification probability and the detection confidence probability are weighted and summed to obtain the candidate risk of the candidate target.
[0127] In one alternative approach, when the review gating is enabled, the category review probability and detection confidence probability of the candidate target are obtained. A first weighting coefficient is assigned to the category review probability, and a second weighting coefficient is assigned to the detection confidence probability. The result of multiplying the category review probability by the first weighting coefficient and the result of multiplying the detection confidence probability by the second weighting coefficient is added to obtain the candidate risk of the candidate target.
[0128] Let the review participation weight corresponding to the current detection category be . The fused candidate risks are denoted as The calculation method is shown in the following formula. The value range is from 0 to 1.
[0129] .
[0130] This formula includes two easily understandable scenarios. When reviewing the gating... At that time, the formula automatically becomes In other words, if the detection confidence probability is used entirely, the visual language model cannot reduce the risk even if it provides a non-alarm category; when At that time, the system follows a fixed weight. Probability of review alarm and detection reliability probability Perform a weighted sum. For example, 0.72 For 0.10, When the gating value is 0.40 and the gate is on, the candidate risk is 0.60 × 0.72 + 0.40 × 0.10 = 0.472; if the same candidate target is too small and the gate is closed, the candidate risk remains 0.72. This example illustrates that only the output of a visual language model with a clear source, a well-defined target, and stable judgment can influence the detection result.
[0131] In this embodiment, the status of the review gating is determined by preset review reliability conditions, and different candidate risk calculation methods are adopted according to the review gating status. The preset review reliability conditions evaluate the reliability of the review results from multiple dimensions, including local view clarity, coordinate consistency, coding margin, and operating status, ensuring that review information is only used in risk calculation when the review results are unreliable. When the review gating is closed, the detection confidence probability is used directly to maintain the original judgment of the detection model; when the review gating is open, the category review probability and the detection confidence probability are weighted and summed to fuse the information from the two models. This process enables the calculation of candidate risks to utilize the review capabilities of the visual language model while maintaining the judgment of the detection model when the review results are unreliable, thus improving the adaptability and accuracy of risk calculation.
[0132] Step S43 above may include steps S421 to S423: Step S421: In response to the processing action of having at least one candidate target being confirmed as an alarm, the action of determining the smoke alarm of the target image is confirmed as an alarm. In one alternative approach, the processing actions of all candidate targets in the target image are traversed, and it is checked whether there is a candidate target whose processing action is a confirmation alarm. If there is at least one candidate target whose processing action is a confirmation alarm, it means that at least one candidate target in the target image has been confirmed as real fireworks, and the fireworks alarm action of the target image is determined to be a confirmation alarm.
[0133] Step S422: In response to the absence of a candidate target whose processing action is to confirm the alarm, and the existence of at least one candidate target whose processing action is to retain the alarm, determine that the smoke alarm action of the target image is to retain the alarm. In one alternative approach, the processing actions for all candidate targets in the target image are iterated. If no candidate target has a processing action of confirming the alarm, the process continues to check if there is a candidate target with a processing action of retaining the alarm. If at least one candidate target has a processing action of retaining the alarm, it indicates that although there is no confirmed fireworks target in the target image, there are candidate targets that need further observation. In this case, the fireworks alarm action for the target image is determined to be a retained alarm.
[0134] Step S423: In response to the fact that the processing action for all candidate targets is to cancel the alarm, the smoke alarm action for the target image is determined to be no alarm.
[0135] In one alternative approach, the processing actions of all candidate targets in the target image are traversed. If the processing action of all candidate targets is to cancel the alarm, it means that there are no candidate targets in the target image that need to be alarmed, and the smoke alarm action of the target image is determined to be no alarm.
[0136] In this embodiment, by judging the above three cases, the processing actions of all candidate targets in the target image are summarized into a target image-level fireworks alarm action. Confirming alarms ensures that real fireworks are not missed, retaining alarms keeps an eye on uncertain candidate targets, and no alarms avoids false alarms for non-smoke targets. This summarization rule ensures that the fireworks alarm action for the target image neither misses real fireworks nor falsely alarms non-smoke targets, thus improving the overall accuracy of fireworks alarms.
[0137] In other embodiments, each candidate target further includes a detection category and a detection confidence probability; after acquiring the target image to be used for fireworks alarm and detecting at least one candidate target in the target image, the method further includes: for any candidate target, in response to the candidate target's category belonging to a detection category in a preset set of categories to be reviewed, and the candidate target's detection confidence probability reaching the review threshold corresponding to the detection category, the candidate target is designated as a candidate target to be reviewed; for any candidate target to be reviewed, a spatially anchored dual view is constructed on the target image based on the candidate bounding box of the candidate target, wherein the spatially anchored dual view includes a global view and a local view, the global view carrying a positional cue to indicate the position of the candidate bounding box in the global view, and the local view including detailed information of the candidate target; the spatially anchored dual view is input into a visual language model, and the visual language model outputs the category review probability of the candidate target based on the positional cue and detailed information; and the corresponding fireworks alarm action is executed according to the category review probabilities of all candidate targets.
[0138] Based on the configuration, select candidate targets to be reviewed from all candidate targets, when the detection category... Belongs to the set of categories to be reviewed And detect confidence level Reaching the review threshold corresponding to this category At that time, the test result was selected as a candidate for review.
[0139] .
[0140] In the formula, A value of 1 indicates that the candidate target enters the review process, while a value of 0 indicates that the candidate target does not enter the review process. For each candidate target that enters the review process, the system establishes an independent candidate record and generates a unique candidate identifier determined by the image identifier, the detector's original index, and the candidate box coordinates. The candidate record at least stores the original candidate box, detection category, detection score, and current processing status. Subsequent requests for bounding box expansion, local view, global view position hints, category review probability, candidate risk, and final smoke alarm actions can only be appended to this record. The visual language model in this application undertakes the candidate classification task, without re-detecting targets or generating new candidate boxes. If no candidates are generated in this step, it means that there are no candidate targets in the current target image that meet the review conditions, and the system does not call the visual language model and directly generates a no-alarm result.
[0141] In other embodiments, the system employs a layered rollback approach for anomalies in the aforementioned steps. When the image is corrupted, key configurations are incomplete, or the first-stage detection fails entirely, the system cannot form a reliable candidate-level judgment and should output a processing anomaly and trigger an algorithm health alarm. Anomalies affecting only a single candidate, including edge expansion and cropping failure, review timeout, insufficient video memory, invalid decision encoding, abnormal category probability quantity or value, insufficient encoding margins, candidate association verification failure, insufficient effective pixels, and exceeding the candidate quantity limit, should disable the review gating for the corresponding candidate. A conservative alarm is generated when a candidate does not meet the confirmation alarm conditions, while other normal candidates continue to be processed. No anomaly should be converted into a suppressable category, nor should it be used as a basis for canceling alarms. For ease of viewing by business personnel, the system draws the candidate bounding boxes generated in the first stage on the target image and labels the detection category and the reliable detection probability after table lookup, the review category output by the visual language model, and the highest encoding probability near each candidate.
[0142] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the fire alarm method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0143] Secondly, this application provides a fire alarm device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the fire alarm method in the above embodiments.
[0144] The following is for reference. Figure 5 It shows a structural schematic diagram of a smoke alarm device suitable for implementing the embodiments of this application. Figure 5 The smoke and fire alarm device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0145] like Figure 5 As shown, the smoke alarm device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The random access memory 1004 also stores various programs and data required for the operation of the smoke alarm device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the smoke alarm device to communicate wirelessly or wiredly with other devices to exchange data. Although smoke alarm devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0146] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0147] The smoke and fire alarm device provided in this application, employing the smoke and fire alarm method in the above embodiments, can improve the accuracy of smoke and fire monitoring, thereby improving the precision of the triggering timing of the smoke and fire alarm. Compared with the prior art, the beneficial effects of the smoke and fire alarm device provided in this application are the same as those of the smoke and fire alarm method provided in the above embodiments, and other technical features in this smoke and fire alarm device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.
[0148] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0149] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0150] Thirdly, this application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the smoke alarm method in the above embodiments.
[0151] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0152] The aforementioned computer-readable storage medium may be included in the smoke and fire alarm device; or it may exist independently and not be assembled into the smoke and fire alarm device.
[0153] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the smoke and fire alarm device, cause the smoke and fire alarm device to perform the steps of the aforementioned method.
[0154] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0155] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0156] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0157] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described smoke alarm method. This improves the accuracy of smoke detection and, consequently, the precision of the smoke alarm triggering timing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the smoke alarm method provided in the above embodiments, and will not be repeated here.
[0158] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for detecting smoke and fire, characterized in that, The method includes: Acquire the target image to be used for fireworks alarm, and detect at least one candidate target in the target image, wherein each candidate target corresponds to a candidate bounding box; For any of the candidate targets, a spatially anchored dual view is constructed on the target image based on the candidate bounding box of the candidate target, wherein the spatially anchored dual view includes a global view and a local view, the global view carries a positional cue for indicating the position of the candidate bounding box in the global view, and the local view includes detailed information of the candidate target; The spatially anchored dual-view is input into the visual language model, and the visual language model outputs the category verification probability of the candidate target based on the location cues and the detailed information. Based on the category verification probability of all the candidate targets, execute the corresponding fireworks alarm action.
2. The smoke and fire alarm method as described in claim 1, characterized in that, The construction of a spatially anchored dual-view on the target image based on the candidate bounding box of the candidate target includes: Obtain the position information of the candidate bounding box of the candidate target in the target image; The location prompt is generated based on the location information, and the location prompt is overlaid on the target image to obtain the global view; Based on the candidate bounding boxes of the candidate targets, local regions are determined from the target image to obtain the local view; The global view and the local view together constitute the spatially anchored dual view.
3. The smoke and fire alarm method as described in claim 2, characterized in that, The step of generating the location prompt based on the location information includes: Based on the location information and the image size of the target image, the normalized coordinates of the candidate box are determined, and the normalized coordinates are used to indicate the relative position of the candidate box in the target image; The target image is divided into multiple visual patches, and the coverage ratio of each visual patch by the candidate bounding box is calculated. The location hint is generated based on the normalized coordinates and the coverage ratio.
4. The smoke and fire alarm method as described in claim 2, characterized in that, The step of determining a local region from the target image based on the candidate bounding box of the candidate target to obtain the local view includes: Obtain the target request expansion ratio of the candidate box of the candidate target; Based on the target requested expansion ratio and the size information of the candidate box, the candidate box is expanded to determine the requested expansion border. Based on the target pixel resolution of the requested border expansion and the positional relationship between the requested border expansion and the target image, the border range of the requested border expansion is corrected to obtain a partial view.
5. The smoke and fire alarm method as described in claim 4, characterized in that, The target request expansion ratio for obtaining the candidate box of the candidate target includes: Obtain the influencing factors of the requested expansion ratio, wherein the influencing factors include at least one of the following: the area ratio of the candidate box of the candidate target in the target image, detection uncertainty, image quality, boundary truncation degree, and basic context prior. The target requested expansion ratio of the candidate box is determined based on at least one of the following: the area ratio of the candidate box, the detection uncertainty, the image quality, the degree of boundary truncation, and the basic context prior.
6. The smoke and fire alarm method as described in claim 5, characterized in that, Determining the target requested expansion ratio of the candidate box based on at least one of the following: the area ratio of the candidate box, the detection uncertainty, the image quality, the degree of boundary truncation, and the basic context prior: The area ratio of the candidate box, the detection uncertainty, the image quality, and the degree of boundary truncation are weighted and summed to obtain the first requested expansion ratio. The area ratio of the candidate box and the image quality are negatively correlated with the first requested expansion ratio, while the detection uncertainty and the degree of boundary truncation are positively correlated with the first requested expansion ratio. The second request edge expansion ratio is determined based on the first request edge expansion ratio and the basic context prior. The second requested edge expansion ratio is limited to a preset edge expansion ratio range to obtain the target requested edge expansion ratio.
7. The smoke and fire alarm method as described in claim 4, characterized in that, The step of correcting the border range of the requested border expansion based on the target pixel resolution and the positional relationship between the requested border expansion and the target image to obtain a local view includes: The effective pixels of the candidate box after scaling are determined based on the target pixel resolution and the size of the requested expansion border. In response to the effective pixels being less than a preset lower pixel limit, the requested border expansion is scaled and corrected, and the scaled and corrected requested border expansion is output. In response to the scaling correction request bounding box exceeding the boundary of the target image, the exceeding area is filled or the request bounding box is translated so that the request bounding box is located within the target image; The partial view is obtained by expanding the border according to the requested scaling correction, and / or the fill correction, and / or the translation correction.
8. The smoke and fire alarm method as described in claim 7, characterized in that, The step of determining the effective pixels of the candidate box after scaling based on the target pixel resolution and the size of the requested expanded border includes: Obtain the size of the candidate box and the size of the requested expansion border; The scaling ratio of the short side of the requested border is determined based on the ratio of the target pixel resolution to the size of the requested border. The effective pixels of the short side of the candidate box after scaling are determined by multiplying the scaling ratio of the short side by the size of the short side of the candidate box.
9. The smoke and fire alarm method as described in claim 7, characterized in that, The step of scaling and correcting the request border and outputting the scaled and corrected request border includes: Obtain the preset scaling step size corresponding to the detection category of the candidate target; The target requested border expansion ratio is reduced according to the preset scaling step size, and the effective pixels of the short side of the candidate box after each scaling are recalculated until the effective pixels are greater than the preset lower limit of pixels, or the target requested border expansion ratio reaches the preset lower limit of border expansion ratio, then the scaling correction is stopped, and the scaled-corrected requested border is output.
10. The smoke and fire alarm method according to any one of claims 1 to 9, characterized in that, The step of inputting the spatially anchored dual-view into the visual language model, and outputting the category verification probability of the candidate target based on the location cues and the detailed information by the visual language model includes: Assign a corresponding internal decision code to each category in a preset set of limited categories, the preset set of limited categories including fireworks categories and at least one interference category; The spatially anchored dual-view is input into the visual language model, and the visual language model outputs the encoding probability of each category within the preset limited category set based on the location cues and the detailed information. Based on the coding probability corresponding to each category, determine the verification alarm probability of the candidate target belonging to the fireworks category and the negative verification probability of the candidate target belonging to the interference category; The category review probability is obtained based on the review alarm probability and the negative review probability.
11. The smoke and fire alarm method as described in claim 1, characterized in that, The step of executing the corresponding fireworks alarm action based on the category verification probability of all the candidate targets includes: For any of the candidate targets, determine the verification gating corresponding to the candidate target, wherein the verification gating includes a closed state or an open state; Based on the review gating, the category review probability, and the detection confidence probability of the candidate target, the candidate risk of the candidate target is determined; Based on the candidate risks, the corresponding processing action for the candidate target is determined, and the processing action includes one of confirming the alarm, canceling the alarm, or retaining the alarm; Based on the processing actions of all the candidate targets, determine the smoke and fire alarm action for the target image.
12. The smoke and fire alarm method as described in claim 11, characterized in that, The step of determining the review gating corresponding to the candidate target includes: In response to meeting the preset verification reliability conditions, the verification gate is determined to be in the open state; In response to the failure to meet the preset verification reliability conditions, the verification gate is determined to be in a closed state; The preset verification reliability conditions include: the effective pixels of the local view reach the preset pixel lower limit and the candidate target in the local view is clear; the visual language model is running normally; and at least one of the candidate box, the position prompt of the global view corresponding to the candidate box, and the local view can be restored to the same candidate target. The step of determining the candidate risk of a candidate target based on the review gating, the category review probability, and the detection confidence probability of the candidate target includes: In response to the verification gating being in the closed state, the detection confidence probability is used as the candidate risk of the candidate target; In response to the verification gating being in the open state, the category verification probability and the detection confidence probability are weighted and summed to obtain the candidate risk of the candidate target.
