A training sample generation method, training method and device of a fire warning model

By constructing a knowledge graph in the field of fire prevention and a cross-attention mechanism, multi-task training samples are generated, which solves the problem of insufficient analytical accuracy of general models in fire monitoring and early warning scenarios and improves the analytical capabilities of fire early warning models.

CN123178967APending Publication Date: 2026-11-27SHENZHEN HIVT TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611395632.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-09
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

The general model is insufficient in processing professional fire prevention information in fire monitoring and early warning scenarios, resulting in low analysis accuracy, especially when faced with detection data from different sources and in different forms.

Method used

By acquiring detection data and fire prevention knowledge data collected by multiple detection devices during the fire evolution process, a knowledge graph in the field of fire prevention is constructed, input information and annotation information are determined, multi-task training samples are generated, and cross-attention mechanism and physical rules are used to train the model to improve the analytical accuracy of the model.

Benefits of technology

It improves the analytical accuracy of fire early warning models in fire monitoring, early warning, and decision support scenarios, and enhances the model's ability to process detection data in different spectral ranges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178967A_ABST
    Figure CN123178967A_ABST
Patent Text Reader

Abstract

The application discloses a fire warning model training sample generation method, a training method and a device. The method comprises the following steps: acquiring detection data collected by a plurality of detection devices in a fire evolution process and fire prevention knowledge data, the plurality of detection devices correspond to at least two different spectral ranges, and the fire prevention knowledge data comprises physical change rule information between detection data corresponding to different spectral ranges in the fire evolution process; determining input information based on the detection data, configuring corresponding instruction information for the input information based on a plurality of training tasks, and determining labeling information based on the input information and the fire prevention knowledge data; and generating multi-task training samples based on the input information, the instruction information and the labeling information. The application constructs multi-task training samples based on multi-spectral detection data and fire prevention knowledge data, effectively integrates fire prevention knowledge and physical laws into the model training process, and improves the analysis accuracy of the fire warning model in the fire monitoring and warning scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of artificial intelligence and fire monitoring technology, and in particular to a method for generating training samples, a training method, and a device for a fire early warning model. Background Technology

[0002] In scenarios such as fire monitoring, early warning, and decision support, different types of detection equipment are typically used to monitor the occurrence and evolution of fires and collect corresponding detection data. The collected detection data can be used to reflect the fire status and its changes, serving as the data basis for fire status analysis and alarm assessment. With the increasing application of models in information analysis and decision support, general-purpose models are also gradually being used to process detection data to assist in tasks such as fire feature identification, alarm analysis, root cause diagnosis, and emergency response recommendations.

[0003] However, general-purpose models are typically trained on general-domain data, and when directly applied to fire monitoring and early warning scenarios, their ability to process specialized fire prevention information is insufficient to meet the demands of the tasks. To assist general-purpose models in completing these tasks, relevant content can be extracted from related fire prevention knowledge data and provided to the general-purpose model along with the detection data for processing. However, this approach relies heavily on external information provided by the model when processing the current task. When faced with detection data from different sources and in different formats, the analytical accuracy of general-purpose models in fire monitoring, early warning, and decision support scenarios remains relatively low. Summary of the Invention

[0004] In view of the above problems, this application provides a method and apparatus for generating training samples and training a fire early warning model, so as to improve the accuracy of fire early warning model analysis. The specific solution is as follows:

[0005] The first aspect of this application provides a method for generating training samples for a fire early warning model, including:

[0006] The method acquires detection data and fire prevention knowledge data collected by multiple detection devices during the fire evolution process. The multiple detection devices correspond to at least two different spectral ranges, and the fire prevention knowledge data includes information on the physical change patterns between the detection data corresponding to different spectral ranges during the fire evolution process.

[0007] Input information is determined based on the detection data, and corresponding instruction information is configured for the input information based on multiple training tasks. Labeling information is determined based on the input information and the fire prevention knowledge data containing the physical change law information.

[0008] Based on the input information, the instruction information, and the annotation information, multi-task training samples are generated. These multi-task training samples are used to train the model to be trained, thereby obtaining a fire early warning model.

[0009] In one possible implementation, the fire prevention knowledge data is represented in the form of a fire prevention domain knowledge graph, the construction of which includes:

[0010] Initial fire prevention knowledge data is acquired, and entity recognition and relationship extraction are performed on the initial fire prevention knowledge data to obtain multiple fire prevention entities and the relationships between the multiple fire prevention entities; wherein, the relationships between the multiple fire prevention entities include at least a multispectral physical evolution relationship, and the physical change law information is characterized by the multispectral physical evolution relationship.

[0011] The fire protection knowledge graph is constructed based on the multiple fire protection entities and the relationships between them.

[0012] In one possible implementation, determining the labeling information based on the input information and the fire prevention knowledge data containing the information on the laws of physical change includes:

[0013] The annotation information is determined based on the input information and the instruction information, according to the fire protection entities in the fire protection knowledge graph and the relationships between the fire protection entities.

[0014] In one possible implementation, determining the input information based on the detection data includes:

[0015] Determine whether the changes in the detection data corresponding to different spectral ranges conform to the physical change law information, and if they do not conform to the physical change law information, determine whether each of the detection devices is abnormal;

[0016] If there are no abnormalities in any of the aforementioned testing devices, acquire the historical testing data corresponding to each of the aforementioned testing devices. The historical testing data is the testing data collected by the corresponding testing device before the acquisition of the testing data. Determine the reliability of each of the aforementioned testing data based on the historical testing data of each of the aforementioned testing devices.

[0017] The detection data are weighted based on the confidence level of each detection data to obtain fused detection data, and the input information is determined based on the fused detection data.

[0018] In one possible implementation, the plurality of detection devices include at least two of visible light imaging devices, infrared thermal imaging devices, and ultraviolet sensing devices, and the detection data includes at least two of visible light image data acquired by the visible light imaging device, infrared thermal imaging data acquired by the infrared thermal imaging device, and ultraviolet detection data acquired by the ultraviolet sensing device.

[0019] Determining the input information based on the fused detection data includes:

[0020] Detection features corresponding to each detection data are extracted from the fused detection data. The detection features include at least two of the following: visual features, temperature distribution features, and temporal features, which correspond to the at least two types of detection data respectively. The visual features correspond to the visible light image data, the temperature distribution features correspond to the infrared thermal imaging data, and the temporal features correspond to the ultraviolet detection data.

[0021] Based on the cross-attention mechanism, each detection feature is mapped to a unified semantic feature space, the attention weights between the mapped detection features are calculated, and cross-modal associations between the detection features are established according to the attention weights to obtain cross-modal alignment features. The input information is then determined based on the cross-modal alignment features.

[0022] A second aspect of this application provides a method for training a fire early warning model, characterized in that it includes:

[0023] Obtain multi-task training samples, wherein the multi-task training samples are training samples generated using any one of the methods described in the first aspect above;

[0024] The fire early warning model is obtained by training the model to be trained based on the multi-task training samples.

[0025] In one possible implementation, training the model to be trained based on the multi-task training samples includes:

[0026] Obtain physical rules, which are determined based on information about the physical change patterns in the fire prevention knowledge data used to generate the multi-task training samples;

[0027] The multi-task training samples are input into the model to be trained to obtain the training output, and the training loss is determined based on the training output and the annotation information in the multi-task training samples.

[0028] The physical residual is determined based on the deviation between the training output and the physical rule. The physical residual is used as a regularization term for the training loss. The model parameters of the model to be trained are updated based on the training loss containing the regularization term.

[0029] In one possible implementation, the method further includes:

[0030] The detection data collected by multiple detection devices and the confidence level of each detection data are obtained, and the detection data are input into the trained fire early warning model to obtain the output to be verified.

[0031] If the credibility of the detection data is not lower than the preset credibility threshold, the verification score between the output to be verified and the detection data is determined according to the physical rules. The verification score is used to characterize the degree of consistency between the output to be verified and the corresponding detection data under the physical rules.

[0032] If the credibility of the detection data is lower than the preset credibility threshold, the verification score between the output to be verified and the detection data is determined as the preset score.

[0033] The comprehensive verification score of the output to be verified is determined based on the verification score corresponding to each of the detection data. If the comprehensive verification score is lower than a preset score threshold, the annotation information corresponding to the detection data is obtained. Based on the detection data and the annotation information, counterexample samples and constraint samples are generated. The counterexample samples and constraint samples are added to the multi-task training samples to obtain updated multi-task training samples. The fire early warning model is then retrained based on the updated multi-task training samples.

[0034] In one possible implementation, the method further includes:

[0035] Acquire historical detection data of multiple detection devices under normal operating conditions. The multiple detection devices are detection devices that collect detection data for generating the multi-task training samples. Determine the baseline feature distribution corresponding to each detection device based on the value distribution of detection features in the historical detection data.

[0036] The current feature distribution is determined based on the value distribution of the detection features in the detection data collected by each detection device, and each current feature distribution is compared with the corresponding benchmark feature distribution to determine the feature drift degree of each detection data.

[0037] If at least one of the feature drift levels reaches a preset drift threshold, it is determined whether each of the detection devices is abnormal, and based on the drift level of each feature and the abnormality of each detection device, the fire early warning model is incrementally trained.

[0038] In one possible implementation, the incremental training of the fire early warning model based on the drift degree of each of the aforementioned features and the anomalies of each of the aforementioned detection devices includes:

[0039] If none of the detection devices are abnormal, determine whether the feature drift of the detection data corresponding to at least two different spectral ranges reaches the preset drift threshold. If the preset drift threshold is reached, generate incremental training samples based on the detection data whose feature drift reaches the preset drift threshold, and perform incremental training on the fire early warning model based on the incremental training samples.

[0040] In one possible implementation, the incremental training of the fire early warning model based on the drift degree of each of the aforementioned features and the anomalies of each of the aforementioned detection devices includes:

[0041] In the event of malfunctioning detection equipment, exclude the detection data collected by the malfunctioning detection equipment.

[0042] Determine whether the feature drift of the detection data corresponding to at least two different spectral ranges in the remaining detection data reaches the preset drift threshold. If the preset drift threshold is reached, generate incremental training samples based on the remaining detection data whose feature drift reaches the preset drift threshold, and perform incremental training on the fire early warning model based on the incremental training samples.

[0043] A third aspect of this application provides a training sample generation device for a fire early warning model, comprising:

[0044] The acquisition module is used to acquire detection data and fire prevention knowledge data collected by multiple detection devices during the fire evolution process. The multiple detection devices correspond to at least two different spectral ranges, and the fire prevention knowledge data includes information on the physical change patterns between the detection data corresponding to different spectral ranges during the fire evolution process.

