Natural geological disaster classification and identification method and system based on improved resnet neural network
By improving the ResNet model, adding channel and spatial attention mechanisms and a global average pooling layer, and using reinforcement learning to optimize the network structure, the problems of low accuracy and poor generalization ability of ResNet in the multi-classification task of natural geological disasters were solved, and the recognition accuracy and recall rate were significantly improved.
Patent Information
- Application Number
- CN202310625316.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2043-05-30
AI Technical Summary
The existing ResNet model has low accuracy and poor generalization ability in the multi-classification task of natural geological disasters, and cannot meet the needs of geological disaster identification and early warning.
Based on ResNet, the optimizer is replaced, the channel attention mechanism and the spatial attention mechanism are added, the global average pooling layer is introduced, and the attention modules are added at different positions through the strategy network based on reinforcement learning ideas to optimize the network structure.
The accuracy and generalization ability of natural geological disaster identification have been improved. The accuracy of the test set has increased from 57.92% to 88.23%, the average precision has increased from 71% to 89%, and the recall rate has increased from 58% to 89%.
Smart Images

Figure CN116758432B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of natural geological disaster classification and identification, and particularly relates to a natural geological disaster classification and identification method and system based on an improved Resnet neural network. BACKGROUND
[0002] Geological disasters are a common natural disaster, including landslides, collapses, and mudslides. The occurrence of geological disasters often has a serious impact on people's lives and property, so predicting and identifying geological disasters is of great significance. In recent years, with the continuous development of computer vision and machine learning technology, image-based geological disaster identification has become an important research direction. However, due to the complexity and diversity of geological disaster images, traditional image classification algorithms face many challenges, such as low classification accuracy and poor generalization ability.
[0003] In recent years, some scholars have applied artificial intelligence technology to geological disaster identification and have made some progress. "Landslide image recognition method based on deep residual network" by Liu Yongqiang et al. This research uses the ResNet network structure and proposes a method for identifying landslide images. The experimental results show that the classification accuracy of this method reaches 94.2%. "Landslide disaster image recognition method based on remote sensing image and ground monitoring data fusion" by Wang Jun et al. This research adopts a method combining remote sensing images and ground monitoring data and proposes a landslide disaster image recognition method. The experimental results show that the classification accuracy of this method reaches 95.3%. "Mudslide image recognition method based on deep convolutional neural network" by Zhang Yajun et al. This research adopts a deep convolutional neural network (CNN) model and proposes a mudslide image recognition method.
[0004] The residual connection of ResNet can effectively solve the gradient vanishing problem in deep convolutional neural networks, allowing the network to be deep without overfitting. The residual module introduced by ResNet is a special network structure used to solve the gradient vanishing problem in deep neural networks. Currently, ResNet has become a basic model in the fields of image classification, object detection, and semantic segmentation in computer vision, and has achieved excellent results in multiple international competitions. However, the Resnet model has low accuracy and poor generalization ability in the multi-classification task of natural geological disasters. In the above data set, the average accuracy is only 57.92%, which cannot meet the basic needs of geological disaster identification and early warning. SUMMARY
[0005] In order to solve the problems in the prior art, the application provides a natural geological disaster classification and identification method and system based on an improved Resnet neural network, which replaces an optimizer and a loss function on the basis of ResNet, adds a channel attention mechanism, a spatial attention mechanism and a global average pooling layer, and can further improve the performance and accuracy of the network; the channel attention mechanism and the spatial attention mechanism are two different attention mechanisms, can respectively perform weighted processing on channels and spatial information in the network, obtain action through a strategy network of a reinforcement learning idea, flexibly and selectively introduce different attention mechanisms at different positions, and improve the robustness and generalization ability of the network; are used for classifying and identifying remote sensing images and prediction, effectively identify various natural disasters including earthquakes, floods, wildfires and volcanic eruptions, and solve the problems mentioned in the above background art.
[0006] In order to achieve the above object, the application provides the following technical scheme: a natural geological disaster classification and identification method based on an improved Resnet neural network, comprising the following steps:
[0007] S1, collecting image data: acquiring remote sensing image data or image data of a geological disaster area shot by a drone;
[0008] S2, constructing a data set: constructing a natural disaster image data set after labeling and data enhancement of the image data, and dividing a training set, a verification set and a test set according to a ratio of 8:1:1;
[0009] S3, constructing a Resnet-CS model: improving a Resnet neural network model to obtain a Resnet-CS model;
[0010] S4, training the Resnet-CS model: inputting data set data into the Resnet-CS model for training to obtain an optimal model;
[0011] S5, geological disaster classification and identification: inputting image data to be measured into the trained optimal model to obtain a prediction classification result.
[0012] Preferably, in step S2, the labeling is specifically labeling the image data as an earthquake, a flood, a wildfire or a volcanic eruption; and the data enhancement includes cropping, scaling, flipping, padding, rotating and mirroring.
[0013] Preferably, in step S3, the improvement of the Resnet neural network model specifically comprises: adding a channel attention module and a spatial attention module after the first layer of convolution in the Resnet neural network model, adding a global average pooling layer before the fully connected layer, and introducing a policy network based on the idea of reinforcement learning, and adding the channel attention module and the spatial attention module at different positions after the residual block layer; the Resnet-CS model comprises a convolution layer, a batch normalization layer, a ReLU activation function, a channel attention module, a spatial attention module, a max pooling layer, a residual block layer, a global average pooling layer, and a fully connected layer.
[0014] Preferably, the policy network based on the idea of reinforcement learning adds the channel attention module and the spatial attention module at different positions after the residual block layer, specifically: converting the input image of the model into a vector, which is the state, making actions according to each state, the actions are adding adaptive attention modules at positions after the ResNet block, which are decided by the policy network of reinforcement learning;
[0015] When the action output by the policy network is 0, the Resnet-CS model adds a spatial attention module and a channel attention module after the first layer of residual block;
[0016] When the action output by the policy network is 1, the Resnet-CS model adds a spatial attention module and a channel attention module after the second layer of residual block;
[0017] When the action output by the policy network is 2, the Resnet-CS model does not add additional attention modules, and only uses the original model structure;
[0018] Then the parameters of the policy network are updated through the action and the reward size corresponding to the action, which is expressed by the following formula:
[0019] G t =r t +γ 1 r t+1 +γ 2 r t+2 +…+γ n r t+n
[0020] Where G t is the multi-step cumulative reward value, γ is the future expected coefficient, which helps the decision to focus on long-term rewards rather than only short-term rewards, and r t+n is the reward value brought by the t+nth action.
[0021] Preferably, the reward refers to the correctness evaluation of the classification result of the model to the input image, and a cross-entropy loss function is used as a reward function to measure the difference between the model output and the real label, and the cross-entropy loss function is as follows:
[0022] L = -1 / N * Σ(Σ(y_ij*log(p_ij)))
[0023] Wherein, N is the number of samples, y_i is the real label of the i-th sample, p_i is the predicted label of the model, and j is the class label in multi-class classification.
[0024] Preferably, the Resnet-CS model uses a momentum stochastic gradient descent (Momentum SGD) to adjust the parameters to minimize the loss function, and the formula is expressed as follows:
[0025] v t = γv t-1 + lr t g t
[0026] Wherein, v t-1 is the direction and amplitude of the last gradient update, γ is a momentum coefficient for controlling the proportion of the last update in the current update, lr t represents the learning rate for controlling the step size of each gradient update, g t represents the gradient at the current time step, which is used to update the parameters of the model.
[0027] Preferably, in step S4, the Resnet-CS model is trained, specifically including: inputting the training set data into the Resnet-CS for training; putting the validation set data into the trained model for verification, outputting the accuracy, precision, recall, F1 value parameters, adjusting the hyperparameters, and obtaining the optimal model; and putting the test set data into the optimal model for testing, and testing and verifying the optimal model.
[0028] In addition, in order to achieve the above purpose, the application also provides the following technical scheme: a natural geological disaster classification and identification system based on an improved Resnet neural network, which can realize the natural geological disaster classification and identification method, and the classification and identification system comprises:
[0029] An image data acquisition module: acquiring remote sensing images or images of geological disaster areas taken by a UAV;
[0030] A data set construction module: constructing a natural disaster image data set after labeling and data enhancement of the image data, and dividing the training set, the validation set and the test set according to the ratio of 8:1:1;
[0031] The Resnet-CS model construction module: the Resnet neural network model is improved to obtain a Resnet-CS model;
[0032] The Resnet-CS model training module: data set data is input into the Resnet-CS model for training to obtain an optimal model;
[0033] The geological disaster classification and identification module: input the image data to be measured into the trained optimal model to obtain a predicted classification result.
[0034] In addition, to achieve the above purpose, the present application also provides the following technical scheme: an electronic device, comprising: a processor; and a memory for storing one or more programs;
[0035] When the one or more programs are executed by the processor, the processor executes the natural geological disaster classification and identification method.
[0036] In addition, to achieve the above purpose, the present application also provides the following technical scheme: a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the natural geological disaster classification and identification method.
[0037] The beneficial effects of the present application are: 1) the present application uses remote sensing images and unmanned aerial vehicle photos as data images, which reduces the difficulty of data collection such as geological disaster site survey; the Resnet-CS model of the present application can run on most terminals, has low hardware requirements, and can be universally implemented and applied on personal computers; 2) the improved Resnet model of the present application can identify various geological disaster categories, and the channel attention module and the spatial attention module are added after the first layer of convolution and before the full connection layer, which can more comprehensively extract feature information and further improve the recognition accuracy; 3) the present application adds a global average pooling layer, which can effectively reduce the model operation complexity, improve the model training speed and recognition accuracy; 4) the strategy network introducing the reinforcement learning idea can more flexibly adjust the network structure, further improve the recognition accuracy and system performance, and on the same data set, the test set accuracy is improved from 57.92% to 88.23%, the average precision is improved from 71% to 89%, and the average recall is improved from 58% to 89%, among which, the significant improvement of the recall rate has important significance for the prediction and identification application of geological disasters. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 The natural geological disaster classification and identification method step flowchart of the present application;
[0039] Figure 2 The remote sensing image example diagram;
[0040] Figure 3 Fig. 1 is a schematic diagram of the Resnet-CS model structure of the present application;
[0041] Figure 4 Fig. 2 is a schematic diagram of the index comparison between the basic ResNet model and the Resnet-CS model of the present application;
[0042] Figure 5 Fig. 3 is a schematic diagram of the natural geological disaster classification and identification system module of the present application;
[0043] Figure 6 Fig. 4 is a schematic diagram of the device structure of the present application;
[0044] In the figure, 110 is an image data acquisition module; 120 is a data set construction module; 130 is a Resnet-CS model construction module; 140 is a Resnet-CS model training module; 150 is a geological disaster classification and identification module; 210 is a processor; and 220 is a storage. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0046] EMBODIMENT
[0047] The present embodiment proposes a natural geological disaster classification and identification method based on an improved Resnet neural network to solve the problems of low recognition rate and low accuracy of the original Resnet model in natural geological disaster identification, which is used for classification and identification of remote sensing images or unmanned aerial vehicle aerial images and prediction, and effectively identifies various natural disasters including floods, hurricanes, earthquakes and other natural geological disasters. Figure 1 As shown in the figure, the method comprises the following steps:
[0048] S1, image data acquisition: acquiring remote sensing images or images of geological disaster areas taken by unmanned aerial vehicles, and the acquired remote sensing images are as shown in the figure. Figure 2
[0049] The data set used in this embodiment is the xBD natural disaster image data set provided by Maxar / DigitalGlobe open data program, which is the first building damage assessment data set so far, and is one of the largest and highest quality public data sets of annotated high-resolution satellite images. This time, 5572 images of the data set are used, all of which are 1024*1024 high-resolution satellite remote sensing images, and 9 different events are marked, including earthquakes, floods, wildfires, volcanic eruptions, etc. These images include pre-disaster and post-disaster images, which can be used to build positioning and damage assessment tasks.
[0050] S2, building data set: after labeling and data augmentation of image data, building natural disaster image data set, and dividing training set, validation set and test set according to the ratio of 8:1:1. Label the picture data set into 9 categories of images such as earthquakes, floods, wildfires, volcanic eruptions, etc. Data augmentation is performed on the remote sensing image data set to improve the recognition accuracy of the model. Data augmentation includes cropping, scaling, flipping, padding, rotation and mirroring.
[0051] S3, building Resnet-CS model: improving the Resnet neural network model to get the Resnet-CS model, as shown in Figure 3
[0052] Further, the improvement of the Resnet neural network model specifically includes: adding a channel attention module and a spatial attention module after the first convolution layer in the Resnet neural network model, adding a global average pooling layer before the fully connected layer, and introducing a policy network based on the idea of reinforcement learning, adding a channel attention module and a spatial attention module at different positions after the residual block layer.
[0053] Further, the Resnet-CS model includes convolution layer, batch normalization layer, ReLU activation function, channel attention module, spatial attention module, max pooling layer, residual block layer, global average pooling layer and fully connected layer.
[0054] B1: convolution layer (Conv2d), which is one of the most basic components in deep learning, used to extract features of images and other data; in this model, the convolution layer is the first layer, which performs convolution operation on the input image to extract low-level features of the image. The size of the feature map generated after convolution is:
[0055]
[0056] B2: Batch normalization layer (BatchNorm2d), the batch normalization layer is one of the common techniques used in model training to accelerate convergence and improve model accuracy; on each small batch of data, the batch normalization layer normalizes the data to make the distribution of the data more stable, thereby accelerating model training, and its core algorithm is:
[0057]
[0058]
[0059]
[0060]
[0061] B3: ReLU activation function: ReLU activation function is one of the most commonly used activation functions in deep learning, which is used to add nonlinear features; ReLU function outputs equal to input when input is greater than 0; when the input is less than or equal to 0, the output is 0;
[0062] f(x) = max(0, x)
[0063] The function is to increase the nonlinear ability of the model, thereby improving the accuracy of the model;
[0064] B4: Channel attention module (ChannelAttention): Channel attention module is an attention mechanism that enhances the model's ability to model the correlation between different channels; by learning the correlation between channels, the channel attention module can adaptively adjust the weight of the channel, thereby improving the accuracy of the model; Different values in s represent the weight information of different channels, giving different weights to channels:
[0065] s = F ex (z, w) = σ(W2ReLU(W1z))
[0066] B5: Spatial attention module (SpatialAttention): Spatial attention module is an attention mechanism that enhances the model's ability to model the correlation between different spatial positions; by learning the correlation between spatial positions, the spatial attention module can adaptively adjust the weight of the spatial position, thereby improving the accuracy of the model; The final output of the attention feature y q :
[0067]
[0068] B6: MaxPooling is used to reduce the size of the image or feature map, which divides the input image or feature map into fixed-size blocks and selects the maximum value in each block as the output. It is used to reduce the spatial size of the feature map, thereby reducing the model parameters and computational cost.
[0069] B7: Residual Blocks: Residual Blocks is a network structure proposed by Residual Network, which adds shortcut connection across layers to construct residual blocks, so that the network can learn residual information; in the residual block, the input features are first passed through a normal convolutional layer, and then added to the original input features to obtain the residual information; finally, the residual information is added to the original input features to obtain the output of the residual block; mathematically, it is defined as:
[0070] y = F(x, {W_i}) + x
[0071] Residual Blocks can help the model learn residual information more easily, thereby accelerating model training and improving model accuracy;
[0072] B8: AvgPool: AvgPool is a pooling operation that compresses the feature map to a fixed-size output; unlike traditional pooling operations, the kernel size of AvgPool is equal to the size of the input feature map, so that the feature map can be compressed to a fixed size;
[0073]
[0074] B9: Fully connected: Fully connected is one of the most basic layers in deep learning, which is used to map input features to output labels. Fully connected is usually used in classification tasks to map feature vectors to classification labels.
[0075] This patent introduces the idea of reinforcement learning, and the state, action and reward in reinforcement learning can be defined as follows:
[0076] State: In this invention, the state refers to the representation of the input image. The input image is converted into a vector using a convolutional neural network, and this vector is the state;
[0077] Action: In this invention, action refers to the position of adding adaptive attention modules after each ResNet block. These positions correspond to adding different operations in the neural network, such as adding a channel attention module at a certain position;
[0078] Reward: In this invention patent, reward refers to the correctness evaluation of the classification result of the model on the input image. The cross-entropy loss function is used as the reward function to evaluate the accuracy of the output category of the model under the given input image.
[0079] Further, the policy network based on the idea of reinforcement learning adds channel attention modules and spatial attention modules at different positions after the residual block layer, which means that the input image of the model is converted into a vector, which is the state, and an action is taken according to each state. The action is to add adaptive attention modules, including channel attention modules and spatial attention modules, at positions after the ResNet block, which is decided by the policy network of reinforcement learning. Specifically, the policy network of the Resnet-CS model uses the input image as the state and outputs a probability distribution indicating which action the agent model should take in the current state. If the action output by the policy network is 0, the Resnet-CS model will add spatial attention modules and channel attention modules after the first layer of residual blocks; if the action output by the policy network is 1, the Resnet-CS model will add spatial attention modules and channel attention modules after the second layer of residual blocks. If the action output by the policy network is 2, the Resnet-CS model does not add additional attention modules and only uses the original Resnet-CS model structure. Then, the parameters of the policy network are updated through the action and the reward size corresponding to the action, and finally, the parameters are updated using the backpropagation algorithm; the performance of the policy network is optimized to improve the recognition effect of Resnet-CS. The formula is expressed as follows:
[0080] G t =r t +γ 1 r t+1 +γ 2 r t+2 +…+γ n r t+n
[0081] Where G t is the multi-step cumulative reward value, γ is the future expected coefficient, which helps the decision to focus on long-term rewards rather than just short-term rewards, and r t+n is the reward value brought by the t+nth action.
[0082] In this patent, the specific meaning is that r is the inverse value of the cross-entropy function value each time, that is, the larger the loss value after each action, the smaller the r value, and the smaller the loss value, the larger the r value; γ is a coefficient close to 1 but less than 1, which is introduced to ensure that each action not only depends on the current situation, but also considers the future situation according to the γ coefficient; then according to the cumulative reward (G tThe parameters of the policy network are updated according to the size of the reward, so that the probability of taking an action in a state with a high reward is greater, thereby optimizing the performance of the policy network.
[0083] The reward refers to the correctness evaluation of the classification result of the input image by the model, and the cross-entropy loss function is used as the reward function to measure the difference between the model output and the true label, improve the generalization ability of the model, and improve the recognition accuracy. In the classification problem, the cross-entropy function is a commonly used loss function for measuring the difference between the model output and the true label; for a classification problem, assuming that there are N samples, each sample has K categories, and the true label of the ith sample is y_i, the predicted label of the model is p_i, the cross-entropy loss function is as follows:
[0084] L = -1 / N * Σ(Σ(y_ij*log(p_ij)))
[0085] Where N is the number of samples, y_i is the true label of the ith sample, p_i is the predicted label of the model, and j is the class label in multi-class classification.
[0086] The Resnet-CS model uses the Momentum Stochastic Gradient Descent (SGD) to adjust the parameters to minimize the loss function and improve the recognition accuracy. The Stochastic Gradient Descent (SGD) optimizer is a commonly used optimizer that iteratively updates the model parameters to gradually reduce the loss function; specifically, it calculates the gradient for each sample and updates the model parameters, so it is suitable for large-scale data sets and high-dimensional features; a momentum-like cumulative quantity is used to replace the true gradient to better find the optimal solution; the formula is as follows:
[0087] v t = γv t-1 + lr t g t
[0088] Where v t-1 is the direction and magnitude of the last gradient update, γ is the momentum coefficient, which controls the proportion of the last update in the current update, lr t represents the learning rate, which controls the step size of each gradient update, g t represents the gradient at the current time step, which is used to update the parameters of the model.
[0089] S4, training the Resnet-CS model: input the data set data into the Resnet-CS model for training to obtain the optimal model.
[0090] The training of the Resnet-CS model specifically includes: inputting training set data into the Resnet-CS for training; inputting validation set data into the trained model for verification, outputting accuracy, precision, recall rate, F1 value parameters, adjusting hyperparameters to make the expected indicators optimal, and obtaining an optimal model; and inputting test set data into the optimal model for testing, and testing and verifying the optimal model.
[0091] When the image data is input into the trained Resnet-CS for processing, transforms are used to randomly crop the image into different sizes and aspect ratios, and then scale the image to the specified size; the image is flipped with a probability; the image is converted into a tensor; and the tensor is normalized;
[0092]
[0093] A channel attention layer and a spatial attention layer are added after the first convolutional layer.
[0094] A channel attention layer and a spatial attention layer are added after the residual block layer.
[0095] The channel attention mechanism introduces an importance weight in the network, which is used to select the most representative channel from the feature map. The importance weight of each channel is calculated, and then the weight is applied to the channel feature map to enhance the expression ability of the important channel. The channel attention mechanism can make the network pay more attention to important channel information, thereby improving the recognition accuracy of the model for natural geological disasters; different values in s represent the weight information of different channels, giving different weights to the channels:
[0096] s = F ex (z, w) = σ(W2ReLU(W1z))
[0097] The spatial attention module is an attention mechanism that enhances the modeling ability of the model for the correlation between different spatial positions; by learning the correlation between spatial positions, the spatial attention module can adaptively adjust the weight of the spatial position, thereby improving the accuracy of the model; the final output attention feature y q :
[0098]
[0099] A global average pooling layer is added before the fully connected layer.
[0100] The global average pooling layer is used to convert the feature map into a vector, and can reduce the parameter quantity and computational quantity of the model.
[0101] Global average pooling operation in the spatial dimension:
[0102]
[0103] In the classification task, the global average pooling layer can convert the feature map into a single feature vector, and then use a fully connected layer to map it to the space of predicted classes.
[0104] The random gradient descent (SGD) optimizer is selected;
[0105] The momentum-like cumulative quantity is used to replace the true gradient to better find the optimal solution:
[0106] v t = gamma * v t-1 + lr t g t
[0107] The cross entropy function (CrossEntropyloss) is used to measure the difference between the model output and the true label;
[0108] L = -1 / N * Sigma (Sigma (y_ij * log (p_ij)))
[0109] Based on the strategy network introduced by the idea of reinforcement learning, attention modules are selectively added at different positions.
[0110] S5, geological disaster classification and identification: obtain relevant image data through remote sensing images or unmanned aerial photography, unify the picture data, input the to-be-tested image data into the trained optimal model, and obtain the predicted classification result.
[0111] The improved Resnet model can identify various geological disaster categories, and the basic ResNet model compared with the Resnet-CS model of the application, as shown in Figure 4 It can be known from Figure 4 that the Resnet-CS model greatly improves the accuracy of the multi-classification problem, and on the same data set, the test set accuracy is improved from 57.92% to 88.23%, the average precision is improved from 71% to 89%, and the average recall is improved from 58% to 89%. Among them, the great improvement of the recall rate has important significance for the prediction and identification application of geological disasters.
[0112] The application replaces the optimizer, loss function, adds the channel attention mechanism, spatial attention mechanism and global average pooling layer on the basis of ResNet, which can further improve the performance and accuracy of the network. The channel attention mechanism and the spatial attention mechanism are two different attention mechanisms, which can respectively weight the channel and spatial information in the network. Through the introduction of the strategy network of the idea of reinforcement learning, the action is obtained, and different attention mechanisms are selectively introduced at different positions, so that the robustness and generalization ability of the network are improved.
[0113] Based on the same inventive concept as the above method embodiments, the embodiments of the present application also provide a natural geological disaster classification and identification system based on an improved Resnet neural network. The system can realize the functions provided by the above method embodiments, as shown in the following figure. Figure 5 The system includes:
[0114] An image data acquisition module 110: acquires remote sensing images or images of geological disaster areas taken by a drone;
[0115] A data set construction module 120: constructs a natural disaster image data set after labeling and data enhancement of the image data, and divides the training set, the validation set, and the test set in a ratio of 8:1:1;
[0116] A Resnet-CS model construction module 130: improves the Resnet neural network model to obtain a Resnet-CS model;
[0117] A Resnet-CS model training module 140: inputs the data set data into the Resnet-CS model for training to obtain an optimal model;
[0118] A geological disaster classification and identification module 150: inputs the image data to be measured into the trained optimal model to obtain a predicted classification result.
[0119] Based on the same inventive concept as the above method embodiments, the embodiments of the present application also provide an electronic device, as shown in the following figure. Figure 6 The device includes: a processor 210; and a memory 220 for storing one or more programs;
[0120] When the one or more programs are executed by the processor 210, the processor performs the natural geological disaster classification and identification method.
[0121] The natural geological disaster classification and identification method includes the following:
[0122] Acquire image data: acquire remote sensing images or images of geological disaster areas taken by a drone;
[0123] Construct a data set: construct a natural disaster image data set after labeling and data enhancement of the image data, and divide the training set, the validation set, and the test set in a ratio of 8:1:1;
[0124] Construct a Resnet-CS model: improve the Resnet neural network model to obtain a Resnet-CS model;
[0125] Training the Resnet-CS model: input the dataset data into the Resnet-CS model for training to obtain an optimal model;
[0126] Geological disaster classification and identification: input the to-be-tested image data into the trained optimal model to obtain a predicted classification result.
[0127] Based on the same inventive concept as the above method embodiments, the embodiments of the present application also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by the processor 210 to implement the natural geological disaster classification and identification method.
[0128] The natural geological disaster classification and identification method comprises the following steps:
[0129] Collecting image data: acquiring remote sensing image data or image data of a geological disaster area taken by a drone;
[0130] Building a dataset: building a natural disaster image dataset after labeling and data enhancement of the image data, and dividing the training set, the verification set and the test set according to the ratio of 8:1:1;
[0131] Building a Resnet-CS model: improving the Resnet neural network model to obtain a Resnet-CS model;
[0132] Training the Resnet-CS model: input the dataset data into the Resnet-CS model for training to obtain an optimal model;
[0133] Geological disaster classification and identification: input the to-be-tested image data into the trained optimal model to obtain a predicted classification result.
[0134] Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features, and any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A natural geological disaster classification and identification method based on an improved Resnet neural network, characterized in that: The steps include: S1. Collect image data: obtain remote sensing images or image data of geological disaster areas taken by drones; S2. Dataset Construction: After labeling and data enhancement of image data, a natural disaster image dataset is constructed and divided into training set, validation set, and test set in a ratio of 8:1:1; S3. Construct a Resnet-CS model: Improve the Resnet neural network model to obtain a Resnet-CS model; the improvement of the Resnet neural network model specifically includes: adding a channel attention module and a spatial attention module after the first convolution layer in the Resnet neural network model, adding a global average pooling layer before the fully connected layer, and a policy network based on reinforcement learning ideas, adding a channel attention module and a spatial attention module at different positions after the residual block layer; the Resnet-CS model includes a convolution layer, a batch normalization layer, a ReLU activation function, a channel attention module, a spatial attention module, a maximum pooling layer, a residual block layer, a global average pooling layer, and a fully connected layer; The reinforcement learning-based policy network adds a channel attention module and a spatial attention module at different positions after the residual block layer. Specifically, the input image of the model is converted into a vector, which is the state, and an action is taken according to each state. The action is to add an adaptive attention module at the position after the ResNet block, and the decision is made by the reinforcement learning policy network. When the action output by the policy network is 0, the Resnet-CS model adds a spatial attention module and a channel attention module after the first layer of residual blocks; When the action output by the policy network is 1, the Resnet-CS model adds a spatial attention module and a channel attention module after the second layer residual block; When the action output by the policy network is 2, the Resnet-CS model does not add an additional attention module and only uses the original model structure; Then, the parameters of the policy network are updated by the action and the reward size corresponding to the action. The formula is as follows: G t =r t +g 1 r t+1 +g 2 r t+2 +…+c n r t+n Among them, G t is the multi-step cumulative reward value, γ is the future expected coefficient, r t+n The reward value brought by the t+nth action; S4. Training Resnet-CS model: Input the dataset data into the Resnet-CS model for training to obtain the optimal model; S5. Geological hazard classification and identification: Input the image data to be tested into the trained optimal model to obtain the predicted classification results.
2. The natural geological disaster classification and identification method based on the improved ResNet neural network according to claim 1 is characterized in that: In step S2, the labeling specifically labels the image data as earthquake, flood, wildfire or volcanic eruption; the data enhancement includes cropping, scaling, flipping, filling, rotating and mirroring.
3. The natural geological disaster classification and identification method based on the improved ResNet neural network according to claim 1 is characterized in that: The reward is the evaluation of the accuracy of the model’s classification results for the input image. The cross-entropy loss function is used as the reward function to measure the difference between the model output and the true label. The cross-entropy loss function is as follows: L=-1 / N*Σ(Σ(y_ij*log(p_ij))) Where N is the number of samples, y_i is the true label of the i-th sample, p_i is the predicted label of the model, and j is the category label in multi-category classification.
4. The natural geological disaster classification and identification method based on the improved ResNet neural network according to claim 1 is characterized in that: The Resnet-CS model uses stochastic gradient descent with momentum to adjust parameters to minimize the loss function, which is expressed as follows: v t =γv t-1 +lr t g t Among them, v t-1 The direction and magnitude of the last gradient update, the γ momentum coefficient, lr t Represents the learning rate, which is used to control the step size of each gradient update, g t Represents the gradient at the current time step, which is used to update the parameters of the model.
5. The natural geological disaster classification and identification method based on the improved ResNet neural network according to claim 1 is characterized in that: In step S4, training the Resnet-CS model specifically includes: inputting the training set data into Resnet-CS for training; putting the validation set data into the trained model for verification, outputting the accuracy, precision, recall rate and F1 value parameters, adjusting the hyperparameters, and obtaining the optimal model; putting the test set data into the optimal model for testing, and testing and verifying the optimal model.
6. A natural geological disaster classification and identification system based on an improved ResNet neural network, characterized by: The classification and identification system can implement the natural geological disaster classification and identification method according to any one of claims 1 to 5, and the classification and identification system includes: Image data acquisition module (110): acquires remote sensing images or image data of geological disaster areas taken by drones; Dataset construction module (120): constructs a natural disaster image dataset after labeling and data enhancement of the image data, and divides the dataset into a training set, a validation set, and a test set in a ratio of 8:1:1; Resnet-CS model building module (130): improves the Resnet neural network model to obtain the Resnet-CS model; Resnet-CS model training module (140): inputting the data set into the Resnet-CS model for training to obtain the optimal model; Geological hazard classification and identification module (150): inputs the image data to be tested into the trained optimal model to obtain the predicted classification result.
7. An electronic device, characterized in that: The electronic device includes: a processor (210); and a memory (220) for storing one or more programs; When the one or more programs are executed by the processor (210), the processor is enabled to execute the natural geological disaster classification and identification method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by the processor (210), the natural geological disaster classification and identification method according to any one of claims 1 to 5 is implemented.