Fire extinguishing method, equipment and medium of intelligent fire-fighting robot based on transfer learning

CN118477277BActive Publication Date: 2024-09-27UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410944799.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-27
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

Existing firefighting robots lack autonomous capabilities in fire extinguishing operations and rely on human remote control operations. Moreover, existing automatic fire extinguishing methods are difficult to effectively implement in actual environments. Agents trained in virtual environments through reinforcement learning have poor robustness in real environments, and There is serious waste of water resources.

Method used

By building a jet fire extinguishing scene in a virtual environment, using generative adversarial networks and reinforcement learning to train the agent, after the training is completed, it is transferred to the real environment, so that it can control the intelligent fire robot to automatically extinguish fires, avoiding additional training in the real environment. Ensure robustness and efficient use of resources.

Benefits of technology

It achieves automatic fire extinguishing capabilities without additional training in real environments, ensuring water conservation and safety. It adopts an end-to-end visual method to simplify image feature design and jet physical property measurement, improving the feasibility of automatic fire extinguishing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118477277B
    Figure CN118477277B
Patent Text Reader

Abstract

The present invention discloses a fire extinguishing method, equipment and medium of an intelligent fire-fighting robot based on transfer learning, and the method comprises: step 1, building a jet fire extinguishing scene in a virtual environment to simulate jets and flames; step 2, collecting a predetermined number of real jet images with an intelligent fire-fighting robot in a real environment, and collecting virtual jet images with a virtual camera in a virtual environment; step 3, calculating the shape similarity between the real jet image and the virtual jet image to obtain a matched virtual-real jet image; step 4, training a generative adversarial network: training the generative adversarial network with the matched virtual-real jet images; step 5, constructing and training a reinforcement learning intelligent agent in a virtual environment, using the generative adversarial network during training to convert the observed virtual jet image into a real jet image; step 6, migrating the intelligent agent trained in the virtual environment to the real intelligent fire-fighting robot, and controlling it to interact with the real environment to complete the automatic fire-fighting task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent firefighting robots, and in particular to a firefighting method of an intelligent firefighting robot based on transfer learning. Background Art

[0002] At present, firefighting robots have been put into use in practical applications and can replace human firefighters in dangerous environments. However, the existing firefighting robots are not intelligent enough and mainly rely on human remote control when performing firefighting operations, that is, firefighting robots lack the ability to extinguish fires autonomously. Therefore, an automatic fire extinguishing method is crucial for intelligent firefighting robots.

[0003] The automatic fire extinguishing method is a strategy to guide the jet to hit the flame. The key is to adjust the trajectory of the jet and make it pass through the fire point. In the actual environment, the jet is affected by many physical factors, such as water supply pressure, environmental wind force, jet velocity and cross-sectional area. It is difficult to predict the trajectory of the jet through the physical model of the jet, so it is difficult to build an automatic fire extinguishing method based on the jet model. In addition, since the area of ​​the jet in the image is often low-textured, binocular feature matching is difficult to perform, so it is difficult to build an automatic fire extinguishing method based on binocular vision. Finally, using reinforcement learning on an actual fire-fighting robot to learn an automatic fire extinguishing method consumes a lot of water resources, and safety cannot be guaranteed. In the virtual environment, the intelligent agent trained using reinforcement learning cannot guarantee its robustness when facing the difference between the virtual environment and the real environment.

[0004] In view of this, the present invention is proposed. Summary of the invention

[0005] The purpose of the present invention is to provide a fire-fighting method, equipment and medium for an intelligent fire-fighting robot based on transfer learning, which can directly transfer the reinforcement learning agent trained by reinforcement learning in a virtual environment to reality, thereby avoiding the waste of resources caused by training the agent in reality and ensuring the robustness of the intelligent fire-fighting robot.

[0006] The objective of the present invention is achieved through the following technical solutions:

[0007] A fire extinguishing method of an intelligent fire fighting robot based on transfer learning, comprising:

[0008] Step 1, building a virtual fire extinguishing environment: building a jet fire extinguishing scene in the virtual environment, simulating the jet and flame in the jet fire extinguishing scene at the same time, and obtaining an image of the jet fire extinguishing scene through a virtual camera;

[0009] Step 2, collecting data: using a color camera in a visual system carried by the intelligent firefighting robot to collect a predetermined number of real jet images in a real environment, and using a virtual camera to collect virtual jet images in a virtual environment;

[0010] Step 3, matching jet images: by calculating the shape similarity between the real jet image collected in step 2 and the virtual jet image, a virtual jet image with the highest similarity is found for each real jet image to obtain a matched virtual-real jet image;

[0011] Step 4, training the generative adversarial network: using the matched virtual-realistic jet images obtained in step 3 as training data, the generative adversarial network is trained by adding jet consistency loss and focal frequency loss;

[0012] Step 5, reinforcement learning: construct a reinforcement learning agent in the virtual environment, and train the reinforcement learning agent with the goal of controlling jet fire extinguishing. During the training process, the generative adversarial network trained in step 4 is used to convert the virtual jet image observed by the reinforcement learning agent into a real jet image;

[0013] Step 6, agent transfer: transfer the reinforcement learning agent trained in the virtual environment to the real intelligent fire-fighting robot, so that the reinforcement learning agent can control the intelligent fire-fighting robot to interact with the real environment to complete the automatic fire-fighting task.