[0045] The determination module is used to determine input information based on the detection data, configure corresponding instruction information for the input information based on multiple training tasks, and determine annotation information based on the input information and the fire prevention knowledge data containing the physical change law information;

[0046] The generation module is used to generate multi-task training samples based on the input information, the instruction information, and the annotation information. The multi-task training samples are used to train the model to be trained to obtain a fire early warning model.

[0047] The fourth aspect of this application provides a training device for a fire early warning model, comprising:

[0048] The acquisition module is used to acquire multi-task training samples, wherein the multi-task training samples are training samples generated by the training sample generation method of the fire early warning model described in any of the first aspects above.

[0049] The training module is used to train the model to be trained based on the multi-task training samples to obtain the fire early warning model.

[0050] The fifth aspect of this application provides a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement the training sample generation method for the fire early warning model described in the first aspect or any implementation thereof, or to implement the training method for the fire early warning model described in the second aspect or any implementation thereof.

[0051] A sixth aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0052] The memory is used to store computer programs;

[0053] The processor is used to execute the computer program so that the electronic device can implement the training sample generation method for the fire early warning model as described in the first aspect or any implementation thereof, or implement the training method for the fire early warning model as described in the second aspect or any implementation thereof.

[0054] The seventh aspect of this application provides a computer storage medium carrying one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device is able to implement the training sample generation method for the fire early warning model described in the first aspect or any implementation thereof, or implement the training method for the fire early warning model described in the second aspect or any implementation thereof.

[0055] This application provides a method for generating training samples for a fire early warning model, utilizing the aforementioned technical solution. In the process of generating training samples for the fire early warning model, firstly, detection data collected by multiple detection devices during the fire evolution process, along with corresponding fire prevention knowledge data, are acquired. Each detection device corresponds to at least two different spectral ranges, and the fire prevention knowledge data contains information on the physical change patterns between the detection data corresponding to different spectral ranges. Input information is generated based on the detection data, and instruction information corresponding to the input information is configured for multiple training tasks. Based on this, annotation information is determined by combining the input information and the fire prevention knowledge data containing information on physical change patterns. Then, multi-task training samples are generated based on the input information, instruction information, and annotation information. The generated multi-task training samples are used to train the model to be trained, thereby obtaining a fire early warning model. This allows the trained fire early warning model to learn detection data in different spectral ranges and their physical change patterns, thus improving the analytical accuracy of the fire early warning model in scenarios such as fire monitoring, early warning, and decision support. Attached Figure Description

[0056] The above and other features, advantages, and aspects of the embodiments of this application will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0057] Figure 1 A schematic diagram of the training sample generation and training system architecture for a fire early warning model provided in this application;

[0058] Figure 2 A flowchart illustrating a method for generating training samples for a fire early warning model provided in this application;

[0059] Figure 3 An exemplary knowledge graph construction and relationship diagram in the field of fire protection provided for this application;

[0060] Figure 4 A flowchart illustrating a training method for a fire early warning model provided in this application;

[0061] Figure 5 A schematic diagram of a training sample generation device for a fire early warning model provided in this application embodiment;

[0062] Figure 6 A schematic diagram of the structure of a training device for a fire early warning model provided in an embodiment of this application;

[0063] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0064] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0065] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0066] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0067] See Figure 1 , Figure 1 A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may provide one or more terminals 100 with the method for generating training samples for the fire early warning model provided in the embodiments of this application and / or the method for training the fire early warning model.

[0068] The terminal 100 may have a corresponding application installed, which can provide an interactive interface. The terminal 100 can receive relevant information input by the user through the interactive interface and send the relevant information to the server 200. The server 200 can process the received information and return the processing result to the terminal 100.

[0069] It should be understood that in some optional implementations, the terminal 100 can also complete the corresponding processing on its own without the cooperation of the server 200, and this application embodiment does not limit this.

[0070] The following description Figure 1 One product form of the mid-terminal 100.

[0071] The terminal 100 in this application embodiment can be a mobile phone, tablet computer, wearable device, vehicle device, augmented reality (AR) device, virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or other electronic device with data processing capabilities. This application embodiment does not limit this.

[0072] Terminal 100 may include components such as a radio frequency unit, memory, input unit, display unit, camera, audio circuit, speaker, microphone, headphone jack, processor, external interface, and power supply. The camera, audio circuit, speaker, microphone, and headphone jack may be selectively included depending on the actual product form. Those skilled in the art will understand that the above components are merely examples and do not constitute a limitation on terminal 100. Terminal 100 may include more or fewer components, combine certain components, or employ different component configurations.

[0073] The input unit can be used to receive input numeric or character information, and to generate input related to user settings or function control. Specifically, the input unit may include a touch screen and / or other input devices, which may include, but are not limited to, one or more of a physical keyboard, function keys, trackball, mouse, and joystick.

[0074] In this embodiment of the application, the input unit can be used to receive information related to the generation or training of training samples for the fire early warning model.

[0075] The display unit can be used to display information input by the user, information provided to the user, various menus of the terminal 100, interactive interfaces, and processing results. In this embodiment, the display unit can be used to display interactive interfaces and processing results related to the training sample generation method and / or the training method of the fire early warning model.

[0076] The memory can be used to store computer programs and data related to the training sample generation method and / or training method of the fire early warning model provided in the embodiments of this application. The processor can execute the above-mentioned computer programs and can also schedule the input unit, display unit and other functional units to realize the corresponding functions.

[0077] The radio frequency (RF) unit can be used to receive and send information. In this embodiment, the RF unit can be used to send relevant information to the server 200 and receive the processing results returned by the server 200.

[0078] It should be understood that the radio frequency unit is optional and can be replaced by other communication interfaces, such as network ports, wireless network interfaces, or other interfaces that enable communication between terminal 100 and server 200.

[0079] Terminal 100 may also include a power source for supplying power to the components, such as a battery or an external power source.

[0080] Terminal 100 may also include an external interface, which may be a USB interface, a multi-pin connector or other interface, for enabling communication between terminal 100 and other devices or for connecting to an external power supply.

[0081] Server 200 may include a bus, a processor, a communication interface, and a memory, and the processor, memory, and communication interface may communicate with each other via the bus.

[0082] The memory can be used to store computer programs and data related to the method for generating training samples and / or the method for training the fire early warning model provided in this application embodiment. The processor can execute the computer programs to implement the method for generating training samples and / or the method for training the fire early warning model. The communication interface can be used to interact with the terminal 100 or other devices.

[0083] First, a definition of the terminology used in this application is provided:

[0084] Low-Rank Adaptation (LoRA): This can be described as an efficient parameter training method that adjusts the model's parameters by setting and training a low-rank increment matrix while keeping the model's original main parameters unchanged.

[0085] Cross-Attention: This refers to a mechanism that uses information from one feature to calculate the degree of attention to another feature, thereby establishing a relationship between different features.

[0086] Retrieval-Augmented Generation (RAG) refers to a process that retrieves information related to the current task from external knowledge bases, databases, or other information sources before or during the generation of content by the model, and then provides the retrieved information along with the current input to the model to assist it in generating the corresponding results.

[0087] Secondly, to facilitate understanding of the technical solutions provided in the embodiments of this application by those skilled in the art, the relevant technologies are described below: Research has found that in scenarios such as fire monitoring, early warning, and decision support, different types of detection equipment can be used to collect detection data, and a general model can combine the detection data to complete tasks such as fire feature identification, alarm analysis, root cause diagnosis, and emergency recommendations. Since the general model is mainly trained based on general domain data, when handling fire prevention tasks, fire prevention knowledge data can also be combined to improve the general model's ability to handle related tasks. Currently, the following methods can be used: knowledge fusion or RAG enhancement. Content related to the current task can be obtained from fire prevention knowledge data, and through context splicing or information fusion, the obtained content and detection data can be provided to the general model, allowing the general model to analyze the detection data with reference to the fire prevention knowledge data. However, this method mainly provides external information when the model processes the current task, and has little impact on the parameters of the general model itself; when there are many sources of detection data and differences in their presentation, the model may still produce biased results when comprehensively analyzing different detection data.

[0088] To address the aforementioned problems, embodiments of this application provide a method for generating training samples for a fire early warning model and a method for training a fire early warning model. The following detailed description, in conjunction with the accompanying drawings, provides a method for generating training samples for a fire early warning model and a method for training a fire early warning model.

[0089] First, refer to Figure 2 , Figure 2 A flowchart illustrating a method for generating training samples for a fire early warning model, as provided in this application embodiment, is shown below. Figure 2 As shown, the method for generating training samples for the fire early warning model provided in this application embodiment may include steps 201 to 203, which are described in detail below.

[0090] Step 201: Obtain detection data and fire prevention knowledge data collected by multiple detection devices during the fire evolution process. The multiple detection devices correspond to at least two different spectral ranges, and the fire prevention knowledge data includes information on the physical change patterns between the detection data corresponding to different spectral ranges during the fire evolution process.

[0091] Specifically, detection equipment can be used to collect spectral response information generated during the occurrence and evolution of a fire. Different detection equipment can correspond to different spectral ranges. Understandably, different detection equipment, based on their respective sensing principles, detect optical or radiation information within different wavelength ranges. Spectral range represents the wavelength range of spectral information that the detection equipment can sense or collect; detection data corresponding to different spectral ranges can reflect the fire state and its changes from different perspectives. Of course, multiple detection equipment can also correspond to the same spectral range, as long as the combined total of the multiple detection equipment can cover at least two different spectral ranges.

[0092] Detection data can be data actually collected by detection equipment during the fire evolution process. The fire evolution process can include the process from initial combustion to combustion development and the change to complete combustion. Detection data can reflect the response of the corresponding spectral range as the fire state changes. Detection data can be real-time data currently collected by the detection equipment, or historical data collected and saved by the detection equipment during previous fires. For the same fire process, detection data collected by different detection equipment within the same or similar time range can be obtained so that the changes of detection data corresponding to different spectral ranges in the corresponding fire stages can be compared during subsequent processing. Fire prevention knowledge data can represent existing knowledge data related to fire identification, fire state analysis, and fire prevention tasks. Fire prevention knowledge data can include historical alarm cases, expert analysis records, flame spectral physical characteristic data, combustible material spectral band response laws, alarm rules, and emergency plans, etc. Historical alarm cases can record fires or alarm events that have occurred and the corresponding detection data and processing results. Expert analysis records can record professional analysis content on fire types, changes in detection data, and processing conclusions. Flame spectral physical property data and combustible spectral band response patterns can reflect the response characteristics of different combustion states or different combustibles within their respective spectral ranges. Alarm rules and emergency plans can be used to describe the corresponding alarm conditions and corresponding handling measures, respectively. In some embodiments, the stored fire prevention knowledge data can be updated as new historical alarm cases, expert analysis records, or flame spectral physical property data are generated, so that the updated fire prevention knowledge data can be used when generating multi-task training samples. Physical change pattern information can be used to describe the physical change relationships between detection data corresponding to different spectral ranges when the fire state changes. Physical change pattern information can include the changing trends of different detection data with changes in the fire state, the order of responses, and the correspondence between them. For example, during the process of a fire developing from initial combustion to full combustion, the detection data corresponding to different spectral ranges may show corresponding response changes, and physical change pattern information can be used to record the correspondence between these response changes. Fire prevention knowledge data can be organized in different forms, such as structured tables, relational databases, rule bases, knowledge graphs, etc., or a combination of these forms. The following example provides an implementation method for organizing fire protection knowledge data using a fire protection knowledge graph.

