A scene graph recognition method for autonomous landing of unmanned aerial vehicles based on ST-Swin-T neural network

Through the ST-Swin-T neural network identification method, the technical problem of the drone being unable to land autonomously in an emergency is solved, and flight safety is improved by being able to determine whether it can land without complex calculations in an emergency, and provides It lays the foundation for UAVs to autonomously learn to identify landing scenarios.

CN118447341BActive Publication Date: 2024-10-01安徽中科星驰自动驾驶技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410906142.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-10-01
Estimated Expiration
2044-07-08

AI Technical Summary

Technical Problem

Existing technology makes it difficult to achieve autonomous landing of UAVs in emergency situations, especially when landing marks cannot be pre-arranged, and the computing power requirements are high when processing complex and unknown landing scenarios, making it difficult to effectively identify whether the scene below is suitable for emergencies. landing.

Method used

The scene graph recognition method based on ST-Swin-T neural network is used to estimate the likelihood function of the landing scene graph category by constructing a data set, building a recognition model for classification recognition, training the model, and testing phase, and using a threshold in the prediction phase. method to determine whether it is an abnormal landing scenario.

Benefits of technology

In an emergency, it can be judged whether it can land without complex calculations, which significantly improves the flight safety of the drone, and provides a basis for its autonomous learning to identify landing scenes, improves the recognition rate of landing scene graphs, and solves the problem of data set size. Overfitting problem caused by small sum classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118447341B_ABST
    Figure CN118447341B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of drone landing recognition technology, and solves the technical problem that traditional methods cannot be applied to drones to achieve autonomous landing in emergency situations. In particular, it relates to a scene graph recognition method for autonomous landing of drones based on ST-Swin-T neural network, including: constructing a data set for drone landing scenes, and dividing the data set into multiple safety levels according to a number of landing scene categories; constructing a recognition model ST-Swin-T for classifying and identifying landing scene graphs of drone landing based on the backbone network of Swin-T neural network; and training the recognition model ST-Swin-T based on a pre-trained model. The present invention can determine whether the drone can land by directly detecting the image below when facing an emergency landing scene, without the need for complex calculations or precise landing at a specific point. It also significantly improves the flight safety of the drone, and at the same time lays a foundation for its autonomous learning to recognize landing scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of unmanned aerial vehicle landing recognition, and in particular to a scene graph recognition method for autonomous landing of unmanned aerial vehicle based on ST-Swin-T neural network. Background Art

[0002] In the past, many scene graph recognition methods have been proposed for drones to accurately identify the landing scene below, such as the automatic landing of drones based on deep learning technology and the landing mark "H". However, when the drone encounters a sudden drop in battery power or detects a fault and needs to land urgently, the landing mark cannot be arranged in advance in such emergency situations, so the drone needs to promptly determine whether the scene below is suitable for emergency landing.

[0003] In a UAV autonomous landing visual positioning method and system with publication number CN105335733A, the relative position and direction between the UAV and the landing point are accurately calculated through image processing technology, and this information is transmitted to the control system of the UAV to guide the UAV to land accurately at the designated location. This invention is used to solve the problem of precise landing, not the problem of automatic landing for emergency situations.

[0004] In a multi-sensor based drone landing area recognition method with publication number CN113359810A, the drone landing area is perceived based on the fusion of sensor data such as lidar, camera and IMU. Although the invention is aimed at emergency landing problems, it also uses deep learning methods to extract point cloud semantic information and perform semantic segmentation on scene models, but the computing power required to process image data and massive point cloud data at the same time is relatively high. When performing effective semantic segmentation, contextual information needs to be considered, including the spatial relationship of objects and the global structure of the entire scene. This method is challenging when facing various complex and unknown landing scenes. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a scene graph recognition method for autonomous landing of UAVs based on the ST-Swin-T neural network, which solves the technical problem that traditional methods are not applicable to autonomous landing of UAVs in emergency situations.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: a scene graph recognition method for autonomous landing of unmanned aerial vehicles based on ST-Swin-T neural network, the method comprising the following steps:

[0007] S1. Build a dataset for drone landing scenarios and divide the dataset into multiple safety levels according to several landing scenario categories.

[0008] S2, based on the backbone network of the Swin-T neural network, a recognition model ST-Swin-T is constructed for classifying and recognizing the landing scene graph of the UAV landing;

[0009] S3, training the recognition model ST-Swin-T based on the pre-trained model;

[0010] S4. During the testing phase of the recognition model ST-Swin-T, data is collected through a large number of experiments, and the likelihood function of the landing scene graph category is estimated based on the collected data;

[0011] S5. The landing scene graph to be identified is used as the input of the recognition model ST-Swin-T, and joint identification is performed based on the likelihood function of the landing scene graph category.

[0012] Furthermore, the landing scene categories include densely populated areas, rooftop platforms, offshore platforms, lawns, roads, densely populated areas, wastelands, farmlands and waters, and the safety levels include safe, general and dangerous, where the safe category is represented by 'L00', the general category is represented by 'L01', and the dangerous category is represented by 'L02'.

[0013] Furthermore, the recognition model ST-Swin-T comprises a first spatial transformation module for generating a transformed image by performing a transformation operation on an input image; and an image block division module for dividing the transformed image into a plurality of image blocks and flattening the image into a one-dimensional vector;

[0014] and a linear embedding module for embedding each one-dimensional vector of each image block generated by the image segmentation module through a linear layer and mapping it to a high-dimensional space; and an ST-Swin-T module for processing each image block in the high-dimensional space;

[0015] It is also used to perform element downsampling operations with an interval of 2 on the width W, height H, and number of channels C, and then splice them together through a fully connected layer to obtain a block fusion module with a feature size of (H / 2, W / 2, 4C).

[0016] Furthermore, the first spatial transformation module includes a localized network for predicting affine transformation parameters, a grid generator for generating a sampling grid based on the affine transformation parameters predicted by the localized network, and a sampler for using the sampling grid generated by the grid generator to sample pixel values ​​from the original image through bilinear interpolation to generate a transformed image.

[0017] Furthermore, the ST-Swin-T module includes a second spatial transformation module for rotating the transformed image; a window multi-head self-attention mechanism module that divides the image block into multiple windows and performs self-attention calculation in each window; and a third spatial transformation module that uses the output of the window multi-head self-attention mechanism module as input for scaling after layer normalization, multi-layer perceptron and residual calculation.

[0018] Furthermore, the calculation formula for self-attention calculation is:

[0019] ;

[0020] In the formula, Represents query, key and value respectively; ; is a tiny constant to avoid invalid calculations, Encodes relative position.

[0021] Furthermore, in step S3, the specific process includes the following steps:

[0022] S31. Add three spatial transformation networks based on the Swin-T neural network to obtain a training model that implements the adaptive attention mechanism.

[0023] S32, load the weights of the training model, train all parameters on the GPU, and set the number of fully connected layers and batch size;

[0024] S33, the recognition model ST-Swin-T with the best performance is trained based on the AdamW optimization algorithm with an initial learning rate of 0.001.

[0025] Furthermore, in step S4, the specific process includes the following steps:

[0026] S41. Setting the image feature vector of the input landing scene graph is a random variable, and the random variable With corresponding class labels ;

[0027] S42. Posterior probability based on landing scene graph The Bayesian decision rule can be rewritten as:

[0028] ;

[0029] In the above formula, Represents class label About random variables The likelihood function of ; Represents class label The prior probability of is a constant; Represents class label About random variables The likelihood function of ; Represents class label The prior probability of

[0030] S43. Obtain the prediction confidence of the landing scene category based on the trained recognition model ST-Swin-T , prediction confidence This is the likelihood function An estimated value of

[0031] S44. According to the likelihood function Determine whether the landing scene graph is an abnormal landing scene. If the likelihood function If it is not within the threshold range, the landing scene diagram is an abnormal landing scene, that is:

[0032] ;

[0033] In the above formula, and They represent the minimum and maximum thresholds for abnormal landing scenarios respectively.

[0034] By means of the above technical solution, the present invention provides a scene graph recognition method for autonomous landing of unmanned aerial vehicles based on ST-Swin-T neural network, which has at least the following beneficial effects:

[0035] 1. The scene graph recognition method proposed in the present invention can determine whether the drone can land by directly detecting the image below when facing an emergency landing scene, without the need for complex calculations or precise landing at a specific point. It significantly improves the flight safety of the drone and lays the foundation for its autonomous learning to recognize landing scenes.

[0036] 2. The present invention trains the constructed recognition model ST-Swin-T through a dedicated scene graph dataset and based on a pre-trained model, thereby being able to obtain a higher landing scene graph recognition rate, thereby solving the technical problem of foreground-background relationship dependence in drone landing scene graph recognition.

[0037] 3. The present invention may have overfitting phenomenon due to the small number and classification of data sets, which may lead to the encounter of landing scene diagrams that do not belong to any training data set during identification. The threshold method is used to solve this problem in the prediction stage to determine whether the landing scene diagram is an abnormal landing scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0039] Figure 1 This is a flow chart of the method for identifying the autonomous landing scene graph of a UAV of the present invention;

[0040] Figure 2 The overall network structure diagram of the identification model ST-Swin-T of the present invention;

[0041] Figure 3 This is a network structure diagram of the key modules in ST-Swin-T of the present invention. DETAILED DESCRIPTION

[0042] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly.

[0043] In order to realize the recognition of landing scene graph, the present invention needs to face its unique characterization. For example, if a large number of lotus leaves appear on the water surface, the scene may belong to "water area" rather than "grassland", and a scene of a bridge across the Yangtze River may belong to "water area" or "highway". That is to say, the deep learning method for object detection focuses on the foreground target of the image, while the recognition of landing scene graph pays more attention to the background information of the image. Therefore, it is necessary to fully understand the relationship between the foreground and background in the scene graph, including the relative positions of objects in space and the global structure of the entire scene graph. This is the difficulty faced by the classification and recognition of landing scene graphs. In addition, although a very powerful model can be trained based on convolutional neural networks, it still has limitations due to the lack of an effective way to process the spatial invariance of the output image data. To address this problem, the present invention introduces a differentiable spatial transformer network ST, which can be embedded in the existing deep neural network architecture. This enables the neural network to actively perform spatial transformation on the feature map, and to achieve it without any additional training supervision or modification of the optimization process based on the feature map itself. In addition, overfitting may occur when the data set is small. In order to solve this problem, the present invention proposes a method based on knowledge transfer and fine-tuning technology, which can still achieve ideal training results when the data set is small. In summary, the present invention uses the recognition model ST-Swin-T and the knowledge transfer method to solve the above problems and realize the recognition of the landing scene diagram of low-altitude UAV in emergency situations.

[0044] Please refer to Figure 1-Figure 3This embodiment proposes a scene graph recognition method for autonomous landing of UAV based on ST-Swin-T neural network. When facing emergency landing scene, it directly detects the image below to determine whether it can land, without complex calculation or precise landing at a specific point. It significantly improves the flight safety of UAV and lays the foundation for its autonomous learning and recognition of landing scenes. The method is divided into the following steps:

[0045] S1. Construct a dataset for drone landing scenarios and divide the dataset into multiple safety levels according to several landing scenario categories; the landing scenario categories include densely populated areas, rooftop platforms, offshore platforms, lawns, roads, densely populated areas, wastelands, farmlands and waters, and the safety levels include safe, general and dangerous, where the safe category is represented by 'L00', the general category is represented by 'L01', and the dangerous category is represented by 'L02'.

[0046] In this embodiment, the landing scene images in the data set are obtained from manually operated drone photography and acquisition from the Internet. According to the drone emergency landing mission, this embodiment constructs a custom data set named LS-9. The data set has a total of 10,000 images, of which 8,000 are training sets and 2,000 are test sets. This data set is divided into 9 categories: "dense crowds", "rooftop platforms", "offshore platforms", "lawns", "highways", "vehicle-dense areas", "wasteland", "farmland" and "water areas".