[0014] A processing device, comprising:

[0015] at least one memory for storing one or more programs;

[0016] At least one processor can execute one or more programs stored in the memory. When the one or more programs are executed by the processor, the processor can implement the method described in the present invention.

[0017] A readable storage medium stores a computer program, which can implement the method described in the present invention when the computer program is executed by a processor.

[0018] Compared with the prior art, the automatic fire extinguishing method of the intelligent fire-fighting robot based on virtual-reality migration provided by the present invention has the following beneficial effects:

[0019] Through virtual-reality migration, the automatic fire-fighting reinforcement learning agent trained in the virtual environment can be directly transferred to the real intelligent fire-fighting robot, and the intelligent fire-fighting robot can be controlled to complete the real fire-fighting task. It can be conveniently and safely applied to the automatic fire-fighting task of the intelligent fire-fighting robot without the need for additional training in the real environment, ensuring that water resources are not wasted and safety is guaranteed. This method adopts an end-to-end automatic fire-fighting method based on vision, which does not require complex image feature design and avoids the measurement of complex jet physical properties. It is in line with the intuition of human firefighters and improves the feasibility of the automatic fire-fighting method in implementation. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0021] Figure 1 A flow chart of a fire extinguishing method for an intelligent fire-fighting robot based on transfer learning provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0022] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in combination with the specific content of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, which does not constitute a limitation of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.

[0023] First, the terms that may be used in this article are explained as follows:

[0024] The term “and / or” means that either or both of them can be realized at the same time. For example, X and / or Y means both “X” or “Y” and “X and Y”.

[0025] The terms "include", "comprises", "contains", "has" or other descriptions with similar semantics should be interpreted as non-exclusive inclusion. For example, including certain technical feature elements (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or products, etc.) should be interpreted as including not only certain technical feature elements explicitly listed, but also other technical feature elements known in the art that are not explicitly listed.

[0026] The term "consisting of..." means excluding any technical feature elements not explicitly listed. If this term is used in a claim, it will make the claim closed, so that it does not contain technical feature elements other than the technical feature elements explicitly listed, except for the conventional impurities related to them. If this term only appears in a clause of a claim, it only limits the elements explicitly listed in the clause, and the elements recorded in other clauses are not excluded from the overall claim.

[0027] Unless otherwise specified or limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this article can be understood according to specific circumstances.

[0028] The orientation or position relationship indicated by terms such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", etc. are based on the orientation or position relationship shown in the drawings and are only for the convenience and simplification of description, and do not explicitly or implicitly indicate that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation of this document.

[0029] The scheme provided by the present invention is described in detail below. The contents not described in detail in the embodiments of the present invention belong to the prior art known to professionals in the field. If the specific conditions are not specified in the embodiments of the present invention, they are carried out according to the conventional conditions in the field or the conditions recommended by the manufacturer. If the manufacturers are not specified in the reagents or instruments used in the embodiments of the present invention, they are all conventional products that can be purchased commercially.

[0030] like Figure 1 As shown, an embodiment of the present invention provides a fire extinguishing method of an intelligent fire fighting robot based on transfer learning, comprising:

[0031] Step 1, building a virtual fire extinguishing environment: building a jet fire extinguishing scene in the virtual environment, simulating the jet and flame in the jet fire extinguishing scene at the same time, and obtaining an image of the jet fire extinguishing scene through a virtual camera;

[0032] Step 2, data collection: using a color camera in the visual system of the intelligent firefighting robot in a real environment to collect a predetermined number of real jet images as target images for training the generative adversarial network; and using a virtual camera in a virtual environment to collect virtual jet images as source images for training the generative adversarial network;

[0033] Step 3, matching jet images: by calculating the shape similarity between the real jet image and the virtual jet image, a virtual jet image with the highest similarity is found for each real jet image to obtain a matched virtual-real jet image;

[0034] Step 4, training the generative adversarial network: using the matched virtual-realistic jet images obtained in step 3, the generative adversarial network is trained by adding jet consistency loss and focal frequency loss;

[0035] Step 5, reinforcement learning: construct a reinforcement learning agent in the virtual environment, and train the reinforcement learning agent with the goal of controlling jet fire extinguishing. During the training process, the generative adversarial network trained in step 4 is used to convert the virtual jet image observed by the reinforcement learning agent into a real jet image;

[0036] Step 6, agent transfer: transfer the reinforcement learning agent trained in the virtual environment to the real intelligent fire-fighting robot, so that the reinforcement learning agent can control the intelligent fire-fighting robot to interact with the real environment to complete the automatic fire-fighting task.

[0037] Preferably, in step 1 of the above method, a jet fire extinguishing scene is constructed in a virtual environment in the following manner, and the jet and flame in the jet fire extinguishing scene are simulated simultaneously, and an image of the jet fire extinguishing scene is acquired through a virtual camera, including:

[0038] Step 11, using a 3D engine that can simulate flames and jets to create a jet fire extinguishing scene;

[0039] Step 12, in the jet fire extinguishing scene, a circular fluid particle emitter is set to generate fluid through the fluid simulation component of the 3D engine that can simulate flames and jets, and the initial velocity of the fluid particles is given to be no less than 30m / s to simulate the jet particles of the water cannon jet;

