Pollutant diffusion inspection and tracing method based on U-Net gas diffusion model
Through the U-Net-based gas diffusion model and MPC-PF-PSO algorithm, the problem of complex calculations and lack of traceability in the existing technology is solved, and the rapid and accurate prediction of pollutant diffusion and leakage point positioning in sudden pollution events are achieved, which improves detection efficiency and decision-making support capabilities.
Patent Information
- Application Number
- CN202411583654.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-07
AI Technical Summary
The existing gas pollution prediction model has complex calculations and high data requirements, making it difficult to provide decision support quickly and effectively in sudden pollution events. Most technologies only pursue pollutant detection without tracing the source.
U-Net-based gas diffusion model is adopted to quickly calculate the dynamic image of pollutant diffusion through deep learning, and path planning is carried out in combination with MPC-PF-PSO algorithm to realize pollutant traceability and leakage point positioning.
It achieves rapid and accurate prediction of pollutant diffusion trends and positioning leakage points in sudden pollution events, provides timely decision-making support, and improves detection accuracy and efficiency.
Smart Images

Figure CN119558178A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental monitoring, and in particular to a pollutant diffusion inspection and tracing method based on a U-Net gas diffusion model. Background Art
[0002] At present, the existing common gas pollution prediction models are all constructed based on physical principles. For example, the Calpuff model adopts a three-dimensional non-steady-state Lagrangian diffusion model, which is mainly composed of terrain, meteorological data preprocessing module, Calmet module, Calpuff module and Calpost module. It uses methods such as smoke puff function segmentation, terrain tracking coordinates, and diagnostic wind field model CALMET. It can accurately determine the source of pollutants at the receptor point, but the calculation process is relatively complicated and has very high requirements for data. When faced with pollution incidents caused by sudden behaviors, it often cannot play its due role.
[0003] More importantly, too many current pollutant inspection technologies only pursue the detection of pollutants, but do not trace the source of pollutants. When the scope of pollutant pollution expands, knowing the existence of pollutants is far from enough to deal with the pollution threat. Unknown pollution leakage sources pose a huge safety hazard to risk relief personnel. Therefore, an algorithm is needed to extend pollutant monitoring and find the concentration leakage source of pollutants. Summary of the invention
[0004] The purpose of the present invention is to remedy the defects of the prior art and provide a pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model.
[0005] The present invention adopts the data-driven U-Net pollutant diffusion deep learning model. By demarcating a fixed area of 3km*3km in a certain urban area and adopting the pollutant diffusion model, the diffusion dynamic image of the pollutant emission point at any location and under any wind direction can be quickly calculated. Only the local pollutant diffusion image of the city is required as input. The pollutant diffusion characteristics in the image are identified by applying the deep learning model. It completely relies on the data itself and does not require the construction of traditional physical models. The prediction time is short and timely decision support can be provided when sudden pollution diffusion events occur.
[0006] In addition, 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 cause the planned path to be unable to be executed in the actual environment, and due to the large amount of calculation, it will take a lot of time to deal with large-scale problems.
[0007] In contrast, the path planning algorithm of the present invention is based on the selective MPC-PF-PSO algorithm, which combines the three methods of 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. The system constraints can be taken into account, so that the planned path is 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 in large-scale problems, greatly reducing the 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 through the gas sensor, and a safe gas concentration threshold C is set. safe , the formula is:
[0013] C current =Sensor Data()
[0014] C safe =Threshold Value
[0015] Among them C current Indicates the currently 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 risk of gas leakage:
[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) Prediction using the U-NET-based gas diffusion model
[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 to the U-NET-based gas diffusion model includes:
[0022] Wind direction W, expressed as a vector;
[0023] Input tensor I, the tensor shape is 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. Its tensor shape is similar to the input image, expressing the predicted concentration distribution of pollutants in different areas. The predicted output tensor shape is T×C×H×W, where T is the time step.
[0025] The formula is:
[0026] P diffusion =U-Net(I,W)
[0027] Among them, P diffusion Represents the output diffusion gas prediction tensor, which has the shape of T×C×H×W;
[0028] (4) Determine the most likely gas leakage point
[0029] Compare the predicted concentrations with the actual monitoring data for each potential leak point:
[0030] Leak Point = argmin Leak Points |P diffusion -C current |
[0031] Here, the leak point with the smallest difference is selected as the most likely leak source. Leak Point represents the most likely location of the leak 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 | reaches 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, updating the path according to real-time data;
[0037] (7) After reaching the predicted leakage point
[0038] After reaching the predicted leak point, verify whether the leak source has been found, including two constraints:
[0039] Constraint 1: Re-predict the gas diffusion model based on U-NET to confirm whether the new potential leakage point is close to the current location. If the distance D between the new predicted leakage point and the current location 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: Gas concentration C at the current location current Maintained at a high level and above 80% of the gas concentrations at previously detected locations C 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] When both constraints are satisfied, the location is confirmed to be the actual leakage source;
[0046] (8) After detecting the correct leak point
[0047] Verify that the leak point is correct, collect data on site, and notify the inspection personnel.
[0048] The gas sensor is installed on the robot.
[0049] The U-NET-based gas diffusion model includes a contraction path and an expansion path;
[0050] The contraction path is used to capture the contextual information of the image, and gradually reduces the spatial dimension of the feature map through continuous convolution and pooling operations, while increasing the number of feature channels. Each contraction block contains two 3x3 convolution layers, a ReLU activation function and a 2x2 maximum pooling operation;
[0051] The expansion path described is to restore the spatial dimension in the network. Each upsampling block in the expansion path first increases the size of the feature map through an upconvolution operation, followed by a 2x2 convolution layer, followed by an operation of splicing with the feature map in the contraction path, followed by two 3x3 convolution layers, each followed by a ReLU activation function, and the last layer uses a 1x1 convolution to map the feature vector to the number of target categories.
[0052] 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 length of time that the model predictive control (MPC) part uses to predict future states. In path planning, T determines how far ahead the algorithm looks in order to calculate future path points;
[0055] dt: Time step; this is the time interval between each step in the simulation or actual experiment. A smaller dt can improve the accuracy of path planning, but at the same time increase the computational burden.
[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 number of iterations of the particle swarm optimization algorithm. A higher number of iterations can increase the probability of finding the global optimal solution, but it will also increase the running time of the algorithm.
[0058] Cost Map initialization refers to setting the starting environment model before the algorithm starts, including obstacle locations, safe areas, and target locations. The cost map helps the algorithm evaluate the pros and cons of different paths by assigning different cost values to different locations; for example, the cost value near an obstacle will be higher to prevent the robot from entering.
[0059] (5-2) Based on the current environment information and target location, the MPC algorithm is used to predict possible future states and paths, and the control input is optimized 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) The PSO algorithm is used 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 minimum cost solution is approached by iteratively updating the particle position.
[0062] The formula is:
[0063] Path = MPC-PF-PSO (T, dt, N, M, Cost Map, Weights); Path is the existing path, MPC-PF-PSO is: Model Predictive Path Planning MPC, Potential Field PF, Particle Swarm Optimization PSO, Cost Map is the cost map used to measure the time and space costs of different paths, Weights represents the weight coefficients, which are used to balance between different factors, such as safety in path planning, the distance of the global path, and the size of the control input.
[0064] The MPC algorithm is used to analyze and determine the cost-optimal input when planning a path to a destination.
[0065] The Potential Field PF is an artificial potential field (PF) and is a widely used path planning and obstacle avoidance algorithm 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] ①The basic principle of potential field algorithm:
[0067] 1. Attraction: The target point generates an attraction to the robot, guiding the robot to move toward the target.
[0068] 2. Repulsion: Obstacles produce repulsion on the robot, causing the robot to stay away from the obstacles.
[0069] The combination of these two forces determines the direction and speed of the robot's movement in the environment. The robot adjusts its path at every moment according to the direction of the total force.
[0070] ②Advantages of potential field algorithm:
[0071] -Simple and intuitive: The algorithm is easy to understand and implement, and the calculation process is simple.
[0072] -Real-time: Because the amount of calculation is small, it is suitable for real-time obstacle avoidance systems that require fast response.
[0073] The specific contents of the PSO algorithm are as follows:
[0074] The PSO algorithm simulates the movement of a group of particles in the search space and finds the optimal solution. Each particle represents a possible path. 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 searches for the best solution by exchanging their discovery information in the search space. Each particle has a position and 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 iterations j+1 and j respectively;
[0077] are the positions of the particle in iterations j+1 and j respectively;
[0078] γ: Inertia weight, used to adjust the search speed of particles;
[0079] c1, c2: acceleration coefficients, used to adjust the speed of particles to the individual optimal position and the global optimal position;
[0080] The individual best position of particle i at iteration j;
[0081] B j : The global optimal position of all particles at iteration j; rand1 and rand2 are uniform random values in the range [0:1]; n represents a time step, which is used to adjust the movement of particles when updating the particle position. This form of update equation is common in physical or motion models, where the time step n allows the model to advance 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 graph derived from the potential field to strike a balance between driving safety and route efficiency. The mathematical expression of the cost function, denoted as f, is shown in formula (3):
[0083]
[0084] Among them, the safety weight, the distance weight to the global path, and the input weight are respectively expressed by w s 、w d 、w u express, Represents the position of the i-th particle at time t; this is the position vector of the particle in Particle Swarm Optimization (PSO), which represents the state or position of the particle at a specific point in time. Representative in position This is usually related to the repulsive force of obstacles in path planning. The potential energy of the particle at a given position is calculated to determine the safety of the position or the distance from the obstacle to the particle. Representative in position The target distance; 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 speed, acceleration, or change in direction. t represents the time parameter; in dynamic systems or models, t is often used to represent a specific moment or stage. For path planning algorithms, this helps track and adjust path decisions that change over time.
[0085] By adjusting the weights, a balance is achieved between the distance to obstacles, compliance with the global path, and the magnitude of the steering input change. Multiple sets of coefficients W = [ws, wd, wu] are defined and optimized. The global optimum (gB) of each coefficient set w is obtained using the rth 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 cost function can be expressed as Equation (4):
[0086]
[0087] Among them, gBr with the smallest g(gBr) is selected as the final path.
[0088] g(gBr): This is an evaluation function used to evaluate the quality of the path under a given configuration \(gB_r\). The output of this function is used to determine which set of weights or parameter configurations produces the best path planning results. k1 and k2: These are weight coefficients that are used to adjust the relative importance of the maximum potential energy and the target distance in the total cost function. k1: Weight coefficient, multiplied by the maximum potential energy, which reflects the importance of avoiding collisions or maintaining a safe distance. k2: 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 configuration gBr, which is usually associated with the largest obstacle or most dangerous area that may be encountered on the path. Dgoal(gBr): This is the distance from the current position to the target position under configuration gB_r, which is used to evaluate the distance cost to reach the target. This function overall evaluates the safety and efficiency of the path under a specific parameter configuration, helping to select the best path configuration.
[0089] The advantages of the present invention are:
[0090] (1) High-precision prediction results
[0091] The pollutant diffusion model based on U-Net can quickly calculate the pollutant diffusion dynamic map of any release point source and any wind direction, perform accuracy evaluation, and 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, so as to determine the control effect 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 detection frequency, and improving 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 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 on the car. When the gas density exceeds the preset threshold, the algorithm determines that there may be a leak, and then enters the leak point location stage. The gas density data collected by the sensor is then preprocessed to ensure the accuracy and reliability of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] Figure 1 This is a pollutant diffusion model diagram based on U-NET of the present invention;
[0099] Figure 2 Schematic diagram of the path changing with the number of iterations ( Figure 2 a, 2b, and 2c are the paths that change with the number of iterations, respectively);
[0100] Figure 3 Generate a graph for the obstacle avoidance path ( Figure 3 a, 3b are the w coefficients when generating the path with one obstacle according to the coefficient w);
[0101] Figure 4 To generate a path diagram with one obstacle based on the coefficient w ( Figure 4 a, 4b are the paths generated when there are two obstacles according to the coefficient w; Figure 4 c, 4d are the paths generated when there are two obstacles according to the coefficient K);
[0102] Figure 5 This is a comparison chart of residual values. DETAILED DESCRIPTION
[0103] Diffusion prediction based on U-Net: Use the pre-trained U-Net model, combined with environmental factors such as current wind direction and pollution density at the current point, to predict the next pollutant diffusion trend. Based on real-time monitoring data, the diffusion concentration map is continuously updated and revised to reflect the latest pollution situation.
[0104] By analyzing the diffusion concentration map, the algorithm guides the car to move in the direction of the highest concentration. In the process of approaching the leak point, the above steps are repeated continuously, that is, updating the diffusion concentration map, algorithm analysis, and guiding the car to move. Through iteration, the search range is gradually narrowed until the specific location of the leak point is located.
[0105] Modeling of complex environmental factors
[0106] Pollutant diffusion is affected by a variety of 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] Optimizing detection strategies
[0108] Traditional pollutant detection algorithms may have problems such as low detection accuracy and slow response speed. Pollutant detection algorithms based on model predictive control (MPC) need to solve the problem of how to accurately predict the diffusion trend of pollutants, thereby optimizing the layout of detection points and detection frequency and improving detection efficiency.
[0109] Global optimization search
[0110] The present invention needs to solve how to combine the particle swarm optimization algorithm (PSO) to find the optimal value with few parameters in a complex pollutant detection environment and adjust the detection strategy in time.
[0111] Real-time and robustness:
[0112] Pollutant detection usually requires real-time or near real-time response, and the system needs to be able to cope with welcome changes and interference. The algorithm needs to solve how to ensure real-time while enhancing the robustness of the system so that it can operate stably and reliably.
[0113] Gas leak detection and location:
[0114] Many gas leak inspection devices can only roughly locate the approximate location of the gas leak. However, when the gas diffusion range is large, it is difficult to find the exact location of the gas leak, which is a huge challenge to the safety of the inspectors. According to our method, we not only detect the gas leak, but also detect the real source of the gas leak to help the inspectors accurately locate the source of the safety hazard. When the gas density is detected to exceed the threshold, how to quickly and accurately determine the location of the leak point requires accurate modeling of the diffusion pattern and the use of real-time detection data to locate the source of the leak, while considering the influence of environmental factors.
[0115] The overall technical solution is that when the robot's gas sensor detects that the concentration of toxic gas exceeds the safe concentration, the algorithm will make predictions based on the gas diffusion model based on U-NET that we have trained, and predict the possible gas leakage location based on the real-time wind direction. The specific method is to randomly select several possible points to input into the gas diffusion model. The model predicts whether the gas diffusion at this point is likely to reach the current area, and whether the predicted gas concentration is close to the real-time monitored concentration. Select a point that is closest to the predicted situation and the real-time monitoring situation as a possible gas leakage point, and finally use 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, continue to predict possible gas leakage detection points based on the real-time toxic gas concentration through the gas diffusion model. If the predicted gas leakage point is found to have changed, the path information is updated and the gas leakage point is reached according to the updated path.
[0116] 1. For inspection algorithms based on MPC, PF, and PSO:
[0117] (1) Model Predictive Path Planning (MPC algorithm content)
[0118] Model predictive control (MPC) is commonly used to analytically determine the most cost-effective inputs when planning a path to a destination. However, in real-time systems, numerical optimization techniques are superior to finding the global optimal input. Instead of finding the optimal path, MPC is used to apply vehicle models and input / output constraints. In model predictive path planning, a path is planned by predicting to T within a time interval dt.
[0119] (2) Particle Swarm Optimization (PSO particle swarm optimization algorithm content)
[0120] Particle swarm optimization is a population-based optimization method that uses a bionic intelligent algorithm. In the MPC framework, PSO is used to optimize path selection. PSO simulates the movement of a group of particles in the search space and finds the optimal solution, where each particle represents a possible path. Particles update their positions according to the set cost function to find the path with the lowest cost. Its purpose is to quickly find the optimal value while using fewer parameters. Particle swarm optimization is a population-based optimization method in which a group of candidate solutions (called particles) iteratively search for the best solution (fitness) by exchanging their discovery information in the search space. Each particle has a position and velocity, as shown in equations (1)-(2):
[0121]
[0122] Among them, V i j+1 ,V i j are the velocities of the particle in iterations j+1 and j respectively;
[0123] are the positions of the particle in the j+1 and j iterations respectively.
[0124] γ: Inertia weight, used to adjust the search speed of particles.
[0125] c1, c2: acceleration coefficients, used to adjust the speed of particles moving toward the individual optimal position and the global optimal position.
[0126] The individual best position of particle i at iteration j.
[0127] B j: The global optimal position of all particles at iteration j. rand1 and rand2 are uniform 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 whose goal 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, in both cases avoiding any potential collisions. The optimization process uses the cost function, combined with the cost map derived from the potential field, to strike a balance between driving safety and route efficiency. The mathematical expression of the cost function, denoted by f, is shown in equation (3):
[0130]
[0131] Among them, 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 amplitude of the steering input change. This approach can prevent unnecessary avoidance in sparsely populated obstacle spaces and reduce the risk of creating 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 rth 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 is obtained, and the cost function can be expressed as formula (4):
[0132]
[0133] Among them, choosing gBr with the smallest g(gBr) as the final path will allow avoiding the above mentioned problems.
[0134] (2) Algorithm Process
[0135] In the path planning algorithm 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. Build models and environmental perception: First, the algorithm needs to obtain environmental information about the vehicle’s current location, such as the location of obstacles and the location of the target. This information can be obtained through the vehicle’s sensor system, such as radar or laser ranging (LiDAR) and other devices.
[0137] 2. Calculate the potential field: Based on the distance between the vehicle and the obstacle and the distance between the vehicle and the target point, calculate the potential field value. The potential field method guides the vehicle movement through repulsion (from the obstacle) and attraction (towards the target point).
[0138] 3. Model Predictive Control (MPC): Use the MPC method to predict the vehicle state in the future and calculate an optimized path. MPC solves the control input by setting a cost function so that the vehicle can get as close to the target point as possible while avoiding obstacles.
[0139] 4. Particle Swarm Optimization (PSO): In the MPC framework, PSO is used to optimize path selection. PSO simulates the movement of a group of particles in the search space and finds the optimal solution. Each particle represents a possible path. Particles update their positions according to the set cost function to find the path with the lowest cost.
[0140] 5. Path output: After iterative calculation, the path with the lowest cost function value is selected from all particles (i.e. possible paths) as the final navigation path.
[0141] The resulting paths usually take two main forms:
[0142] Coordinate list: A path can be represented as a list of coordinate points that specify the route from the starting point to the end point. This list can be used directly by the navigation system to guide the vehicle along the calculated path. Visual graphics: In some applications, especially in the testing and verification phase of path planning, the path will be drawn on a graphical interface to intuitively show the direction of the path from the starting point to the destination point. This usually includes the visualization of obstacle locations and vehicle motion trajectories.
[0143] (5) The following are the main parameters used in the algorithm and their respective meanings:
[0144] a). Prediction time (T): In model predictive control (MPC), the prediction time is the time horizon of future control inputs. It determines how far ahead the algorithm will predict the vehicle’s path.
[0145] b). Time step (dt): This is the time interval that the algorithm considers 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 it will also increase the computational burden.
[0147] d). Iterations (M): This is the maximum number of iterations that the PSO algorithm searches. Increasing the number of iterations can increase the possibility of finding the optimal solution, but it will also increase the calculation time accordingly.
[0148] e) Weight coefficients in the cost function (ws, wd, wu): These weight coefficients represent the safety distance, the distance from the global path, and the magnitude of the steering input change, respectively. Adjusting these weights can make a trade-off between 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] 2. Pollutant diffusion model based on U-NET, such as Figure 1 As shown;
[0151] Net's network architecture is a fully convolutional network, and its architecture design consists of two main parts: a contracting path and an expanding path, which are symmetrical in the network.
[0152] 1. Contracting Path:
[0153] The purpose of this part is to capture the contextual information of the image, and gradually reduce the spatial dimension of the feature map through continuous convolution and pooling operations, while increasing the number of feature channels. Each shrinking block usually contains two 3x3 convolutional layers followed by a ReLU activation function. This is followed by a 2x2 max pooling operation to downsample the feature map and reduce the size of the feature map. In each downsampling step, the number of feature channels is doubled to capture richer contextual information.
[0154] 2. Expanding Path:
[0155] The purpose of the expansion path is to recover the spatial dimension in the network for accurate localization and segmentation. Each upsampling block in the expansion path first increases the size of the feature map through an up-convolution operation. This is followed by a 2x2 convolution layer to reduce the number of feature channels. Next is a concatenation operation with the feature map in the contraction path, which helps combine low-level features (such as edge information) with high-level features (such as contextual information). This is followed by two 3x3 convolution 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 categories.
[0156] At each upsampling step in the expanding path, the feature maps of the corresponding layers in the contracting path are copied and concatenated to the feature maps of the expanding path. These skip connections allow the network to retain and utilize high-resolution information captured previously during the upsampling process, thereby improving segmentation accuracy.
[0157] This design of U-Net allows the network to learn effectively with limited training samples and can process images of any size. Through the overlap-tile strategy, U-Net can seamlessly segment large images while using mirroring to process contextual information at the edge of the image.
[0158] During training, U-Net uses stochastic gradient descent to optimize network parameters. Due to the use of unpadded convolutions, the output image size is smaller than the input image, so the training strategy tends to use larger input image patches instead of large batch sizes to maximize GPU memory utilization. This requires the use of a high momentum value (0.99) so that a large number of previous training samples are considered in the current optimization step.
[0159] The calculation of the loss function relies on the combination of the pixel-level soft maximum function and the cross entropy loss function.
[0160]
[0161] The soft maximum function is defined as:
[0162] This function converts the output of the network into a probability distribution so that each pixel can be assigned to the most likely class.
[0163] In order to emphasize the importance of certain pixels in training, especially for difficult-to-segment areas 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 categories and regions that are less common 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 regard pollutant diffusion pattern learning as a dynamic target recognition task, except that the target's form is relatively abstract. With the help of U-NET, we can quickly calculate the pollutant diffusion dynamic map of any release point source and any wind direction end-to-end 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 this time.
[0170]
[0171] ——Study on pollutant diffusion model:
[0172] We use the local pollutant diffusion cloud map of the city as input and use a deep learning model to extract the characteristics of pollutant diffusion in the image, which greatly speeds up the model's reasoning speed.
[0173] Our overall technical strategy uses the robot's gas sensors to detect toxic gas concentrations that exceed safe levels. When this is detected, our algorithm is activated, which is based on our trained U-NET-based gas diffusion model to predict possible gas leak locations based on real-time wind direction. The specific approach is to randomly select some possible points and input them into the gas diffusion model, which predicts whether the gas diffusion of these points is likely to reach the current area and whether the predicted gas concentration is close to the real-time monitored concentration. We will select a point where the predicted situation best matches the actual monitoring situation as a possible gas leak point. Finally, we will use the inspection algorithm based on MPC, PF, and PSO to select an optimal path to the possible gas leak point we predicted. During the process of going, we will continue to predict possible gas leak points through the gas diffusion model based on the real-time toxic gas concentration, and when we find that the predicted leak point has changed, we will update the path information and go to the gas leak point along the new path.
[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 the gas sensor and sets a safe gas concentration threshold C safe . The formula for this step is:
[0177] C current =Sensor Data()
[0178] C safe =Threshold Value
[0179] Among them C current Indicates the current detected gas concentration.
[0180] 2. Check for gas leak risks
[0181] Compare the current gas concentration with the safety threshold to determine whether there is a risk of gas leakage:
[0182] if C current >C safe then Risk=True else Risk=False
[0183] 3. Prediction using the U-NET-based gas diffusion model
[0184] In this step, the model uses current environmental data, including wind direction and real-time images captured from the monitoring area, to predict gas dispersion. The data input to the U-NET model includes:
[0185] Wind direction W, usually expressed as a vector.
[0186] The input tensor I has a 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 predicted concentration distribution of pollutants in different regions. The predicted output tensor has a shape of 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 leak point
[0190] Compare the predicted concentrations with the actual monitoring data for each potential leak point:
[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 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 to perform path planning. The details of the inspection algorithm have been explained above. This step specifically includes:
[0195] (1) Initialize the 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 impact of external noise, thereby enhancing the robustness of path planning.
[0198] (4) PSO searches for the optimal path by simulating the movement of a group of particles on a cost map. Each particle represents a potential path solution, and the minimum cost solution is approached by iteratively updating the particle position.
[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 leak point, it is necessary to verify whether the leak source has been found. This includes two constraints: Constraint 1: Re-perform the gas diffusion model prediction to confirm whether the new potential leak point is close to the current location. If the distance D between the new predicted leak 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: Gas concentration C at the current location current It needs to be maintained at a high level and at least higher than the gas concentration C at 80% of the previously detected locations previous .
[0208] if C current >0.8×C previous then Constraint 2 is satisfied
[0209] When both constraints are satisfied, the location is confirmed to be the actual leakage source.
[0210] 8. After detecting the correct leak point
[0211] Once the leak point is verified, on-site data collection will be carried out and the inspection personnel will be notified.
[0212] The automatic path planning part of the algorithm has the advantage of strong adaptability. The algorithm allows the use of multiple sets of weight coefficients to enhance adaptability to different environmental conditions. This feature enables the algorithm to make real-time decisions to choose a safe path or a fast path based on the current scenario. It also has a balance between safety and efficiency. The cost function of the algorithm aims to find the shortest path to avoid collisions, thus maintaining a balance between safety and route efficiency. The algorithm can also reduce the risk of dangerous paths and the risk of generating unsafe paths in areas with multiple obstacles, and avoid unnecessary detours by selectively avoiding obstacles in areas with sparse obstacles.
[0213] The core of the algorithm, U-Net, is the basic network of the pollutant diffusion model. The network is widely used in image segmentation and target recognition. In the project, we regard the learning of pollutant diffusion patterns as a dynamic target recognition task, but the target's form is relatively abstract. In addition, U-Net is relatively lightweight and the code implementation is relatively simple. It can maximize the use of limited device computing power on edge devices with limited computing resources and quickly build networks in a short time.
[0214] Commonly used atmospheric 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 complex in data processing and calculation, require high-quality input data and take a long time. This makes them more suitable for routine, area-specific forecasts. However, in the face of emergency pollution events, these models often have difficulty in providing help quickly and effectively.
[0215] Based on the pollutant diffusion model, we can quickly generate dynamic images of pollutant diffusion for any release source and wind direction, and evaluate their accuracy. Our method only uses local pollutant diffusion images within the urban area as input, and extracts pollutant diffusion features in the image through a deep learning model. This purely data-driven method does not require complex physical model construction and has a short prediction time, making it very suitable for emergency response and decision support for sudden pollution incidents.
[0216] The present invention uses a pollutant diffusion data set of a fixed simulation area of 3km*3km in a certain urban area, and according to the pollutant diffusion model based on U-NET, quickly calculates the pollutant diffusion dynamic map of any release point source and any wind direction, and performs accuracy evaluation. Only the local pollutant diffusion cloud map of the city is used as input, and the deep learning model is used to extract the characteristics of pollutant diffusion in the image. It is purely data-driven, does not require the establishment of a physical model, and takes a short prediction time. It is suitable as an emergency disposal decision-making aid for sudden pollution diffusion events.
[0217] The trained pollutant diffusion model can be used to locate the specific location of the pollution source. After identifying the real-time pollutant concentration through various toxic and hazardous gas sensors, combined with the real-time wind direction of the day and the trained pollutant diffusion prediction model, the most likely leakage source location is predicted, and then the project's path planning algorithm is used to realize automatic path planning to the possible leakage source.
[0218] When the vehicle is at (5,25) and the destination is (30,25), the results for M=1, 10 and 30 are shown in the figure below. Figure 2 The parameters used are g = 0.95, c1 = 0.333, c2 = 0.5, T = 3, dt = 0.2, N = 40. The bold red line is the optimal path, and the lines of other colors are candidate paths.
[0219] When encountering Figure 3 When there are obstacles as shown, the generated path will change according to the value of Wr = [ws, wd, wu]r. 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 in the figure, the concentration error is mainly concentrated near the pollution source (as shown in the red box), and the main values are distributed between -0.02 and 0.02. Different colors represent errors in different concentration intervals. The low concentration represented by blue has a relatively small relative error, and the medium and high concentration represented by green and red have a higher average error. The green area represents the medium concentration area, and the large error affects a larger area.
Claims
1. A pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model, characterized by: The specific steps include: (1) Initialize gas detection First, the gas concentration C in the current environment is read through the gas sensor, and a safe gas concentration threshold C is set. safe , the formula is: C current =Sensor Data() C safe =Threshold Value Among them C current Indicates the currently detected gas concentration, Sensor Data() represents the abstract function of the gas sensor to detect gas, and Threshold Value represents the preset threshold; (2) Check for gas leakage risks Compare the current gas concentration with the safety threshold to determine whether there is a risk of gas leakage: if C current >C safe then Risk=True else Risk=False Then, else, and false are Python-like pseudocodes, and Risk is an abstract symbol for dangerous situations; (3) Prediction using the U-NET-based gas diffusion model 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 to the U-NET-based gas diffusion model includes: Wind direction W, expressed as a vector; Input tensor I, the tensor shape is C×H×W, where C represents the number of channels, H is the height, and W is the width; The U-NET-based gas diffusion model processes the input data and outputs a predicted pollutant diffusion map. Its tensor shape is similar to the input image, expressing the predicted concentration distribution of pollutants in different areas. The predicted output tensor shape is T×C×H×W, where T is the time step. The formula is: P diffusion =U-Net(I,W) Among them, P diffusion Represents the output diffuse gas prediction tensor; (4) Determine the most likely gas leakage point Compare the predicted concentrations with the actual monitoring data for each potential leak point: Leak Point=argmin LeakPoints |P diffusion -C current | Here, the leak point with the smallest difference is selected as the most likely leak source. Leak Point represents the most likely location of the leak 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 | reaches minimum; (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 path in real time: Update Path based on Real-time Data() That is, updating the path according to real-time data; (7) After reaching the predicted leakage point After reaching the predicted leak point, verify whether the leak source has been found, including two constraints: Constraint 1: Re-predict the gas diffusion model based on U-NET to confirm whether the new potential leakage point is close to the current location. If the distance D between the new predicted leakage point and the current location 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 satisfied; Constraint 2: Gas concentration C at the current location current Maintained at a high level and above 80% of the gas concentrations at the previously detected locations C previous ; if C current >0.8×C previous then Constraint 2is satisfied That is, if C current >0.8×C previous , then constraint 2 is considered satisfied; When both constraints are satisfied, the location is confirmed to be the actual leakage source; (8) After detecting the correct leak point Verify that the leak point is correct, collect data on site, and notify the inspection personnel.
2. According to claim 1, a pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model is characterized by: The gas sensor is installed on the robot.
3. According to claim 1, a pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model is characterized by: The U-NET-based gas diffusion model includes a contraction path and an expansion path; The contraction path is used to capture the contextual information of the image, and gradually reduces the spatial dimension of the feature map through continuous convolution and pooling operations, while increasing the number of feature channels. Each contraction block contains two 3x3 convolution layers, a ReLU activation function and a 2x2 maximum pooling operation; The expansion path described is to restore the spatial dimension in the network. Each upsampling block in the expansion path first increases the size of the feature map through an upconvolution operation, followed by a 2x2 convolution layer, followed by an operation of splicing with the feature map in the contraction path, followed by two 3x3 convolution layers, each followed by a ReLU activation function, and the last layer uses a 1x1 convolution to map the feature vector to the number of target categories.
4. According to claim 1, a pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model is characterized by: 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; Cost Map Initialization Cost map refers to setting the initial environment model before the algorithm starts, including obstacle locations, safe areas, and target locations. The cost map helps the algorithm evaluate the pros and cons of different paths by assigning different cost values to different locations. (5-2) Based on the current environment information and target location, the MPC algorithm is used to predict possible future states and paths, and the control input is optimized 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) The PSO algorithm is used 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 minimum cost solution is approached by iteratively updating the particle position. The formula is: 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 PF, Particle Swarm Optimization PSO, Cost Map is the cost map used to measure the time and space costs of different paths, and Weights represents the weight coefficient.
5. According to claim 4, a pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model is characterized by: The MPC algorithm is used to analyze and determine the cost-optimal input when planning a path to a destination.
6. According to claim 4, a pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model is characterized by: The specific contents of the PSO algorithm are as follows: The PSO algorithm simulates the movement of a group of particles in the search space and finds the optimal solution. Each particle represents a possible path. 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 searches for the best solution by exchanging their discovery information in the search space. Each particle has a position and velocity, as shown in equations (1)-(2): Among them, V i j+1 ,V i j are the velocities of the particle in iterations j+1 and j respectively; are the positions of the particle in iterations j+1 and j respectively; γ: Inertia weight, used to adjust the search speed of particles; c1, c2: acceleration coefficients, used to adjust the speed of particles to the individual optimal position and the global optimal position; The individual best position of particle i at iteration j; B j : The global optimal position of all particles at iteration j; rand1 and rand2 are uniform random values with a value range of [0:1]; n represents a time step, which is used to adjust the movement of particles when updating the particle position.
7. According to claim 6, a pollutant diffusion inspection and tracing method based on the U-Net gas diffusion model is characterized by: 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 graph derived from the potential field to strike a balance between driving safety and route efficiency. The mathematical expression of the cost function, denoted as f, is shown in formula (3): Among them, the safety weight, the distance weight to the global path, and the input weight are respectively expressed by w s 、w d 、w u express, represents the position of the ith particle at time t; Representative in position potential energy; Representative in position The target distance; u(t) represents the control input at time t; t represents the time parameter; By adjusting the weights, a balance is achieved between the distance to obstacles, compliance with the global path, and the magnitude of the steering input change. Multiple sets of coefficients W = [ws, wd, wu] are defined and optimized. The global optimum (gB) of each coefficient set w is obtained using the rth 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 cost function can be expressed as Equation (4): Among them, gBr with the smallest g(gBr) is selected as the final path.
Citation Information
Patent Citations
Atmospheric pollution tracing method for multi-source data
CN115358332A
Gas leakage source positioning method of PSO algorithm based on neural network optimization
CN117370757A
Method and device for evaluating influence of industrial heat source on atmospheric pollutant concentration
CN117789853A
Multi-condition constraint three-dimensional digital core generation method based on diffusion model
CN117830510A
Water quality state fusion perception and prediction traceability method
CN118070234A
Cited By
Dynamic traffic environment monitoring method and device
CN120148258A
Dynamic Traffic Environment Monitoring Method and Device
CN120148258B
Sample information management system based on big data
CN120218605A
Patrol robot path optimization method and system based on dynamic obstacle avoidance
CN120255529A
Driving method and system of quadruped robot based on neural network model
CN120274766A