Pollutant Diffusion Inspection and Tracing Method Based on U-Net Gas Diffusion Model
Through the combination of U-Net model and MPC-PF-PSO algorithm, the shortcomings of pollutant traceability and path planning in the existing technology are solved, and efficient and safe pollutant detection and leakage point positioning are achieved, which is suitable for the field of environmental monitoring.
Patent Information
- Application Number
- CN202411583654.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2044-11-07
AI Technical Summary
The existing gas pollution prediction model calculates complex and difficult to trace the traceability of pollutants when facing sudden pollution events. Traditional path planning algorithms cannot adapt to the dynamic environment, resulting in inefficient detection and safety hazards.
The U-Net-based pollutant diffusion deep learning model is used to combine the MPC-PF-PSO algorithm to predict pollutant diffusion through real-time gas concentration monitoring and environmental data. The MPC-PF-PSO algorithm is used to plan the optimal path to achieve rapid and accurate positioning of leakage points.
It realizes high-precision and rapid pollutant diffusion prediction and path planning, improves detection efficiency and safety, and can provide timely decision-making support in emergencies.
Smart Images

Figure CN119558178B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental monitoring, and particularly relates to a method for inspecting and tracing the diffusion of pollutants based on a U-Net gas diffusion model. Background Art
[0002] Currently, existing common gas pollution prediction models are constructed based on physical principles. For example, the Calpuff model adopts a three-dimensional unsteady Lagrangian diffusion model, which mainly consists of a terrain and meteorological data preprocessing module, a Calmet module, a Calpuff module, and a Calpost module. By using methods such as plume function segmentation, terrain-following coordinates, and the diagnostic wind field model CALMET, it can relatively accurately judge the source of pollutants at the receptor point. However, the calculation process is relatively complex, and the requirements for data are very high. In the face of pollution events caused by sudden behaviors, it often cannot play its due role.
[0003] More importantly, currently, too many pollutant inspection technologies only pursue the detection of pollutants and do not pursue the tracing of pollutants. When the pollution range of pollutants expands, simply knowing the existence of pollutants is far from sufficient to cope with the pollution threat. The unknown pollution leakage source poses a very great safety hazard to the risk-removing personnel. Therefore, an algorithm is needed to extend the pollutant monitoring and find the concentration leakage source of pollutants. Summary of the Invention
[0004] The purpose of the present invention is to make up for the defects of the existing technologies and provide a method for inspecting and tracing the diffusion of pollutants based on a U-Net gas diffusion model.
[0005] The present invention adopts a data-driven U-Net deep learning model for pollutant diffusion. By designating a fixed area of 3km * 3km in a certain urban area and using a pollutant diffusion model, it can quickly calculate the diffusion dynamic images of pollutant emission points at any position and under any wind direction. Only the local pollutant diffusion images of the city are used as input. By applying the deep learning model to identify the pollutant diffusion characteristics in the images, it completely depends on the data itself and does not require the construction of a traditional physical model. The prediction time is short, and it can provide timely decision support when sudden pollution diffusion events occur.
[0006] In addition, the existing path planning algorithms are based on global optimization, such as the Dijkstra algorithm and the A* algorithm. However, these two algorithms do not consider the dynamic changes in the actual environment, which may lead to the planned paths being unable to be executed in the actual environment. Moreover, due to the large amount of calculation, a large amount of time will be consumed when dealing with large-scale problems.
[0007] In contrast, the present invention is based on a selective MPC-PF-PSO algorithm, which combines the path planning algorithm of three methods: model predictive control (MPC), particle filtering (PF) and particle swarm optimization (PSO), and can better handle complex nonlinear systems and dynamic environments. MPC is a control strategy that establishes a mathematical model of the system, then predicts the future system behavior, and finally determines the current controller input based on the prediction results. It can take into account the constraints of the system and make the planned path more in line with the actual situation. PF can estimate the state of the system and enhance the robustness of the algorithm. PSO can quickly find better solutions to large-scale problems, greatly reducing calculation time.
[0008] Combined with the pollutant diffusion prediction algorithm and the MPC-PF-PSO inspection algorithm, the algorithm can successfully find the highest concentration point and complete the tracing operation.
[0009] The present invention is achieved through the following technical solutions:
[0010] A pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model specifically includes the following steps:
[0011] (1) Initialize gas detection
[0012] First, the gas concentration C in the current environment is read by the gas sensor, and a safe gas concentration threshold C is set. safe , the formula is:
[0013] C current =SensorData()
[0014] C safe =Threshold Value
[0015] Among them C current Indicates the current detected gas concentration, Sensor Data() represents the abstract function of the gas sensor to detect gas, and Threshold Value represents the preset threshold;
[0016] (2) Check for gas leakage risks
[0017] Compare the current gas concentration with the safety threshold to determine whether there is a gas leakage risk:
[0018] if C current >C safe then Risk=True else Risk=False
[0019] Then, else, and false are Python-like pseudocodes, and Risk is an abstract symbol for dangerous situations;
[0020] (3) Use the U-NET-based gas diffusion model for prediction
[0021] The U-NET-based gas diffusion model uses current environmental data to predict gas diffusion. The current environmental data includes wind direction and real-time images captured from the monitoring area. The data input into the U-NET-based gas diffusion model includes:
[0022] Wind direction W, represented as a vector;
[0023] Input tensor I, with a tensor shape of C×H×W, where C represents the number of channels, H is the height, and W is the width;
[0024] The U-NET-based gas diffusion model processes the input data and outputs a predicted pollutant diffusion map, whose tensor shape is similar to the input image, expressing the predicted pollutant concentration distribution in different regions. The predicted output tensor shape is T×C×H×W, where T is the time step;
[0025] The formula is expressed as:
[0026] P diffusion = U-Net(I,W)
[0027] where P diffusion represents the predicted tensor of the diffused gas output, and the tensor shape is T×C×H×W;
[0028] (4) Determine the most likely gas leakage point
[0029] Compare the predicted concentration at each potential leakage point with the actual monitoring data:
[0030] Leak Point = argmin Leak Points |P diffusion -C current |
[0031] Here, select the leakage point with the smallest difference as the most likely leakage source. Leak Point represents the most likely position of the leakage point; the argmin function represents the variable value when the objective function reaches the minimum, aiming to make |P diffusion -C current | reach the minimum;
[0032] (5) Use the MPC-PF-PSO algorithm for path planning and select the optimal path;
[0033] (6) Move along the optimal path
[0034] Move along the determined optimal path and update the gas concentration data and path in real time:
[0035] Update Path based on Real-time Data()
[0036] That is, update the path according to the real-time data;
[0037] (7) After reaching the predicted leakage point
[0038] After reaching the predicted leakage point, verify whether the leakage source has really been found, including two constraints:
[0039] Constraint 1: Re-perform the prediction of the gas diffusion model based on U-NET to confirm whether the new potential leakage point is close to the current position. If the distance D between the newly predicted leakage point and the current position is less than the set threshold D threshold , then Constraint 1 is satisfied;
[0040] if D < D threshold then Constraint 1 is satisfied
[0041] That is, if D < D threshold , then Constraint 1 is considered satisfied;
[0042] Constraint 2: The gas concentration C at the current position current remains at a high level and is higher than 80% of the gas concentration C at the previous detection locations previous ;
[0043] if C current > 0.8 × C previous then Constraint 2 is satisfied
[0044] That is, if C current > 0.8 × C previous , then Constraint 2 is considered satisfied;
[0045] After both of these constraints are satisfied, confirm that this position is the actual leakage source;
[0046] (8) After detecting the correct leakage point
[0047] Verify that the leakage point is correct, collect on-site data, and notify the patrol personnel.
[0048] The gas sensor described above is installed on the robot.
[0049] The gas diffusion model based on U-NET described above includes a contracting path and an expanding path;
[0050] The described contraction path is used to capture the context information of the image, gradually reducing the spatial dimension of the feature map through consecutive convolution and pooling operations while increasing the number of feature channels. Each contraction block contains two 3x3 convolutional layers, a ReLU activation function, and a 2x2 max pooling operation;
[0051] The described expansion path restores the spatial dimension in the network. Each upsampling block in the expansion path first increases the size of the feature map through a transposed convolution operation, followed by a 2x2 convolutional layer, then an operation to concatenate with the feature map in the contraction path, and then two 3x3 convolutional layers, with a ReLU activation function following each convolutional layer. The last layer uses a 1x1 convolution to map the feature vector to the number of target classes.
[0052] The content of the MPC-PF-PSO algorithm is as follows:
[0053] (5-1) Initialize the cost map Cost Map and algorithm parameters T, dt, N, M;
[0054] T: Prediction Time, which is the time length used by the model predictive control (MPC) part to predict future states. In path planning, T determines the time range that the algorithm looks ahead to calculate future path points;
[0055] dt: Time Step; this is the time interval calculated at each step in simulation or actual experiments. A smaller dt can improve the accuracy of path planning but increases the computational burden at the same time.
[0056] N: Number of Particles; in the particle swarm optimization (PSO) part, N represents the total number of particles, which are used to explore the search space and find the optimal path solution.
[0057] M: Maximum Number of Iterations; this parameter sets the upper limit of the iteration times of the particle swarm optimization algorithm. A higher number of iterations can increase the probability of finding the global optimal solution but also increases the running time of the algorithm.
[0058] The Cost Map initialization cost map refers to setting the initial environmental model before the algorithm starts, including obstacle positions, safe areas, and target positions. The cost map helps the algorithm evaluate the quality of different paths by assigning different cost values to different locations; for example, the cost value near obstacles will be higher to avoid the robot driving into them.
[0059] (5-2) Based on the current environmental information and the target location, use the MPC algorithm to predict possible future states and paths, and optimize the control input to minimize the path cost;
[0060] (5-3) Use the PF algorithm to estimate the uncertainty of the system state and the impact of external noise;
[0061] (5-4) Use the PSO algorithm to find the optimal path by simulating the movement of a group of particles on the cost map. Each particle represents a potential path solution, and the particle positions are iteratively updated to approach the lowest-cost solution;
[0062] The formula is expressed as:
[0063] Path = MPC - PF - PSO(T, dt, N, M, Cost Map, Weights); Path is the existing path, and MPC - PF - PSO is: Model Predictive Path Planning, Model Predictive Control MPC, Potential Field PF, Particle Swarm Optimization PSO, Cost Map is a cost map used to measure the spatio-temporal costs of different paths, and Weights represents weight coefficients, which are used to balance between different factors, such as safety in path planning, the distance of the global path, and the magnitude of the control input.
[0064] The described MPC algorithm is used to analyze and determine the input with the optimal cost when planning the path to reach the destination.
[0065] The described Potential Field PF (Potential Fields, abbreviated as PF) is an artificial potential field widely used in path planning and obstacle avoidance algorithms for automated robots. It is based on the electromagnetic field theory in physics and creates a virtual potential field around the robot to guide the robot to move from the starting point to the target point while avoiding obstacles.
[0066] ① Basic principle of the potential field algorithm:
[0067] 1. Attractive force: The target point generates an attractive force on the robot, guiding the robot to move towards the target.
[0068] 2. Repulsive force: The obstacle generates a repulsive force on the robot, causing the robot to move away from the obstacle.
[0069] The superposition of these two forces determines the moving direction and speed of the robot in the environment. The robot adjusts its traveling path according to the direction of the total resultant force at each moment.
[0070] ② Advantages of the potential field algorithm:
[0071] - Simple and intuitive: The algorithm is easy to understand and implement, and the calculation process is simple.
[0072] - Real-time performance: Because the amount of calculation is small, it is suitable for real-time obstacle avoidance systems that require quick response.
[0073] The specific content of the PSO algorithm is as follows:
[0074] The PSO algorithm finds the optimal solution by simulating the movement of a group of particles in the search space. Each particle represents a possible path, and the particle updates its position according to the set cost function to find the path with the lowest cost; the PSO algorithm is a population-based optimization method, in which a group of candidate solutions iteratively search for the best solution by exchanging the information they find in the search space. Each particle has a position and a velocity, as shown in equations (1)-(2):
[0075]
[0076] Among them, V i j+1 , V i j are the velocities of the particle in the (j + 1)-th and j-th iterations respectively;
[0077] are the positions of the particle in the (j + 1)-th and j-th iterations respectively;
[0078] γ: Inertia weight, used to adjust the search speed of the particle;
[0079] c1, c2: Acceleration coefficients, used to adjust the adjustment speed of the particle towards the individual best position and the global best position;
[0080] The individual best position of particle i at iteration j;
[0081] gB j : The global best position of all particles at iteration j; rand1 and rand2 are uniformly random values, and the value range is [0:1]; n represents a time step, and this time step n is used to adjust the movement amount of the particle when updating the particle position. In physical or motion models, this form of update equation is common, where the time step n allows the model to move forward at discrete time intervals during the simulation.
[0082] The PSO algorithm uses a cost function to determine an optimal path. The goal is to find a route. The optimization process uses the cost function and combines the cost map derived from the potential field to balance between the safety of driving and the efficiency of the route. The mathematical expression of the cost function, denoted as f, is shown in equation (3):
[0083]
[0084] Among them, the safety weight, the distance weight to the global path, and the input weight are represented by w s 、w d 、w u respectively. represents the position of the i-th particle at time t; this is the position vector of the particle in the Particle Swarm Optimization (PSO), which represents the state or position of the particle at a specific time point. represents the potential energy at the position ; this is usually related to the repulsive force of the obstacles in path planning, calculates the potential energy of the particle at a given position, and is used to judge the safety of this position or the distance from the obstacle to the particle. represents the target distance at the position ; this can be interpreted as the distance between the particle and the target point, and is often used to calculate the proximity of the particle to the end point in path planning. u(t) represents the control input at time t; this refers to the control variable used to adjust the particle path or speed at time t, such as changes in speed, acceleration, or direction, etc. t represents the time parameter; in a dynamic system or model, t is usually used to represent a specific moment or stage. For a path planning algorithm, this helps to track and adjust the path decisions that change over time.
[0085] By adjusting the weights, a balance is achieved among the distance from the obstacle, the compliance with the global path, and the amplitude of the steering input change. Define multiple sets of coefficients W = [ws, wd, wu], and optimize them. Using the r-th g (gBr), the maximum potential value Max(U)jgBr, and the distance between the final position of gBr and the destination point Dgoal(gBr), the global optimum (gB) of each coefficient set w is obtained. The cost function can be expressed by Equation (4) as:
[0086]
[0087] Among them, the gBr with the minimum g(gBr) is selected as the final path.
[0088] g(gBr): This is an evaluation function used to assess the path quality under a given configuration \(gB_r\). The output value of this function is used to determine which set of weight or parameter configurations yields the best path planning results. k1 and k2: Both of these are weight coefficients used to adjust the relative importance of the maximum potential energy and the target distance in the total cost function. k1: The weight coefficient multiplied by the maximum value of the potential energy, which reflects the importance of avoiding collisions or maintaining a safe distance. k2: The weight coefficient multiplied by the distance from the current position to the target position, which reflects the urgency or efficiency of reaching the target. Max(U)∣gBr: This is the maximum value of the potential energy under the configuration gBr, usually associated with the maximum obstacles or the most dangerous areas that may be encountered on the path. Dgoal(gBr): This is the distance from the current position to the target position under the configuration gB_r, used to evaluate the distance cost of reaching the target. Overall, this function evaluates the safety and efficiency of the path under specific parameter configurations, helping to select the best path configuration.
[0089] Advantages of the present invention are as follows:
[0090] (1) High-precision prediction results
[0091] The pollutant diffusion model based on U-Net can quickly calculate the dynamic graph of pollutant diffusion for any release point source and any wind direction, and conduct accuracy evaluation, predict the diffusion range and concentration distribution of pollutants under different environmental conditions, providing a reliable basis for subsequent path planning.
[0092] (2) Improve detection accuracy and efficiency
[0093] Through the MPC algorithm, the process model is used to predict the output changes of the process in the future for a period of time, so as to determine the control action that should be applied to the process at the current moment according to a certain optimization goal. Through the prediction and optimization of MPC, as well as its combined prediction model and feedback correction, the present invention can adjust the control strategy according to the current system state and environmental information at each sampling moment, more accurately predict the diffusion trend of pollutants, thereby optimizing the layout of detection points and the detection frequency, and improving the detection accuracy and efficiency.
[0094] (3) Real-time response and robustness:
[0095] The algorithm can achieve real-time or near-real-time pollutant detection response, and at the same time has strong robustness, can cope with environmental changes and interference, and maintain the stable and reliable operation of the system.
[0096] (4) Quickly and accurately locate the leakage point:
[0097] In the initial stage, the algorithm first monitors the gas density in the environment in real time through the sensors carried on the trolley. When the gas density exceeds the preset threshold, the algorithm determines that there may be a leakage situation, and thus enters the leakage point location stage. Then, the gas density data collected by the sensors is preprocessed to ensure the accuracy and reliability of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] Figure 1 FIG. is a diagram of the pollutant diffusion model based on U-NET of the present invention;
[0099] Figure 2 FIG. is a schematic diagram of the path changing with the number of iterations ( Figure 2 a, 2b, 2c are respectively the paths changing with the number of iterations);
[0100] Figure 3 FIG. is a diagram of the generation of the obstacle avoidance path ( Figure 3 a, 3b are respectively the w coefficients when generating the path with one obstacle according to the coefficient w);
[0101] Figure 4 FIG. is a diagram of the path generated with one obstacle according to the coefficient w ( Figure 4 a, 4b are respectively the paths generated with two obstacles according to the coefficient w; Figure 4 c, 4d are respectively the paths generated with two obstacles according to the coefficient K);
[0102] Figure 5 FIG. is a diagram of the comparison of residual values. DETAILED DESCRIPTION OF THE INVENTION
[0103] Diffusion prediction based on U-Net: Using the pre-trained U-Net model, combined with environmental factors such as the current wind direction and the pollution density at the current point, predict the next pollutant diffusion trend. According to the real-time monitoring data, continuously update and correct the diffusion concentration map to reflect the latest pollution situation.
[0104] By analyzing the diffusion concentration map, the algorithm guides the trolley to move in the direction of the highest concentration. During the process of approaching the leakage point, continuously repeat the above steps, that is, update the diffusion concentration map, the algorithm analyzes, and guides the trolley to move. Through an iterative method, gradually narrow the search range until the specific location of the leakage point is located.
[0105] Modeling of complex environmental factors
[0106] The diffusion of pollutants is affected by various environmental factors, such as wind direction, wind speed, humidity, temperature, etc. How to integrate these complex environmental factors into the U-Net model so that it can accurately simulate the diffusion behavior of pollutants under different environmental conditions is a key technical issue.
[0107] Optimized Detection Strategy
[0108] Traditional pollutant detection algorithms may have problems such as low detection accuracy and slow response speed. The pollutant detection algorithm based on Model Predictive Control (MPC) needs to solve how to accurately predict the diffusion trend of pollutants, so as to optimize the layout and detection frequency of detection points and improve the detection efficiency.
[0109] Global Optimization Search
[0110] This invention needs to solve how to combine the Particle Swarm Optimization (PSO) algorithm to find the optimal value with few parameters in a complex pollutant detection environment and timely adjust the detection strategy.
[0111] Real-time Performance and Robustness:
[0112] Pollutant detection usually requires real-time or near-real-time response. At the same time, the system needs to be able to cope with environmental changes and interference. The algorithm needs to solve how to enhance the robustness of the system while ensuring real-time performance so that it can operate stably and reliably.
[0113] Gas Leakage Point Detection and Location:
[0114] Many gas leakage inspection devices can only roughly locate the general location of gas leakage. However, when the gas diffusion range is large, it is difficult to find the exact location of gas leakage, which poses a huge challenge to the safety of inspection personnel. According to our method, we not only detect that there is gas leakage, but also detect the real gas leakage source to help inspection personnel accurately locate the source of safety hazards. When the gas density is detected to exceed the threshold, how to quickly and accurately determine the location of the leakage point requires accurate modeling of the diffusion mode and using real-time detection data to locate the leakage source, while considering the influence of environmental factors.
[0115] The overall technical solution is that when the gas sensor of the robot detects that the concentration of toxic gas exceeds the safe concentration, the algorithm will make a prediction according to the gas diffusion model based on U-NET we trained, and predict the possible gas leakage location according to the real-time wind direction. The specific method is to randomly select several possible points and input them into the gas diffusion model. The model checks whether the gas diffusion at this point is likely to reach the current area through prediction, and whether the predicted gas concentration is close to the real-time monitored concentration. Select a point with the closest prediction situation to the real-time monitoring situation as the possible gas leakage point. Finally, adopt the inspection algorithm based on MPC, PF, and PSO to select an optimal path to the predicted possible gas leakage point. At the same time, on the way of the path, continue to predict the possible gas leakage detection points according to the real-time concentration of toxic gas through the gas diffusion model. If it is found that the predicted gas leakage point has changed, update the path information and go to the gas leakage point according to the updated path.
[0116] 1. For the inspection algorithms based on MPC, PF, and PSO:
[0117] (1) Model Predictive Path Planning (Content of MPC algorithm)
[0118] Model Predictive Control (MPC) is usually used to analyze and determine the cost - optimal input when planning a path to a destination. However, in real - time systems, numerical optimization techniques are superior to finding the global - optimal input. MPC is used in a timely manner to apply vehicle models and input / output limitations, rather than finding the optimal path. In model - predictive path planning, a path is planned by predicting into the future T within a time interval dt.
[0119] (2) Particle Swarm Optimization (Content of PSO particle swarm optimization algorithm)
[0120] Particle Swarm Optimization is a population - based optimization method that uses a bionic intelligent algorithm. Under the MPC framework, PSO is used to optimize path selection. PSO finds the optimal solution by simulating the movement of a group of particles in the search space, where each particle represents a possible path. The particles update their positions according to a set cost function to find the path with the lowest cost. Its purpose is to quickly find the optimal value with fewer parameters. The particle swarm algorithm is a population - based optimization method in which a set of candidate solutions (called particles) iteratively search for the best solution (fitness) by exchanging the information they have discovered in the search space. Each particle has a position and a velocity, as shown in equations (1) - (2):
[0121]
[0122] where, V i j+1 , V i j are the velocities of the particle in the (j + 1)-th and j - th iterations respectively;
[0123] are the positions of the particle in the (j + 1)-th and j - th iterations respectively.
[0124] γ: Inertia weight, used to adjust the search speed of the particle.
[0125] c1, c2: Acceleration coefficients, used to adjust the adjustment speed of the particle towards its individual best position and the global best position.
[0126] The individual best position of particle i at iteration j.
[0127] gB j: The global best position of all particles at iteration j. rand1 and rand2 are uniformly random values in the range [0:1].
[0128] (3) Selective cost function
[0129] The PSO algorithm uses a cost function to determine an optimal path, the goal of which is to minimize the driving distance while avoiding collisions. The goal is to find a route that either follows a predefined path with high fidelity or seeks the shortest possible path, avoiding any potential collisions in both cases. This optimization process uses the cost function, combined with a cost map derived from the potential field, to balance the safety of driving and the efficiency of the route. The mathematical expression of the cost function, denoted as f, is shown in Equation (3):
[0130]
[0131] where the safety weight, the distance weight to the global path, and the input weight are represented by ws, wd, and wu respectively. By adjusting these weights, a balance can be achieved between the distance to the obstacle, the compliance with the global path, and the magnitude of the steering input change. This method can prevent unnecessary avoidance in sparsely populated obstacle spaces and reduce the risk of generating dangerous paths in areas with many obstacles. To ensure optimal obstacle avoidance, it is recommended to define multiple sets of coefficients W = [ws, wd, wu] and optimize them. Using the r-th gB (gBr), the maximum potential value Max(U)jgBr, and the distance between the final position of gBr and the destination point Dgoal(gBr), the global optimum (gB) of each coefficient set w can be obtained, and the cost function can be expressed as Equation (4):
[0132]
[0133] Selecting the gBr with the minimum g(gBr) as the final path will allow the above problems to be avoided.
[0134] (2) Algorithm flow
[0135] In path planning algorithms using selective model predictive control (MPC), artificial potential fields (APFs), and particle swarm optimization (PSO), the final path is generated through a series of calculation and optimization steps as follows:
[0136] 1. Establish model and environmental perception: First, the algorithm needs to obtain environmental information about the current position of the vehicle, such as the positions of obstacles and the target position. This information can be obtained through the vehicle's sensing system, such as devices like radar or light detection and ranging (LiDAR).
[0137] 2. Calculate the potential field: Calculate the potential field value based on the distance between the vehicle and the obstacle and the distance between the vehicle and the target point. The potential field method guides the vehicle's movement through repulsive forces (emanating from obstacles) and attractive forces (towards the target point).
[0138] 3. Model Predictive Control (MPC): Use the MPC method to predict the vehicle state over a period of time in the future and calculate an optimized path. MPC solves for the control input by setting a cost function, enabling the vehicle to approach the target point as closely as possible while avoiding obstacles.
[0139] 4. Particle Swarm Optimization (PSO): Within the MPC framework, use PSO to optimize path selection. PSO simulates the movement of a swarm of particles in the search space and finds the optimal solution, where each particle represents a possible path. The particles update their positions according to the set cost function to search for the path with the lowest cost.
[0140] 5. Path output: After iterative calculations, select the path with the lowest cost function value from all particles (i.e., possible paths) as the final navigation path.
[0141] The final path is usually presented in two main forms:
[0142] List of coordinates: The path can be represented as a list of coordinate points that specify the route from the starting point to the ending point. This list can be directly used by the navigation system to guide the vehicle along the calculated path. Visualization graph: In some applications, especially during the testing and validation phases of path planning, the path is plotted on a graphical interface to visually show the path from the starting point to the target point, usually including the visualization of obstacle positions and the vehicle's movement trajectory.
[0143] (5) The following are the main parameters used in this algorithm and their respective meanings:
[0144] a). Prediction time (T): In Model Predictive Control (MPC), the prediction time is the time horizon for future control inputs. It determines how long the algorithm will predict the vehicle's driving path.
[0145] b). Time step (dt): This is the time interval considered by the algorithm in path planning. A smaller time step can improve the accuracy of path planning but may increase the computational complexity.
[0146] c). Number of particles (N): In Particle Swarm Optimization (PSO), the number of particles determines the sample size when searching for the optimal path. More particles may increase the chance of finding a better path but also increase the computational burden.
[0147] d). Number of iterations (M): This is the maximum number of iterations for the PSO algorithm to perform the search. Increasing the number of iterations can increase the likelihood of finding the optimal solution, but it will also correspondingly increase the computational time.
[0148] e). Weight coefficients (ws, wd, wu) in the cost function: These weight coefficients represent the safety distance, the distance from the global path deviation, and the magnitude of the steering input change, respectively. Adjusting these weights can make a trade-off among safety, path fidelity, and operation smoothness.
[0149] The parameters used are g = 0.95, c1 = 0.333, c2 = 0.5, T = 3, dt = 0.2, N = 40.
[0150] II. The pollutant diffusion model based on U-NET is as Figure 1 shown;
[0151] The network architecture of U-Net is a fully convolutional network, and its architecture design includes two main parts: the contracting path and the expanding path, which are symmetric in the network.
[0152] 1. Contracting Path:
[0153] The purpose of this part is to capture the context information of the image. By successive convolutional and pooling operations, the spatial dimension of the feature map is gradually reduced, while the number of feature channels is increased. Each contracting block usually contains two 3x3 convolutional layers, followed by a ReLU activation function. Then there is a 2x2 max pooling operation for downsampling the feature map to reduce its size. In each downsampling step, the number of feature channels is doubled to capture richer context information.
[0154] 2. Expanding Path:
[0155] The purpose of the expansion path is to restore the spatial dimension in the network for precise localization and segmentation. Each upsampling block in the expansion path first increases the size of the feature map through an up-convolution operation. Then there is a 2x2 convolutional layer to reduce the number of feature channels. Next is an operation of concatenating with the feature map in the contraction path, which helps combine low-level features (such as edge information) with high-level features (such as context information). After that are two 3x3 convolutional layers, each followed by a ReLU activation function. The last layer uses a 1x1 convolution to map the feature vector to the number of target classes.
[0156] In each upsampling step of the expansion path, the feature map of the corresponding layer in the contraction path is copied and concatenated to the feature map of the expansion path. These skip connections allow the network to retain and utilize the previously captured high-resolution information during the upsampling process, thereby improving the accuracy of segmentation.
[0157] This design of U-Net allows the network to learn effectively with limited training samples and can handle images of arbitrary size. Through the overlap-tile strategy, U-Net can seamlessly segment large images while using mirroring to handle the context information at the image edges.
[0158] During training, U-Net is implemented using stochastic gradient descent to optimize the network parameters. Since unpadded convolutions are used, the output image size is smaller than the input image, so the training strategy tends to use larger input image patches rather than large batch sizes to maximize the utilization efficiency of GPU memory. This requires using a high momentum value (0.99) to consider the updates of a large number of previous training samples in the current optimization step.
[0159] The calculation of the loss function depends on the combination of the pixel-level softmax function and the cross-entropy loss function.
[0160]
[0161] The softmax function is defined as:
[0162] This function converts the output of the network into a probability distribution, enabling each pixel to be assigned to the most likely class.
[0163] To emphasize the importance of certain pixels during training, especially for difficult-to-segment regions, such as adjacent thin
[0164]
[0165] To represent the boundaries between cells, U-Net introduces a weight map.
[0166] The weight map helps the network focus more on the boundaries of less common categories and regions in the training data.
[0167] Based on U-NET, we established a pollutant diffusion model that is different from the previous completely physical-based models. Instead, we innovatively used data-driven model design.
[0168] We view pollutant diffusion pattern learning as a dynamic target recognition task, albeit one with a more abstract target form. Using U-Net, we rapidly compute dynamic pollutant diffusion maps for any release point source and any wind direction, and perform accuracy evaluation.
[0169] In addition, the loss function of U-NET was changed to make the model more suitable for our downstream task.
[0170]
[0171] ——Study of pollutant diffusion model:
[0172] We use local urban pollutant diffusion cloud maps as input and use deep learning models to extract the characteristics of pollutant diffusion in the image, which greatly accelerates the model's inference speed.
[0173] Our overall technical strategy utilizes the robot's gas sensors to detect toxic gas concentrations exceeding safe levels. Upon detection, our algorithm activates. This algorithm, based on our trained U-NET-based gas diffusion model, predicts the likely location of a gas leak based on real-time wind direction. Specifically, we randomly select a number of possible points and input them into the gas diffusion model. The model then predicts whether gas diffusion from these points is likely to reach the current area and whether the predicted gas concentrations are close to those observed in real time. The point with the best match between the predicted and the actual monitored conditions is selected as the likely gas leak point. Finally, we employ a patrol algorithm based on MPC, PF, and PSO to select the optimal path to the predicted leak point. During the journey, we continue to use the gas diffusion model to predict possible leak points based on real-time toxic gas concentrations. If the predicted leak point changes, we update the path information and follow the new route to the leak point.
[0174] 3. Combining the path planning algorithm and gas detection, the tracing algorithm process is as follows:
[0175] 1. Initialize gas detection
[0176] The system first reads the gas concentration C in the current environment through a gas sensor and sets a safety gas concentration threshold C safe . The formula for this step is:
[0177] C current = Sensor Data()
[0178] C safe = Threshold Value
[0179] where C current represents the currently detected gas concentration.
[0180] 2. Check the gas leakage risk
[0181] Compare the current gas concentration with the safety threshold to determine whether there is a gas leakage risk:
[0182] if C current > C safe then Risk = True else Risk = False
[0183] 3. Use a gas diffusion model based on U-NET for prediction
[0184] In this step, the model uses the current environmental data (including wind direction and real-time images captured from the monitoring area) to predict gas diffusion. The data input into the U-NET model includes:
[0185] The wind direction W, usually represented as a vector.
[0186] The input tensor I, with a tensor shape of C×H×W (where C represents the number of channels, H is the height, and W is the width. The U-NET model processes these inputs and outputs a predicted pollutant diffusion map, whose tensor shape is similar to the input image, expressing the concentration distribution of the predicted pollutants in different regions. The predicted output tensor shape is T×C×H×W (T is the time step).
[0187] The formula can be expressed as:
[0188] P diffusion = U-Net(I,W)
[0189] 4. Determine the most likely gas leakage point
[0190] Compare the predicted concentration at each potential leakage point with the actual monitoring data:
[0191] Leak Point = argmin Leak Points |P diffusion - C current|
[0192] Here, the leakage point with the smallest difference is selected as the most likely leakage source.
[0193] 5. Use the MPC-PF-PSO algorithm for path planning
[0194] In the fifth step of path planning, the system uses model predictive control (MPC), particle filter (PF), and particle swarm optimization (PSO) algorithms for comprehensive path planning. The details of this inspection algorithm have been described before. This step specifically includes:
[0195] (1) Initialize the cost map Cost Map and algorithm parameters T, dt, N, M.
[0196] (2) Based on the current environmental information and target location, the MPC algorithm predicts possible future states and paths, and optimizes the control input to minimize the path cost.
[0197] (3) PF is used to estimate the uncertainty of the system state and the influence of external noise, enhancing the robustness of path planning.
[0198] (4) PSO finds the optimal path by simulating the movement of a group of particles on the cost map. Each particle represents a potential path solution, and the particle positions are iteratively updated to approach the lowest-cost solution.
[0199] The formula can be expressed as:
[0200] Path = MPC-PF-PSO(T, dt, N, M, Cost Map, Weights)
[0201] 6. Move along the optimal path
[0202] The robot moves along the determined optimal path and updates the gas concentration data and path in real time:
[0203] Update Path based on Real-time Data()
[0204] 7. After reaching the predicted leakage point
[0205] After reaching the predicted leakage point, it is necessary to verify whether the leakage source has really been found. This includes two constraint conditions: Constraint 1: Re-perform the gas diffusion model prediction to confirm whether the new potential leakage point is close to the current location. If the distance D between the newly predicted leakage point and the current location is less than the set threshold D threshold , then Constraint 1 is satisfied.
[0206] if D < D thresholdthen Constraint 1 is satisfied
[0207] Constraint 2: The gas concentration C at the current position current needs to be maintained at a high level and at least higher than the gas concentration C at 80% of the previous detection locations previous .
[0208] if C current >0.8×C previous then Constraint 2 is satisfied
[0209] After both of these constraints are satisfied, confirm that this position is the actual leakage source.
[0210] 8. After detecting the correct leakage point
[0211] Once the leakage point is verified correctly, conduct on-site data collection and notify the patrol personnel.
[0212] The automatic path planning part of this algorithm has the advantage of strong adaptability. The algorithm allows the use of multiple sets of weight coefficients to enhance the adaptability to different environmental conditions. This feature enables the algorithm to make real-time decisions to select a safe path or a fast path according to the current scenario. And it also has a balance between safety and efficiency. The cost function of this algorithm aims to find the shortest path to avoid collisions, so it maintains a balance between safety and route efficiency. This algorithm can also reduce the risk of dangerous paths and reduce the risk of generating unsafe paths in multi-obstacle areas. By selectively avoiding obstacles in sparse obstacle areas, it avoids unnecessary detours.
[0213] The core of this algorithm - U-Net is the basic network of the pollutant diffusion model. This network is widely used in image segmentation and target recognition. In this project, we can regard the learning of the pollutant diffusion pattern as a dynamic target recognition task, except that the form of the target is relatively abstract. In addition, U-Net is relatively lightweight and the code implementation is relatively simple, which can make the most of the limited device computing power and quickly build the network in a short time on edge devices with limited computing resources.
[0214] Common air pollution forecasting methods, such as Calpuff, AERMOD, and CMAQ air quality models, are mainly based on physical principles. Although these methods are accurate, they are relatively complex in data processing and calculation, require high-quality input data and take a long time. This makes them more suitable for conducting regular forecasts for specific regions. However, in the face of emergency pollution events, these models often have difficulty providing help quickly and effectively.
[0215] Based on the pollutant dispersion model, we can rapidly generate dynamic maps of pollutant dispersion for any release source and wind direction, and evaluate their accuracy. Our method uses only localized pollutant dispersion images within an urban area as input, extracting pollutant dispersion characteristics from these images through a deep learning model. This purely data-driven approach eliminates the need for complex physical modeling and offers rapid prediction times, making it ideal for emergency response and decision support for sudden pollution incidents.
[0216] This method uses a pollutant diffusion dataset for a fixed simulated area of 3km x 3km in an urban area. Based on a U-NET-based pollutant diffusion model, it rapidly calculates dynamic images of pollutant diffusion for any release point source and any wind direction, and then performs an accuracy assessment. Using only a localized urban pollutant diffusion cloud map as input, a deep learning model is used to extract features of pollutant diffusion within the image. This purely data-driven approach, without the need for physical modeling, results in fast prediction times and is suitable for assisting in emergency decision-making in the event of a sudden pollution diffusion event.
[0217] The trained pollutant diffusion model can be used to locate the specific location of pollution sources. After various toxic and hazardous gas sensors identify real-time pollutant concentrations, combined with the day's real-time wind direction and the trained pollutant diffusion prediction model, the most likely leak source is predicted. The project's path planning algorithm then automatically plans a route to the potential leak source.
[0218] When the vehicle is at (5,25) and the destination is set to (30,25), the results for M=1, 10 and 30 are as follows: Figure 2 The parameters used are g = 0.95, c1 = 0.333, c2 = 0.5, T = 3, dt = 0.2, and N = 40. The bold red line is the optimal path, and the lines in other colors are candidate paths.
[0219] When encountering Figure 3 When W1 = [0.2, 0.5, 0] and W2 = [1.0, 0.5, 0] are applied, the resulting path is as follows: Figure 4 As shown in the figure, the red line is the optimal path when W1 is applied, and the blue line is the optimal path when W2 is applied. Lines of other colors are candidate solutions for the path.
[0220] like Figure 5 As shown, concentration errors are primarily concentrated near the pollution source (as shown in the red box), with the main values ranging from -0.02 to 0.02. Different colors represent errors in different concentration ranges. Low concentrations represented by blue have relatively small errors, while medium and high concentrations represented by green and red have relatively high average errors. Green areas represent medium concentrations, where large errors affect a larger area.
Claims
1. A method for inspecting, tracing the source of pollutant diffusion based on a U-Net gas diffusion model, characterized in that: Specifically, it includes the following steps: (1) Initialize gas detection First, read the gas concentration C in the current environment through a gas sensor and set a safety gas concentration threshold C safe , and the formula is: C current = Sensor Data() C safe = Threshold Value Among which C current represents the currently detected gas concentration, Sensor Data() represents the abstract function for the gas sensor to detect gas, and Threshold Value represents the pre-set threshold value; (2) Check the gas leakage risk Compare the current gas concentration with the safety threshold to determine whether there is a gas leakage risk: if C current >C safe then Risk = True else Risk = False Then, else, false are pseudo-codes in Python-like language, and Risk is an abstract symbol for dangerous situations; (3) Use a gas diffusion model based on U-NET for prediction The gas diffusion model based on U-NET uses the current environmental data to predict gas diffusion. The current environmental data includes the wind direction and real-time images captured from the monitoring area. The data input into the gas diffusion model based on U-NET includes: The wind direction W, represented as a vector; The input tensor I, with a tensor shape of C×H×W, where C represents the number of channels, H is the height, and W is the width; The gas diffusion model based on U-NET processes the input data and outputs a predicted pollutant diffusion map, whose tensor shape is similar to that of the input image, expressing the concentration distribution of the predicted pollutants in different regions. The shape of the predicted output tensor is T×C×H×W, where T is the time step; The formula is expressed as: P diffusion = U-Net(I, W) where P diffusion represents the predicted tensor of the diffused gas output; (4) Determine the most likely gas leakage point Compare the predicted concentration at each potential leakage point with the actual monitoring data: Leak Point=argmin LeakPoints |P diffusion -C current | Here, the leakage point with the smallest difference is selected as the most likely leakage source, and Leak Point represents the most likely position of the leakage point; the argmin function represents the variable value when the objective function reaches the minimum value. The purpose is to make |P diffusion -C current | reach the minimum by continuously changing Leak Points; (5) Use the MPC-PF-PSO algorithm for path planning and select the optimal path; (6) Move along the optimal path Move along the determined optimal path and update the gas concentration data and the path in real time: Update Path based on Real-time Data() That is, update the path according to the real-time data; (7) After reaching the predicted leakage point After reaching the predicted leakage point, verify whether the leakage source has really been found, including two constraint conditions: Constraint 1: Re - perform the prediction of the gas diffusion model based on U - NET to confirm whether the new potential leakage point is close to the current position. If the distance D between the newly predicted leakage point and the current position is less than the set threshold D threshold , then Constraint 1 is satisfied; if D<D threshold then Constraint 1is satisfied That is, if D < D threshold , then Constraint 1 is considered to be satisfied; Constraint 2: The gas concentration C at the current location current is maintained at a high level and is higher than the gas concentration C at 80% of the previous detection locations previous ; if C current >0.8×C previous then Constraint 2 is satisfied That is, if C current > 0.8 × C previous , then Constraint 2 is considered to be satisfied; After both of these two constraints are met, confirm that this location is the actual leakage source; (8) After detecting the correct leakage point Verify that the leakage point is correct, collect on-site data, and notify the inspection personnel.
2. The pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model according to claim 1, characterized in that: The gas sensor is installed on the robot.
3. A method for inspecting and tracing the diffusion of pollutants based on the U-Net gas diffusion model according to claim 1, characterized in that: The gas diffusion model based on U-NET includes a contracting path and an expanding path; The contracting path is used to capture the context information of the image. By continuous convolution and pooling operations, the spatial dimension of the feature map is gradually reduced, while the number of feature channels is increased. Each contracting block contains two 3x3 convolutional layers, a ReLU activation function, and a 2x2 max pooling operation; The expanding path restores the spatial dimension in the network. Each upsampling block in the expanding path first increases the size of the feature map through a transposed convolution operation, then a 2x2 convolutional layer, followed by an operation of concatenating with the feature map in the contracting path. After that, there are two 3x3 convolutional layers, and each convolutional layer is followed by a ReLU activation function. The last layer uses a 1x1 convolution to map the feature vector to the number of target classes.
4. The pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model according to claim 1, wherein: The content of the MPC-PF-PSO algorithm is as follows: (5-1) Initialize the cost map Cost Map and algorithm parameters T, dt, N, M; T: Prediction Time; dt: Time Step; N: Number of Particles; M: Maximum Number of Iterations; The Cost Map initialization cost map refers to setting the initial environmental model before the algorithm starts, including obstacle positions, safe areas, and target positions. The cost map helps the algorithm evaluate the advantages and disadvantages of different paths by assigning different cost values to different locations; (5-2) Based on the current environmental information and target position, use the MPC algorithm to predict possible future states and paths, and optimize the control input to minimize the path cost; (5-3) Use the PF algorithm to estimate the uncertainty of the system state and the impact of external noise; (5-4) Use the PSO algorithm to find the optimal path by simulating the movement of a group of particles on the cost map. Each particle represents a potential path solution, and the particle positions are iteratively updated to approach the lowest-cost solution; The formula is expressed as: Path = MPC - PF - PSO(T, dt, N, M, Cost Map, Weights); Path is the existing path, MPC - PF - PSO is: Model Predictive Path Planning model predictive control MPC, Potential Field potential field PF, Particle Swarm Optimization particle swarm optimization PSO, Cost Map is the cost map used to measure the spatio-temporal costs of different paths, and Weights represents the weight coefficients.
5. The pollutant diffusion inspection and traceability method based on the U-Net gas diffusion model according to claim 4, characterized in that: The described MPC algorithm is used to analyze and determine the input with the optimal cost when planning the path to the destination.
6. The pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model according to claim 4, characterized in that: The specific content of the described PSO algorithm is as follows: The PSO algorithm finds the optimal solution by simulating the movement of a group of particles in the search space. Each particle represents a possible path, and the particle updates its position according to the set cost function to find the path with the lowest cost; The PSO algorithm is a population-based optimization method, where a group of candidate solutions iteratively search for the best solution by exchanging the information they discover in the search space. Each particle has a position and a velocity, as shown in equations (1)-(2): where V i j+1 , V i j are the velocities of the particle in the (j + 1)-th and j-th iterations respectively; are the positions of the particle in the (j + 1)-th and j-th iterations respectively; γ: Inertia weight, used to adjust the search speed of the particle; c1, c2: Acceleration coefficients, used to adjust the adjustment speed of the particle towards the individual best position and the global best position; The individual best position of particle i at iteration j; gB j : The global best position of all particles at iteration j; rand1 and rand2 are uniformly random values with a range of [0:1]; n represents a time step, which is used to adjust the movement amount of particles when updating the particle positions.
7. A method for inspecting, tracing the source of pollutant diffusion based on a U-Net gas diffusion model according to claim 6, characterized in that: The PSO algorithm uses a cost function to determine an optimal path. The goal is to find a route, and the optimization process uses the cost function, combined with the cost map derived from the potential field, to balance the safety of driving and the efficiency of the route. The mathematical expression of the cost function, denoted as f, is shown in equation (3): Among them, the safety weight, the distance weight to the global path, and the input weight are represented by w s , w d , w u respectively. represents the position of the i-th particle at time t; represents the potential energy at the position ; represents the target distance at the position ; u(t) represents the control input at time t; t represents the time parameter; By adjusting the weights, a balance is achieved among the distance to the obstacle, the compliance with the global path, and the amplitude of the steering input change. Define multiple sets of coefficients \(W = [w_s, w_d, w_u]\) and optimize them. Using the \(r\)-th \(g(gB_r)\), the maximum potential value \(Max(U)_{jgB_r}\), and the distance between the final position of \(gB_r\) and the destination point \(D_{goal}(gB_r)\), the global optimum \((gB)\) of each coefficient set \(w\) is obtained. The cost function can be expressed by Equation (4) as follows: Among them, the \(gB_r\) with the minimum \(g(gB_r)\) is selected as the final path.
Citation Information
Patent Citations
Water quality state fusion perception and prediction traceability method
CN118070234A
Dynamic emergency early-warning assessment and decision-making support method and system for sudden atmospheric pollution accident
WO2021120765A1