[0040] Step 13, in the jet fire extinguishing scene, flame simulation is performed by using particle effects of a 3D engine that can simulate flames and jets, or by using a plane to play a pre-recorded flame video to simulate flames, and a collision trigger is set for the simulated flame;

[0041] Step 14, establishing a logical connection between the jet particles of the water cannon jet and the collision trigger of the simulated flame, so that the particle number of the jet particles hitting the simulated flame can be read.

[0042] In the above method, the 3D engine capable of simulating flames and jets is any one of Unity3D engine, unreal3D engine, Maya3D engine, etc. The 3D engine capable of simulating flames and jets is preferably Unity3D engine, the fluid simulation component is Obi Fluid component, and the circular fluid particle emitter is Obi Emitter.

[0043] Preferably, in step 3 of the above method, by calculating the shape similarity between the real jet image and the virtual jet image, a virtual jet image with the highest similarity is found for each real jet image to obtain a matched virtual-real jet image, including:

[0044] Step 31, obtaining the jet generation point of the simulated jet particles in a 3D engine capable of simulating flames and jets , the emission angle of the jet particles [ i p i y ] , the initial velocity of the jet particles and the radius of the jet particles parameter;

[0045] Step 32, construct the genetic algorithm population: the jet generation point of the jet particle , the emission angle of the jet particles [ i p i y ] , the initial velocity of the jet particles and the radius of the jet particles Initialize the genetic algorithm population for the gene, each different individual in the genetic algorithm population represents a virtual jet image with different shape;

[0046] Step 33, evaluate the fitness of all individuals: calculate the fitness of all individuals in the genetic algorithm population by the shape similarity between the virtual jet image and the real jet image, wherein the shape similarity is calculated by the mask of the virtual jet image and the real jet image:

[0047] ;

[0048] in, is the shape similarity between the virtual jet image and the real jet image; are the coordinates of the same pixel point in the virtual jet image and the real jet image; , They are respectively a mask of a virtual jet image and a mask of a real jet image, the mask of the virtual jet image is obtained through the color threshold and dynamic features of the virtual jet image, and the mask of the real jet image is obtained through the color threshold and dynamic features of the real jet image; specifically, the mask of the virtual jet image is obtained in the following manner: a mask obtained through the color threshold of the image and a mask obtained through the dynamic features of the image, and the intersection of these two masks is used as the mask of the virtual jet image; the mask of the real jet image is obtained in the following manner: a mask obtained through the color threshold of the image and a mask obtained through the dynamic features of the image, and the intersection of these two masks is used as the mask of the real jet image; for different shooting conditions, the color performance of the jet is different, and the method of determining the color threshold is different. In the method of the present invention, for each group of collected jet images, an initial frame is selected, a jet area is manually selected therein, and the RGB values ​​of the jet pixels are counted, thereby determining the upper and lower thresholds of the three RGB channels; the dynamic features can be based on foreground extraction of frame differences or determination of frame differences;

[0049] Step 34, selection, crossover and mutation:

[0050] The selection method is: randomly select a predetermined number of individuals from the genetic algorithm population, and select the individual with the best fitness as the winner, and then repeat the selection until the predetermined number of individuals are selected;

[0051] The crossover method is: from a predetermined number of individuals selected, the genes of the offspring individuals are generated between the corresponding genes of the two parent individuals by linear mixing;

[0052] The mutation method is: add a random value that obeys the Gaussian distribution to the gene of the offspring individual to obtain the mutated individual;

[0053] Step 35, iterate the population: if the specified number is not reached or the fitness is not higher than the set threshold, return to step 32 and iterate again. After the iteration, the individual with the highest fitness is obtained, and the virtual jet image generated by the gene of the individual with the highest fitness is matched with the real jet image to obtain a matched virtual-real jet image.

[0054] Preferably, in step 4 of the above method, the matched virtual-realistic jet image obtained in step 3 is used to train the generative adversarial network by adding jet consistency loss and focal frequency loss in the following manner, including:

[0055] Step 41, initializing the network: using a framework using paired data, initializing a generative adversarial network with random weights;

[0056] Step 42, processing the training data: using the mask of the virtual jet image and the mask of the real jet image, respectively extracting the jet region of the virtual jet image and the jet region of the real jet image from the matched virtual-real jet images, and obtaining jet region images of the two images with complex backgrounds removed;

[0057] Step 43, training the generative adversarial network: using the jet region images of the two images obtained in step 42 with the complex background removed as training data input to the generative adversarial network, with the conversion of the virtual jet image into the real jet image as the training target, and the total loss of the training target for:

[0058] ;

[0059] in, Generate adversarial losses for added conditions during training; L1 distance loss added during training; The jet consistency loss is added during training; The focal frequency loss is added during training;

[0060] The total loss of training the network using the target The generative adversarial network is trained, and the generator of the trained generative adversarial network is used to convert the virtual jet image into the real jet image.

[0061] Preferably, in step 43 of the above method, the jet consistency loss added during the training process is for:

[0062] ;