[0093] In one possible implementation, the fire prevention knowledge data is represented in the form of a fire prevention domain knowledge graph. The construction of this knowledge graph includes: acquiring initial fire prevention knowledge data, and performing entity recognition and relationship extraction on the initial fire prevention knowledge data to obtain multiple fire prevention entities and the relationships between these entities. The relationships between the multiple fire prevention entities at least include multispectral physical evolution relationships, and the physical change patterns are characterized by these multispectral physical evolution relationships. The fire prevention domain knowledge graph is then constructed based on the multiple fire prevention entities and the relationships between them.

[0094] Specifically, such as Figure 3As shown, a knowledge graph in the field of fire prevention can be used to represent fire prevention knowledge data in a structured form. It can include fire prevention entities representing fire prevention objects or attributes, and relationships representing the connections between different fire prevention entities. A knowledge graph in the field of fire prevention can transform initial fire prevention knowledge data, originally stored in scattered forms such as text, records, rules, or numerical values, into interconnected fire prevention entities and relationships, thus facilitating the organization of fire prevention knowledge data according to fire prevention entities and the relationships between them. Initial fire prevention knowledge data can be fire prevention knowledge data that has not yet undergone entity identification and relationship extraction processing, and can include historical alarm data, expert analysis records, flame spectral physical characteristic data, combustible material spectral band response patterns, alarm rules, and emergency plans. The data sources and data representation formats of different initial fire prevention knowledge data can vary. For example, historical alarm data can include structured data such as fire occurrence time, detection results, and alarm results; expert analysis records and emergency plans can include text data; and flame spectral physical characteristic data and combustible material spectral band response patterns can include numerical data or regular data formed by organizing numerical data. Entity recognition can be used to identify data objects that can serve as nodes in a fire prevention knowledge graph from initial fire prevention knowledge data. Data objects obtained through entity recognition can be considered fire prevention entities. Fire prevention entities can include data objects that can be used to characterize fire prevention knowledge content, such as combustibles, fire status, spectral bands, spectral characteristics, alarm types, alarm levels, and emergency measures. Entity recognition can be implemented in different ways. A fire prevention domain dictionary can be pre-established, and fire prevention entities can be identified from the initial fire prevention knowledge data based on the entity names, entity categories, and corresponding words recorded in the dictionary. Alternatively, a pre-trained entity recognition model can be used to process the initial fire prevention knowledge data, and fire prevention entities can be determined based on the entity categories and scope output by the model. In some embodiments, candidate fire prevention entities can be obtained first using an entity recognition model, and then verified using a fire prevention domain dictionary or preset entity rules. By combining model recognition and rule verification, the scope of entity recognition can be expanded while reducing the possibility of data not belonging to the fire prevention domain being incorrectly identified as fire prevention entities. Relation extraction can be used to determine the connections between different fire protection entities and to establish relationships between them. Relation extraction can be performed according to pre-defined relationship rules. For example, the corresponding relationships can be determined based on the co-occurrence of different fire protection entities in the initial fire protection knowledge data and the content expressed between them. Relation extraction can also be achieved through a pre-trained relationship extraction model. The initial fire protection knowledge data containing fire protection entities can be input into the model, and the relationships between the corresponding fire protection entities can be determined based on the relationship categories output by the model.In some embodiments, the relationships determined by relational rules and those determined by relational extraction models can be compared, and conflicting relationships can be verified to reduce the possibility of erroneous relationships entering the fire protection knowledge graph. Relationships between fire protection entities can include association relationships, clustering relationships, and multispectral physical evolution relationships. Association relationships can be used to represent the correspondence between two fire protection entities in fire protection knowledge. Clustering relationships can be used to represent the classification relationship between multiple fire protection entities with similar fire protection attributes or similar spectral performance. Multispectral physical evolution relationships can be used to represent the evolutionary relationship of physical features formed between detection data corresponding to different spectral ranges when the fire state changes with the combustion process. For example, for the process of the same combustible material gradually developing from the ignition state to the fully combusted state, detection data corresponding to different spectral ranges can produce different responses as the combustion state changes. Multispectral physical evolution relationships between different fire protection entities can be established based on the response order, trend, and correspondence formed by detection data corresponding to different spectral ranges as the fire state changes. Therefore, the information on the physical change patterns between detection data corresponding to different spectral ranges during the fire evolution process can be represented in the fire protection knowledge graph through multispectral physical evolution relationships. In some embodiments, after obtaining fire-resistant entities and the relationships between them, entity disambiguation and attribute alignment can be performed on the fire-resistant entities. Entity disambiguation can be used to distinguish fire-resistant entities with the same name but representing different objects, or to identify fire-resistant entities with different names but representing the same object. For example, initial fire-resistant knowledge data from different sources may use different names to describe the same combustible material; entity disambiguation can determine whether different names correspond to the same fire-resistant entity. Attribute alignment can be used to unify the representation of the same or corresponding attributes in initial fire-resistant knowledge data from different sources. For example, when different data sources use different units to represent temperature or spectral wavelength, the corresponding attributes can be converted according to a preset data format so that the same attributes have a consistent data representation. Through entity disambiguation and attribute alignment, the differences in names and attribute representations of initial fire-resistant knowledge data from different sources can be reduced, avoiding the formation of duplicate or conflicting fire-resistant entities for the same fire-resistant object in the fire-resistant knowledge graph. The processed fire-resistant entities can be used as nodes in the fire-resistant knowledge graph, and the relationships between fire-resistant entities can be used as connections between nodes, thereby constructing the fire-resistant knowledge graph. Nodes in the fire protection knowledge graph can also store the attribute information of corresponding fire protection entities, enabling fire protection entities, attribute information, and relationships between entities to jointly represent the corresponding fire protection knowledge data. Of course, after generating new historical alarm data, expert analysis records, or other fire protection knowledge data, entity recognition and relationship extraction can be performed on the newly added fire protection knowledge data. For fire protection entities or relationships that do not exist in the fire protection knowledge graph, newly obtained fire protection entities or relationships can be added to the fire protection knowledge graph.For existing fire prevention entities, the corresponding attribute information or relationships can be updated based on newly added fire prevention knowledge data, so that the fire prevention knowledge graph can be updated as fire prevention knowledge data increases.

[0095] By performing entity recognition and relationship extraction on initial fire prevention knowledge data from different sources and in different forms, and by using multispectral physical evolution relationships to characterize the physical change patterns between detection data corresponding to different spectral ranges, scattered fire prevention knowledge and multispectral physical change patterns can be organized into a fire prevention domain knowledge graph with clearly defined entities and relationships. This fire prevention domain knowledge graph can be further used to determine the annotation information corresponding to input and instruction information; the specific determination method will be described further below and will not be repeated here.

[0096] Step 202: Determine input information based on the detection data, configure corresponding instruction information for the input information based on multiple training tasks, and determine annotation information based on the input information and the fire prevention knowledge data containing the physical change law information.

[0097] Specifically, the input information can be information formed from detection data that can be processed as a training task. The input information can retain the fire state and changes reflected in the detection data and can be organized according to the data format that the model to be trained can process. Since the detection data collected by different detection devices may differ in data format, acquisition time, and data volume, the detection data can be format-converted, time-correlated, and organized before determining the input information, so that detection data corresponding to the same fire process or the same time range can be processed according to a unified data organization method. The training task can represent the processing objective that the model to be trained is expected to achieve through multi-task training samples. Training tasks include at least two of the following: multispectral feature analysis tasks, alarm analysis tasks, root cause diagnosis tasks, emergency suggestion tasks, and data annotation tasks. Different training tasks can set different processing objectives for the same input information and can correspond to different output requirements. The multispectral feature analysis task can be used to determine the flame spectral characteristics based on the detection features corresponding to different spectral ranges in the input information. For example, the spectral response reflected in the current detection data can be determined based on the detection data corresponding to multiple detection devices. The alarm analysis task can be used to determine the corresponding alarm level based on the multispectral features reflected in the input information. Root cause diagnosis tasks can be used to determine the corresponding fire cause or combustible material type based on detection features or alarm results. Emergency suggestion tasks can be used to determine the corresponding emergency response content based on alarm levels and relevant fire prevention knowledge. Data annotation tasks can be used to determine the response type corresponding to different spectral ranges based on input information. These training tasks allow the same detection data to be used for different fire prevention tasks such as feature parsing, alarm assessment, cause analysis, and subsequent handling. Therefore, for the same input information, different instruction information can be configured for multiple training tasks, enabling the same set of detection data to form training content oriented towards different processing objectives. Instruction information can represent information used to instruct the model to be trained to perform corresponding training tasks in response to input information, and can include task requirements, output content requirements, and output format requirements. Instruction information can be generated using pre-set task instruction templates. For example, corresponding task instruction templates can be pre-established for different training tasks. After determining the training task, the necessary content corresponding to the input information is filled into the corresponding task instruction template to obtain the instruction information. In some embodiments, multiple task instruction templates with different expressions but consistent task requirements can be pre-set for the same training task, and one task instruction template can be selected from the corresponding task instruction templates to generate instruction information when generating multi-task training samples. By using different expressions to describe the same training task, the situation where the model to be trained is only adapted to a fixed instruction expression can be reduced, so that the resulting multi-task training samples have richer instruction expression forms.Multi-task training samples include at least two of the following: question-answering samples, inference samples, constraint samples, counterexample samples, comparison samples, thought chain samples, and soft-label samples. Question-answering samples can convert fire-resistant entities or their attributes into questions and corresponding answers. For example, they can form question-answer content based on the correspondence between specific spectral bands and combustibles, enabling the model to learn basic fire prevention knowledge. Inference samples can be formed based on the relationships between multiple fire-resistant entities in a fire prevention knowledge graph, and corresponding inference criteria can be added between the input information and the labeled information, enabling the model to learn to determine the processing result based on the relationships between fire-resistant entities. Constraint samples can be formed based on the physical rules in fire prevention knowledge data, and corresponding physical requirements can be set in the instruction information, ensuring that the training output conforms to the corresponding physical change laws. Counterexample samples can use erroneous conclusions that violate physical change laws as negative examples, and configure correct labeling information corresponding to the input information. For example, when the detection data corresponding to multiple spectral ranges clearly does not conform to a certain fire conclusion, this erroneous fire conclusion can be formed as a counterexample sample, enabling the model to distinguish between outputs that conform to and do not conform to physical change laws during training. Comparison samples can be set up to distinguish between samples that conform to and violate the laws of physical change, and the difference between the two samples can be used to enhance the ability of the model to distinguish different detection states. Thought chain samples can be formed by creating training samples containing intermediate reasoning content based on the relationship paths in the fire prevention knowledge graph, so that the deductive relationships between input information, fire prevention knowledge, and annotation information can be reflected in the training samples. Soft-label samples can determine the probability or confidence level of different candidate results based on fire prevention knowledge in the fire prevention knowledge graph, rather than using only a single defined category as annotation information, thus allowing the proximity between different categories to participate in model training.

