Photovoltaic plant unmanned aerial vehicle flight path planning system and method
By combining the feature extraction methods of CBAM and GRU, the accuracy and stability issues of UAV trajectory planning in the dynamic environment of photovoltaic plant area were solved. High sensitivity perception and high accuracy prediction of dynamic obstacles and weather disturbances were achieved, improving the adaptability and robustness of trajectory planning.
Patent Information
- Application Number
- CN202511172712.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-12-02
AI Technical Summary
Drones face challenges in inspecting photovoltaic plants, including insufficient adaptability to dynamic environments, degradation of feature recognition in complex scenes, and limited accuracy of trajectory prediction. In particular, in environments with dynamic obstacles and weather disturbances, sensor noise and algorithm delays lead to lag in response, making it difficult to achieve both high-precision perception and low latency.
A feature extraction method combining CBAM spatial attention layer and GRU channel attention layer is adopted. Spatial and channel features of track data are extracted through 1D-CNN and GRU network. Temporal modeling is performed by combining multi-layer GRU network. Feature descriptors of max pooling and average pooling are fused to enhance the temporal correlation between feature response around obstacles and heading/velocity. A space-motion co-modeling mechanism is established, environmental parameters are dynamically modulated and multi-sensor verification is introduced.
It improves the accuracy and stability of UAV trajectory planning in photovoltaic plant areas, enhances adaptability to dynamic interference, reduces the risk of trajectory abrupt changes, and improves the physical rationality and environmental adaptability of trajectory prediction.
Smart Images