[0063] in, It is the generator of the Generative Adversarial Network; and They are the center curve of the jet region image and the center curve of the converted real jet image. Pixel coordinates, is the number of pixels on the central curve of the jet region image; is the discount factor; the jet consistency loss makes the generator G of the generative adversarial network based on the unconverted virtual jet image Transformed realistic jet image Close to the original realistic jet image in texture , while keeping the unconverted virtual jet image The shape of the real jet image is unchanged, that is, the converted Compared with the unconverted virtual jet image The shape of is consistent with that of the virtual jet image by penalizing the unconverted Realistic jet image generated with conversion The shape difference is realized;

[0064] The L1 distance loss added during training is:

[0065] ;

[0066] The L1 distance loss makes and The local features are similar;

[0067] Added focal frequency loss to the training process for:

[0068] ;

[0069] in, and The original virtual jet image is converted into a virtual jet image in the frequency domain and the real jet image generated by the conversion is converted into a real jet image in the frequency domain. The sizes of the virtual jet image converted into the frequency domain and the real jet image are both M×N. is the virtual jet image converted to the frequency domain The weight at the origin is close to 0; is the discount factor;

[0070] Adding conditions to the training process to generate adversarial losses for:

[0071] ;

[0072] in, It is the generator of the Generative Adversarial Network; is the discriminator of the generative adversarial network; refers to the unconverted virtual jet image during training With original realistic jet image The discriminator of a generative adversarial network given an input Output: refers to the use of unconverted virtual jet images as training Realistic jet image generated with conversion The discriminator of a generative adversarial network given an input The output of ; this conditional generative adversarial loss is used to guide the generator of the generative adversarial network to transform and generate realistic jet images.

[0073] Preferably, in step 41 of the above method, a framework using paired data is Pix2pix.

[0074] Preferably, in step 5 of the above method, a reinforcement learning agent is constructed in a virtual environment in the following manner, and the reinforcement learning agent is trained with the goal of controlling jet fire extinguishing, including:

[0075] Step 51, build a reinforcement learning agent: build a feature extractor, two fully connected layers, and a strategy subnetwork in the virtual environment Sum value subnetwork Reinforcement learning agents composed of

[0076] Step 52, constructing an agent observation space: the observation space of the reinforcement learning agent constructed in step 51 is a single color image. After the virtual camera acquires a virtual jet image in a virtual environment, a jet region image of the virtual jet image is extracted by a mask of the virtual jet image. The jet region image is then input into a generator of a trained generative adversarial network, and converted into a real jet image by the generator. The flame region in the virtual jet image before conversion is superimposed on the converted real jet image, so that the real jet image contains both the converted real jet and the flame target.

[0077] Step 53, constructing the action space of the reinforcement learning agent: in each time step, the reinforcement learning agent can choose to rotate the water cannon upward, downward, left, or right, or remain still. If the water cannon is rotated, it will rotate a fixed angle in the selected direction;

[0078] Step 54, construct the hit reward of the reinforcement learning agent: the reinforcement learning agent at time step Hit Rewards The rules are as follows:

[0079] ;

[0080] in, is the total number of jet particles that hit; is the number of particles of the jet that hits in the current time step; is the threshold of the number of jet particles. When this threshold is exceeded, the fire extinguishing task is considered completed.

[0081] by Represents the reinforcement learning agent at time step The time penalty obtained, =-0.01 The longer the reinforcement learning agent takes, the less reward it will eventually get;

[0082] Added potential based bonus defined using the distance difference between the jet and the flame target , the reinforcement learning agent at time step Potential-based rewards earned for:

[0083] ;

[0084] in, It is the vertical distance from the center point of the flame target to the center plane of the jet, and also represents the potential energy; set The value of The range is limited to (-0.1, 0.1);

[0085] The reward obtained by the reinforcement learning agent at time step t for:

[0086] ;

[0087] in, Represents the reinforcement learning agent at time step Hit bonus obtained; Represents the reinforcement learning agent at time step The time penalty obtained; Represents the reinforcement learning agent at time step Potential-based rewards earned;

[0088] Step 55, use the PPO algorithm to train the reinforcement learning agent. The value is 0.99, =0.95; the ratio clipping of the PPO algorithm is set to 0.2.

[0089] Preferably, in step 51 of the above method, the feature extractor of the constructed reinforcement learning agent adopts the IMPALA feature extractor.

[0090] The embodiment of the present invention further provides a processing device, including:

[0091] at least one memory for storing one or more programs;

[0092] At least one processor can execute one or more programs stored in the memory, and when the one or more programs are executed by the processor, the processor can implement the above method.

[0093] The embodiments of the present invention further provide a readable storage medium storing a computer program, which can implement the above method when the computer program is executed by a processor.

[0094] In summary, the method of the embodiment of the present invention, based on the virtual-reality migration method, can directly migrate the reinforcement learning agent obtained by reinforcement learning training in the virtual environment to reality, thereby avoiding the waste of resources caused by training the agent in reality. A reinforcement learning agent is constructed in a virtual environment, which uses visual information to observe the size and direction of the position difference between the jet and the fire point, and controls the water cannon to extinguish the fire. At the same time, a generative adversarial network is used to convert the jet image in the virtual environment into a real jet, and the shape consistency of the jet before and after the conversion is ensured by the jet consistency loss, so that the agent can learn an effective automatic fire extinguishing method and can maintain robustness after migrating to the real environment, thereby solving the above-mentioned technical problems existing in the prior art.

[0095] In order to more clearly demonstrate the technical solution and technical effects provided by the present invention, the fire extinguishing method of the intelligent fire-fighting robot based on transfer learning provided by the embodiment of the present invention is described in detail with specific examples below.