[0098] Labeling information represents the expected correct output corresponding to the input and instruction information. It can serve as reference information for evaluating whether the model's output meets the training objectives during subsequent training. Labeling information can take different data forms depending on the output requirements of different training tasks. For example, labeling information can take the form of text content, category information, or structured information organized according to preset fields.

[0099] The input information for the training samples to be generated (i.e., subsequent multi-task training samples) can be determined by filtering, grouping, concatenating, or converting the detection data. Further processing of the detection data based on the correspondence between multiple detection data points can also be performed to ensure that the input information reflects the correlation between different detection data points. The following section will further explain the process of determining the input information using one possible implementation method.

[0100] In one possible implementation, determining the input information based on the detection data includes: determining whether the changes in the detection data corresponding to different spectral ranges conform to the physical change law information; and if they do not conform to the physical change law information, determining whether each of the detection devices is abnormal. If none of the detection devices are abnormal, acquiring historical detection data corresponding to each detection device, wherein the historical detection data is the detection data collected by the corresponding detection device before acquiring the current detection data, and determining the reliability of each detection data based on the historical detection data of each detection device. Weighting the detection data based on the reliability of each detection data to obtain fused detection data, and determining the input information based on the fused detection data.

[0101] Specifically, the changes in detection data corresponding to different spectral ranges can represent the changing trends of each detection data as the fire state changes within the same fire process or time range, as well as the corresponding relationships between different detection data. The actual detection data can be compared with the expected change relationships of the detection data corresponding to different spectral ranges recorded in the physical change law information to determine whether the changes in the actual detection data conform to the physical change law information. This determination can be made using methods such as rule matching or deviation comparison. For example, the change direction, response state, or numerical range that different detection data should meet under the corresponding fire state can be predetermined based on the physical change law information, and the actual detection data can be compared with the corresponding expected change relationship. When the actual detection data meets the corresponding expected change relationship, it can be determined that the changes in the different detection data conform to the physical change law information. When there is a conflict between the actual detection data and the corresponding expected change relationship, it can be determined that the changes in the different detection data do not conform to the physical change law information. In some embodiments, the deviation between the actual detection data and the corresponding expected change result can also be calculated separately, and the overall deviation degree can be determined based on multiple deviations. When the overall deviation degree exceeds a preset deviation threshold, it can be determined that the changes in the different detection data do not conform to the physical change law information. Judging by the degree of deviation can prevent slight fluctuations in detection data from being directly identified as inconsistent with the laws of physical change. For example, when the detection data corresponding to a certain spectral range shows a clear flame response, and according to the laws of physical change, other spectral ranges corresponding to this detection data should also show corresponding changes under the current fire condition, but the actual detection data does not show corresponding changes, it can be determined that there is a conflict of change between different detection data. In this case, instead of directly determining the input information based on one detection data, it is necessary to further judge whether there are abnormalities in each detection device, thereby distinguishing between the true differences between detection data and data conflicts caused by detection device abnormalities. Detection device abnormalities can indicate that the data currently collected by the detection device cannot properly reflect the state of the corresponding detection object. The presence of abnormalities in the corresponding detection device can be judged based on whether the detection data exceeds the detection device's range, remains unchanged within a continuous time range, has abnormal jumps between adjacent sampling values, continuously outputs zero values, or has missing detection data. The above fault manifestations can be judged based on the normal operating range and historical operating status of the detection device. For example, when the detection data remains exactly the same for multiple consecutive sampling times, while the corresponding detection object has changed significantly within that time range, the corresponding detection device can be identified as possibly having a data stagnation abnormality. You can also set corresponding anomaly detection conditions for different types of anomalies. When the detection data meets any of the anomaly detection conditions, the corresponding detection device can be identified as an anomaly detection device.When none of the test data meets the corresponding anomaly judgment conditions, it can be determined that there are no anomalies in the test equipment. By first checking for anomalies in the test equipment, the amount of erroneous test data caused by test equipment failure or data loss can be reduced from entering the subsequent fusion processing. Historical test data can represent the test data that the corresponding test equipment has collected and saved before the current test data collection. Historical test data can be obtained from the local storage location of the corresponding test equipment, historical test database, or other data storage locations. Historical test data within a preset time range before the current moment can be used as the data basis for calculating reliability, so that the obtained reliability can reflect the recent operating status of the test equipment.

[0102] Credibility represents the degree to which corresponding detection data can be accepted in the current fusion processing. Higher credibility indicates that the corresponding detection data is currently more stable and more consistent with the historical correspondence with other detection data. Recent stability, in-range proportion, and historical consistency rate with corresponding detection data from other detection devices can be determined based on the historical detection data of the corresponding detection device, and the credibility of the corresponding detection data can be determined based on the above information. Recent stability represents the degree to which the historical detection data collected by the corresponding detection device maintains a normal fluctuation state within a preset time range. Recent stability can be determined based on the fluctuation amplitude or the proportion of abnormal data in the historical detection data. In-range proportion represents the proportion of historical detection data within the normal detection range of the corresponding detection device to the total number of historical detection data. Historical consistency rate represents the proportion of historical detection data from the corresponding detection device that satisfies the physical change law information between historical detection data from other spectral ranges and historical detection data from other spectral ranges. In some embodiments, recent stability, in-range proportion, and historical consistency rate can be normalized and the credibility of the detection data can be determined according to preset weights. For example, the credibility of the i-th detection data... It can be determined according to the following formula:

[0103]

[0104] in, This can represent the recent stability of the i-th detection device. This can represent the percentage within the measurement range corresponding to the i-th detection device. This can represent the historical consistency rate between the detection data of the i-th detection device and the corresponding detection data of other detection devices. , and Each can represent a corresponding preset weight, and can satisfy... + + =1. Each preset weight can be pre-set according to the data stability of different testing equipment and application requirements. By simultaneously considering the operating status of the testing equipment itself and the historical correspondence between different testing data, the bias caused by determining the reliability based on only a single indicator can be avoided.

[0105] After determining the confidence level of each detection data point, the corresponding fusion weight can be determined based on each confidence level. When different detection data points have different numerical ranges or data units, the detection data can be normalized or standardized before weighting to avoid the different numerical scales directly affecting the fusion result. Optionally, the fusion weight corresponding to the i-th detection data point... It can be determined according to the following formula:

[0106]

[0107] in, This can represent the number of detection data points involved in the fusion. This can represent the confidence level corresponding to the i-th detection data. It can represent the sum of the confidence levels of each detection data point involved in the fusion.

[0108] The sum of all fusion weights can be 1, and detection data with higher credibility has a greater impact on the fused detection data. Fusion detection data can represent data obtained after comprehensive processing of multiple detection data and their corresponding credibility. For detection data that can be directly fused numerically, weighted calculations can be performed based on the fusion weights corresponding to each detection data. For detection data that cannot be directly calculated on the same numerical scale, corresponding detection results or detection features can be extracted from each detection data separately, and then weighted and combined according to their respective credibility. This allows for the preservation of detection information from different spectral ranges while reducing the impact of data with lower credibility on the fusion results. The fusion weights corresponding to each detection data can also be used to determine whether the detection conclusions of different detection data have sufficient consistency. For example, the fusion weights corresponding to detection data supporting the same detection conclusion can be accumulated to obtain the weighted consistency rate corresponding to that detection conclusion. When the highest weighted consistency rate reaches a preset consistency rate threshold, the corresponding fused detection data can be used; when the highest weighted consistency rate is lower than the preset consistency rate threshold, it can be determined that there is still a significant conflict between the current multiple detection data, and a detection data conflict warning can be output instead of forcibly determining a fire analysis conclusion based on the current detection data. The preset consistency rate threshold can be set to 60%. By using the above methods, we can avoid forming definitive fire analysis conclusions based on only a portion of the detection data when there are obvious conflicts in the detection data corresponding to multiple normal detection devices.

[0109] Therefore, by first investigating potential equipment malfunctions when conflicting physical variations occur in detection data across different spectral ranges, and then determining the reliability of each detection data point based on historical data when no malfunctions exist, and finally performing weighted fusion based on reliability, it is possible to distinguish between data anomalies caused by equipment failures and genuine detection differences between normal equipment. Simultaneously, by assigning greater fusion weights to detection data with stable operating conditions and high historical consistency, the impact of random fluctuations or low-reliability detection data on the fused detection data can be reduced, thus providing more reliable multispectral detection data for subsequent input information determination.

[0110] To further characterize the correlation between detection data corresponding to different spectral ranges, in one possible implementation, the plurality of detection devices includes at least two of visible light imaging devices, infrared thermal imaging devices, and ultraviolet sensing devices. The detection data includes at least two of visible light image data acquired by the visible light imaging device, infrared thermal imaging data acquired by the infrared thermal imaging device, and ultraviolet detection data acquired by the ultraviolet sensing device. Determining the input information based on the fused detection data includes: extracting detection features corresponding to each detection data from the fused detection data, wherein the detection features include at least two of visual features, temperature distribution features, and temporal features corresponding to the at least two types of detection data, respectively. The visual features correspond to the visible light image data, the temperature distribution features correspond to the infrared thermal imaging data, and the temporal features correspond to the ultraviolet detection data. Based on a cross-attention mechanism, each detection feature is mapped to a unified semantic feature space. Attention weights are calculated between the mapped detection features, and cross-modal associations are established between the detection features based on the attention weights to obtain cross-modal alignment features. The input information is then determined based on the cross-modal alignment features.