[0047] Among them, "densely crowded areas" refer to areas with large flow of people, such as airports, railway stations, bus stations, shopping centers, commercial streets, vegetable markets, amusement parks, crowded beaches, and tourist attractions with large flow of people during holidays.

[0048] The surface of the "rooftop platform" should be flat and free of obstacles to ensure a smooth landing of the drone.

[0049] "Offshore platform" refers to coastal or island areas where drones can land on offshore platforms for ocean monitoring, search and rescue, and other tasks. Typical scenarios include oil and gas extraction platforms, offshore wind farms, scientific research ship platforms, cruise ships or offshore tourism platforms, and offshore logistics bases.

[0050] "Lawn" means flat, weed-free, and free of obstacles (such as stagnant water, potholes, etc.). The lawn should have enough space to accommodate the landing of drones. Public green spaces in cities, such as squares, football fields, wetland parks, etc., can also be considered as drone landing spots if the lawns are in good condition and sparsely populated.

[0051] "Highway" refers to roads designed specifically for vehicle travel, including urban elevated roads, ground roads and expressways.

[0052] Typical places of "vehicle-intensive areas" include main roads and highways with heavy traffic, open-air parking lots, freight terminals and other areas.

[0053] "Wasteland" refers to undeveloped land, fallow land, river banks and lake sides, edges of nature reserves, mountainous and hilly areas, and unmaintained areas in parks.

[0054] "Farmland" refers to farmland that is temporarily not planted with crops and farmland planted with food crops or cash crops. Food crops include wheat, corn, soybeans and rice fields when there is no water, and cash crops include tea plantations, cotton and tobacco, etc. Farmland also includes areas such as orchards and vineyards.

[0055] "Water areas" refer to lakes, reservoirs, rivers, oceans, ponds or agricultural irrigation areas, etc.

[0056] In addition, this embodiment divides the landing scene into three safety levels according to the landing scene category to distinguish whether the drone can land. The three safety levels are represented by "safe", "general" and "dangerous", such as "lawn", "offshore platform" and "rooftop" belong to the safe level, "wasteland" and "farmland" belong to the general level; "dense crowd area", "dense vehicle area", "highway" and "water area" belong to the dangerous level. The safe category is represented by 'L00', the general category is represented by 'L01', and the dangerous category is represented by 'L02'.

[0057] S2. Based on the backbone network of the Swin-T neural network, a recognition model ST-Swin-T is constructed for classifying and recognizing the landing scene diagram of the UAV landing. Among them, the Swin-T neural network is a neural network architecture based on Transformer, which performs well in the field of computer vision, especially in tasks such as image classification, target detection and image segmentation. The main features of Swin-T include its unique window attention mechanism and hierarchical feature extraction structure. The network structure diagram of the recognition model ST-Swin-T constructed in this embodiment is shown in FIG. Figure 2 and Figure 3 As shown in the figure, three spatial transformation modules, namely ST1, ST2 and ST3, are added to the basic backbone network Swin-T. This is a self-contained module that can be embedded in the Swin-T architecture at any position and in any number. The spatial distribution of the input feature map is changed by learning transformation parameters to focus on the area of ​​interest. After the downsampling layer operation and adaptive attention mechanism of ST-Swin-T, the receptive field is gradually expanded, so that the attention mechanism can focus on the global features of the landing scene map.

[0058] Among them, the recognition model ST-Swin-T includes a first spatial transformation module for generating a transformed image by performing cropping and translation geometric operations on an input image of width W, height H and number of channels C; wherein the first spatial transformation module includes a localization network for predicting affine transformation parameters, a grid generator for generating a sampling grid according to the affine transformation parameters predicted by the localization network, and a sampler for sampling pixel values ​​from the original image by bilinear interpolation using the sampling grid generated by the grid generator to generate the transformed image. Specifically, the convolutional network of the localization network is used to predict affine transformation parameters. These affine transformation parameters define how to transform the input image to a new coordinate space. The grid generator generates a sampling grid according to the affine transformation parameters predicted by the localization network, and the sampling grid defines how pixels in the input image are mapped to the new space. Using the generated sampling grid, the sampler module samples pixel values ​​from the original image by bilinear interpolation to generate the transformed image.