[0096] Example 1

[0097] like Figure 1 As shown, this embodiment provides a fire extinguishing method for an intelligent fire-fighting robot based on transfer learning, which is an automatic fire extinguishing method for an intelligent fire-fighting robot based on virtual-reality migration, comprising the following steps:

[0098] Step 1, building a virtual fire-fighting environment: building a jet fire-fighting scene in a virtual environment, in which the jet fire-fighting scene in the virtual environment needs to simulate the jet and the flame at the same time, and can obtain an image of the virtual environment through a virtual camera;

[0099] Step 2, data collection: in a real environment, a color camera in the visual system of the intelligent firefighting robot is used to collect a predetermined number of jet images as target images for training the generative adversarial network; at the same time, a virtual camera is used in a virtual environment to collect virtual jet images as source images for training the generative adversarial network;

[0100] Step 3, matching jet images: by calculating the shape similarity between the real jet image and the virtual jet image, a virtual jet image with the highest similarity is found for each real jet image, and a matching virtual-real jet image is obtained;

[0101] Step 4, training the generative adversarial network: using the matched virtual-realistic jet images obtained above as training data to train the generative adversarial network, during the training process, adding the jet consistency loss to ensure the shape consistency of the image conversion, and adding the focus frequency loss to ensure the stability of the training;

[0102] Step 5, reinforcement learning: build a reinforcement learning agent in the virtual environment and train it to control jet fire extinguishing. During the training process, use the trained generative adversarial network to convert the observed virtual jet into a real jet;

[0103] Step 6, agent transfer: transfer the reinforcement learning agent trained in the virtual environment to the real intelligent fire-fighting robot, so that the reinforcement learning agent controls the intelligent fire-fighting robot to interact with the real environment to complete the automatic fire-fighting task.

[0104] Furthermore, in step 1 of the above method, a jet fire extinguishing scene is constructed in a virtual environment according to the following method, including:

[0105] Step 11, create a scene using Unity3D engine as a 3D engine that can simulate flames and jets;

[0106] Step 12, the simulation of the jet fluid is realized through the Obi Fluid component of the Unity3D engine. A circular Obi Emitter is set to generate the fluid, and the initial velocity of the fluid particles is given to be greater than 30m / s to simulate the water cannon jet;

[0107] Step 13, the flame simulation is created through the particle effects of the Unity3D engine or a plane is used to play the flame video recorded in advance, and at the same time, a collision trigger is set for the simulated flame;

[0108] Step 14, establishing a logical connection between the jet particles and the collision trigger of the simulated flame, so that the number of jet particles hitting the flame can be read.

[0109] Furthermore, in step 3 of the above method, the virtual jet image and the real jet image are matched in the following manner:

[0110] Step 31: Get the jet generation point of the virtual jet particle in the Unity3D engine , the emission angle of the jet particles [ i p i y ] , the initial velocity of the jet particles and the radius of the jet particles parameter;

[0111] Step 32, construct the genetic algorithm population: the jet generation point of the jet particle , the emission angle of the jet particles [ i p i y ] , the initial velocity of the jet particles and the radius of the jet particles Initialize a population for the gene, where each individual in the population represents a virtual jet image with a different shape;

[0112] Step 33, evaluate the fitness of all individuals: the fitness is calculated by the shape similarity between the virtual jet image and the real jet image, and the shape similarity is calculated by the mask between the virtual jet image and the real jet image:

[0113] ;

[0114] in, is the shape similarity between the virtual jet image and the real jet image; are the coordinates of the same pixel point in the virtual jet image and the real jet image; , They are respectively the mask of the virtual jet image and the mask of the real jet image, and both the mask of the virtual jet image and the mask of the real jet image can be obtained by color threshold, dynamic features, etc.;

[0115] Step 34, selection, crossover, mutation:

[0116] The specific method of selection is: randomly select several individuals from the population, and select the individual with the best fitness as the winner, and repeat until a sufficient number of individuals are selected;

[0117] The specific method of crossover is: Generate the genes of the offspring individuals between the corresponding genes of the two parent individuals through linear mixing;

[0118] The specific method of mutation is: adding random values ​​that obey Gaussian distribution to the genes of offspring individuals;

[0119] Step 35, iterate the population: if the specified number is not reached or the fitness is not higher than the set threshold, return to step 32 and restart the iteration. After the iteration, the individual with the highest fitness is obtained, and the virtual jet image generated by the gene of the individual with the highest fitness is matched with the real jet image.

[0120] Furthermore, in step 4 of the above method, the generative adversarial network is trained in the following manner:

[0121] Step 41, initialize the network: select a framework that uses paired data, such as Pix2pix, and initialize a generative adversarial network with random weights;

[0122] Step 42, processing training data: using the mask of the virtual jet image and the mask of the real jet image, respectively extracting the jet region of the virtual jet image and the jet region of the real jet image from the matched virtual-real jet images, respectively obtaining jet region images of the two images with complex backgrounds removed, thereby removing the influence of the complex background on the training;

[0123] Step 43, training the generative adversarial network: using the jet region images of the two images obtained in step 42 with the complex background removed as training data input to the generative adversarial network, with the conversion of the virtual jet image into the real jet image as the training target, and the total loss of the training target for:

[0124] ;

[0125] in, Generate adversarial losses for added conditions during training; L1 distance loss added during training; The jet consistency loss is added during training; The focal frequency loss is added during training;

[0126] The total loss of training the network using the target The generative adversarial network is trained, and the generator of the trained generative adversarial network can be taken out and used for the virtual-reality conversion of the jet.

[0127] In the above step 43, the jet consistency loss added to the training process The calculation formula is as follows:

[0128] ;

[0129] in, It is the generator of the Generative Adversarial Network; and They are the central curves of the jet region image and the converted real jet image. Pixel coordinates, is the number of pixels on the central curve of the jet region image; is the discount factor; the jet consistency loss makes the generator Based on the unconverted virtual jet image Converted into a realistic jet image Close to the original realistic jet image in texture , while keeping the unconverted virtual jet image The shape of remains unchanged, that is, the real jet image converted into Compared with the unconverted virtual jet image This is done by penalizing the unconverted virtual jet image The real jet image converted into The shape difference is achieved.

[0130] The calculation formula of the L1 distance loss added to the training process is as follows:

[0131] ;

[0132] This loss transforms the realistic jet image into With original realistic jet image The local features are similar.

[0133] The calculation formula for the focal frequency loss added to the training process is as follows:

[0134] ;

[0135] in, and The original virtual jet image is converted into a virtual jet image in the frequency domain and the real jet image generated by the conversion is converted into a real jet image in the frequency domain. The sizes of the virtual jet image converted into the frequency domain and the real jet image are both M×N. is the virtual jet image converted to the frequency domain The weight at the origin is close to 0. is the discount factor. The focal frequency loss balances the loss caused by the black background in the training data and ensures the stability of the generative adversarial network training.

[0136] The calculation formula for the conditional generative adversarial loss added to the training process is as follows:

[0137] ;

[0138] in, It is the generator of the Generative Adversarial Network; is the discriminator of the generative adversarial network; refers to the unconverted virtual jet image during training With original realistic jet image The discriminator of a generative adversarial network given an input Output: refers to the use of unconverted virtual jet images as training Realistic jet image generated with conversion The discriminator of a generative adversarial network given an input The output of ; this conditional generative adversarial loss is used to guide the generator of the generative adversarial network to transform a specific type of image, that is, to generate realistic jet images.

[0139] Furthermore, in step 5 of the above method, a reinforcement learning agent is constructed in a virtual environment and reinforcement learning training is performed in the following manner, including:

[0140] Step 51, build the agent network: the reinforcement learning agent consists of a feature extractor, two fully connected layers and a strategy Sum It consists of two sub-networks; the feature extractor can choose IMPALA feature extractor;

[0141] Step 52, constructing the observation space of the agent: The observation space of the reinforcement learning agent is a single color image. After the virtual camera obtains the jet image in the Unity3D scene, the jet image area is extracted by the mask, and then the image is input into the generator of the trained generative adversarial network, and the generator converts it into a real jet. Finally, the flame area in the original image is superimposed on the converted real jet image, so that the image contains both the converted real jet and the flame target;

[0142] Step 53, constructing the agent action space: In each time step, the reinforcement learning agent can choose to turn the water cannon up, down, left, right or remain still. If the water cannon is turned, it will turn a fixed angle in the selected direction.

[0143] Step 54, construct the reward function of the reinforcement learning agent: First, the hit reward , the reinforcement learning agent at time step Hit Rewards The rules are as follows:

[0144] ;

[0145] in, is the total number of particles hit, is the number of particles hit in the current time step, It is the threshold of the number of particles. When it exceeds this threshold, the fire extinguishing task is considered to be completed.

[0146] by Represents the reinforcement learning agent at time step The time penalty obtained, =-0.01 The longer the reinforcement learning agent takes, the less reward it will eventually get;

[0147] At the same time, in order to solve the problem of sparse rewards, potential-based rewards are added , using the distance difference between the jet and the flame target to define a potential-based reward , the reinforcement learning agent at time step Potential-based rewards earned for:

[0148] ;

[0149] in, It is the vertical distance from the center point of the flame target to the center plane of the jet, and also represents the potential energy. The value of The range of is limited to (-0.1, 0.1); it can be seen that the originally sparse reward function becomes dense due to the existence of the potential energy function. Whenever the jet approaches the flame target, the reinforcement learning agent will receive a reward, which plays a good guiding role in the exploration of the reinforcement learning agent in the simulation environment; In summary, the reward obtained by the reinforcement learning agent at time step t for:

[0150] ;

[0151] Step 55, use the PPO algorithm to train the reinforcement learning agent: The value is 0.99, = 0.95. The ratio clipping of the PPO algorithm is set to 0.2.

[0152] In summary, the automatic fire extinguishing method according to the embodiment of the present invention has at least the following beneficial effects:

[0153] (1) The automatic fire-fighting method of the intelligent fire-fighting robot based on virtual-reality migration can implement the mature reinforcement learning agent in the virtual environment in the real environment, solving the problem that reinforcement learning is difficult to apply in the real automatic fire-fighting task.

[0154] (2) The vision-based end-to-end automatic fire-fighting method avoids complex, artificial image feature design and does not rely on the estimation of the jet physical model. It is easier to implement on real-world intelligent fire-fighting robots.