[0111] Specifically, visible light imaging equipment can be used to acquire visible light image data corresponding to flame morphology, smoke morphology, and brightness distribution; infrared thermal imaging equipment can be used to acquire infrared thermal imaging data corresponding to the temperature distribution of the fire source area, surrounding area, or target area; and ultraviolet sensing equipment can be used to acquire ultraviolet detection data of flame radiation response changes over time. In actual deployment, two or three of these detection devices can be selected to jointly acquire detection data based on the installation conditions of the fire monitoring area, the type of monitoring object, and task requirements. This allows for joint characterization of the same fire process from different spectral ranges. When extracting detection features corresponding to each detection data from the fused detection data, feature extraction can be performed separately according to the data type. For visible light image data, visual features reflecting flame appearance, smoke outline, and brightness changes can be extracted. For infrared thermal imaging data, temperature distribution features reflecting temperature levels, temperature gradients, and heat source distribution can be extracted. For ultraviolet detection data, temporal features reflecting response intensity, response change trends, and temporal continuity can be extracted. This allows detection data corresponding to different spectral ranges to form detection features suitable for subsequent joint processing. After obtaining the detection features, they can be aligned based on a cross-attention mechanism. Specifically, visual features, temperature distribution features, and temporal features can be mapped to a unified semantic feature space, and attention weights between the detection features can be calculated within this unified semantic feature space. These attention weights characterize the correlation strength between different detection features, enabling a detection feature to focus on other detection features more relevant to the current task during feature representation. This establishes cross-modal correlations between different detection features, resulting in cross-modal aligned features. These cross-modal aligned features can be directly used as input information, or they can be further concatenated, compressed, or aggregated before being used as input information. Through this approach, the input information can not only include detection results from different spectral ranges but also reflect the correlations between different detection features, thereby improving the expressive power of the input information on the fire state.

[0112] Using the above method can more fully integrate the detection content of different spectral ranges into the obtained input information, thereby improving the adaptability of the input information to subsequent training tasks.

[0113] The above describes how to obtain input information. The following will describe how to determine the corresponding annotation information based on the input information.

[0114] In one possible implementation, determining the annotation information based on the input information and the fire prevention knowledge data containing the physical change law information includes: determining the annotation information according to the input information and the instruction information, based on the fire prevention entities in the fire prevention knowledge graph and the relationships between the fire prevention entities.

[0115] Specifically, based on the detection features contained in the input information, fire-resistant entities corresponding to the detection features can be searched in the fire protection knowledge graph. Furthermore, other fire-resistant entities related to the found fire-resistant entities and their corresponding relationships can be obtained. Matching can be performed by the name, attributes, or detection features of fire-resistant entities and their corresponding relationships. Alternatively, fire-resistant knowledge related to the input information can be searched along established relationships between fire-resistant entities. Instruction information can be used to limit the output content required for this annotation. Based on the training task corresponding to the instruction information, fire-resistant knowledge that supports the corresponding output can be selected from the fire-resistant entities and relationships related to the input information, and annotation information can be determined based on the selected fire-resistant knowledge. Thus, even if the same input information corresponds to multiple fire-resistant entities and relationships, annotation information corresponding to the corresponding training task can be formed based on different instruction information. In some embodiments, when the input information involves detection features corresponding to different spectral ranges, the annotation results obtained based on fire-resistant entities and other relationships can be verified by combining the multispectral physical evolution relationships in the fire protection knowledge graph. When the annotation results are consistent with the corresponding multispectral physical evolution relationships, the annotation results can be determined as annotation information. This reduces the likelihood of inconsistencies between the annotation information and the physical variation patterns of multispectral detection data when relying solely on a single fire-resistant entity. Entities, relationships, and multispectral physical evolution relationships within the fire protection knowledge graph can all serve as annotation bases. For example, when the input information contains detection features corresponding to multiple spectral ranges, the corresponding fire-resistant entities can be matched based on the detection features. Then, the required output content can be determined according to the instruction information, and knowledge content supporting the output can be obtained along the corresponding fire-resistant entity relationships. Finally, the output can be checked against the current detection features using multispectral physical evolution relationships to obtain the corresponding annotation information.

[0116] Therefore, by inputting information, we can determine the fire protection entities and relationships related to the current detection data, use instruction information to limit the annotation content, and combine the relationships in the fire protection knowledge graph to determine the annotation information. This allows the obtained annotation information to correspond to both the actual detection content and the training task, thereby improving the matching degree between the annotation information and the input and instruction information.

[0117] Step 203: Generate multi-task training samples based on the input information, the instruction information, and the annotation information. The multi-task training samples are used to train the model to be trained to obtain a fire early warning model.

[0118] Specifically, a multi-task training sample can represent a data unit formed for training a model under training across multiple training tasks. Each multi-task training sample can contain corresponding input information, instruction information, and annotation information. The input information serves as the processing object for the model under training, the instruction information indicates the training task the model needs to complete, and the annotation information represents the expected output for that training task. Multi-task training samples can be generated by directly organizing the input, instruction, and annotation information according to a preset data structure, or by pre-establishing training sample templates corresponding to different training tasks and filling the corresponding templates with the input, instruction, and annotation information. Using training sample templates ensures that training samples for different training tasks have a relatively uniform data format, facilitating subsequent batch input into the model under training. In some embodiments, the input, instruction, and annotation information can also be converted into a data format suitable for fine-tuning model instructions. For example, a multi-task training sample can be organized into three parts: system prompts, user instructions, and expected output. The system prompts can define the processing scenario corresponding to the fire prevention task, the user instructions can be formed based on the instruction information, and the expected output can be formed based on the annotation information. Using the above format, the generated multi-task training samples can be directly used for subsequent fine-tuning of the model's instructions. The model to be trained can represent a model that has not yet completed the training process corresponding to the embodiments of this application. The generated multi-task training samples can be input into the model to be trained, and the model parameters can be adjusted according to the difference between the output generated by the model to be trained in response to the input information and instruction information and the corresponding labeled information, thereby obtaining a fire early warning model. The specific model training process will be further described in later embodiments and will not be repeated here.

[0119] The above describes a method for generating training samples for a fire early warning model provided by embodiments of this application. The following will describe a method for training a fire early warning model provided by embodiments of this application.

[0120] Reference Figure 4 , Figure 4 A flowchart illustrating a training method for a fire early warning model provided in this application embodiment is shown below. Figure 4 As shown, the training method for the fire early warning model provided in this application embodiment may include steps 401 to 402, which are described in detail below.

[0121] Step 401: Obtain multi-task training samples, wherein the multi-task training samples are training samples generated using the training sample generation method of the fire early warning model in any of the foregoing embodiments.

[0122] Step 402: Train the model to be trained based on the multi-task training samples to obtain the fire early warning model.

[0123] Specifically, the meaning of the model to be trained can be found in the aforementioned embodiments, and will not be repeated here. Multi-task training samples can be input into the model to be trained in preset batches, allowing the model to generate training outputs based on the input and instruction information in the multi-task training samples. The model parameters are then adjusted based on the difference between the training outputs and the corresponding labeled information. This training process can be repeated until a preset training termination condition is reached, thereby obtaining a fire early warning model. The preset training termination condition can be determined based on the number of training rounds, training loss, or the model's processing results on validation data. For example, training can end when a preset number of training rounds is reached, or when the training loss decreases to a preset range and stabilizes. In some embodiments, training can be completed by updating all model parameters of the model to be trained, or some of the original model parameters can be kept unchanged, and trainable parameters can be set for efficient parameter training. Using the method of updating all model parameters allows for adjustment of the overall model parameters based on multi-task training samples. Using the parameter-efficient training method reduces the number of model parameters that need to be updated, thereby reducing the computational resources required during training. The specific method for updating model parameters can be determined based on the model size and training resources available for the model to be trained.

[0124] By acquiring multi-task training samples obtained using the aforementioned fire early warning model training sample generation method, and using these multi-task training samples to train the model to be trained, the input information, instruction information, and annotation information used during the training process can be kept consistent with the aforementioned training sample generation process. This allows the model to be trained to adjust its parameters based on the training content corresponding to different training tasks, thereby obtaining a fire early warning model for fire monitoring and early warning scenarios.

[0125] In the above training process, the physical change law information in the fire prevention knowledge data can be further used to constrain the training process of the model to be trained. The following is a further explanation of a possible implementation method.

[0126] In one possible implementation, training the model to be trained based on the multi-task training samples includes: acquiring physical rules, which are determined based on physical change patterns in fire prevention knowledge data used to generate the multi-task training samples; inputting the multi-task training samples into the model to be trained to obtain a training output, and determining a training loss based on the training output and the annotation information in the multi-task training samples; determining a physical residual based on the deviation between the training output and the physical rules, using the physical residual as a regularization term for the training loss, and updating the model parameters of the model to be trained based on the training loss including the regularization term.

[0127] Specifically, physical rules can represent rules formed based on the physical change patterns in fire prevention knowledge data, used to determine whether the training output conforms to known fire physics. Physical correspondences between detection data corresponding to different spectral ranges can be converted into physical rules. For example, corresponding physical rules can be formed based on the correspondence between spectral band response and temperature change, or the correspondence between combustibles and spectral characteristics. For physical relationships that need to be strictly satisfied, the corresponding content can be set as hard physical requirements. Multi-task training samples can be input into the model to be trained, and the model can generate training outputs based on the input and instruction information in the multi-task training samples. The training loss can be determined based on the difference between the training output and the corresponding labeled information, allowing the model to learn the correct output corresponding to different training tasks by reducing the training loss. Physical residuals can represent the deviation between the training output and the output state required by the physical rules. The fire prevention conclusions represented by the training output can be compared with the corresponding physical rules, and the physical residuals can be determined based on the degree of non-compliance with the physical rules. The more the training output conforms to the corresponding physical rules, the smaller the physical residuals can be. The greater the deviation between the training output and the corresponding physical rules, the larger the physical residuals can be. The physical residual can be used as a regularization term in the training loss, so that model parameter updates are affected not only by the difference between the training output and the labeled information, but also by whether the training output conforms to physical rules. Thus, when the training output is close to the labeled information but deviates significantly from the corresponding physical rules, the physical residual can be used to increase the corresponding training loss, thereby suppressing outputs that do not conform to physical laws during model parameter updates. In some embodiments, low-rank adaptation (LoRA) can be used to update the model parameters of the model to be trained. This method keeps the original main model parameters of the model unchanged and updates the low-rank increment matrix set in the model according to the training loss including the regularization term, thereby reducing the number of model parameters that need to be updated during training. By updating the low-rank increment matrix, the probability preference of the model to output results that conform to physical rules can be adjusted.