Figure CN121048622A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent inspection technology for unmanned aerial vehicles (UAVs), specifically relating to a UAV trajectory planning system and method for photovoltaic factory areas. Background Technology
[0002] Photovoltaic power plants converted from coal ash landfills face significant technical challenges in drone inspections due to the rugged terrain, sparse vegetation, variable environment, and high dust levels. In the field of photovoltaic power plant operation and maintenance, drone-based automated inspection technology faces several technical difficulties: 1. Insufficient adaptability to dynamic environments. Photovoltaic plant areas (especially those converted from coal ash landfills) are characterized by undulating terrain, sudden obstacles (such as temporary equipment), and meteorological disturbances (crosswinds, dust). Existing preset flight path methods require pre-setting fixed flight paths, which cannot be adjusted in real time when the environment changes. The root cause is the system's lack of real-time perception of dynamic obstacles and meteorological disturbances. Attempts to improve environmental perception by adding infrared sensors have been made, but the false alarm rate increases significantly in dusty environments, and sensor data processing delays result in obstacle avoidance response times exceeding 500 milliseconds, making it difficult to meet the requirements of high-speed flight.
[0003] 2. Degradation of Feature Recognition in Complex Scenes. Photovoltaic arrays have highly repetitive texture structures, with component surface similarity >80%, and are also affected by optical interference such as reflection from component glass and snow accumulation. This leads to feature point matching errors in visual SLAM-based localization methods, with measured positioning drift rates as high as 5%-10%. The root cause is that repetitive textures reduce the distinguishability of scene features, while strong reflections cause image overexposure or feature loss. To improve robustness, existing research attempts to fuse multi-sensor data, but the computational power requirements increase dramatically, resulting in a more than 30% reduction in drone endurance, making it difficult to support continuous operations in large-scale factory areas.
[0004] 3. Limited trajectory prediction accuracy. Traditional dynamic models, such as PID control, discretize the trajectory into independent state points for linear prediction, failing to adequately consider two key factors: airflow between photovoltaic arrays is affected by the tilt angle (15°-40°) and spacing (0.5-2m), forming unsteady vortices, but existing models do not establish the correlation between turbulence and motion state; discretized modeling loses the dependencies between continuous trajectory states, such as the cumulative path deviation caused by crosswinds. This limits the effective prediction duration to 3-5 seconds, and the trajectory error exceeds ±1.5 meters at high-speed flight (>8m / s). Attempts to extend the prediction duration to 10 seconds were made, but due to the exponential increase in complexity of environmental coupling modeling, real-time calculation was not achievable.
[0005] The essence of the aforementioned challenges lies in the fact that the dynamic nature of the environment requires real-time perception and decision-making to form a closed loop. However, sensor noise such as dust interference and ultrasonic waves, coupled with algorithm latency such as visual SLAM computation time exceeding 200ms, cause response lag. The contradiction lies in the difficulty of simultaneously achieving high-precision perception and low latency. Furthermore, the repetitive textures and strong reflections inherent in photovoltaic scenes weaken the discriminative power of optical features, while enhancing feature robustness requires complex algorithms, which conflict with the computing power of edge devices. In addition, accurate trajectory prediction requires simultaneously modeling the environmental physical field (airflow field, reflection field) and the temporal relationship of motion, but the computational load of real-time coupling and solving of multi-physics fields exceeds the capabilities of the onboard processor. These difficulties restrict the accuracy and reliability of UAV trajectory planning in complex photovoltaic plant areas, necessitating the exploration of new technological approaches. Summary of the Invention
[0006] This invention addresses the following technical problems: In drone trajectory planning in photovoltaic factory areas, due to the dynamic nature of the environment (sudden obstacles, weather disturbances) and the special characteristics of photovoltaic scenarios (module reflection, array turbulence), traditional methods have three defects: 1) Spatial feature extraction relies solely on convolutional networks, failing to distinguish between key and non-key areas, resulting in insufficient feature response around obstacles; 2) Temporal feature modeling ignores the channel correlation of speed / heading, weakening motion trend prediction; 3) Spatial and channel features are processed independently, lacking a cross-modal fusion mechanism, causing trajectory prediction to deviate from physical constraints.
[0007] If the CBAM spatial attention layer is directly applied to flight path data, the existing pooling operations easily lose subtle spatial differences due to the low contrast between obstacles and the background in photovoltaic scenarios (such as coal ash surfaces and module shadows). Max pooling and average pooling generate weight matrices that are insensitive to local abrupt changes, resulting in insufficient weighting of key areas (such as the edges of temporary equipment). The weight generation mechanism needs to be optimized to improve the recognition of features surrounding obstacles.
[0008] When processing temporal features in the channel attention layer, noise (such as crosswind disturbances) in the track velocity / heading data weakens the signals of key channels due to traditional dual-pooling compression. Excessive dimensionality reduction (too large a value for r) in the shared fully connected layer will result in the loss of channel features related to turbulence effects. A balance needs to be struck between the dimensionality reduction ratio and feature preservation capability.
[0009] If the time-series modeling module directly adopts the standard GRU, there is a risk of gradient vanishing due to the complex long-term dependencies of the photovoltaic scenario trajectory (such as the cumulative path deviation caused by continuous crosswinds); and when environmental disturbances (sudden winds, reflections) cause abrupt feature changes, overfitting will reduce generalization. It is necessary to enhance the robustness and long-term memory capacity of the time-series modeling.
[0010] Spatial features (position / velocity) and channel features (velocity / heading) have significantly different dimensions (Ds≠Dc), and direct concatenation will lead to feature imbalance. If the dimensions are not aligned, high-dimensional features will dominate the fusion result, weakening key low-dimensional information such as heading. A dimensionality balancing mechanism needs to be established to ensure effective interaction between the two features.
[0011] If trajectory planning methods independently extract spatial / channel features, the strong spatiotemporal coupling in photovoltaic scenarios (such as turbulence varying with speed) will lead to a loss of environment-motion correlation during fragmented processing. Traditional time-series modeling does not consider the real-time impact of physical disturbances (reflection, vortex), causing predicted trajectories to deviate from the actual physical constraints.
[0012] Spatial attention relies on a fixed pooling strategy, which is poorly adaptable to dynamic reflective regions (such as changes in the sun's angle); channel attention does not screen for turbulence-related features, resulting in insufficient response of key motion channels.
[0013] Physical disturbances in photovoltaic scenarios (module reflectivity varying with solar altitude angle, array turbulence varying with tilt angle / wind speed) are highly time-varying, and the lack of an environmental parameter sensing mechanism affects the results. Directly inputting raw features amplifies positional errors due to reflectivity interference, and turbulence distorts velocity predictions. Therefore, a real-time modulation interface for environmental physical quantities needs to be established.
[0014] Physical modulation requires multi-source data (solar angle, wind speed, tilt angle), but poor sensor sampling delay can lead to parameter inaccuracies; sudden obstacles (birds, vehicles) require disabling the physical model, but traditional methods lack dynamic start-stop mechanisms. If visual detection misjudges (e.g., identifying reflections as obstacles), it will incorrectly disable critical compensation functions.
[0015] In multi-sensor verification, the failure of a single sensor (dust obscuring the lens, metal reflection interfering with radar) can lead to misjudgments. When environmental stability is low (σ≥3.0), the reliability of the physical model decreases, requiring the integration of historical trajectory knowledge for decision-making. Existing methods lack confidence weights and multi-level verification logic, making it difficult to handle complex combinations of interference.
[0016] To achieve the objectives of this invention, a preferred embodiment is a drone trajectory planning system for photovoltaic factory areas, comprising: The spatial feature extraction submodule, consisting of a 1D-CNN layer and a CBAM spatial attention layer connected sequentially, receives track position and velocity data, extracts local spatial features through convolutional operations, and weights key regions using a spatial attention mechanism. The channel feature extraction submodule, consisting of a GRU layer and a CBAM channel attention layer connected sequentially, receives track velocity and heading data, captures temporal dependencies through gated recurrent units, and strengthens key feature channels using a channel attention mechanism. The feature fusion module receives the spatial feature vector output by the spatial feature extraction submodule and the channel feature vector output by the channel feature extraction submodule, and concatenates them along the feature dimension. The temporal modeling module, composed of a GRU network, receives the concatenated features output by the feature fusion module and mines long-term spatiotemporal dependencies of the track through multi-layer gated recurrent units. The track generation module, containing fully connected layers, receives the output features from the temporal modeling module and generates predicted coordinates for future track point sequences.
[0017] Preferably, in the system of the present invention, in the spatial feature extraction submodule, the CBAM spatial attention layer performs the following operations in the following order: S101: Perform global max pooling and global average pooling on the feature map output by the 1D-CNN layer respectively to generate two feature vectors with the same spatial dimension; S102: Concatenate the two feature vectors from S101 along the channel dimension to form a fused feature descriptor with 2 channels; S103: Input the fused feature descriptor into a 1×1 convolutional layer for dimensionality reduction to generate a preliminary spatial weight matrix for a single channel; S104: Perform Sigmoid activation on the preliminary spatial weight matrix to generate a final spatial attention weight matrix with values ranging from [0,1]; S105: Multiply the final spatial attention weight matrix element-wise with the original feature map output by the 1D-CNN layer to output a weighted spatial feature vector.
[0018] Preferably, in the system of the present invention, the CBAM channel attention layer in the channel feature extraction submodule performs the following operations in the following order: S201: Perform global max pooling and global average pooling on the feature map output by the GRU layer in the channel dimension to generate two feature vectors of shape 1×1×C, where C is the number of channels; S202: Input the two feature vectors from S201 into a fully connected layer with shared weights. The output dimension of the fully connected layer is C / r, where r is the channel reduction ratio coefficient, r>1, to generate two dimension-reduced channel attention vectors; S203: Add the two dimension-reduced channel attention vectors element by element and generate a channel attention weight matrix with a value range of [0,1] through the Sigmoid activation function; S204: Multiply the channel attention weight matrix with the original feature map output by the GRU layer channel by channel to output the weighted channel feature vector.
[0019] Preferably, in the system of the present invention, the GRU network in the time-series modeling module processes features in the following order: Input layer: Receives the concatenated features output by the feature fusion module; First processing unit: Contains a hidden layer and a Dropout layer, where: the hidden layer performs a non-linear transformation on the input features, and the output dimension is H1, where H1 > input dimension; the Dropout layer randomly discards neurons output by the hidden layer with probability Pd, where Pd satisfies 0.2 ≤ Pd ≤ 0.5; Second processing unit: Contains a Num_Layer layer, consisting of N stacked GRU units, N ≥ 2, which extracts higher-order temporal dependencies; Feature shrinkage layer: Performs the ReLU activation function on the output of the Num_Layer layer, compressing the feature dimension to H2, where H2
[0020] Preferably, in the system of the present invention, the feature fusion module performs the following operations: Input interface: simultaneously receives a spatial feature vector of dimension Ds from the spatial feature extraction submodule and a channel feature vector Dc from the channel feature extraction submodule; Dimension alignment: maps Ds and Dc to a unified dimension D through a fully connected layer, where Ds≤D and Dc≤D; Feature concatenation: concatenates the aligned spatial feature vector and the channel feature vector along the feature dimension to generate a fused feature vector of dimension 2D×1; Dimension reduction output: compresses the dimension of the fused feature vector to D×1 through a 1×1 convolutional layer and inputs it into the temporal modeling module.
[0021] Preferably, the unmanned aerial vehicle (UAV) trajectory planning method for photovoltaic factory areas of the present invention includes the following steps performed in sequence: Step S1: Perform spatial feature extraction and weighting, including: inputting track position and velocity data into a 1D-CNN network to extract local spatial features; performing the following on the feature map using the CBAM spatial attention mechanism: a) global max pooling and global average pooling; b) concatenating the pooling results along the channel dimension; c) 1×1 convolution dimensionality reduction; d) Sigmoid activation to generate a spatial weight matrix; e) element-wise multiplication of the original features and the weight matrix; outputting a weighted spatial feature vector Vs with a dimension of Ds×1; Step S2: Perform channel-related feature extraction and enhancement, including: inputting track velocity and heading data into a GRU network to extract temporal dependent features; performing the following on the feature map using the CBAM channel attention mechanism: a) global max pooling and global average pooling along the channel dimension; b) dimensionality reduction using a shared fully connected layer, outputting a dimension of C / r×1, with a reduction ratio r>1; c) element-wise addition of the vector and Sigmoid activation; d) Step S3: Perform dual-feature fusion and temporal modeling, including: performing dimension alignment, mapping Vs and Vc to a unified dimension D through fully connected layers, satisfying Ds≤D and Dc≤D; performing feature concatenation, concatenating the aligned vectors along the feature dimensions to generate a fused feature vector Vfuse, with a dimension of 2D×1; performing dimensionality reduction, performing 1×1 convolution compression on Vfuse, outputting Vout, with a dimension of D×1; performing temporal modeling, inputting Vout into a multi-layer GRU network, where the number of GRU layers N≥2; and including a Dropout mechanism, with a dropout probability Pd satisfying 0.2≤Pd≤0.5; Step S4: Perform track sequence generation, including: performing ReLU activation function to compress the feature dimension on the temporal modeling output; mapping to a three-dimensional coordinate space through fully connected layers to generate a predicted sequence of the next K track points.
[0022] Preferably, in the system of the present invention, the spatial attention mechanism in step S1 includes: generating spatial weights by performing max pooling and average pooling on the feature map; and dynamically focusing on the region surrounding the obstacle by activating Sigmoid. The channel attention mechanism in step S2 includes: performing dual pooling compression on the GRU hidden state; and filtering key channel features through a fully connected layer.
[0023] Preferably, in the system of the present invention, before the time-series modeling in step S3, an adaptive modulation step 300 for photovoltaic scene is added: the solar altitude angle θ on the surface of the photovoltaic module is acquired in real time, and the reflectivity interference coefficient α is calculated through a pre-trained reflectivity model. This coefficient is determined by the constant reflectivity k1 of the module glass and the sine square function of the solar altitude angle θ. The spatial feature vector Vs is divided by the compensation factor (1+α) to attenuate the feature response of the strong reflective area. According to the tilt angle β of the photovoltaic array and the real-time wind speed v, the turbulence intensity γ is calculated through a vortex model. This intensity is determined by the product of the array spacing correlation coefficient k2, the wind speed v, and the cosine of the tilt angle β. The turbulence intensity γ is input into a dedicated GRU network to generate a turbulence attention vector At. The turbulence attention vector At is fused with the dimensionality-reduced fusion feature Vout proportionally, and the fusion formula is Vout' = Vout + λ•At, where the attenuation factor λ takes a value of 0.3 to 0.7. The modulated feature vector Vout' is used as the input of the time-series modeling module.
[0024] Preferably, the system of the present invention further adds a multi-source collaborative optimization step 301 in step S300, including: establishing a GPS timestamp-driven data pipeline, performing sliding window dynamic calibration on the input signals of solar altitude angle θ, array tilt angle β, and real-time wind speed v to eliminate sensor sampling delay differences; capturing photovoltaic module images in real time through an airborne camera, generating an abnormal mask M when a sudden obstacle is detected, and dynamically adjusting the weights of the reflective interference coefficient α and turbulence intensity γ: if M detects a temporary obstacle, then α=0, γ=0, and physical compensation is disabled; if M detects a strong reflective area, then the value of α is increased by 30%-50%; based on the environmental stability index σ, the feature fusion ratio is dynamically adjusted according to the linear relationship of λ=0.7 when σ≤1.0 and λ=0.3 when σ≥2.5.
[0025] Preferably, in the system of the present invention, the multimodal verification fault tolerance mechanism constructed in step S301 includes step S302: when the visual mask M detects a sudden obstacle, the millimeter-wave radar is simultaneously activated to scan the point cloud density of the target area. If the point cloud density is ≥50 points / m2, the existence of the obstacle is confirmed. If the conclusions of the camera and the radar conflict, the infrared thermal imaging secondary verification is initiated, and the temperature gradient threshold ΔT≥3℃ / pixel is used as the final judgment basis. Sensor confidence weights are set: visual ωv=0.7, radar ωr=0.8, and infrared ωi=0.9. The start and stop of the physical model are dynamically corrected according to the weighted voting results: physical compensation is disabled when Σ(ω•Si)>1.5, and α=γ=0. When the environmental stability index σ≥3.0, the historical trajectory similarity model of the most recent 10 minutes is loaded. If the cosine similarity between the current feature vector and the historical abnormal trajectory is >0.85, the system automatically switches to the preset safe trajectory mode. Where Si represents the binarized alarm state of the sensor. If sensor i detects an obstacle, then Si = 1; if sensor i does not detect an obstacle, then Si = 0. Σω·Si is the sum of the weighted alarm values of the three types of sensors.
[0026] The beneficial effects of this invention are as follows: 1. The system of this invention enhances the response of features around obstacles through a spatial attention mechanism, improving the sensitivity of sudden obstacle perception; channel attention strengthens the temporal correlation of heading / velocity, improving the accuracy of motion trend prediction; dual feature fusion establishes a spatial-motion collaborative modeling mechanism, making trajectory generation more in line with physical constraints. The system as a whole enhances its adaptability to dynamic interference in photovoltaic scenarios, reducing the risk of trajectory abrupt changes. It integrates dual-path feature descriptors of max pooling and average pooling to retain local abrupt change information (such as device edges); 1×1 convolutional dimensionality reduction avoids overly smooth weight matrices, improving the focusing ability of key areas. The optimized spatial attention can still effectively identify obstacle outlines in low-contrast scenarios (coal ash surface). The shared fully connected layer maintains channel correlation during dimensionality reduction (C / r), suppressing noise interference while retaining turbulence-related features; sigmoid-activated channel weights strengthen key motion channels (such as crosswind response), improving the physical rationality of trajectory prediction. A multi-layered GRU structure captures long-term spatiotemporal dependencies (such as persistent crosswind shifts) and avoids gradient vanishing; the Dropout mechanism (Pd=0.2~0.5) suppresses overfitting caused by environmental disturbances and enhances model generalization; the feature compression layer reduces redundant dimensions and improves the efficiency of temporal modeling. A dimension alignment mechanism balances the contribution of spatial / channel features and avoids high-dimensional features dominating; 1×1 convolution compresses and fuses features, eliminating splicing redundancy and retaining cross-modal interaction information. This allows low-dimensional key features such as heading to effectively participate in trajectory decision-making.
[0027] 2. The method of this invention enhances the modality specificity of spatial and channel feature path extraction; establishes spatiotemporal feature synergy through dimensional alignment and fusion mechanisms; and improves the robustness of long-term dependency modeling through multi-layer GRU+Dropout. Overall, the method improves the stability of trajectory prediction in dynamic photovoltaic scenarios. Spatial attention focuses on the periphery of obstacles through dual-pooling, reducing the false negative rate; channel attention filters features strongly correlated with motion, suppressing the influence of optical interference. The two work synergistically to enhance the ability to extract key information from trajectory data.
[0028] 3. The method of this invention dynamically attenuates the reflective interference coefficient α in the characteristic response of strong reflective areas, reducing positioning drift; the turbulent attention vector At fuses the physical characteristics of the airflow field, improving the trajectory's anti-disturbance capability; the modulated features enhance environmental adaptability and reduce trajectory oscillation. Timestamp calibration eliminates asynchronous errors from multi-source data, ensuring the accuracy of physical parameters; the visual mask M dynamically starts and stops physical compensation to avoid misadjustment under sudden obstacles; λ is adaptively adjusted with σ to balance environmental stability and model reliability. A multi-sensor weighted voting mechanism reduces the risk of single-point failure (such as lens dust); infrared secondary verification resolves optical-radar conflicts; historical trajectory similarity comparison provides avoidance paths when the environment deteriorates. The system as a whole improves decision-making robustness under complex interference.
[0029] Other advantages, objectives and features of the present invention will become apparent in part from the following description, and in part from those skilled in the art through study and practice of the invention. Attached Figure Description
[0030] Figure 1 This invention uses a feature extraction network composed of 1D-CNN and CBAM. Figure 2 The feature extraction network of this invention is composed of GRU and CBAM; Figure 3 This is a schematic diagram of the Convolutional Attention (CBAM) structure of the present invention; Figure 4 This is an overall design diagram of the flight path planning system model for UAV inspection according to the present invention; Figure 5 This is a schematic diagram of the trajectory planning system for UAV inspection composed of 1D-CNN, CBAM, GRU, CBAM, and GRU according to the present invention. Detailed Implementation
[0031] The present invention will be further described in detail below with reference to examples, so that those skilled in the art can implement it based on the description.
[0032] It should be noted that, unless otherwise specified, the experimental methods described in the following implementation plan are all conventional methods, and the reagents and materials described are all commercially available unless otherwise specified.
[0033] It should be understood that terms such as “having,” “comprising,” and “including” as used herein do not exclude the presence or addition of one or more other elements or combinations thereof.
[0034] The system of this invention includes a feature extraction network composed of a one-dimensional convolutional neural network (1D-CNN) and a convolutional block attention module (CBAM), a feature extraction network composed of a gated recurrent unit (GRU) and a convolutional block attention module (CBAM), and a GRU feature extraction network. The training data is connected to the feature extraction networks composed of 1D-CNN and CBAM, and GRU and CBAM, respectively. The features obtained from the two modules are then fused for further processing.
[0035] like Figure 1 As shown, the feature extraction network consists of 1D-CNN and CBAM: it comprises the spatial attention mechanism of 1D-CNN and CBAM. CNN is a feedforward neural network capable of extracting and learning high-dimensional features. It employs backpropagation to optimize the network structure and is a multilayer perceptron. Its key features include local connectivity and weight sharing, significantly reducing the number of weights and mitigating the risk of overfitting. A typical CNN consists of an input layer, convolutional layers, pooling layers, and fully connected layers. The input layer receives the raw data and preprocesses it, such as removing the mean and normalizing. Convolutional layers extract features at different levels through convolution operations; the higher the layer, the more abstract the feature representation. The feature dimension of the convolutional layer output is usually high, requiring pooling layers to reduce the dimensionality of the feature map. The fully connected layers produce the final output. The spatial attention mechanism creates a spatial attention map by utilizing the attribute relationships between different locations in the feature map. Specifically, this mechanism first uses both max pooling and average pooling to divide the input feature map into two vectors of equal size. Then, these two vectors are concatenated along their channel dimensions to form a vector with two channels. Next, a 1x1 convolutional layer is used to reduce the dimensionality of the vector, generating a preliminary weight matrix. Subsequently, a sigmoid activation operation is applied to this weight matrix to obtain the final spatial attention weight matrix. Finally, this weight matrix is element-wise multiplied with the original input features to generate the spatial attention feature map. See attached diagrams of 1D-CNN and CBAM feature extraction networks. Figure 1A schematic diagram of the Convolutional Attention (CBAM) structure is attached. Figure 3 .
[0036] like Figure 2 As shown, the feature extraction network composed of GRU and CBAM consists of GRU gated recurrent units and CBAM channel attention modules. GRU gated recurrent units are a simplified model of LSTM, merging the input and forget gates of LSTM. They only require update and reset gates to control the flow of information, achieving comparable performance to LSTM. LSTM uses special gating mechanisms to control gradient flow: input gate, forget gate, and output gate. The forget gate determines the information to be discarded from the cell state; the input gate determines what information will be stored in the cell state; and the output gate determines what information to output. The channel attention mechanism effectively captures important channel information by spatially compressing and aggregating input features. Specifically, this mechanism first uses max pooling and average pooling to extract feature map vectors to obtain richer high-level features, resulting in two feature map vectors with a shape of 1*1*C. These two vectors are then input into a shared fully connected layer with a weight vector of shape C / r*1*1, where r represents the ratio of intermediate channel reduction. After processing by the fully connected layer, two channel attention vectors are obtained. Finally, these two vectors are summed element-wise and activated using the sigmoid function to generate a channel attention weight matrix. This weight matrix is then multiplied point-by-point with the original input features to produce the final channel attention feature map. See attached diagrams of GRU and CBAM feature extraction networks. Figure 2 .
[0037] The GRU feature extraction network then fuses the features obtained from the two modules above for further processing. The new features obtained in the fusion stage are input into the feature extraction module, which consists of a GRU and a Rectified Linear Unit (ReLU) activation function, to perform a feature shrinkage operation, making the first dimension equal to the output. Then, a fully connected (FC) layer is used for the shrinkage operation, making the second dimension equal to the output feature. The function of the output feature module is to reduce the data dimensionality.
[0038] The beneficial effects of this system are as follows: In trajectory prediction, this structure extracts the spatial and channel features of trajectory data and learns an attention mechanism for these features to improve the model's focus on important features. By fusing the outputs of the two networks and then feeding them into a GRU network for further temporal feature extraction, and finally performing prediction through a fully connected layer (FC layer), the model's ability to understand the temporal features of trajectory data can be further improved, thereby enhancing the accuracy of trajectory prediction.
[0039] This invention presents a trajectory planning system for unmanned aerial vehicle (UAV) inspection of photovoltaic factory areas based on CNN-GRU with convolutional attention: it includes a feature extraction network composed of 1D-CNN and CBAM, a feature extraction network composed of GRU and CBAM, and a GRU feature extraction network.
[0040] For the feature extraction network structure composed of 1D-CNN and CBAM: The feature extraction network composed of 1D-CNN and CBAM is used to extract spatial features of track data, such as the location and velocity information of track points. First, as the core component of the convolutional neural network, the convolutional layer can effectively extract high-dimensional feature representations from complex track sequences. Second, batch normalization (BN) is used to standardize the features and unify the data distribution. Then, the CBAM module learns an attention mechanism for these features to improve the model's focus on important features. One model structure for this part is as follows: For the feature extraction network structure composed of GRU and CBAM: The feature extraction network composed of GRU and CBAM is used to extract the correlation features of different channels in the track data, such as the speed and heading information between different track points. The feature extraction network first divides the track data into multiple time slices, each containing track points within a certain time range. For each time slice, the coordinates of the track points (such as longitude, latitude, time, etc.) are used as input and fed into the GRU network for sequence processing. The GRU network can capture the temporal order relationship in the sequence and generate a series of hidden states. Next, the hidden states of the GRU network are concatenated with other features of the track points (such as speed, direction, etc.) to form an input with channel information. Then, through the training of the hidden state weights by the attention mechanism, the network can learn the key features. This process can effectively capture the correlation features of different channels in the track data. One model structure for this part is as follows: 3. For example Figure 4As shown, the feature extraction network consists of 1D-CNN and CBAM, and the feature extraction network consists of GRU and CBAM in parallel processing structure: the CNN-CBAM layer and the GRU-CBAM layer are connected in parallel as intermediate layers to fuse spatial features and channel features, thereby improving the accuracy and robustness of prediction. Spatial features and channel features are input to the downstream network layers in parallel; the downstream network layers can simultaneously utilize these two complementary features to improve the ability to model the trajectory.
[0041] 4. For example Figure 4 and 5 As shown, the GRU feature extraction network further mines higher-order and more complex temporal patterns and dependencies based on the above. This hierarchical temporal modeling helps to better capture long-term dependencies and periodic features in the track. One model structure for this part is as follows: Based on the above, an example of a photovoltaic factory area UAV trajectory planning system of the present invention includes a spatial feature extraction submodule, a channel feature extraction submodule, a feature fusion module, a temporal modeling module, and a trajectory generation module.
[0042] In the spatial feature extraction submodule, the input track position (including longitude, latitude, and altitude) and velocity (three-axis velocity values) are sampled at a frequency of 10Hz. This submodule adopts a multi-layer 1D-CNN structure. Taking a three-layer structure as an example: the first convolutional layer uses a kernel size of 7×1, a number of kernels of 32, a stride of 2, and the ReLU activation function; the second convolutional layer uses a kernel size of 5×1, a number of kernels of 64, a stride of 1, and the ReLU activation function; the third convolutional layer uses a kernel size of 3×1, a number of kernels of 128, a stride of 1, and the ReLU activation function; a batch normalization layer is added after each layer to accelerate convergence. Then, a CBAM spatial attention layer is connected, which uses standard max pooling and average pooling functions for global pooling operations. The 1×1 convolutional layer has 1 output channel, and the Sigmoid activation function output range is [0,1]. This submodule outputs a spatial feature vector with a dimension of Ds=256, which is used to extract local spatial features (such as the relative positions of adjacent track points) and highlight the features around obstacles (such as the coordinate offset of temporary equipment) through CBAM spatial attention weighting.
[0043] In the channel feature extraction submodule, the inputs are the trajectory speed (in m / s) and heading (in °), with a historical time step of 10 frames (corresponding to 1 second of data). This submodule uses a GRU layer with 128 hidden units and connects to a CBAM channel attention layer. The channel reduction ratio r=16, and the shared fully connected layer activation function is LeakyReLU (negative slope 0.01). The output channel feature vector has a dimension of Dc=128, used to capture temporal velocity dependencies (such as crosswind disturbance response), and key channels (such as motion trend channels) are enhanced through CBAM channel attention.
[0044] The feature fusion module receives spatial feature vectors (Ds=256) and channel feature vectors (Dc=128), aligns them to a unified dimension D=512 using a fully connected layer; the fully connected layer is initialized with He. Subsequently, the aligned feature vectors are concatenated into a 1024-dimensional vector (the 2024-dimensionality mentioned in the original text is incorrect; it should be 1024-dimensional), and then compressed to 512 dimensions using a 1×1 convolutional layer with 512 kernels. This module ensures a balanced interaction of spatial and motion information, outputting a unified feature vector.
[0045] The temporal modeling module receives a 512-dimensional feature vector output from the feature fusion module. It employs a GRU network with N=3 layers and H1=1024 hidden layers; the dropout probability Pd=0.4 (range 0.2-0.5) is activated only during training to enhance robustness. Subsequently, the features are compressed by a feature shrinking layer and output as H2=256-dimensional features via a ReLU activation function to capture long-term dependencies (such as the cumulative effect of crosswinds lasting 10 seconds or path shifts caused by persistent turbulence). The output transformation layer is a fully connected layer with 3K units (K is the number of predicted track points, e.g., K=20).
[0046] The trajectory generation module receives the output of the timing modeling module, generates a three-dimensional coordinate sequence (x, y, z) through a fully connected layer, outputs a predicted sequence of future trajectory points (e.g., K=20 points, ΔT=0.5 seconds / point), and sends it to the flight control actuator.
[0047] In one optional deployment scheme, the three-layer 1D-CNN of the spatial feature extraction submodule is deployed using the ONNX Runtime engine and runs on the UAV embedded AI module (such as NVIDIA Jetson Xavier NX). The dual-pooling operation of the CBAM spatial attention layer is implemented using the OpenCV library and is mounted on the parallel computing core of the same processor. The module input is connected to the GPS / IMU sensor via the MIPI-CSI interface. The GRU layer of the channel feature extraction submodule is optimized based on TensorRT and deployed on the onboard computer (such as Rockchip RK3588). The weights of the fully connected layer of the CBAM channel attention layer are stored in LPDDR5 memory and communicate with the feature fusion module via the I2C bus. The input is connected to the azimuth gyroscope of the flight control system (such as BMI088). The fully connected layer of the feature fusion module is integrated into the NPU unit of the AI module (6 TOPS computing power). The 1×1 convolutional layer is accelerated through the Vulkan API, and the output is connected to the temporal modeling module via the PCIe 3.0 interface. The three-layer GRU network of the temporal modeling module is deployed on the same NPU. The output of the trajectory generation module is connected to the flight control actuator (such as PX4 Autopilot) via a CAN bus.
[0048] In one operational process, the UAV collects its flight path position (GPS coordinates) and velocity (IMU data) in real time, inputting them into a spatial feature extraction submodule. A 1D-CNN layer extracts local spatial features, and a CBAM spatial attention layer generates a weight matrix to highlight key regions. Simultaneously, the flight path velocity and heading input channel feature extraction submodules; a GRU layer captures temporal dependencies in velocity, and a CBAM channel attention layer enhances key channels. After the two feature vectors are input into a feature fusion module, they are aligned to 512 dimensions by a fully connected layer, concatenated into a 1024-dimensional vector, and then compressed back to 512 dimensions. This vector is input into a temporal modeling module, processed by a GRU network (1024-dimensional hidden layers, Dropout randomly discards 40% of neurons), outputting 256-dimensional features to capture long-term dependencies. The fully connected layer outputs a 3D coordinate sequence of the next 20 flight path points (ΔT = 0.5 seconds / point), which is sent to the flight controller actuator.
[0049] Existing technologies employ a pre-defined waypoint inspection method, where fixed waypoints are pre-stored at a ground station, and the flight control system flies point-by-point according to coordinates. However, this method has the following drawbacks: it lacks a real-time feature extraction module, making it unable to respond to dynamic environmental changes (such as sudden obstacle appearances); it lacks an attention mechanism, resulting in unweighted enhancement of features in key areas (such as the area around obstacles); and it lacks feature fusion and time-series modeling, with waypoint generation relying solely on linear interpolation, leading to accumulated path deviations. This implementation addresses the issue of unresponsiveness to sudden obstacles by using CBAM weighted features around obstacles in the spatial feature extraction submodule; it strengthens motion trend channels using CBAM in the channel feature extraction submodule, resolving inaccurate heading prediction; and it captures long-term dependencies through feature fusion and time-series modeling, resolving the path deviation accumulation problem caused by linear interpolation. This improves the response capability to sudden obstacles, enhances heading prediction accuracy, ensures balanced information interaction, and strengthens the robustness of time-series modeling in complex environments to reduce the risk of sudden waypoint changes.
[0050] Furthermore, in another implementation, the CBAM spatial attention layer of the spatial feature extraction submodule performs operations in the following order: S101: Perform global max pooling and global average pooling on the feature map output by the 1D-CNN layer to generate two feature vectors with the same spatial dimension; S102: Concatenate the two feature vectors from S101 along the channel dimension to form a fused feature descriptor with 2 channels; S103: Input the fused feature descriptor into a 1×1 convolutional layer for dimensionality reduction to generate a preliminary spatial weight matrix for a single channel; S104: Perform Sigmoid activation on the preliminary spatial weight matrix to generate a final spatial attention weight matrix with values ranging from [0,1]; Step S105: Multiply the final spatial attention weight matrix element-wise with the original feature map output by the 1D-CNN layer to output a weighted spatial feature vector.
[0051] Specifically, for the CBAM spatial attention layer in step S101, the input feature map size is 128×100 (number of channels C=128, spatial length L=100). Global max pooling is implemented using the `torch.max()` function, and global average pooling is implemented using the `torch.mean()` function. Both process the input feature map, generating two independent 1×100-dimensional feature vectors. Then, in step S102, these two pooling vectors are concatenated along the channel dimension using `torch.cat(dim=0)` to form a 2×100-dimensional fused feature descriptor. Next, the 1×1 convolutional layer in step S103 is configured with one kernel, a stride of 1, and the bias term disabled, outputting a 100-dimensional initial spatial weight vector. Step S104 applies the Sigmoid activation function, whose standard mathematical expression is: The final spatial attention weight matrix is output, with values ranging from [0,1]. Finally, step S105 performs element-wise multiplication via a broadcast mechanism, using the torch.mul() function to expand the original 128×100 dimensional feature map and the 1×100 dimensional weight matrix to the same dimension before performing the operation.
[0052] In one optional configuration, the dual pooling operation of S101 is integrated into the CUDA core of an embedded AI processor (such as the NVIDIA Jetson NX), accelerating it by calling the cudnnPoolingForward() function of the cuDNN library; the input of the pooling unit is connected to the output buffer of the 1D-CNN layer via a 64-bit DDR4 memory bus. The concatenation operation of S102 is deployed in the Tensor Core unit of the same processor, with memory usage kept within 2KB. The 1×1 convolutional layer of S103 is implemented using the IConvolutionLayer interface of an off-the-shelf deep learning inference engine (such as TensorRT), and the convolution weights are stored in on-chip SRAM with a capacity of 50KB. The sigmoid activation calculation of S104 is processed in real time through the processor's built-in transcendental function unit (such as the FP16 arithmetic logic unit). The element-wise multiplier of S105 is integrated into the processor's data path, and its output is connected to the input FIFO queue of the feature fusion module via a 32-bit AXI bus.
[0053] In one workflow, during the input feature processing stage, the 1D-CNN layer outputs a 128×100-dimensional feature map as input to the spatial attention layer. Example data includes channel 0 representing longitude gradient features and channel 64 representing height abrupt changes (such as obstacle edges). In the dual pooling execution (S101), global max pooling extracts the maximum value of each row, generating a 100-dimensional vector such as [0.92, 0.15, ..., 0.78]; global average pooling calculates the mean of each row, generating a 100-dimensional vector such as [0.35, 0.61, ..., 0.29]. Feature concatenation (S102) merges these two vectors along the channel axis into a 2×100 matrix, for example, [[0.92, 0.15, ..., 0.78], [0.35, 0.61, ..., 0.29]]. Convolutional dimensionality reduction (S103) applies a 1×1 convolution kernel (weights such as [-0.2, 1.1]) to calculate the output value for each column (e.g., -0.2×max + 1.1×mean), generating a 100-dimensional vector such as [0.21, 0.58, ..., 0.63]. Weight generation (S104) is performed by activating with a sigmoid function, outputting a final weight matrix such as [0.55, 0.64, ..., 0.65], where specific regions (e.g., the coordinates of the coal ash transport vehicle corresponding to the photovoltaic field area in positions 20-30) are highlighted. Feature weighting (S105) multiplies each channel of the original feature map by this weight matrix; for example, channel 0 becomes [0.35×0.55, ..., 0.78×0.65], enhancing the feature response around obstacles. In terms of technical performance, the dual-pooling fusion mechanism captures both local extrema and global distribution, preserving information on abrupt changes in obstacle edges (such as device outlines); the 1×1 convolutional layer adaptively learns the spatial weight distribution, avoiding feature smoothing caused by averaging; dynamic weights focus on key areas (such as the area around temporary obstacles), improving the reliability of subsequent obstacle avoidance planning.
[0054] Existing technologies employ a preset waypoint inspection method, which is based on fixed path planning. This method has spatial processing limitations: it lacks a feature weighting mechanism, resulting in equal treatment of all areas and failing to enhance features around obstacles (such as temporary equipment coordinate offsets). Furthermore, fixed waypoints cannot respond to dynamic environmental changes. The differentiating features of this implementation include: a dual-pooling mechanism (S101) that simultaneously captures feature extrema and mean values, overcoming the information loss of single-pooling; 1×1 convolutional weight learning (S103) that adaptively generates spatial attention, replacing manually set fixed attention regions; and dynamic weighting (S105) that improves the feature response of key regions in real time, solving the problem of unresponsiveness to sudden environmental changes.
[0055] Furthermore, in another implementation, the CBAM channel attention layer in the channel feature extraction submodule: In the channel attention layer operation, global max pooling and average pooling can be implemented using the PyTorch framework's AdaptiveMaxPool1d and AdaptiveAvgPool1d functions, with an input feature map size of 128 channels × 100 time steps. The channel reduction ratio r of the shared fully connected layer can be set to 16 (preferred value), the output dimension is 8, and the activation function is LeakyReLU (negative slope 0.01). In terms of hardware deployment, the fully connected layer can be integrated into the NPU unit of the embedded AI module (e.g., TensorRT optimized deployment), with weight parameters stored in an LPDDR5 memory chip and connected to the GRU processing unit via an I2C bus. Sigmoid activation calculation is implemented using an FP16 half-precision floating-point unit, ensuring real-time processing latency <5ms.
[0056] In one optional configuration, the dual-pooling processing in step S201 is deployed on the parallel computing core of the AI coprocessor, receiving the 128×100 feature matrix output from the GRU layer via a 64-bit DDR4 bus. The shared fully connected layer in step S202 is integrated into the matrix multiplication unit of the NPU, with a weight matrix of size 128×8 stored in a 32KB SRAM cache. The vector addition operation in step S203 is executed by the Arithmetic Logic Unit (ALU), and the output is transmitted to the activation function module via a PCIe 3.0 interface. The feature multiplication operation in step S204 is deployed on the tensor core of the data path, using CUDA kernel functions to implement channel-by-channel broadcast multiplication.
[0057] In a specific workflow example: the input feature map channel 0 (heading angle change rate) is double pooled to generate a vector of [0.85, 0.72], which is then reduced to [0.63, 0.41] by a fully connected layer. After Sigmoid activation, a weight of 0.68 is generated, which finally enhances the heading channel feature to 1.68 times the original value.
[0058] This implementation employs a single-pooling channel compression method, using only average pooling to generate channel weights. It simultaneously captures channel extreme value features and statistical characteristics through dual pooling (S201), and shares a fully connected layer (S202) to preserve turbulence-related motion channel information (such as crosswind response channels) during dimensionality reduction. Experimental tests show that in a turbulent environment with a wind speed of 8 m / s, the channel attention of this implementation reduces the heading prediction error to ±0.5°, while the traditional single-pooling method achieves an error of ±1.2°.
[0059] Furthermore, in another implementation, the GRU network in the temporal modeling module processes features in the following order: Input layer: receives the concatenated features output by the feature fusion module; First processing unit: includes a hidden layer and a Dropout layer, wherein: the hidden layer performs a non-linear transformation on the input features, and the output dimension is H1, where H1 > input dimension; the Dropout layer processes features with probability P. d Randomly discard neurons output from the hidden layer, where P d Satisfying 0.2≤P d ≤0.5; Second processing unit: contains a Num_Layer layer, consisting of N stacked GRU units, N≥2, extracting higher-order temporal dependencies; Feature shrinkage layer: performs ReLU activation on the output of the Num_Layer layer, compressing the feature dimension to H2, H2
[0060] Specifically, starting from the input layer, this layer receives the concatenated feature vector output by the feature fusion module as the initial input for temporal modeling. Next, the first processing unit processes these inputs. It includes a hidden layer that performs a non-linear transformation, where the output dimension H1 must be greater than the input dimension (e.g., if the input dimension is 512, H1 can be set to 1024) to expand the feature space. Following the hidden layer is a Dropout layer with a probability Pd limited to between 0.2 and 0.5 (preferably 0.4), randomly dropping neurons during training to prevent overfitting. Subsequently, the second processing unit operates, containing N stacked GRU units, where N is greater than or equal to 2 (e.g., N=3), constructing a high-order temporal dependency model. The stacked structure supports multi-scale temporal feature extraction, and the GRU units employ a bidirectional structure to enhance the ability to capture temporal correlations. The feature processing then proceeds: the feature shrinking layer uses the ReLU activation function to compress the feature dimension to H2 (H2 is less than H1, for example, H2=256 when H1=1024), eliminating redundant information through non-linear compression and enhancing feature discriminativeness; next, the output transformation layer processes the data, mapping the H2 dimension to a three-dimensional coordinate space through a fully connected layer (FC layer), with the output format being a predicted coordinate sequence of the next K waypoints. In the implementation parameter example, the hidden layer dimension H1 is preferably 1024 to ensure it is greater than the input dimension 512, the Dropout probability Pd is preferably 0.4 to fit the range of 0.2 to 0.5, the feature shrinking layer output dimension H2 is preferably 256 to satisfy the rule of being less than H1, and the number of GRU stacking layers N is preferably 3 to satisfy the requirement of being greater than or equal to 2. The technical enhancement mechanisms include: a multi-layer GRU structure that can capture long-term dependencies on the order of 10 seconds (such as the cumulative crosswind shift); a Dropout mechanism that randomly discards 40% of neurons during the training phase to improve generalization ability under environmental perturbations; and a ReLU-activated shrinking layer that reduces the feature dimension to 50% of the original input (e.g., from 512 to 256) to improve computational efficiency.
[0061] The closest existing technology uses a single-layer GRU structure (N=1) without a Dropout mechanism. This implementation uses a 3-layer GRU stack (N=3), increasing the temporal modeling depth by 200% compared to a single-layer structure, capturing the cumulative effect of crosswinds lasting up to 10 seconds. The Dropout mechanism (Pd=0.4) randomly masks 40% of neuron connections during training, reducing the overfitting rate of the test model by 62%. The feature shrinkage layer compresses 1024-dimensional features to 256-dimensional features, reducing computation by 75% while retaining 93% of the effective information. The output conversion layer uses a fully connected structure instead of the traditional linear interpolation method, reducing the trajectory prediction error from ±1.2 meters to ±0.5 meters. Comparative tests show that under 8 m / s crosswind interference, the trajectory offset of this scheme is reduced by 58% compared to the traditional method.
[0062] Furthermore, in another embodiment, the feature fusion module performs the following operations: Input interface: simultaneously receives a spatial feature vector of dimension Ds from the spatial feature extraction submodule and a channel feature vector Dc from the channel feature extraction submodule; Dimension alignment: maps Ds and Dc to a unified dimension D through a fully connected layer, where Ds≤D and Dc≤D; Feature concatenation: concatenates the aligned spatial feature vector and the channel feature vector along the feature dimension to generate a fused feature vector of dimension 2D×1; Dimension reduction output: compresses the dimension of the fused feature vector to D×1 through a 1×1 convolutional layer and inputs it into the temporal modeling module.
[0063] Specifically, in the feature fusion module, the module receives spatial feature vectors Vs∈R from the spatial feature extraction submodule via the MIPI-CSI bus. 256 And receive the channel feature vector Vc∈R via the I2C bus. 128 Before dimension alignment, a dynamic calibration mechanism is performed to eliminate sensor sampling delay differences. This mechanism uses sliding window calibration with a window size of 10 frames (corresponding to 1 second of data) and timestamp matching via a GPS clock source to ensure that Vs and Vc are synchronized in time. Dimension alignment is achieved through two independent fully connected layers: the weight matrices are defined as Ws∈R... 512×256 and Wc∈R 512×128 The system has a uniform dimension D=512, a spatial feature dimension Ds=256, and a channel feature dimension Dc=128. The weight matrix uses a He initialization strategy, with bias terms set to zero. After dimension alignment, aligned spatial feature vectors (512×1) and channel feature vectors (512×1) are obtained. Feature concatenation is performed in the parallel computation kernel of the Neural Processing Unit (NPU), concatenating the two 512×1 vectors along the feature dimensions to form a 1024×1 fused vector Vfuse, with memory usage kept within 8KB. Dimensionality reduction output is achieved through a 1×1 convolutional layer with 512 convolutional kernels, a stride of 1, and ReLU activation. The weight matrix Wconv∈R 512×1024 The bias term bconv∈R 512 The output vector is compressed to Vout∈R 512 This convolutional layer utilizes the Vulkan API for parallel computation acceleration. The entire feature fusion module is deployed on the NPU unit of the NVIDIA Jetson Xavier NX. The computation time for a fully connected layer is no more than 2ms, and the computation latency for a 1×1 convolution is no more than 1.5ms, resulting in a total computation latency of no more than 3.5ms. The input interface receives data via MIPI-CSI and I2C bus, ensuring efficient data transmission and processing.
[0064] An example of a drone trajectory planning method for a photovoltaic factory area according to the present invention includes the following steps performed in sequence: Step S1: Perform spatial feature extraction and weighting, including: inputting the track position and velocity data into a 1D-CNN network to extract local spatial features; performing the following on the feature map using the CBAM spatial attention mechanism: a) global max pooling and global average pooling; b) concatenating the pooling results along the channel dimension; c) 1×1 convolution dimensionality reduction; d) generating a spatial weight matrix using Sigmoid activation; e) multiplying the original features element-wise with the weight matrix; outputting the weighted spatial feature vector Vs, with a dimension of Ds×1. Step S2: Perform channel-related feature extraction and enhancement, including: inputting track speed and heading data into the GRU network to extract temporal dependent features; performing the following on the feature map using the CBAM channel attention mechanism: a) global max pooling and global average pooling in the channel dimension; b) dimensionality reduction processing using a shared fully connected layer, with an output dimension of C / r×1 and a reduction ratio r>1; c) element-wise addition of vectors and sigmoid activation; d) multiplying the original features and weight matrix channel by channel; outputting the weighted channel feature vector Vc, with a dimension of Ds×1. Step S3: Perform dual-feature fusion and temporal modeling, including: performing dimension alignment, mapping Vs and Vc to a unified dimension D through fully connected layers, satisfying Ds≤D and Dc≤D; performing feature concatenation, concatenating the aligned vectors along the feature dimensions to generate a fused feature vector Vfuse with a dimension of 2D×1; performing dimensionality reduction, performing 1×1 convolution compression on Vfuse to output Vout with a dimension of D×1; performing temporal modeling, inputting Vout into a multi-layer GRU network, where the number of GRU layers N≥2; and including a Dropout mechanism, with a dropout probability Pd satisfying 0.2≤Pd≤0.5; Step S4: Generate the track sequence, including: compressing the feature dimension by applying the ReLU activation function to the time series modeling output; mapping it to a three-dimensional coordinate space through a fully connected layer to generate a predicted sequence of the next K track points.
[0065] Specifically, first, prepare the flight path position, velocity, and heading data, which are obtained from the UAV's flight history or real-time sensor data. Step S1 performs spatial feature extraction and weighting: input the flight path position and velocity data into a one-dimensional convolutional neural network (1D-CNN). This network can be implemented using an existing deep learning framework such as the 1D-CNN module in TensorFlow. Its input dimension is adjusted according to the data, and it outputs local spatial features. Subsequently, the feature map is processed through the CBAM spatial attention mechanism: global max pooling and global average pooling are performed; the pooling results are concatenated along the channel dimension; dimensionality reduction is performed using 1×1 convolution, with the convolution kernel size fixed at 1×1. The dimension after dimensionality reduction can be adjusted to 64, 128, or 256, with 128 being the preferred value; a sigmoid activation function is applied to generate a spatial weight matrix; the original features are multiplied element-wise by the weight matrix to output the weighted spatial feature vector Vs. In the dimension Ds×1 of Vs, Ds can be 64, 128, or 256, with 128 being the preferred value. This step runs on the computer's central processing unit (CPU) or graphics processing unit (GPU), and is located in the feature extraction layer of the data processing unit. The process is as follows: after the input data undergoes feature extraction via a 1D-CNN, key spatial information is enhanced through an attention mechanism, and the output Vs is used for subsequent processing. The numerical value is selected based on experimental tuning: Ds is determined from 64 to 256 using a grid search, with 128 being the preferred value to balance computational efficiency and feature richness. Equipment selection can include standard computing hardware, such as a general-purpose GPU; the material can be a silicon-based semiconductor chip. Parameter setting is achieved by adjusting pooling and convolution parameters through cross-validation to ensure feature stability.
[0066] Step S2 performs channel-related feature extraction and enhancement: Track speed and heading data are input into a Gated Recurrent Unit (GRU) network, which can be implemented using the GRU module in PyTorch, outputting temporally dependent features. The feature map is processed using the CBAM channel attention mechanism: global max pooling and global average pooling are performed along the channel dimension; a shared fully connected layer is used for dimensionality reduction, resulting in an output dimension of C / r×1. The reduction ratio r can be 8, 16, or 32, with 16 being preferred; the vectors are element-wise summed and then activated using a Sigmoid function; the original features are multiplied by the weight matrix channel-wise, outputting a weighted channel feature vector Vc, whose dimension Ds×1 is the same as in S1, with 128 being preferred. This step runs in the computer's temporal modeling module, installed after the GRU network layer. The process is as follows: input data is processed by GRU to capture temporal dependencies, the attention mechanism enhances key channel correlations, and the output Vc is used for fusion. In the numerical selection, r is optimized from 8 to 32 through experiments, with 16 being preferred to improve feature compression efficiency. Equipment selection can include existing memory modules, such as DDR4 RAM; copper-based circuit boards can be used as materials. The parameter setting method is as follows: r is calculated based on the feature dimension C, where C is the number of input channels; setting r=16 is preferred to maintain information integrity. The experimental object is a drone flight dataset from a photovoltaic factory area. The experimental method includes splitting the training and test sets, and evaluating the feature extraction effect through mean squared error.
[0067] Step S3 performs dual-feature fusion and temporal modeling: First, dimension alignment is performed, mapping Vs and Vc to a unified dimension D through fully connected layers. The dimension D can be 128, 256, or 512, with 256 being preferred, satisfying Ds≤D and Dc≤D (Dc is the dimension of Vc). Second, feature concatenation is performed, concatenating the aligned vectors along the feature dimensions to generate a fused feature vector Vfuse, with a dimension of 2D×1, where D is preferably 256. Then, dimensionality reduction is performed, applying 1×1 convolutional compression to Vfuse with a fixed kernel size, outputting Vout with a dimension of D×1, preferably 256. Finally, temporal modeling is performed, inputting Vout into a multi-layer GRU network. The number of GRU layers N can be 2, 3, or 4, with 3 being preferred; and a Dropout mechanism is included, with a dropout probability Pd of 0.2, 0.3, or 0.4, preferably 0.3. This step runs in the computer's feature fusion module, positioned between the fully connected layer and the GRU layer. The working process is as follows: Vs and Vc are aligned and then stitched together. Dimensionality reduction through convolution is used to reduce redundancy. GRU is used to model the time series, and Dropout is used to prevent overfitting. In numerical selection, D is determined from 128 to 512 through feature importance analysis, with 256 being the preferred value. N and Pd are optimized using a validation set, with N=3 and Pd=0.3 being the preferred values to optimize generalization ability. Equipment selection can include multi-core processors; aluminum-based heat sinks can be used as materials. Parameter setting methods are as follows: D is dynamically set based on the input dimension, and Pd is adjusted using the early stopping method. Compared to the closest existing technologies (such as single GRU or CNN trajectory planning), existing technologies use only a single network with a simple connection structure, failing to effectively fuse spatial and temporal features, resulting in large trajectory prediction errors. This step, however, uses a GRU enhanced with dual attention feature fusion and Dropout. The key difference lies in the dimensional alignment and stitching of spatial and channel features, enabling the simultaneous capture of local details and long-term dependencies, thereby solving the trajectory drift problem in the complex environment of photovoltaic plants.
[0068] Step S4 generates the track sequence: The ReLU activation function is applied to the time-series modeling output to compress the feature dimension; the output is then mapped to a 3D coordinate space through a fully connected layer. This fully connected layer can be implemented using a standard neural network layer, with an output dimension of 3×K, where K is the number of future track points. K can be 5, 10, or 15, with 10 being preferred. A predicted sequence of the next K track points is generated. This step runs in the computer's output module, after the GRU network is installed. The process is as follows: the GRU output undergoes a ReLU nonlinear transformation, is mapped to the coordinate space by the fully connected layer, and a predicted sequence is output. In the numerical selection, K is set from 5 to 15 based on actual flight requirements, with 10 being preferred to cover short-term tracks.
[0069] The entire method works as follows: input data is processed sequentially through S1 to S4; S1 and S2 extract weighted features; S3 performs fusion modeling; and S4 generates sequences. The connection structure is implemented through a data flow pipeline. The technical effects are: improved trajectory prediction accuracy, reduced UAV flight deviations in photovoltaic factory areas, and enhanced path planning reliability.
[0070] Furthermore, the spatial attention mechanism in step S1 includes: performing max pooling and average pooling on the feature map to generate spatial weights; and dynamically focusing on the region surrounding the obstacle by activating Sigmoid. The channel attention mechanism in step S2 includes: performing dual pooling compression on the GRU hidden state; and filtering key channel features through a fully connected layer.
[0071] First, max pooling and average pooling operations are performed on the input feature map (e.g., a feature map from a convolutional neural network). The kernel size for the pooling operations can be 3×3 or 5×5, with 3×3 being preferred. These two pooling operations can capture the importance information of different locations in the feature map. The results of max pooling and average pooling are concatenated along the channel dimension to obtain a feature map with two channels. Next, a standard convolutional layer with a kernel size of 7×7 is applied to this concatenated feature map for feature fusion. The number of channels output by the convolutional layer can be set to 1. Then, the single-channel feature map output by the convolutional layer is processed through a sigmoid activation function. The value range of the sigmoid function output is between 0 and 1, which can represent the importance weight of each location in space. Generally, locations with a sigmoid output value greater than 0.5 can be regarded as the area around obstacles that need to be dynamically focused (i.e., higher weight), while areas with a value less than 0.5 are suppressed (i.e., lower weight). Finally, this spatial weight map is multiplied element-wise with the original input feature map to obtain the feature map weighted by the spatial attention mechanism. This feature map highlights information about the area surrounding the obstacle. These computational steps can be performed on onboard computing units (such as GPUs or dedicated AI acceleration chips) using readily available deep learning frameworks (such as TensorFlow or PyTorch).
[0072] The channel attention mechanism described in step S2 can be implemented using the following specific method: First, the hidden state features output by the GRU network are obtained. Then, global max pooling and global average pooling operations are performed simultaneously on this hidden state feature map. Both pooling operations compress the entire feature map into two one-dimensional vectors along the spatial dimensions (height and width) (each vector's length is equal to the number of channels C in the original feature map), representing the maximum response feature and average response feature of each channel, respectively. These two compressed vectors are concatenated along the channel dimension to form a feature vector of length 2C. Next, this concatenated vector is input into a fully connected layer (or multilayer perceptron MLP). This fully connected layer can contain a dimensionality reduction layer (e.g., reducing the input dimension 2C to 2C / r, where r can be 4, 8, or 16, preferably 8), a ReLU activation function, and a dimension restoration layer (restoring the dimension to the original number of channels C). The output of the fully connected layer is a one-dimensional vector of length C, representing the importance score of each channel. Subsequently, this vector is passed through the Sigmoid activation function to obtain the weight coefficients for each channel (with values ranging from 0 to 1). Typically, channels with Sigmoid output values greater than 0.6 can be considered key channel features. Finally, the obtained channel weight coefficients are multiplied channel-by-channel along the original GRU hidden state feature map to obtain the feature map filtered by the channel attention mechanism. This feature map enhances the feature responses of key channels. These operations are also performed on the onboard computing unit, utilizing existing deep learning libraries.
[0073] The spatial attention mechanism described in this embodiment dynamically calculates spatial weights through pooling operations and sigmoid activation, effectively guiding the model to focus on key regions surrounding obstacles. The channel attention mechanism, through double pooling and fully connected layer processing of the GRU state, filters out the channel features most important for prediction at the current moment. Compared to methods that only use ordinary convolution or GRU for obstacle detection, this embodiment adds spatial and channel attention mechanisms after feature extraction. Existing technologies lack such dynamic focusing mechanisms, making it difficult to effectively distinguish obstacles from the background or suppress interference information from irrelevant channels in complex scenes (such as occlusion and changes in lighting), resulting in limited detection accuracy. This embodiment, by introducing a spatial attention mechanism, can adaptively enhance features around obstacles, improving localization capabilities; by introducing a channel attention mechanism, it can selectively enhance channel features most relevant to the current obstacle state and suppress noisy channels. The synergistic effect of these two mechanisms significantly improves the accuracy and robustness of obstacle detection, especially in dynamically changing photovoltaic factory environments.
[0074] Furthermore, in another implementation, before the time-series modeling in step S3, a photovoltaic scene adaptive modulation step 300 is added: the solar altitude angle θ on the surface of the photovoltaic module is acquired in real time, and the reflectivity interference coefficient α is calculated through a pre-trained reflectivity model. This coefficient is determined by the constant reflectivity k1 of the module glass and the sine square function of the solar altitude angle θ. The spatial feature vector Vs is divided by the compensation factor (1+α) to attenuate the feature response of the strong reflective area. According to the tilt angle β of the photovoltaic array and the real-time wind speed v, the turbulence intensity γ is calculated through a vortex model. This intensity is determined by the product of the array spacing correlation coefficient k2, the wind speed v, and the cosine of the tilt angle β. The turbulence intensity γ is input into a dedicated GRU network to generate a turbulence attention vector At. The turbulence attention vector At is fused with the dimensionality-reduced fusion feature Vout proportionally, and the fusion formula is Vout' = Vout + λ·At, where the attenuation factor λ takes a value of 0.3 to 0.7. The modulated feature vector Vout' is used as the input of the time-series modeling module.
[0075] Specifically, after spatial feature extraction and fusion, an adaptive modulation step for the photovoltaic scene is performed. The solar altitude angle θ (in degrees) on the surface of the photovoltaic module is acquired in real time. This angle can be measured using a high-precision tilt sensor (e.g., photoelectric coded or MEMS type) installed near the photovoltaic array or on the module frame. The reflection interference coefficient α is calculated using a pre-trained reflectivity model. This reflectivity model is constructed based on the reflectivity constant k1 of the module glass (its value can be 0.04, corresponding to common photovoltaic glass types) and the square of the sine of the solar altitude angle θ, specifically expressed as α = k1 * (sin(θ)). 2 Using the calculated α value, the spatial feature vector Vs (which comes from the previous feature extraction step) is divided by the compensation factor (1 + α), thereby reducing the response intensity of highly reflective areas in the feature vector.
[0076] Simultaneously, the tilt angle β (in degrees) and wind speed v (in meters per second) of the photovoltaic array are acquired in real time. The tilt angle β can be obtained using the same tilt sensor as the one used to measure θ. The wind speed v can be measured using a mechanical or ultrasonic anemometer mounted on the photovoltaic support column. Based on the acquired tilt angle β and wind speed v, the turbulence intensity γ is calculated using a vortex model. This vortex model is determined by the product of the array spacing correlation coefficient k2 (its value can be 0.15, corresponding to a common array spacing of about 1 meter), the wind speed v, and the cosine of the tilt angle β, specifically expressed as γ = k2 * v * cos(β). The calculated turbulence intensity γ is input into a dedicated gated recurrent unit (GRU) network (this GRU network can have one hidden layer containing 128 units, using tanh as the activation function; after training, this GRU network can generate an attention vector At reflecting the current turbulence influence based on the γ value).
[0077] Finally, the turbulent attention vector At generated by the GRU network is proportionally fused with the fusion feature vector Vout (which comes from the previous feature dimensionality reduction step). The fusion formula is Vout' = Vout + λ·At. Here, the attenuation factor λ is an adjustable parameter, ranging from 0.3 to 0.7, and preferably 0.5 in this embodiment. The feature vector Vout' obtained after this modulation step will serve as input data for subsequent temporal modeling modules (e.g., LSTM or Transformer).
[0078] Through the above steps, this adaptive modulation module comprehensively handles non-stationary disturbances introduced by component surface reflection (affected by solar altitude angle) and airflow turbulence around the array (affected by wind speed and array tilt angle). It first uses a reflectivity model to attenuate and compensate for the characteristics of highly reflective areas, then uses a vortex model and GRU network to capture turbulent dynamics and generate attention weights, and finally incorporates turbulent attention information into spatial features through adjustable factors. This processing enables subsequent time-series modeling modules to obtain more robust input features to complex on-site environmental disturbances, helping to improve the accuracy of photovoltaic power prediction models under variable weather and different installation conditions.
[0079] In another implementation, a multi-source collaborative optimization step 301 is further added to step S300, including: establishing a GPS timestamp-driven data pipeline, performing sliding window dynamic calibration on the input signals of solar altitude angle θ, array tilt angle β, and real-time wind speed v to eliminate sensor sampling delay differences; capturing photovoltaic module images in real time through an airborne camera, generating an abnormal mask M when a sudden obstacle is detected, and dynamically adjusting the weights of the reflective interference coefficient α and turbulence intensity γ: if M detects a temporary obstacle, then α=0, γ=0, and physical compensation is disabled; if M detects a strong reflective area, then the value of α is increased by 30%-50%; based on the environmental stability index σ, the feature fusion ratio is dynamically adjusted according to the linear relationship of λ=0.7 when σ≤1.0 and λ=0.3 when σ≥2.5.
[0080] Specifically, in step S300, when implementing multi-source collaborative optimization, a GPS timestamp-driven data pipeline is first established (a GPS module with the NMEA-0183 protocol can be selected). This pipeline uses a 1-second sliding window period to dynamically calibrate the input signals of the solar altitude angle θ (obtained through a photovoltaic array tilt sensor), array tilt angle β (measured through a digital inclinometer), and real-time wind speed v (collected through an ultrasonic anemometer), eliminating the ±0.5-second sampling delay difference between sensors. An airborne camera (a 5-megapixel industrial camera can be used) captures images of the photovoltaic modules at a frequency of 5 frames per second, and identifies sudden obstacles (such as birds and fallen leaves) through a pre-trained YOLOv5 model. When a temporary obstacle is detected, a binary anomaly mask M is generated, and its parameters are dynamically adjusted: if M detects a temporary obstacle (e.g., occlusion area ≥ 10%), the reflectivity interference coefficient α is set to 0, the turbulence intensity γ is set to 0, and the physical compensation module is disabled; if M detects a highly reflective area (e.g., specular reflection intensity ≥ 800 lux), the α value is increased from the base value of 0.2 to 0.26-0.3 (preferably by 40%). The environmental stability index σ is calculated by weighting the standard deviation of wind speed and the standard deviation of light intensity over the past 10 minutes, and is adjusted according to a linear relationship: feature fusion ratio λ = 0.7 when σ ≤ 1.0, and λ = 0.3 when σ ≥ 2.5 (e.g., λ = 0.5 when σ = 1.5).
[0081] In one optional configuration, the GPS module outputs a timestamp to the data acquisition card, synchronously triggering data acquisition from the tilt sensor (fixed at the support pivot) and the anemometer (deployed 1.5 meters above the array). Video streams from the onboard camera (mounted on a support column at the array edge) are inferred in real-time by an edge computing unit (such as Jetson Nano), outputting an anomaly mask M to the main controller. The main controller then determines the type of M based on the following: If the obstacle is temporary (such as a bird), a disable compensation command is sent to the inverter to avoid erroneous adjustment. If there is strong reflection (such as reflection from snow), the voltage signal of α is boosted from 1V to 1.4V through the DAC module (corresponding to α=0.28).
[0082] Meanwhile, the environmental monitoring unit calculates the σ value every 30 seconds (data source: anemometer and light sensor), dynamically adjusts the weights of the fusion algorithm using a linear mapping table between σ and λ, and outputs the result to the maximum power point tracker. The mapping table is as follows: Compared to methods relying solely on fixed parameters, this implementation addresses the cumulative errors caused by multi-sensor data delays through GPS timestamp synchronization. Existing technologies, lacking calibrated sampling time differences, produce erroneous tilt angle adjustments during sudden wind speed changes. An anomaly masking mechanism distinguishes between temporary obstacles and persistent reflections, avoiding energy losses due to uniform compensation in existing technologies (actual measurements show a 9% improvement in power generation efficiency under strong reflective conditions). The dynamic fusion ratio adjustment of the environmental stability index σ overcomes the problem of rigid feature weights in traditional methods during sudden weather changes, reducing ineffective adjustments by up to 60% in strong turbulent scenarios such as σ>2.5. Ultimately, this achieves stable power output from the photovoltaic array under complex environments.
[0083] Furthermore, in another implementation, step S301 involves constructing a multimodal verification fault-tolerant mechanism, including step S302: When the visual mask M detects a sudden obstacle, the millimeter-wave radar is simultaneously activated to scan the point cloud density of the target area. If the point cloud density is ≥50 points / m² 2 If the camera and radar conclusions conflict, a secondary verification using infrared thermal imaging is initiated, with the temperature gradient threshold ΔT ≥ 3℃ / pixel used as the final decision criterion. Sensor confidence weights are established: visual ωv = 0.7, radar ωr = 0.8, and infrared ωi = 0.9. The physical model startup and shutdown are dynamically adjusted based on the weighted voting results: physical compensation is disabled when Σ(ω·Si) > 1.5, and α = γ = 0. When the environmental stability index σ ≥ 3.0, the historical trajectory similarity model of the most recent 10 minutes is loaded. If the cosine similarity between the current feature vector and the historical abnormal trajectory is > 0.85, the system automatically switches to the preset safe trajectory mode (if σ < 3.0, this function is disabled).
[0084] Specifically, in step S302, the visual mask M detects sudden obstacles using a binocular camera (e.g., a 2-megapixel CMOS sensor) located below the drone's nose. When an obstacle is detected, a millimeter-wave radar (operating frequency band 77-81GHz) mounted on the underside of the drone is simultaneously activated to perform a point cloud scan of the target area. The point cloud density threshold is set to 50 points / m². 2 (Adjustable range: 45-55 points / m) 2 If the scan result is greater than or equal to the threshold, the presence of an obstacle is confirmed. If the camera and radar conclusions conflict (e.g., the visual system reports an obstacle but the radar does not detect it), the infrared thermal imager (response wavelength 7.5-13.5μm) located on the side of the gimbal bracket is activated. The temperature gradient threshold ΔT ≥ 3℃ / pixel (preferred value, adjustable range 2.5-4℃ / pixel) is used as the decision criterion. This threshold is determined by calibrating the temperature difference boundary between the live target and the environment.
[0085] The sensor confidence weights are assigned as follows: visual ωv = 0.7 (dynamically fine-tuned ±0.05 based on image jitter rate), radar ωr = 0.8 (fluctuating ±0.03 based on point cloud distortion rate), and infrared ωi = 0.9 (fixed stability). During weighted voting, if Σ(ω·Si) > 1.5 (Si is the binarized output of each sensor), the flight control physical compensation module is disabled (i.e., attitude angle compensation parameter α = 0 and altitude compensation γ = 0). When the environmental stability index σ ≥ 3.0 (calculated by a weighted fusion algorithm based on real-time monitoring of parameters such as wind speed, rainfall intensity, and electromagnetic interference intensity), the historical flight path database (capacity ≥ 10 minutes) stored in the flight control module is loaded, and a cosine similarity algorithm is used to compare the current flight path feature vector (including three-axis acceleration and pitch angle data) with historical abnormal trajectories. If the similarity > 0.85 (threshold calibrated through 300 sets of strong wind interference tests), the system switches to a preset safe flight path mode (this mode is pre-stored in the flight control obstacle avoidance system).
[0086] During implementation, data from each sensor is transmitted to the main control board (which can optionally use a Cortex-A53 architecture processor) via the airborne bus, with a control cycle of 10ms. The temperature gradient calculation for the infrared thermal imager uses the 3×3 pixel neighborhood gradient mean method, and the millimeter-wave radar point cloud density is statistically analyzed using Euclidean distance clustering. The historical trajectory similarity model updates its feature library every 15 seconds, with feature dimensions including the rate of change of heading angle and altitude fluctuation variance. This scheme maintains the reliability of obstacle avoidance decisions when sensors are affected by environmental interference through dynamic weight fusion and comparison with historical behavior, avoiding trajectory oscillations caused by false triggering of the physical model.
[0087] This implementation effectively mitigates the misjudgment problem of a single sensor in complex airspace by using a multimodal cross-validation mechanism and an adaptive weighting strategy; by combining environmental perception and historical behavior analysis, it enhances the obstacle avoidance robustness of UAVs in sudden obstacle scenarios and improves the safety redundancy capability of the autonomous flight system.
[0088] Taking the drone inspection scenario of a photovoltaic power station in a coal ash landfill area as an example, considering challenges such as rugged terrain, component reflection, and crosswind turbulence, both the implementation and comparative examples use unified test environment parameters. The test environment includes a photovoltaic array tilt angle β=30°, a component spacing of 1.2 meters (corresponding to a turbulence coefficient k2=0.18); meteorological conditions are a solar altitude angle θ=60° (reflectivity k1=0.04), a real-time wind speed v=6m / s; a sudden obstacle is a temporary transport vehicle with dimensions of 2m×3m; the drone's flight speed is 8m / s, and the historical flight track sampling frequency is 10Hz.
[0089] Example 1 The implementation steps are as follows: First, spatial feature extraction (S1) is performed: real-time trajectory data is input, including position (longitude 112.5°, latitude 38.2°, altitude 50m) and velocity (east 5.2m / s, north 6.1m / s, vertical 0.3m / s). Features are extracted using 1D-CNN convolutional layers with kernels of [7×1,32], [5×1,64], and [3×1,128]. Then, the CBAM spatial attention mechanism is applied: max pooling generates feature vectors such as [0.92,0.15,...,0.78], and average pooling generates feature vectors such as [0.35,0.61,...,0.29]. After concatenation, dimensionality reduction is achieved through 1×1 convolution, followed by Sigmoid activation to obtain a weight matrix such as [0.55,0.64,...,0.65]. The output is a weighted spatial feature Vs with a dimension of 256×1.
[0090] Next, channel feature extraction (S2) is performed: input is airspeed and heading angle 215°. A GRU layer (128 hidden units) is used to capture temporal dependencies. Then, CBAM channel attention is applied: through dual pooling compression, followed by dimensionality reduction via a shared fully connected layer (compression ratio r=16, output dimension 8), and Sigmoid activation to generate channel weights, such as the heading channel weight of 0.68. The output is enhanced channel feature Vc, with a dimension of 128×1.
[0091] Next, feature fusion and temporal modeling (S3) are performed: Vs (256-dimensional) and Vc (128-dimensional) are aligned to 512 dimensions through a fully connected layer. They are concatenated into a 1024-dimensional vector and compressed to 512 dimensions through a 1×1 convolution. This vector is then input into a three-layer GRU network (1024-dimensional hidden layers, Dropout=0.4) to capture long-term dependencies.
[0092] Finally, track generation (S4) is performed: ReLU activation is used to compress the features to 256 dimensions, and then a fully connected layer is used to output the track for the next 10 seconds, with a total of 20 track points.
[0093] Test results showed that the maximum track deviation was ±1.2m (in areas with strong reflectivity), the obstacle response delay was 480ms, and the equipment missed detection rate was 8.5% (due to reflectivity interference).
[0094] Example 2 Based on Example 1, the following steps are added: First, add physical modulation (S300): Calculate the reflective interference coefficient α = k1×sin 2 (θ) = 0.04×sin 2(60°) = 0.03, the spatial feature Vs is attenuated, Vs' = Vs / (1+0.03). The turbulence intensity γ is calculated as k2×v×cos(β) = 0.18×6×cos(30°) = 0.94, and γ is input into a dedicated GRU to generate turbulence attention At. Then, feature fusion enhancement is performed, Vout' = Vout + λ·At (λ is initially 0.5).
[0095] Next, multi-source optimization (S301) is added: GPS timestamps and sensor data are synchronized to eliminate ±0.5s delay; strong reflective areas are detected by the airborne camera to increase the α value by 40%, making α=0.042; and λ is linearly adjusted to 0.55 based on the environmental stability index σ=2.2.
[0096] Finally, a fault-tolerant mechanism (S302) is added: after visual detection of the transport vehicle, millimeter-wave radar scanning is activated (point cloud density 72 points / m²). 2 To identify obstacles; perform weighted voting decisions such as Σ(ω·Si)= 0.7×1 + 0.8×1 = 1.5 (where ω represents the weight, Si represents the sensor output, and 1 indicates detection). If the result is less than or equal to the threshold, physical compensation is maintained. When the historical track similarity is 0.76 (below the switching threshold of 0.85), the safety mode is not switched.
[0097] Test results showed that the maximum track deviation was ±0.4m (in the reflective area), a 67% reduction compared to Example 1; the obstacle response delay was 210ms, a 56% reduction; and the equipment miss rate was 2.1%, a 75% reduction.
[0098] Comparative Example As a comparative example, the traditional preset waypoint method is used, and the steps include: The ground station pre-stores a fixed sequence of waypoints (longitude / latitude / altitude); the flight control system uses PID control to track the preset points without real-time feature extraction; when encountering an obstacle, basic obstacle avoidance is triggered, and after hovering for 5 seconds, it detours around the obstacle with a fixed radius of 10m.
[0099] Test results showed that the maximum track deviation was ±2.5m (due to cumulative drift caused by turbulence), and the problem analysis was that there was no time-series modeling and the crosswind effect was not corrected; the obstacle response delay was 820ms, and the problem analysis was that there was no spatial attention and the obstacle avoidance relied on hovering; the equipment missed detection rate was 15.7%, and the problem analysis was that the features of strong reflective areas were not weighted, and the positioning failed.
[0100] Compared to Example 1, Example 2 shows that physical modulation (S300) effectively suppresses reflection and turbulence interference, reducing track deviation by 67%; multi-source optimization (S301) dynamically increases the α value, reducing the false negative rate to 2.1%; and the fault-tolerant mechanism (S302) avoids false shutdown compensation, improving obstacle response speed by 56%. Compared to the comparative example, Example 2 demonstrates that the dual attention mechanism addresses feature degradation, reducing the false negative rate from 15.7% to 2.1%; temporal modeling corrects long-term drift, optimizing track deviation from ±2.5m to ±0.4m; and multi-sensor collaboration overcomes dynamic obstacle response lag, reducing latency from 820ms to 210ms.
[0101] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. It can be applied to various fields suitable for the present invention. Further modifications can be readily implemented by those skilled in the art.
Claims
1. A flight path planning system for unmanned aerial vehicles (UAVs) in a photovoltaic factory area, characterized in that, include: The spatial feature extraction submodule consists of a 1D-CNN layer and a CBAM spatial attention layer connected sequentially. It is used to receive track position and velocity data, extract local spatial features through convolution operations, and use the spatial attention mechanism to weight key regions. The channel feature extraction submodule consists of a GRU layer and a CBAM channel attention layer connected sequentially. It is used to receive track speed and heading data, capture temporal dependencies through a gated loop unit, and enhance key feature channels using a channel attention mechanism. The feature fusion module receives the spatial feature vector output by the spatial feature extraction submodule and the channel feature vector output by the channel feature extraction submodule, and concatenates the two in the feature dimension. The temporal modeling module, composed of a GRU network, receives the spliced features output by the feature fusion module and mines the long-term spatiotemporal dependencies of the trajectory through a multi-layer gated recurrent unit. The track generation module includes a fully connected layer, which receives the output features of the time series modeling module and generates the predicted coordinates of the future track point sequence.
2. The system according to claim 1, characterized in that, In the spatial feature extraction submodule, the CBAM spatial attention layer performs operations in the following order: S101: Perform global max pooling and global average pooling on the feature maps output by the 1D-CNN layer to generate two feature vectors with the same spatial dimension. S102: Concatenate the two feature vectors of S101 along the channel dimension to form a fusion feature descriptor with 2 channels; S103: Input the fused feature descriptor into a 1×1 convolutional layer for dimensionality reduction to generate a preliminary spatial weight matrix for a single channel; S104: Apply Sigmoid activation to the initial spatial weight matrix to generate the final spatial attention weight matrix with values ranging from [0,1]. S105: Multiply the final spatial attention weight matrix element-wise with the original feature map output by the 1D-CNN layer to output the weighted spatial feature vector.
3. The system according to claim 2, characterized in that, In the channel feature extraction submodule, the CBAM channel attention layer performs operations in the following order: S201: Perform global max pooling and global average pooling on the feature map output by the GRU layer in the channel dimension to generate two feature vectors of shape 1×1×C, where C is the number of channels; S202: Input the two feature vectors from S201 into a fully connected layer with shared weights. The output dimension of this fully connected layer is C / r, where r is the channel reduction ratio coefficient and r>1, generating two dimension-reduced channel attention vectors. S203: Add the two channel attention vectors after dimensionality reduction element by element, and generate a channel attention weight matrix with values in the range [0,1] through the Sigmoid activation function; S204: Multiply the channel attention weight matrix with the original feature map output by the GRU layer channel by channel to output the weighted channel feature vector.
4. The system according to claim 3, characterized in that, The GRU network in the temporal modeling module processes features in the following order: Input layer: Receives the concatenated features output by the feature fusion module; The first processing unit contains a hidden layer and a Dropout layer, where: The hidden layer performs a non-linear transformation on the input features, and the output dimension is H1, where H1 > the input dimension. The dropout layer uses probability P d Randomly discard neurons output from the hidden layer, where P d Satisfying 0.2≤P d ≤0.5; The second processing unit contains a Num_Layer layer, which consists of N stacked GRU units, where N≥2, and extracts higher-order temporal dependencies. Feature shrinkage layer: Perform the ReLU activation function on the output of the Num_Layer layer to compress the feature dimension to H2, where H2 < H1; Output transformation layer: The fully connected layer maps the feature dimension to the track point coordinate dimension to generate the predicted track sequence.
5. The system according to claim 1, characterized in that, The feature fusion module performs the following operations: simultaneously receiving a spatial feature vector of dimension Ds from the spatial feature extraction submodule and a channel feature vector Dc from the channel feature extraction submodule; mapping Ds and Dc to a unified dimension D through a fully connected layer, where Ds≤D and Dc≤D; concatenating the aligned spatial feature vector and the channel feature vector along the feature dimension to generate a fused feature vector of dimension 2D×1; compressing the dimension of the fused feature vector to D×1 through a 1×1 convolutional layer, and inputting it into the temporal modeling module.
6. A method for unmanned aerial vehicle (UAV) trajectory planning in a photovoltaic factory area, characterized in that, The steps are executed in the following order: Step S1: Perform spatial feature extraction and weighting, including: The trajectory position and velocity data are input into a 1D-CNN network to extract local spatial features. The feature map is then processed using the CBAM spatial attention mechanism: a) global max pooling and global average pooling; b) concatenation of the pooling results along the channel dimension; c) 1×1 convolution dimensionality reduction; d) Sigmoid activation to generate a spatial weight matrix; e) element-wise multiplication of the original features with the weight matrix; the weighted spatial feature vector Vs is output, with a dimension of Ds×1. Step S2: Perform channel association feature extraction and enhancement, including: The trajectory speed and heading data are input into the GRU network to extract temporal dependent features. The feature map is then processed using the CBAM channel attention mechanism as follows: a) global max pooling and global average pooling in the channel dimension; b) dimensionality reduction processing using a shared fully connected layer, with an output dimension of C / r×1 and a reduction ratio r > 1; c) element-wise addition of vectors and sigmoid activation; d) channel-wise multiplication of the original features and the weight matrix; the weighted channel feature vector Vc is output with a dimension of Ds×1. Step S3: Perform dual-feature fusion and temporal modeling, including: Dimension alignment is performed by mapping Vs and Vc to a unified dimension D through fully connected layers, satisfying Ds≤D and Dc≤D; feature concatenation is performed by concatenating the aligned vectors along the feature dimensions to generate a fused feature vector Vfuse with a dimension of 2D×1; dimensionality reduction is performed by performing 1×1 convolution compression on Vfuse to output Vout with a dimension of D×1; temporal modeling is performed by inputting Vout into a multi-layer GRU network, where the number of GRU layers N≥2 and includes a Dropout mechanism, with a dropout probability Pd satisfying 0.2≤Pd≤0.5; Step S4: Generate the track sequence, including: compressing the feature dimension by applying the ReLU activation function to the time series modeling output; mapping it to a three-dimensional coordinate space through a fully connected layer to generate a predicted sequence of the next K track points.
7. The method according to claim 6, characterized in that: The spatial attention mechanism in step S1 includes: generating spatial weights by performing max pooling and average pooling on the feature map; and dynamically focusing on the region surrounding the obstacle by activating Sigmoid. The channel attention mechanism in step S2 includes: compressing the GRU hidden state by double pooling; and filtering key channel features through a fully connected layer.
8. The method according to claim 6, characterized in that, Before the timing modeling in step S3, add a photovoltaic scenario adaptive modulation step 300: The solar elevation angle θ on the surface of the photovoltaic module is acquired in real time. The reflection interference coefficient α is calculated by a pre-trained reflectivity model. This reflection interference coefficient is determined by the constant reflectivity k1 of the module glass and the sine square function of the solar elevation angle θ. The spatial feature vector Vs is divided by the compensation factor (1+α) to attenuate the feature response of the strong reflective area. Based on the photovoltaic array tilt angle β and real-time wind speed v, the turbulence intensity γ is calculated using a vortex model. This intensity is determined by the product of the array spacing correlation coefficient k2, wind speed v, and the cosine of the tilt angle β. The turbulence intensity γ is then input into a GRU network to generate a turbulence attention vector At. The turbulent attention vector At is fused with the dimensionality-reduced fusion feature Vout proportionally, and the fusion formula is Vout' = Vout + λ·At, where the attenuation factor λ takes a value of 0.3 to 0.
7. The modulated feature vector Vout' is used as the input to the time series modeling module.
9. The method according to claim 8, characterized in that, Further, in step S300, a multi-source collaborative optimization step 301 is added, including: establishing a GPS timestamp-driven data pipeline, performing sliding window dynamic calibration on the input signals of solar altitude angle θ, array tilt angle β, and real-time wind speed v, and eliminating sensor sampling delay differences; The system captures real-time images of photovoltaic modules using an onboard camera. When a sudden obstacle is detected, an abnormal mask M is generated, and the weights of the reflection interference coefficient α and turbulence intensity γ are dynamically adjusted: if M detects a temporary obstacle, α=0 and γ=0, and physical compensation is disabled; if M detects a highly reflective area, the value of α is increased by 30%-50%. Based on the environmental stability index σ, the feature fusion ratio is dynamically adjusted as follows: when σ≤1.0, λ=0.7; when 1.0<σ<2.5, λ=0.7-0.4×(σ-1.0) / 1.5 according to the linear relationship; and when σ≥2.5, λ=0.
3.
10. The method according to claim 9, characterized in that, Step S301 involves constructing a multimodal verification fault-tolerant mechanism, including step S302: When the visual mask M detects a sudden obstacle, the millimeter-wave radar is simultaneously activated to scan the point cloud density of the target area. If the point cloud density is ≥50 points / m² 2 This confirms the existence of the obstacle; If the camera and radar conclusions conflict, a secondary verification using infrared thermal imaging will be initiated, with the temperature gradient threshold ΔT ≥ 3℃ / pixel used as the final decision criterion. Establish sensor confidence weights: visual ωv=0.7, radar ωr=0.8, infrared ωi=0.9; dynamically adjust the start and stop of the physical model according to the weighted voting results: disable physical compensation when Σ(ω·Si)>1.5, and set α=γ=0; When the environmental stability index σ≥3.0, the historical trajectory similarity model of the most recent 10 minutes is loaded. If the cosine similarity between the current feature vector and the historical abnormal trajectory is >0.85, the system will automatically switch to the preset safe trajectory mode.
Citation Information
Cited By
Multi-source data driven unmanned aerial vehicle flight path prediction method and system
CN121902065A