[0155] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0156] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims. The information disclosed in the background technology section of this article is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as an admission or in any form that the information constitutes prior art known to those skilled in the art.

Claims

1. A fire extinguishing method of an intelligent fire fighting robot based on transfer learning, characterized in that: include: Step 1, building a virtual fire extinguishing environment: building a jet fire extinguishing scene in the virtual environment, simulating the jet and flame in the jet fire extinguishing scene at the same time, and obtaining an image of the jet fire extinguishing scene through a virtual camera; Step 2, collecting data: using a color camera in a visual system carried by the intelligent firefighting robot to collect a predetermined number of real jet images in a real environment, and using a virtual camera to collect virtual jet images in a virtual environment; Step 3, matching jet images: by calculating the shape similarity between the real jet image collected in step 2 and the virtual jet image, a virtual jet image with the highest similarity is found for each real jet image to obtain a matched virtual-real jet image; Step 4, training the generative adversarial network: using the matched virtual-realistic jet images obtained in step 3 as training data, the generative adversarial network is trained by adding jet consistency loss and focal frequency loss; The matched virtual-realistic jet images obtained in step 3 are used to train the generative adversarial network by adding jet consistency loss and focal frequency loss, including: Step 41, initializing the network: using a framework using paired data, initializing a generative adversarial network with random weights; Step 42, processing the training data: using the mask of the virtual jet image and the mask of the real jet image, respectively extracting the jet region of the virtual jet image and the jet region of the real jet image from the matched virtual-real jet images, and obtaining jet region images of the two images with complex backgrounds removed; Step 43, training the generative adversarial network: using the jet region images of the two images obtained in step 42 with the complex background removed as training data input to the generative adversarial network, with the conversion of the virtual jet image into the real jet image as the training target, and the total loss of the training target for: ; in, Generate adversarial losses for added conditions during training; L1 distance loss added during training; The jet consistency loss is added during training; The focal frequency loss is added during training; The total loss of training the network using the target Training a generative adversarial network, and using the trained generator of the generative adversarial network to convert a virtual jet image into a real jet image; In step 43, the jet consistency loss added during the training process for: ; in, It is the generator of the Generative Adversarial Network; and They are the center curve of the jet region image and the center curve of the converted real jet image. Pixel coordinates, is the number of pixels on the central curve of the jet region image; is the discount factor; the jet consistency loss makes the generator G of the generative adversarial network based on the unconverted virtual jet image Transformed realistic jet image Close to the original realistic jet image in texture , while keeping the unconverted virtual jet image The shape of the real jet image is unchanged, that is, the converted Compared with the unconverted virtual jet image The shape of is consistent with that of the virtual jet image by penalizing the unconverted Realistic jet image generated with conversion The shape difference is realized; The L1 distance loss added during training is: ; The L1 distance loss makes and The local features are similar; Added focal frequency loss to the training process for: ; in, and The original virtual jet image is converted into a virtual jet image in the frequency domain and the real jet image generated by the conversion is converted into a real jet image in the frequency domain. The sizes of the virtual jet image converted into the frequency domain and the real jet image are both M×N. is the virtual jet image converted to the frequency domain The weight at the origin is close to 0; is the discount factor; Generate adversarial loss for added conditions in the training process for: ; in, It is the generator of the Generative Adversarial Network; is the discriminator of the generative adversarial network; refers to the unconverted virtual jet image during training With original realistic jet images The discriminator of a generative adversarial network given an input Output: refers to the use of unconverted virtual jet images as training Realistic jet image generated with conversion The discriminator of a generative adversarial network given an input The output of the conditional generative adversarial loss is used to guide the generator of the generative adversarial network to transform and generate realistic jet images; Step 5, reinforcement learning: construct a reinforcement learning agent in the virtual environment, and train the reinforcement learning agent with the goal of controlling jet fire extinguishing. During the training process, the generative adversarial network trained in step 4 is used to convert the virtual jet image observed by the reinforcement learning agent into a real jet image; Step 6, agent transfer: transfer the reinforcement learning agent trained in the virtual environment to the real intelligent fire-fighting robot, so that the reinforcement learning agent can control the intelligent fire-fighting robot to interact with the real environment to complete the automatic fire-fighting task.

2. The fire extinguishing method of the intelligent fire fighting robot based on transfer learning according to claim 1 is characterized in that: In the step 1, a jet fire extinguishing scene is constructed in a virtual environment in the following manner, and the jet and flame in the jet fire extinguishing scene are simulated simultaneously, and an image of the jet fire extinguishing scene is acquired through a virtual camera, including: Step 11, using a 3D engine that can simulate flames and jets to create a jet fire extinguishing scene; Step 12, in the jet fire extinguishing scene, a circular fluid particle emitter is set to generate fluid through the fluid simulation component of the 3D engine that can simulate flames and jets, and the initial velocity of the fluid particles is given to be no less than 30m / s to simulate the jet particles of the water cannon jet; Step 13, in the jet fire extinguishing scene, flame simulation is performed by using particle effects of a 3D engine that can simulate flames and jets, or by using a plane to play a pre-recorded flame video to simulate flames, and a collision trigger is set for the simulated flame; Step 14, establishing a logical connection between the jet particles of the water cannon jet and the collision trigger of the simulated flame, so that the particle number of the jet particles hitting the simulated flame can be read.