[0128] In this embodiment, by forming physical rules based on physical change information and using the physical residual between the training output and the physical rules as a regularization term for the training loss, the model parameter update can be affected by both the annotation information and the physical change law. This allows the trained fire early warning model to not only learn the task results in the training samples, but also learn the physical laws corresponding to detection data in different spectral ranges during the model parameter update process, reducing the possibility of the model generating outputs that conflict with known physical laws.

[0129] After obtaining the fire early warning model, the output results of the fire early warning model can be further verified using actual detection data and corresponding physical rules, and the verification results can be used to retrain the fire early warning model. The specific implementation method is explained below.

[0130] In one possible implementation, the training method of the fire early warning model further includes: acquiring detection data collected by multiple detection devices and the credibility of each detection data, and inputting the detection data into the trained fire early warning model to obtain an output to be verified. If the credibility of the detection data is not lower than a preset credibility threshold, a verification score between the output to be verified and the detection data is determined according to the physical rules, whereby the verification score characterizes the degree of consistency between the output to be verified and the corresponding detection data under the physical rules. If the credibility of the detection data is lower than the preset credibility threshold, the verification score between the output to be verified and the detection data is determined as a preset score. A comprehensive verification score for the output to be verified is determined based on the verification scores of each detection data. If the comprehensive verification score is lower than a preset score threshold, annotation information corresponding to the detection data is acquired, and counterexample samples and constraint samples are generated based on the detection data and the annotation information. The counterexample samples and constraint samples are added to the multi-task training samples to obtain updated multi-task training samples, and the fire early warning model is retrained based on the updated multi-task training samples.

[0131] Specifically, the method for determining the credibility of each detection data point can be found in the aforementioned embodiments, and will not be repeated here. The output to be verified can represent the fire assessment result generated by the trained fire early warning model based on the current detection data. The consistency between the output to be verified and the detection state reflected by each detection data point can be determined according to physical rules, and the corresponding verification score can be determined accordingly. The verification score can be used to quantify the degree of consistency between the output to be verified and the corresponding detection data under physical rules. In some embodiments, the expected performance of different detection data can be preset according to physical rules. For example, when the output to be verified indicates the presence of a fire, it can be determined whether the corresponding detection data exhibits the corresponding response specified by the physical rules. When the detection data and the output to be verified conform to the corresponding physical rules, a higher verification score can be determined. When there is a physical conflict between the detection data and the output to be verified, a lower verification score can be determined. The case of conforming to the physical rules can be recorded as passed and assigned a value of 1, while the case of not conforming to the physical rules can be recorded as abnormal and assigned a value of 0. A preset credibility threshold can be used to determine whether the current detection data is suitable for participating in normal physical consistency judgment. When the credibility of the detection data is not lower than the preset credibility threshold, the verification score can be determined according to the aforementioned physical rules. When the confidence level of the detected data is lower than a preset confidence level threshold, the corresponding detected data can be regarded as detected data that cannot be reliably judged at present, and the verification score is determined to be the preset score. For example, in some embodiments, the preset score can be set to 0.5, so that low-confidence detected data is neither processed according to physical rules nor according to physical rules violations, thereby reducing the impact of low-confidence detected data on the final verification result.

[0132] The comprehensive verification score represents the overall physical consistency of the output to be verified after integrating the verification results of each detection data point. The verification scores can be weighted according to the importance of each detection data point, and the comprehensive verification score is determined based on the weighting result. For example, the comprehensive verification score can be converted to a score range of 0-100. A preset score threshold can be used to determine whether there are obvious physical inconsistencies in the output to be verified that require retraining of the fire early warning model. When the comprehensive verification score is lower than the preset score threshold, the correct annotation information corresponding to the current detection data can be obtained, and counterexample samples and constraint samples can be generated respectively. Counterexample samples can be used to record the erroneous outputs generated by the current fire early warning model and their corresponding correct annotation information, while constraint samples can be used to record the physical rule requirements that the current detection data should meet. These counterexample samples and constraint samples can be added to the original multi-task training samples, and the fire early warning model can be retrained specifically using the updated multi-task training samples. Different output processing intervals can also be set according to the comprehensive verification score. For example, the current output can be rejected when the overall verification score is low, a low-confidence warning can be set for the current output and a review can be performed when the overall verification score is in the middle range, and the output can be output normally when the overall verification score is high. For instance, scores below 40 can be set as the rejection range, scores between 40 and 95 as the review range, and scores above 95 as the normal output range. The specific scores mentioned above can be set according to actual application requirements.

[0133] In this embodiment, by combining the reliability of the detection data and physical rules to verify each output of the fire early warning model, the interference of low-reliability detection data on the judgment of physical consistency can be reduced. Furthermore, when the comprehensive verification score is low, the corresponding detection data and correct annotation information are converted into negative examples and constraint samples and retrained. This can supplement the training data for the physically inconsistent outputs that have been exposed, thereby reducing the possibility that the fire early warning model will generate the same type of erroneous output again in the future.

[0134] In addition to retraining the fire early warning model based on the output to be verified, it is also possible to determine whether incremental training of the fire early warning model is needed based on the changes in the characteristic distribution of the detection data during operation. The following section further explains one possible implementation method.

[0135] In one possible implementation, the training method for the fire early warning model further includes: acquiring historical detection data from multiple detection devices operating normally, wherein the multiple detection devices are detection devices that collect detection data for generating the multi-task training samples; determining a baseline feature distribution corresponding to each detection device based on the value distribution of detection features in the historical detection data; determining a corresponding current feature distribution based on the value distribution of detection features in the detection data collected by each detection device; comparing each current feature distribution with the corresponding baseline feature distribution to determine the degree of feature drift of each detection data; and determining whether each detection device is abnormal when at least one of the feature drift degrees reaches a preset drift threshold, and incrementally training the fire early warning model based on the degree of feature drift and the abnormality of each detection device.

[0136] Specifically, historical detection data under normal operating conditions represents the detection data collected when the detection equipment is operating normally and no fire has occurred in the corresponding monitoring area. Corresponding detection features can be extracted from the historical detection data accumulated by each detection device during stable operation, and the typical value range and fluctuation of these features under normal conditions can be statistically analyzed to determine the baseline feature distribution for each detection device. The baseline feature distribution can serve as a basis for judging whether the distribution of subsequent detection data has changed. The baseline feature distribution represents the statistical distribution of the corresponding detection features when the detection equipment is operating normally, and can be characterized by the average value, value range, distribution shape, and degree of fluctuation of the detection features. The current feature distribution represents the distribution of detection features corresponding to the detection data collected by the detection equipment within the current monitoring time range. Detection data can be divided according to preset time windows, and the current feature distribution can be determined based on the value of the detection features within each preset time window. For example, a time window can be formed according to one hour or other preset duration, and the current feature distribution corresponding to each time window can be compared with the baseline feature distribution. Using time windows for comparison can reduce the possibility of accidental fluctuations at a single sampling moment directly triggering model updates. Feature drift indicates the degree to which the current feature distribution changes relative to a baseline feature distribution. The degree of feature drift can be determined based on factors such as the deviation of the detected feature's mean, the change in its distribution shape, and the proportion of data exceeding the normal range. The more significant the difference between these indicators and the baseline feature distribution, the greater the degree of feature drift. For example, the comparison results of multiple consecutive time windows can be used to determine whether a preset drift threshold has been reached. For instance, if the feature drift degree in multiple consecutive time windows reaches the corresponding threshold, then it can be determined that the detected data has experienced persistent feature drift. For example, three consecutive time windows can be used for judgment, and a mean deviation of 20% or an out-of-range proportion of 15% can be used as the reference threshold for the corresponding detected feature. The number of time windows and the specific thresholds can be set according to the type of detection equipment and actual operating conditions. This allows for the differentiation between persistent distribution changes and short-term data fluctuations.

[0137] When the feature drift of at least one detection data reaches a preset drift threshold, it can be further determined whether each detection device is abnormal. The specific meaning of detection device abnormality can be found in the aforementioned embodiments. This can also be determined based on whether the detection device is experiencing data jamming, a sudden increase in noise, or detection data exceeding the device's measurement range. By determining detection device abnormalities before incremental training, it is possible to avoid directly using the detection feature shift caused by detection device malfunction as a change in actual data distribution to update the fire warning model. It can be further determined whether incremental training of the fire warning model is necessary based on the feature drift of each detection data and the abnormality of each detection device. Incremental training can mean adjusting the model parameters based on the already obtained fire warning model, using newly added valid detection data or training samples formed from the newly added detection data, without having to re-execute the complete initial training process. The following will explain how to determine incremental training data by combining the feature drift corresponding to different spectral ranges and the abnormality of the detection devices, depending on the specific circumstances.

[0138] Therefore, by establishing a baseline feature distribution using historical detection data during normal operation of the detection equipment, and comparing the current feature distribution with the corresponding baseline feature distribution, continuous distribution changes in the detection data relative to the normal state can be identified. Furthermore, by considering any abnormal conditions of the detection equipment before triggering incremental training, the possibility of incorrect updates to the fire warning model due to equipment malfunctions or instantaneous data fluctuations can be reduced, thus enabling incremental training to more effectively address changes in the actual distribution of the detection data.

[0139] In one possible implementation, the incremental training of the fire early warning model based on the drift degree of each feature and the abnormality of each detection device includes: when there are no abnormalities in each of the detection devices, determining whether the feature drift degree of the detection data corresponding to at least two different spectral ranges reaches the preset drift threshold; and if the preset drift threshold is reached, generating incremental training samples based on the detection data whose feature drift degree reaches the preset drift threshold, and performing incremental training on the fire early warning model based on the incremental training samples.

[0140] Specifically, assuming no abnormalities exist in any of the detection devices, the degree of feature drift of the detection data corresponding to different spectral ranges can be further compared. Here, if the feature drift of the detection data corresponding to at least two different spectral ranges reaches a preset drift threshold, it indicates that the detection data of at least two different spectral ranges have changed to a preset degree relative to their respective baseline feature distributions. By combining the detection data of different spectral ranges for judgment, incremental training of the fire early warning model can be avoided by directly triggering it based on the change of a single detection data point. Furthermore, the feature drift situation over multiple consecutive time windows can be combined to determine whether the detection data corresponding to different spectral ranges have undergone coordinated changes. For example, when the detection data corresponding to at least two different spectral ranges reach the preset drift threshold over multiple consecutive time windows, and the corresponding changes do not significantly conflict with the information on physical change patterns, the corresponding detection data can be identified as the detection data for incremental training. This can reduce erroneous model updates caused by short-term fluctuations or slow anomalies from a single data source.