[0059] In order to better illustrate the first spatial transformation module, a feature map is input , where the height H is 224, the width W is 224, and the channel C is 3. After the first spatial transformation module (ST1), the feature map The clipping and translation geometry operations are performed, and the output is In order to explain how to transform, the following transformation formula is used:

[0060] ;

[0061] In the above formula, , is the transformation matrix; , is the translation vector; The feature map The position before the transformation;

[0062] Among them, by changing and T parameters to achieve cropping and translation.

[0063] For example, the size of each image block is 4x4 pixels, and the image It is divided into 56x56 image blocks, each image block is regarded as a "word" and flattened into a one-dimensional vector. Therefore, the recognition model ST-Swin-T also includes an image segmentation module for dividing the transformed image into several image blocks and flattening them into a one-dimensional vector.

[0064] The one-dimensional vector of each image block is embedded through a linear layer to map it to a high-dimensional space. The weight of this linear layer is shared by all blocks, so the recognition model ST-Swin-T also includes a linear embedding module that embeds each one-dimensional vector of each image block generated by the image segmentation module through a linear layer to map it to a high-dimensional space.

[0065] The ST-Swin-T module is used to process each image block and the transformed image in the high-dimensional space; wherein, the ST-Swin-T module includes a second spatial transformation module for rotating the transformed image; a window multi-head self-attention mechanism module that divides the image block into multiple windows and performs self-attention calculation in each window; and a third spatial transformation module that uses the output of the window multi-head self-attention mechanism module as input for scaling after layer normalization, multi-layer perceptron and residual calculation; and a window-by-window moving multi-head self-attention mechanism module that realizes information exchange between different windows by introducing window offsets between consecutive attention blocks.

[0066] Specifically, the second space transformation module realizes the rotation function. The rotation can be achieved when expressed as:

[0067] ;

[0068] In the above formula, is the rotation angle; The feature map Position before transformation.

[0069] Among them, the window multi-head self-attention mechanism module divides the image block into multiple windows. The present invention sets the window size to , number of windows . And self-attention calculation is performed in each window. This mechanism helps to reduce the computational complexity. The specific self-attention calculation formula is as follows:

[0070] ;

[0071] In the formula, Represents query, key and value respectively; ; is a tiny constant to avoid invalid calculations. In addition, relative position encoding is added , relative position encoding b is used to introduce position information into the Transformer model. Since the Transformer model itself does not have the ability to process the position information of elements in the sequence, relative position encoding becomes a solution to this problem. The application of relative position encoding helps the model better understand the spatial relationship between pixels when processing images, thereby improving the performance of the model in visual recognition tasks.

[0072] The obtained output is input into the third spatial transformation module after layer normalization, multi-layer perceptron and residual calculation. The third spatial transformation module (ST3) realizes the scaling function. As shown in the above transformation formula, when When the image is enlarged, When , the image reduction function can be realized, and the specific parameters are obtained through spatial transformation network training.

[0073] The window-by-window moving multi-head self-attention mechanism module realizes information exchange between different windows by introducing window offsets between consecutive attention blocks. This mechanism allows the model to capture cross-window context information while maintaining high efficiency. The original 4 windows are changed to 9 windows by moving window by window. For the increase in the number of serial ports, the original number of windows is maintained by setting a mask and cross-window information exchange is realized, that is, the mask value is set to negative infinity, and the redundant values ​​will be masked after the softmax function calculation.

[0074] The block fusion module is used to perform downsampling operations on the width W, height H, and number of channels C at intervals of 2, and then concatenate them together through the fully connected layer to obtain a feature size of (H / 2, W / 2, 4C). The block fusion module can reduce the computational complexity and gradually expand the receptive field through hierarchical downsampling, so that the attention mechanism can focus on global features.

[0075] like Figure 2 As shown in the figure, the S1 module contains a linear embedding module and an ST-Swin-T module, and the S2 module contains a block fusion module and an ST-Swin-T module. Among them, by implementing one operation on the S1 module, the S2 module implements the same operation calculation three times in a row. The last calculation of the S2 module does not require downsampling operation, and finally the loss is calculated through the fully connected layer and the loss function.