3. The fire extinguishing method of the intelligent fire-fighting robot based on transfer learning according to claim 2 is characterized in that: In step 3, by calculating the shape similarity between the real jet image and the virtual jet image, a virtual jet image with the highest similarity is found for each real jet image to obtain a matched virtual-real jet image, including: Step 31, obtaining the jet generation point of the simulated jet particles in a 3D engine capable of simulating flames and jets , the emission angle of the jet particles , the initial velocity of the jet particles and the radius of the jet particles parameter; Step 32, construct the genetic algorithm population: the jet generation point of the jet particle , the emission angle of the jet particles , the initial velocity of the jet particles and the radius of the jet particles Initialize the genetic algorithm population for the gene, each different individual in the genetic algorithm population represents a virtual jet image with different shape; Step 33, evaluate the fitness of all individuals: calculate the fitness of all individuals in the genetic algorithm population by the shape similarity between the virtual jet image and the real jet image, wherein the shape similarity is calculated by the mask of the virtual jet image and the real jet image: ; in, is the shape similarity between the virtual jet image and the real jet image; are the coordinates of the same pixel point in the virtual jet image and the real jet image; , are respectively a mask of a virtual jet image and a mask of a real jet image, wherein the mask of the virtual jet image is obtained by the color threshold and dynamic features of the virtual jet image, and the mask of the real jet image is obtained by the color threshold and dynamic features of the real jet image; Step 34, selection, crossover and mutation: The selection method is: randomly select a predetermined number of individuals from the genetic algorithm population, and select the individual with the best fitness as the winner, and then repeat the selection until the predetermined number of individuals are selected; The crossover method is: from a predetermined number of individuals selected, the genes of the offspring individuals are generated between the corresponding genes of the two parent individuals by linear mixing; The mutation method is: add a random value that obeys the Gaussian distribution to the gene of the offspring individual to obtain the mutated individual; Step 35, iterate the population: if the specified number is not reached or the fitness is not higher than the set threshold, return to step 32 and iterate again. After the iteration, the individual with the highest fitness is obtained, and the virtual jet image generated by the gene of the individual with the highest fitness is matched with the real jet image to obtain a matched virtual-real jet image.

4. The fire extinguishing method of the intelligent fire fighting robot based on transfer learning according to claim 1 is characterized in that: In step 41, a framework for using paired data is Pix2pix.

5. The fire extinguishing method of an intelligent fire-fighting robot based on transfer learning according to any one of claims 1 and 4, characterized in that: In step 5, a reinforcement learning agent is constructed in a virtual environment in the following manner, and the reinforcement learning agent is trained with the goal of controlling jet fire extinguishing, including: Step 51, build a reinforcement learning agent: build a feature extractor, two fully connected layers, and a strategy subnetwork in the virtual environment Sum value subnetwork Reinforcement learning agents composed of Step 52, constructing an agent observation space: the observation space of the reinforcement learning agent constructed in step 51 is a single color image. After the virtual camera acquires a virtual jet image in a virtual environment, a jet region image of the virtual jet image is extracted by a mask of the virtual jet image. The jet region image is then input into a generator of a trained generative adversarial network, and converted into a real jet image by the generator. The flame region in the virtual jet image before conversion is superimposed on the converted real jet image, so that the real jet image contains both the converted real jet and the flame target. Step 53, constructing the action space of the reinforcement learning agent: in each time step, the reinforcement learning agent can choose to rotate the water cannon upward, downward, left, right or remain still. If the water cannon is rotated, it will rotate a fixed angle in the selected direction; Step 54, construct the hit reward of the reinforcement learning agent: the reinforcement learning agent at time step Hit Rewards The rules are as follows: ; in, is the total number of jet particles that hit; is the threshold of the number of jet particles. When this threshold is exceeded, the fire extinguishing task is considered completed. is the number of jet particles that hit in the current time step t; by Represents the reinforcement learning agent at time step The time penalty obtained, =-0.01, the longer the reinforcement learning agent spends, the less reward it will eventually get; Added potential based bonus defined using the distance difference between the jet and the flame target , the reinforcement learning agent at time step Potential-based rewards earned for:: ; in, is the vertical distance from the center of the flame target to the center plane of the jet, which also represents the potential energy. Represents the time step; sets the weight The value of The range is limited to (-0.1, 0.1); The reinforcement learning agent at time step Rewards for: ; in, Represents the reinforcement learning agent at time step Hit bonus obtained; Represents the reinforcement learning agent at time step The time penalty obtained; Represents the reinforcement learning agent at time step Potential-based rewards earned; Step 55, use the PPO algorithm to train the reinforcement learning agent. The value is 0.99, =0.95; the ratio clipping of the PPO algorithm is set to 0.

2.

6. The fire extinguishing method of the intelligent fire fighting robot based on transfer learning according to claim 5 is characterized in that: In step 51, the feature extractor of the constructed reinforcement learning agent adopts the IMPALA feature extractor.

7. A processing device, characterized in that: include: at least one memory for storing one or more programs; At least one processor is capable of executing one or more programs stored in the memory, and when the one or more programs are executed by the processor, the processor is capable of implementing the method described in any one of claims 1 to 6.

8. A readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the method described in any one of claims 1 to 6 can be implemented.