[0141] Incremental training samples can be generated from detection data whose feature drift reaches a preset drift threshold. Specifically, the training sample generation method described above can be followed, with input information generated based on the corresponding detection data, and instruction and annotation information configured in conjunction with relevant fire prevention knowledge data to generate incremental training samples. When the detection data exhibiting feature drift reveals novel spectral features not fully covered in the existing training samples, comparative samples or soft-labeled samples can also be generated based on the novel spectral features to supplement the fire early warning model's training data for the novel detection features.

[0142] Incremental training samples can be input into an already trained fire early warning model, and the model parameters can be updated based on these samples. Alternatively, only some trainable parameters in the fire early warning model can be updated, thereby enabling the model to further learn the detection data features after persistent feature drift while retaining its existing capabilities.

[0143] In this embodiment, by using feature drift from detection data corresponding to at least two different spectral ranges as the basis for incremental training when all detection devices are functioning normally, the possibility of unnecessary model updates caused by abnormal fluctuations in a single detection data point can be reduced. Furthermore, by using the detection data with effective feature drift to generate incremental training samples, the fire early warning model can be adaptively updated to new data distributions that emerge during operation, thereby improving the fire early warning model's ability to process subsequently changed detection data.

[0144] In the event of an abnormality in the detection equipment, the detection data collected by the abnormal detection equipment can be excluded first. Then, the incremental training can be determined based on the feature drift of the remaining detection data. The following section will explain another possible implementation method.

[0145] In one possible implementation, the incremental training of the fire early warning model based on the drift degree of each feature and the anomaly status of each detection device includes: excluding detection data collected by an abnormal detection device when such an abnormal device exists; determining whether the feature drift degree of detection data corresponding to at least two different spectral ranges in the remaining detection data reaches a preset drift threshold; and if it reaches the preset drift threshold, generating incremental training samples based on the remaining detection data whose feature drift degree reaches the preset drift threshold, and incrementally training the fire early warning model based on the incremental training samples.

[0146] Specifically, in the presence of abnormal detection equipment, the detection data collected by the abnormal equipment can be excluded from the data used to determine feature drift. The remaining detection data can represent the detection data collected by other normal detection equipment after excluding the data collected by the abnormal equipment. By excluding the data corresponding to the abnormal equipment, feature shifts caused by anomalies such as equipment jamming, sudden noise increases, or range overflow can be avoided from being incorrectly used in the incremental training of the fire warning model. If the feature shift originates solely from the abnormal equipment, incremental training of the fire warning model can be avoided. After excluding the detection data collected by the abnormal equipment, it can be further determined whether the remaining detection data still includes detection data corresponding to at least two different spectral ranges, and whether the feature drift of each detection data reaches a preset drift threshold. When the detection data corresponding to at least two different spectral ranges in the remaining detection data all reach the preset drift threshold, it can be determined that there is still a change in the distribution of multi-source features after excluding the influence of equipment anomalies. If, after excluding the abnormal equipment, only the detection data corresponding to one spectral range reaches the preset drift threshold, incremental training can be temporarily suspended to reduce the possibility of incorrect model updates caused by changes in a single data source. Optionally, cross-validation can be performed using the relationships between remaining detection data. For example, when at least two different spectral ranges of remaining detection data show persistent feature drift, and there is no obvious physical conflict between the changes in different detection data, the corresponding remaining detection data can be identified as data for generating incremental training samples. Cross-validation using remaining normal data can further distinguish between real data distribution changes and local shifts caused by detection equipment malfunctions. Also, after eliminating faulty channels, cross-validation is performed using other data sources before deciding whether to update the model. Incremental training samples can be generated based on remaining detection data whose feature drift reaches a preset drift threshold. The specific method for generating incremental training samples can be found in the aforementioned example of generating multi-task training samples, and will not be repeated here. For new detection features that appear during operation, corresponding training samples can be supplemented based on the corresponding remaining detection data, and the incremental training samples can be used to continue updating the model parameters of the fire early warning model.

[0147] In this embodiment, by first excluding the detection data collected by the abnormal detection equipment, and then using the feature drift characteristics of at least two different spectral ranges in the remaining normal detection data to determine the incremental training data, the possibility of equipment failure data entering the training process and contaminating the parameters of the fire early warning model can be reduced. Simultaneously, by retaining the true distribution changes reflected by other normal detection equipment, the complete discarding of data with training value at the current stage due to the malfunction of some detection equipment can be avoided, thereby improving the reliability of the incremental training triggering process.

[0148] The above describes a method for generating training samples for a fire early warning model and a method for training a fire early warning model, as provided in the embodiments of this application. The following will describe the apparatus for performing the above-described method for generating training samples for a fire early warning model.

[0149] Please see Figure 5 , Figure 5 This is a schematic diagram of a training sample generation device for a fire early warning model provided in an embodiment of this application. Figure 5 As shown, the training sample generation device 500 for the fire early warning model includes:

[0150] The acquisition module 501 is used to acquire detection data and fire prevention knowledge data collected by multiple detection devices during the fire evolution process. The multiple detection devices correspond to at least two different spectral ranges, and the fire prevention knowledge data includes information on the physical change patterns between the detection data corresponding to different spectral ranges during the fire evolution process.

[0151] The determination module 502 is used to determine input information based on the detection data, configure corresponding instruction information for the input information based on multiple training tasks, and determine annotation information based on the input information and the fire prevention knowledge data containing the physical change law information;

[0152] The generation module 503 is used to generate multi-task training samples based on the input information, the instruction information and the annotation information. The multi-task training samples are used to train the model to be trained to obtain a fire early warning model.

[0153] In an optional embodiment, the fire prevention knowledge data is represented in the form of a fire prevention domain knowledge graph, the construction of which includes:

[0154] Initial fire prevention knowledge data is acquired, and entity recognition and relationship extraction are performed on the initial fire prevention knowledge data to obtain multiple fire prevention entities and the relationships between the multiple fire prevention entities; wherein, the relationships between the multiple fire prevention entities include at least a multispectral physical evolution relationship, and the physical change law information is characterized by the multispectral physical evolution relationship.

[0155] The fire protection knowledge graph is constructed based on the multiple fire protection entities and the relationships between them.

[0156] In an optional embodiment, the determining module 502 is specifically used for:

[0157] The annotation information is determined based on the input information and the instruction information, according to the fire protection entities in the fire protection knowledge graph and the relationships between the fire protection entities.

[0158] In an optional embodiment, the determining module 502 is specifically used for:

[0159] Determine whether the changes in the detection data corresponding to different spectral ranges conform to the physical change law information, and if they do not conform to the physical change law information, determine whether each of the detection devices is abnormal;

[0160] If there are no abnormalities in any of the aforementioned testing devices, acquire the historical testing data corresponding to each of the aforementioned testing devices. The historical testing data is the testing data collected by the corresponding testing device before the acquisition of the testing data. Determine the reliability of each of the aforementioned testing data based on the historical testing data of each of the aforementioned testing devices.

[0161] The detection data are weighted based on the confidence level of each detection data to obtain fused detection data, and the input information is determined based on the fused detection data.

[0162] In an optional embodiment, the plurality of detection devices includes at least two of a visible light imaging device, an infrared thermal imaging device, and an ultraviolet sensing device, and the detection data includes at least two of the visible light image data acquired by the visible light imaging device, the infrared thermal imaging data acquired by the infrared thermal imaging device, and the ultraviolet detection data acquired by the ultraviolet sensing device; the determining module 502 is specifically used for:

[0163] Detection features corresponding to each detection data are extracted from the fused detection data. The detection features include at least two of the following: visual features, temperature distribution features, and temporal features, which correspond to the at least two types of detection data respectively. The visual features correspond to the visible light image data, the temperature distribution features correspond to the infrared thermal imaging data, and the temporal features correspond to the ultraviolet detection data.

[0164] Based on the cross-attention mechanism, each detection feature is mapped to a unified semantic feature space, the attention weights between the mapped detection features are calculated, and cross-modal associations between the detection features are established according to the attention weights to obtain cross-modal alignment features. The input information is then determined based on the cross-modal alignment features.

[0165] In an optional embodiment, the training task includes at least two of the following: multispectral feature parsing task, alarm analysis task, root cause diagnosis task, emergency suggestion task, and data annotation task.

[0166] The multi-task training samples include at least two of the following: question-answering samples, inference samples, constraint samples, counterexample samples, comparison samples, thought chain samples, and soft-label samples.

[0167] The above describes a method for generating training samples for a fire early warning model, a method for training a fire early warning model, and an apparatus for generating training samples for a fire early warning model, as provided in the embodiments of this application. The apparatus for performing the above-described method for training a fire early warning model will be described below.

[0168] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a training device for a fire early warning model provided in an embodiment of this application. Figure 6 As shown, the training method apparatus 600 for the fire early warning model includes:

[0169] The second acquisition module 601 is used to acquire multi-task training samples, wherein the multi-task training samples are training samples generated using the training sample generation method of the fire early warning model in any of the foregoing embodiments.

[0170] The training module 602 is used to train the model to be trained based on the multi-task training samples to obtain the fire early warning model.

[0171] In an optional embodiment, the training module 602 is specifically used for:

[0172] Obtain physical rules, which are determined based on information about the physical change patterns in the fire prevention knowledge data used to generate the multi-task training samples;

[0173] The multi-task training samples are input into the model to be trained to obtain the training output, and the training loss is determined based on the training output and the annotation information in the multi-task training samples.

[0174] The physical residual is determined based on the deviation between the training output and the physical rule. The physical residual is used as a regularization term for the training loss. The model parameters of the model to be trained are updated based on the training loss containing the regularization term.

[0175] In an optional embodiment, the apparatus further includes a retraining module for:

[0176] The detection data collected by multiple detection devices and the confidence level of each detection data are obtained, and the detection data are input into the trained fire early warning model to obtain the output to be verified.

[0177] If the credibility of the detection data is not lower than the preset credibility threshold, the verification score between the output to be verified and the detection data is determined according to the physical rules. The verification score is used to characterize the degree of consistency between the output to be verified and the corresponding detection data under the physical rules.

[0178] If the confidence level of the detection data is lower than the preset confidence level threshold, the verification score between the output to be verified and the detection data is determined as the preset score.