[0076] In view of the fact that the recognition of the landing scene graph requires the combination of the background information of the object, the contextual relationship and the small size of the data set of the present invention, the present invention introduces an adaptive attention mechanism module, namely the recognition model ST-Swin-T, which enables it to dynamically adjust the size and shape of the focus area according to the image content. It allows spatial operations on data in the network and can be embedded in the existing neural network architecture, so that the neural network can actively perform spatial transformations on the feature map, conditional on the feature map itself, without any additional training supervision or modification of the optimization process. This is particularly important for identifying objects of different scales (such as the scale of the scene graph identified by the drone during the landing from a high altitude will continue to change).

[0077] S3. Train the recognition model ST-Swin-T based on the pre-trained model; in this embodiment, the basic network of the training model is improved based on the Swin-T neural network, and three spatial transformation networks are added to realize the adaptive attention mechanism. The relevant literature based on transformers all mentioned that visual transformers require large-scale training data sets to obtain good results. Therefore, for the problem of small data set size in the present invention, knowledge transfer and fine-tuning methods are used for training, that is, training is performed based on the pre-trained model, and the specific process is divided into the following steps:

[0078] S31. Three spatial transformation networks are added based on the Swin-T neural network to obtain a training model for implementing an adaptive attention mechanism; wherein the three added spatial transformation networks are the first spatial transformation module (ST1), the second spatial transformation module (ST2) and the third spatial transformation module (ST3) mentioned above, which will not be described again here to avoid repeated explanations.

[0079] S32. Load the weights of the training model, train all parameters on the GPU, and set the number of fully connected layers and batch size. The GPU uses NVIDIA's GeForce RTX 2080 Ti, changes the number of fully connected layers from 1000 to 9, and sets the batch size to 32.

[0080] S33, training based on the AdamW optimization algorithm with an initial learning rate of 0.001 to obtain the best performance recognition model ST-Swin-T; in this step, this embodiment adopts a total of 90 cycles of training starting from a learning rate of 0.001, and a cycle refers to the process in which the entire data set is completely traversed once, that is, all data samples have been used for model training once. In the training stage, the weight is decayed by 10 every 30 cycles. Specifically, if the initial weight decay is , then in the nth cycle, the value of weight decay can be expressed as:

[0081] ;

[0082] in, express Round down. For example, the initial weight decay value of the present invention is 0.05, then: in the 1st to 29th period, the weight decay value is 0.05. In the 30th to 59th period, the weight decay value is 0.005. In the 60th to 89th period, the weight decay value is 0.0005.

[0083] In this embodiment, for the drone landing scene image recognition task, it is difficult to obtain good recognition results without a large-scale data set and a complex network structure. Using the knowledge transfer method, taking the pre-trained model as the starting point of the new model, and using the newly constructed data set to train part of the network or the entire network can often improve the accuracy and generalization ability of the model.

[0084] Since the landing scene classification in the data set is only a part of the scene classes that may be encountered, and the number and classification of the data set of the present invention are small, the landing scenes encountered during actual flight may be more complex. The drone may encounter a landing scene that does not belong to any training data set during emergency landing. Taking into account this abnormal situation, how to identify this landing scene is the anomaly detection problem proposed by the present invention, that is, the threshold method is used to solve the anomaly detection problem in the classifier in the prediction stage, such as the method proposed in S4.

[0085] S4. During the test phase of the recognition model ST-Swin-T, a large number of experiments are conducted to collect data, and the likelihood function of the landing scene graph category is estimated based on the collected data. In this step, the classification of the landing scene graph is to classify a certain category Assigned to one or more feature vectors . A dataset is a set of image samples With corresponding class labels Because different targets are presented in different ways, such as different landing scene graphs. Therefore, the present invention inputs the image feature vector of the scene graph is regarded as a random variable. In practical applications, each category to be classified is regarded as a random vector. In order to minimize the probability of misclassification of the feature vector, the class label The probability of occurrence is maximized, that is, among all class labels The posterior probability Maximize. The specific process is divided into the following steps:

[0086] S41. Setting the image feature vector of the input landing scene graph is a random variable, and the random variable With corresponding class labels ;

[0087] S42. Posterior probability based on landing scene graph The Bayesian decision rule can be rewritten as:

[0088] ;

[0089] In the above formula, Represents class label About random variables The likelihood function of ; Represents class label The prior probability of is a constant; Represents class label About random variables The likelihood function of ; Represents class label The prior probability of .

[0090] Specifically, in all class labels The posterior probability Maximization, according to the Bayesian decision rule, is as follows:

[0091] ;

[0092] In the formula, is the posterior probability.

[0093] The Bayesian decision rule is changed to the following formula:

[0094] ;

[0095] The above formula converts each sample Assigned to a class label .

[0096] How to estimate the likelihood function In theory, this problem can be solved by calculating the histogram of the sample feature vector of the training data set. However, due to the curse of dimensionality, this method cannot be used in engineering practice. Multilayer perceptrons and convolutional neural networks cannot perform anomaly detection by themselves. Therefore, in order to solve this problem, this embodiment proposes a threshold segmentation method as follows:

[0097] S43. Obtain the prediction confidence of the landing scene category based on the trained recognition model ST-Swin-T , prediction confidence This is the likelihood function The training of the recognition model ST-Swin-T is divided into training and testing stages. In the testing stage, a large number of experiments are conducted to collect data. Then, based on these data, the prediction confidence of the landing scene category is obtained through the trained recognition model ST-Swin-T, that is, the estimated value of the likelihood function. Therefore, for the likelihood function It is obtained based on empirical method.

[0098] S44. According to the likelihood function Determine whether the landing scene graph is an abnormal landing scene. If the likelihood function If the prediction confidence is too high or too low, the landing scene corresponding to the landing scene image is classified as other abnormal classes, as shown in the following formula:

[0099] ;

[0100] In the above formula, and They represent the minimum and maximum thresholds of abnormal landing scenarios, respectively. and The value of needs to be obtained by testing a large number of landing scene graphs, and is not specifically limited in this embodiment.

[0101] S5. Use the landing scene graph to be identified as the input of the recognition model ST-Swin-T, and perform joint identification based on the likelihood function of the landing scene graph category; specifically, this embodiment is tested based on the test set, and the label and the top 5 prediction confidences are displayed in the landing scene graph. After verification, it was found that most of the top five results are basically very relevant to the true value label. If it belongs to the "safe" and "general" categories, it can land, and if it belongs to the "dangerous" category, it cannot land. For misclassification outside the data set, the threshold method of S4 is used for judgment. If it cannot be judged, it is judged based on the drone's own electronic fence whether it can land.

[0102] The present invention improves the Swin-T neural network and is based on knowledge transfer and fine-tuning technology to solve the foreground-background relationship problem that is relied on in the recognition of UAV landing scene graphs. The present invention achieves this goal by constructing a dedicated scene graph data set and performing model training. Under the action of the pre-training model and the fine-tuning method, the present invention can obtain a higher recognition rate of landing scene graphs. In view of the abnormal detection problem that may arise in the model testing phase, the present invention uses a threshold method to exclude other abnormal landing scene graphs, thereby solving the problem. The present invention is aimed at emergency landing scenes, and determines whether it can land by directly detecting the image below, without the need for complex calculations or precise landing at a specific point. This method significantly improves the flight safety of the UAV and lays the foundation for its autonomous learning to identify landing scenes.

[0103] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, so the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0104] The above implementation methods have been described in detail. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A scene graph recognition method for autonomous landing of unmanned aerial vehicles based on ST-Swin-T neural network, characterized in that: The method comprises the following steps: S1. Build a dataset for drone landing scenarios and divide the dataset into multiple safety levels according to several landing scenario categories. S2, based on the backbone network of the Swin-T neural network, a recognition model ST-Swin-T is constructed for classifying and recognizing the landing scene graph of the UAV landing; Three spatial transformation modules are added on the basis of the backbone network Swin-T, namely the first spatial transformation module, the second spatial transformation module and the third spatial transformation module; The first spatial transformation module includes a localization network for predicting affine transformation parameters, a grid generator for generating a sampling grid according to the affine transformation parameters predicted by the localization network, and a sampler for sampling pixel values ​​from the original image by bilinear interpolation to generate a transformed image using the sampling grid generated by the grid generator; The second spatial transformation module and the third spatial transformation module have the same structure as the first spatial transformation module; The recognition model ST-Swin-T includes a first spatial transformation module for generating a transformed image by performing a transformation operation on an input image, wherein the transformation operation is a cropping and translation geometric operation on an input image of width W, height H and number of channels C; and an image block division module for dividing the transformed image into a plurality of image blocks and flattening them into a one-dimensional vector; and a linear embedding module for embedding each one-dimensional vector of each image block generated by the image segmentation module through a linear layer and mapping it to a high-dimensional space; and an ST-Swin-T module for processing each image block in the high-dimensional space; and a block fusion module for performing downsampling operations on the width W, height H, and number of channels C with an interval of 2, and then splicing them together through a fully connected layer to obtain a block fusion module with a feature size of (H / 2, W / 2, 4C); S3, training the recognition model ST-Swin-T based on the pre-trained model; S4. During the testing phase of the recognition model ST-Swin-T, data is collected through a large number of experiments, and the likelihood function of the landing scene graph category is estimated based on the collected data; S5. The landing scene graph to be identified is used as the input of the recognition model ST-Swin-T, and joint identification is performed based on the likelihood function of the landing scene graph category.

2. The scene graph recognition method according to claim 1, characterized in that: The landing scene categories include densely populated areas, rooftop platforms, offshore platforms, lawns, roads, densely populated areas, wastelands, farmlands and waters, and the safety levels include safe, general and dangerous, where the safe category is represented by 'L00', the general category is represented by 'L01', and the dangerous category is represented by 'L02'.

3. The scene graph recognition method according to claim 1, characterized in that: The ST-Swin-T module includes a second spatial transformation module for rotating the transformed image; a window multi-head self-attention mechanism module for dividing the image block into multiple windows and performing self-attention calculation in each window; And a third spatial transformation module that uses the output of the window multi-head self-attention mechanism module as input to achieve scaling after layer normalization, multi-layer perceptron and residual calculation; The second space transformation module realizes the rotation function. The rotation can be achieved when expressed as: ; In the above formula, is the rotation angle; The feature map The position before the transformation; The third space transformation module implements the scaling function. When the transformation matrix When the transformation matrix The image reduction function can be realized.

4. The scene graph recognition method according to claim 3, characterized in that: The calculation formula for self-attention calculation is: ; In the formula, Represents query, key and value respectively; ; is a tiny constant to avoid invalid calculations, Encodes relative position.

5. The scene graph recognition method according to claim 1, characterized in that: In step S3, the specific process includes the following steps: S31. Add three spatial transformation modules based on the Swin-T neural network to obtain a training model that implements the adaptive attention mechanism; S32, load the weights of the training model, train all parameters on the GPU, and set the number of fully connected layers and batch size; S33, the recognition model ST-Swin-T with the best performance is trained based on the AdamW optimization algorithm with an initial learning rate of 0.

001.

6. The scene graph recognition method according to claim 1, characterized in that: In step S4, the specific process includes the following steps: S41. Setting the image feature vector of the input landing scene graph is a random variable, and the random variable With corresponding class labels ; S42. Posterior probability based on landing scene graph The Bayesian decision rule can be rewritten as: ; In the above formula, Represents class label About random variables The likelihood function of ; Represents class label The prior probability of is a constant; Represents class label About random variables The likelihood function of ; Represents class label The prior probability of S43. Obtain the prediction confidence of the landing scene category based on the trained recognition model ST-Swin-T , prediction confidence This is the likelihood function An estimated value of S44. According to the likelihood function Determine whether the landing scene graph is an abnormal landing scene. If the likelihood function If it is not within the threshold range, the landing scene diagram is an abnormal landing scene, that is: ; In the above formula, and They represent the minimum and maximum thresholds for abnormal landing scenarios respectively.