[0179] The comprehensive verification score of the output to be verified is determined based on the verification score corresponding to each of the detection data. If the comprehensive verification score is lower than a preset score threshold, the annotation information corresponding to the detection data is obtained. Based on the detection data and the annotation information, counterexample samples and constraint samples are generated. The counterexample samples and constraint samples are added to the multi-task training samples to obtain updated multi-task training samples. The fire early warning model is then retrained based on the updated multi-task training samples.

[0180] In an optional embodiment, the device further includes an incremental training module for:

[0181] Historical detection data of multiple detection devices under normal operating conditions are obtained. The multiple detection devices are detection devices that collect detection data for generating the multi-task training samples. Based on the value distribution of detection features in the historical detection data, the baseline feature distribution corresponding to each detection device is determined.

[0182] The current feature distribution is determined based on the value distribution of the detection features in the detection data collected by each detection device, and each current feature distribution is compared with the corresponding benchmark feature distribution to determine the feature drift degree of each detection data.

[0183] If at least one of the feature drift levels reaches a preset drift threshold, it is determined whether each of the detection devices is abnormal, and based on the drift level of each feature and the abnormality of each detection device, the fire early warning model is incrementally trained.

[0184] In an optional embodiment, the incremental training module is specifically used for:

[0185] If none of the detection devices are abnormal, determine whether the feature drift of the detection data corresponding to at least two different spectral ranges reaches the preset drift threshold. If the preset drift threshold is reached, generate incremental training samples based on the detection data whose feature drift reaches the preset drift threshold, and perform incremental training on the fire early warning model based on the incremental training samples.

[0186] In an optional embodiment, the incremental training module is specifically used for:

[0187] In the event of malfunctioning detection equipment, exclude the detection data collected by the malfunctioning detection equipment.

[0188] Determine whether the feature drift of the detection data corresponding to at least two different spectral ranges in the remaining detection data reaches the preset drift threshold. If the preset drift threshold is reached, generate incremental training samples based on the remaining detection data whose feature drift reaches the preset drift threshold, and perform incremental training on the fire early warning model based on the incremental training samples.

[0189] This application also provides an electronic device in its embodiments. (See reference...) Figure 7 The diagram illustrates a structural schematic of an electronic device suitable for implementing the training sample generation method and the training method of the fire early warning model in the embodiments of this application. The electronic device in the embodiments of this application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0190] like Figure 7 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. When the electronic device is powered on, the RAM 703 also stores various programs and data required for the operation of the electronic device. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0191] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, memory cards, hard drives, etc.; and communication devices 709. Communication device 709 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead.

[0192] This application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device enables the electronic device to implement the training sample generation method and the training method of any of the fire early warning models provided in this application.

[0193] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the fire early warning model training sample generation methods and fire early warning model training methods provided in this application.

[0194] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0195] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0196] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0197] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A method for generating training samples for a fire early warning model, characterized in that, include: The method acquires detection data and fire prevention knowledge data collected by multiple detection devices during the fire evolution process. The multiple detection devices correspond to at least two different spectral ranges, and the fire prevention knowledge data includes information on the physical change patterns between the detection data corresponding to different spectral ranges during the fire evolution process. Input information is determined based on the detection data, and corresponding instruction information is configured for the input information based on multiple training tasks. Labeling information is determined based on the input information and the fire prevention knowledge data containing the physical change law information. Based on the input information, the instruction information, and the annotation information, multi-task training samples are generated. These multi-task training samples are used to train the model to be trained, thereby obtaining a fire early warning model.

2. The method according to claim 1, characterized in that, The fire prevention knowledge data is represented in the form of a fire prevention knowledge graph, and the construction of the fire prevention knowledge graph includes: Initial fire prevention knowledge data is acquired, and entity recognition and relationship extraction are performed on the initial fire prevention knowledge data to obtain multiple fire prevention entities and the relationships between the multiple fire prevention entities; wherein, the relationships between the multiple fire prevention entities include at least a multispectral physical evolution relationship, and the physical change law information is characterized by the multispectral physical evolution relationship. The fire protection knowledge graph is constructed based on the multiple fire protection entities and the relationships between them.

3. The method according to claim 2, characterized in that, The determination of annotation information based on the input information and the fire prevention knowledge data containing the physical change law information includes: The annotation information is determined based on the input information and the instruction information, according to the fire protection entities in the fire protection knowledge graph and the relationships between the fire protection entities.

4. The method according to claim 1, characterized in that, The step of determining input information based on the detection data includes: Determine whether the changes in the detection data corresponding to different spectral ranges conform to the physical change law information, and if they do not conform to the physical change law information, determine whether each of the detection devices is abnormal; If there are no abnormalities in any of the aforementioned testing devices, acquire the historical testing data corresponding to each of the aforementioned testing devices. The historical testing data is the testing data collected by the corresponding testing device before the acquisition of the testing data. Determine the reliability of each of the aforementioned testing data based on the historical testing data of each of the aforementioned testing devices. The detection data are weighted based on the confidence level of each detection data to obtain fused detection data, and the input information is determined based on the fused detection data.

5. The method according to claim 4, characterized in that, The plurality of detection devices include at least two of visible light imaging devices, infrared thermal imaging devices, and ultraviolet sensing devices, and the detection data includes at least two of visible light image data acquired by the visible light imaging device, infrared thermal imaging data acquired by the infrared thermal imaging device, and ultraviolet detection data acquired by the ultraviolet sensing device. Determining the input information based on the fused detection data includes: Detection features corresponding to each detection data are extracted from the fused detection data. The detection features include at least two of the following: visual features, temperature distribution features, and temporal features, which correspond to the at least two types of detection data respectively. The visual features correspond to the visible light image data, the temperature distribution features correspond to the infrared thermal imaging data, and the temporal features correspond to the ultraviolet detection data. Based on the cross-attention mechanism, each detection feature is mapped to a unified semantic feature space, the attention weights between the mapped detection features are calculated, and cross-modal associations between the detection features are established according to the attention weights to obtain cross-modal alignment features. The input information is then determined based on the cross-modal alignment features.

6. A training method for a fire early warning model, characterized in that, include: Obtain multi-task training samples, wherein the multi-task training samples are training samples generated using the method described in any one of claims 1-5; The fire early warning model is obtained by training the model to be trained based on the multi-task training samples.

7. The method according to claim 6, characterized in that, The training of the model to be trained based on the multi-task training samples includes: Obtain physical rules, which are determined based on information about the physical change patterns in the fire prevention knowledge data used to generate the multi-task training samples; The multi-task training samples are input into the model to be trained to obtain the training output, and the training loss is determined based on the training output and the annotation information in the multi-task training samples. The physical residual is determined based on the deviation between the training output and the physical rule. The physical residual is used as a regularization term for the training loss. The model parameters of the model to be trained are updated based on the training loss containing the regularization term.

8. The method according to claim 7, characterized in that, The method further includes: The detection data collected by multiple detection devices and the confidence level of each detection data are obtained, and the detection data are input into the trained fire early warning model to obtain the output to be verified. If the credibility of the detection data is not lower than the preset credibility threshold, the verification score between the output to be verified and the detection data is determined according to the physical rules. The verification score is used to characterize the degree of consistency between the output to be verified and the corresponding detection data under the physical rules. If the credibility of the detection data is lower than the preset credibility threshold, the verification score between the output to be verified and the detection data is determined as the preset score. The comprehensive verification score of the output to be verified is determined based on the verification score corresponding to each of the detection data. If the comprehensive verification score is lower than a preset score threshold, the annotation information corresponding to the detection data is obtained. Based on the detection data and the annotation information, counterexample samples and constraint samples are generated. The counterexample samples and constraint samples are added to the multi-task training samples to obtain updated multi-task training samples. The fire early warning model is then retrained based on the updated multi-task training samples.

9. The method according to any one of claims 6-8, characterized in that, The method further includes: Historical detection data of multiple detection devices under normal operating conditions are obtained. The multiple detection devices are detection devices that collect detection data for generating the multi-task training samples. Based on the value distribution of detection features in the historical detection data, the baseline feature distribution corresponding to each detection device is determined. The current feature distribution is determined based on the value distribution of the detection features in the detection data collected by each detection device, and each current feature distribution is compared with the corresponding benchmark feature distribution to determine the feature drift degree of each detection data. If at least one of the feature drift levels reaches a preset drift threshold, it is determined whether each of the detection devices is abnormal, and based on the drift level of each feature and the abnormality of each detection device, the fire early warning model is incrementally trained.

10. The method according to claim 9, characterized in that, The incremental training of the fire early warning model based on the drift degree of each feature and the anomaly status of each detection device includes: If none of the detection devices are abnormal, determine whether the feature drift of the detection data corresponding to at least two different spectral ranges reaches the preset drift threshold. If the preset drift threshold is reached, generate incremental training samples based on the detection data whose feature drift reaches the preset drift threshold, and perform incremental training on the fire early warning model based on the incremental training samples.

11. The method according to claim 9, characterized in that, The incremental training of the fire early warning model based on the drift degree of each feature and the anomaly status of each detection device includes: In the event of malfunctioning detection equipment, exclude the detection data collected by the malfunctioning detection equipment. Determine whether the feature drift of the detection data corresponding to at least two different spectral ranges in the remaining detection data reaches the preset drift threshold. If the preset drift threshold is reached, generate incremental training samples based on the remaining detection data whose feature drift reaches the preset drift threshold, and perform incremental training on the fire early warning model based on the incremental training samples.

12. A training sample generation device for a fire early warning model, characterized in that, include: The first acquisition module is used to acquire detection data and fire prevention knowledge data collected by multiple detection devices during the fire evolution process. The multiple detection devices correspond to at least two different spectral ranges, and the fire prevention knowledge data includes information on the physical change patterns between the detection data corresponding to different spectral ranges during the fire evolution process. The determination module is used to determine input information based on the detection data, configure corresponding instruction information for the input information based on multiple training tasks, and determine annotation information based on the input information and the fire prevention knowledge data containing the physical change law information; The generation module is used to generate multi-task training samples based on the input information, the instruction information, and the annotation information. The multi-task training samples are used to train the model to be trained to obtain a fire early warning model.

13. A training device for a fire early warning model, characterized in that, include: The second acquisition module is used to acquire multi-task training samples, wherein the multi-task training samples are training samples generated using the training sample generation method of the fire early warning model according to any one of claims 1-5. The training module is used to train the model to be trained based on the multi-task training samples to obtain the fire early warning model.

14. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the training sample generation method of the fire early warning model according to any one of claims 1-5, or implement the training method of the fire early warning model according to any one of claims 6-11.

15. A computer storage medium, characterized in that, The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the training sample generation method of the fire early warning model according to any one of claims 1-5, or to implement the training method of the fire early warning model according to any one of claims 6-11.