Improved Yolov8-seg algorithm-based crater rapid identification and area detection method and system

Through the improved Yolov8-seg algorithm and GhostNet network, combined with the CBAM attention mechanism, the problem of inefficiency of traditional manual exploration methods is solved, and the rapid identification and accurate area measurement of the relics after nuclear explosion are achieved, which improves the recognition accuracy and robustness. meets the needs of immediate response.

CN119169480APending Publication Date: 2024-12-20GUILIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411200329.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-08-22
Filing Date
2024-08-29
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Traditional artificial field survey methods are time-consuming, inefficient and risky in the assessment of sequelae of nuclear explosions, and cannot meet the needs of immediate response. The standard Yolov8 model lacks the accuracy of crater identification under complex backgrounds and variable lighting conditions.

Method used

Using the improved Yolov8-seg algorithm, the crater detection network is constructed by acquiring satellite high-resolution image data for preprocessing and data enhancement, and combined with the GhostNet network and CBAM attention mechanism, the model is optimized to enhance the recognition ability and resistance in complex environments. Interference ability, calculate mask area and equivalent circle radius.

Benefits of technology

It realizes rapid and accurate identification and area measurement of the relic after nuclear explosion, improves the robustness and recognition accuracy of the model in complex environments, meets the needs of immediate response, and improves national security monitoring and emergency response capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169480A_ABST
    Figure CN119169480A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and particularly discloses a crater rapid identification and area detection method and system based on an improved Yov8-seg algorithm, and the method comprises the steps: obtaining high-resolution image data of a satellite, carrying out the preprocessing, and constructing a crater data set; labeling the images of the crater data set to enable the images to be in one-to-one correspondence with labels; performing online data enhancement on the crater data set, synthesizing a new sample, and constructing a crater detection network; the enhanced crater data set is input into a crater detection network for model training, hyper-parameter deployment is carried out, and an improved YOLOv8 target detection model is obtained; inputting a to-be-detected crater image into an improved YOLOv8 target detection model which is lighter and higher in precision, and outputting a mask image which is provided with an independent mask and covers an original image; the area of each mask is calculated through a geographic space image data processing calculation method, and the corresponding equivalent circle radius is calculated. By adopting the technical scheme, the crater can be quickly identified, and the area and the radius of the crater can be accurately measured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing and relates to a method and system for rapid crater recognition and area detection based on an improved Yolov8-seg algorithm. Background Art

[0002] With the evolution of modern warfare and the continued existence of potential threats from nuclear weapons, rapid assessment of the aftereffects of nuclear explosions has become a key need in the field of national security and emergency response. The crater produced by a nuclear bomb explosion is not only an important basis for assessing the power of the explosion and determining the type of explosion, but also the basis for post-disaster reconstruction planning and environmental impact assessment.

[0003] Traditional manual on-site investigation methods are time-consuming, inefficient, and high-risk, and cannot meet the needs of immediate response. Therefore, using modern image processing and computer vision technology, especially deep learning models, to quickly identify craters and accurately measure their area has become a hot topic in this field.

[0004] In recent years, target detection and segmentation algorithms have made significant progress in various application scenarios. Among them, the Yolo (YouOnly Look Once) series of algorithms have occupied an important position in the field of target detection due to their high efficiency and accuracy. As the latest member of the Yolo family, Yolov8 has become an ideal choice for processing real-time video streams and large-scale image data sets with its faster inference speed and higher detection accuracy. However, for specific scenarios such as crater recognition, the standard Yolov8 model has no quantitative analysis when facing complex backgrounds, variable lighting conditions and diverse crater morphologies, and there is still room for optimization. Summary of the invention

[0005] The purpose of the present invention is to provide a method and system for rapid crater identification and area detection based on an improved Yolov8-seg algorithm, so as to achieve rapid and accurate crater identification and detection.

[0006] In order to achieve the above object, the basic scheme of the present invention is: a method for rapid crater identification and area detection based on an improved Yolov8-seg algorithm, comprising the following steps:

[0007] Acquire high-resolution satellite image data and preprocess them to construct a crater dataset;

[0008] Label the images of the crater dataset so that the images correspond to the labels one by one;

[0009] Perform online data augmentation on the crater dataset and synthesize new samples;

[0010] Based on the YOLOv8-seg algorithm, a crater detection network is constructed;

[0011] The enhanced crater dataset is input into the crater detection network for model training and hyperparameter adjustment to obtain an improved YOLOv8 target detection model.

[0012] Input the crater image to be tested into the improved YOLOv8 target detection model, and output a mask image with a separate mask and a mask image covering the original image;

[0013] The area of ​​each mask is calculated through geospatial image data processing and calculation methods, and the corresponding equivalent circle radius is deduced.

[0014] The working principle and beneficial effects of this basic solution are as follows: This technical solution optimizes and customizes the Yolov8-seg model in view of the particularity of the nuclear explosion site images to enhance the model's ability to identify crater features, resist interference, and accurately locate. By introducing advanced image preprocessing technology, the model's robustness in complex environments is improved, and the crater can be quickly identified. Its area and radius can also be accurately measured, providing strong data support for subsequent analysis and evaluation work.

[0015] Furthermore, the method of preprocessing the high-resolution satellite image data and constructing the crater dataset is as follows:

[0016] Orthorectification was performed on the multispectral images with a resolution of 4 meters and the panchromatic spectral images with a resolution of 1 meter.

[0017] The multispectral image with a resolution of 4 meters and the panchromatic image with a resolution of 1 meter that have completed orthorectification are fused to complete the data preprocessing of the multispectral image with a resolution of 4 meters and the panchromatic image with a resolution of 1 meter.

[0018] Preprocess the image data to facilitate subsequent use.

[0019] Furthermore, the specific steps of online data enhancement for the crater dataset and synthesizing new samples are as follows:

[0020] Adjust the three hyperparameters of Hue, Saturation, and Value and optimize them. hsv_h=0.015 means that in the color adjustment of the image, the hue will be randomly offset by ±0.015 of the original hue to simulate the color changes under different lighting conditions; hsv_s=0.7 means that the saturation range will be ±70% of the original saturation, which can enhance or weaken the color intensity of the image; hsv_v=0.6 means that the brightness adjustment range is ±60% of the original brightness to simulate the change of light and dark;

[0021] Adjust the four hyperparameters of degrees rotation angle, translate translation, shear shearing, and fliplr left and right flipping for optimization. Degrees = 10.0 means that the image rotation angle range is ±10 degrees, which is used to randomly rotate the image and increase the angle diversity; translate = 0.2 means the image translation ratio, which is the maximum translation distance of the horizontal and vertical axes is 20% of the image width or height; shear = 2 is the strength of the shear transformation, which is the maximum value of the shear angle of 2 degrees, which is used to distort the image shape; fliplr = 0.5 means the probability of horizontal flipping, which means that there is a 50% probability that the image will be flipped horizontally;

[0022] MixUp, Mosaic, and RandomErasing are used for optimization. Mixup = 0.8 means that the mixing coefficient lambda is used to generate a new synthetic sample to increase the amount of data. The image and its corresponding label are controlled by lambda, which means that the training set samples and corresponding labels are divided into set A and set B according to the proportion:

[0023] x′=λxA+(1-λ)xB

[0024] y′=λyA+(1-λ)yB

[0025] Among them, x′ is the new sample image dataset, y′ is the new sample label dataset, λ is the mixing coefficient lambda, which is 0.8; xA and xB are the image data of sample A and sample B respectively, yA and yB are the label data of sample A and sample B respectively;

[0026] Mosaic=0.2 means that 20% of the area of ​​each image is replaced with low resolution; erasing=0.3 means that 30% of the area of ​​each image will be randomly erased.

[0027] Data enhancement is performed on images, and new samples are synthesized to increase the diversity of training data and address data imbalance issues, thereby improving the model's generalization ability, robustness, and adaptability to different scales.

[0028] Furthermore, based on the YOLOv8-seg algorithm, the method of constructing a crater detection network is as follows:

[0029] The architecture of the crater detection network includes backbone, neck, and head. The backbone performs feature extraction to capture the semantic information and contextual relevance of the input data. The neck further processes and fuses the multi-scale features extracted by the backbone network. The head predicts the location, category, and pixel-level mask of the target, predicts the mask image covering the original image, traverses and extracts the mask of each individual predicted target, and then puts it into the mask of each independent predicted target one by one according to the geographic data of the location on the original image.

[0030] The GhostNet network is used to reconstruct the backbone network of the network model, generating highly correlated feature maps through low-cost linear operations;

[0031] The CBAM attention mechanism is integrated to give the model adaptive attention to the characteristics of different regions through channel and spatial modules, thereby enhancing its sensitivity to nuclear bomb features.

[0032] Targeted optimization and customization of the crater detection network is carried out to enhance the model's ability in identifying crater features, anti-interference and precise positioning.

[0033] Furthermore, the backbone contains 3 standard convolutional layers Conv, 2 lightweight Ghostconv convolutional layers, 4 C3ghost modules and 3 CBAM attention modules;

[0034] Input the data into the backbone feature extraction part. The specific steps are:

[0035] Input the RGB TIF format image with a width and height size of H*W and a resolution of 640*640 and a channel number C of 3 into the backbone Conv convolution layer Layer0, apply 64 3×3 convolution kernels with a step size of 2, and obtain the first-level feature map P1 with a resolution of 320*320;

[0036] The data output from Layer0 is input into the GhostConv convolution layer Layer1, and 128 3×3 convolution kernels are applied with a step size of 2 to obtain the second-level feature map P2 with a resolution of 160*160;

[0037] Input the data output from Layer1 into Layer2 of the C3Ghost module, apply the C3Ghost module, keep 128 channels, and enable residual connection;

[0038] The data output from Layer2 is input into the CBAM attention module Layer3, and the CBAM module is applied. The number of input channels is 128, and the attention pooling kernel size is 7×7.

[0039] The data output from Layer3 is input into the GhostConv convolution layer Layer4, and 256 3×3 convolution kernels are applied with a step size of 2 to obtain the third-level feature map P3 with a resolution of 80*80;

[0040] Input the data output from Layer4 into Layer5 of the C3Ghost module, apply the C3Ghost module, keep 256 channels, and enable residual connection;

[0041] The data output from Layer5 is input into the CBAM attention module Layer6, and the CBAM module is applied. The number of input channels is 256, and the attention pooling kernel size is 7×7;

[0042] The data output by Layer6 is input into the Conv convolution layer Layer7, and 512 3×3 convolution kernels are applied with a step size of 2 to obtain the fourth-level feature map P4 with a resolution of 40*40;

[0043] Input the data output from Layer7 into Layer8 of the C3Ghost module, apply the C3Ghost module, keep 512 channels, and enable residual connection;

[0044] The data output from Layer8 is input into the CBAM attention module Layer9, and the CBAM module is applied. The number of input channels is 512, and the attention pooling kernel size is 7×7;

[0045] The data output by Layer9 is input into the Conv convolution layer Layer10, and 1024 3×3 convolution kernels are applied with a step size of 2 to obtain the fifth-level feature map P5 with a resolution of 20*20;

[0046] Input the output data of Layer10 into the C3Ghost module Layer11, apply the C3Ghost module, keep 1024 channels, and enable residual connection.

[0047] The ghostnet network structure is used in the backbone to replace the original network structure, which improves the detection speed, and adds the CBAM attention mechanism to highlight the edge features of the crater and improve the accuracy of crater mask extraction.

[0048] Furthermore, the GhostNet network uses the Swish activation function to optimize the gradient propagation during the process:

[0049] f(x)=x*sigmoid(x)

[0050] Where x represents the input of the neuron; f(x) represents the output of the neuron; sigmoid = 1 / (1+e -x), Sigmoid is a nonlinear function that provides a nonlinear weight for the input value x.

[0051] Using the Swish activation function helps with gradient propagation during the optimization process.

[0052] Furthermore, the CBAM attention module includes a channel attention module and a spatial attention module. The feature map of the previous layer is input into the CBAM attention module and sequentially passes through two independent dimensions to generate two attention maps. The attention maps respectively reflect the importance of the channel and the spatial position in the feature map.

[0053] Multiply the attention map by the input feature map for adaptive feature modification;

[0054] In the channel attention module, the feature map F of the previous layer is input through global maximum pooling and global average pooling respectively to obtain two 1×1×C feature maps and send them to a two-layer multi-layer perceptron MLP respectively;

[0055] The features output by MLP are added element-wise, and then activated by sigmoid to generate the final channel feature map.

[0056] Perform element-wise multiplication on the channel feature map and the input feature map F to generate the F1 feature map as the input data of the spatial attention module:

[0057] M c (F)=σ(MLP(AvgPool(F))+MLP(MaxPool(F)))

[0058] =σ(W1(W0(F avg ))+W1(W0(F max )))

[0059] Among them, M c (F) represents the channel attention map; F represents the input feature map; σ represents the sigmoid function, which is used to convert the output of MLP into a value between 0 and 1, indicating the importance of each channel; AvgPool(F) represents average pooling of the feature map; MaxPool(F) represents maximum pooling of the feature map; MLP() represents inputting the feature map after average pooling and maximum pooling into the multilayer perceptron; W0 represents the first layer of the multilayer perceptron; W1 represents the second layer of the multilayer perceptron; F avg and F max Respectively represent the average pooling and maximum pooling of the feature map F;

[0060] In the spatial attention module, the feature map F1 operated by the channel attention module is subjected to channel-based global maximum pooling and global average pooling to obtain two H×W×1 feature maps and perform feature map channel splicing;

[0061] The concatenated feature map undergoes a 7×7 convolution operation, with the feature selection being 1 channel, and then passes through sigmoid to generate a spatial feature map. The spatial feature map is multiplied by the input feature map F1 to obtain the feature map of the final CBAM attention mechanism module:

[0062] M s (F1)=σ(f 7×7 ([AvgPool(F1);MaxPool(F1)]))

[0063] =σ(f 7×7 ([F 1avg ; F 1max ]))

[0064] Among them, M s (F1) represents the spatial attention map; F1 represents the feature map after the channel attention module operation; AvgPool(F1) represents average pooling; MaxPool(F1) represents maximum pooling; F1avg represents the feature map after average pooling, and F1max represents the feature map after maximum pooling; [F1avg; F1max] represents the concatenation of AvgPool(F1) and MaxPool(F1) in the channel dimension; f 7×7 Represents a convolution operation with a convolution kernel size of 7×7.

[0065] The CBAM attention module can help the network better focus on the key areas in the input image, enabling the model to more accurately locate and identify target objects.

[0066] Furthermore, the area of ​​each mask is calculated through the geospatial image data processing calculation method, and the corresponding equivalent circle radius is deduced. The specific steps are as follows:

[0067] Data reading and preprocessing: Use the rasterio library to read the binary mask TIF file containing geographic reference information generated by the improved YOLOv8 target detection model. The white area in the mask represents the target area, and the black area is the non-target area;

[0068] Vectorization: The shapes function is used to convert the pixel-level binary mask into vector polygon features, identify continuous white pixel blocks and convert them into geometric objects.

[0069] Polygon optimization and validity check: During the conversion process, the buffer(0) method is used to try to close possible open polygons, and the is_valid attribute is used to filter out valid geometric objects to eliminate the interference of noise points in the process of model generation mask;

[0070] Create GeoDataFrame: Use the geopandas library to organize valid polygon geometry objects into a GeoDataFrame while preserving the coordinate reference system of the original TIF;

[0071] Area, radius calculation and threshold setting: Calculate the area of ​​each polygon, sort the polygons of different sizes from GeoDataFrame, set a threshold and exclude polygons with an area smaller than the threshold, exclude the interference of noise points in the process of mask generation by the model, and calculate the radius of the equivalent circle based on the area of ​​the polygon;

[0072] Graphic visualization: Use the matplotlib library to draw polygonal graphics to display the extracted region boundaries, area, and equivalent circle radius.

[0073] Through the geospatial image data processing calculation method, the accurate crater area and equivalent circular crater radius are calculated using high-precision masks.

[0074] The present invention also provides a crater rapid identification and area detection system based on an improved Yolov8-seg algorithm, comprising a data acquisition unit and a processing unit, wherein the data acquisition unit is used to acquire high-resolution satellite image data;

[0075] The input end of the processing unit is connected to the output end of the data acquisition unit, and the processing unit executes the method of the present invention to perform rapid crater identification and area detection.

[0076] The system utilizes a data acquisition unit and a processing unit to realize the required image acquisition, and achieves rapid recognition and accurate area measurement and equivalent circle radius. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 It is a flow chart of a method for rapid crater identification and area detection based on an improved Yolov8-seg algorithm of the present invention;

[0078] Figure 2 It is a structural schematic diagram of an improved YOLOv8 target detection model of the present invention based on the improved Yolov8-seg algorithm for rapid crater identification and area detection method;

[0079] Figure 3 It is a predicted mask effect diagram of the crater rapid identification and area detection method based on the improved Yolov8-seg algorithm of the present invention. DETAILED DESCRIPTION

[0080] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0081] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0082] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.

[0083] The present invention discloses a method for rapid crater identification and area detection based on an improved Yolov8-seg algorithm, which is dedicated to improving the technical level of post-nuclear explosion relic identification and aims to achieve rapid and accurate crater identification and detection, and is of great value in strengthening national security monitoring capabilities, accelerating emergency response processes, and promoting the development of related scientific research fields.

[0084] The present invention makes quantitative analysis on craters, makes up for the scarcity of self-made high-resolution crater database, extracts relevant masks, and uses the improved yolov8-seg model, which is more lightweight and has high crater extraction accuracy. Figure 1 As shown in FIG. 1 , the method for rapid crater identification and area detection based on the improved Yolov8-seg algorithm includes the following steps:

[0085] Obtain high-resolution image data (e.g., 1-meter resolution, which is a fusion of 1-meter resolution panchromatic spectrum and 4-meter resolution multispectral) from the Gaofen-2 satellite and perform preprocessing to construct a crater dataset;

[0086] The preprocessed data set was cropped using the ROI tool in ENVI5.6, and the images of the crater data set were labeled using labelme software to generate a json file. The json file was converted into a txt file read by yolo through the conversion code, so that the images and labels corresponded one to one.

[0087] Perform online data enhancement (such as geometric transformation, color space transformation, hybrid transformation, etc.) on the crater dataset to synthesize new samples, increase the diversity of training data, and deal with data imbalance issues, thereby improving the model's generalization ability, robustness, and adaptability to different scales;

[0088] Based on the YOLOv8-seg algorithm, a crater detection network is constructed;

[0089] The enhanced crater dataset is input into the crater detection network for model training, and a large number of hyperparameters are adjusted to obtain a more lightweight and accurate improved YOLOv8 target detection model (through comparative experiments, the variables are controlled, and the total number of epochs training model rounds, the number of samples contained in each training batch, the lr0 initial learning rate, the lrf final learning rate factor and other parameters are adjusted. The unimproved yolov8 model is used as a reference, and the results are evaluated during the parameter adjustment process to judge the quality of the model. For example, the evaluation results mentioned below are measured based on accuracy and speed). Figure 2 As shown;

[0090] Input the crater image to be tested into the improved YOLOv8 target detection model, and output a mask image with a separate mask and a mask image covering the original image (the model detection head will predict the mask image covering the original image, traverse and extract the mask of each separate predicted target, and then put them into the mask of each independent predicted target according to the geographic data of the position on the original image. These independent masks assigned with geographic data are used for subsequent area calculations), such as Figure 3 As shown;

[0091] The area of ​​each mask is calculated through geospatial image data processing and calculation methods, and the corresponding equivalent circle radius is deduced.

[0092] In a preferred embodiment of the present invention, the method for preprocessing the high-resolution satellite image data and constructing the crater data set is as follows:

[0093] Orthorectification is performed on the multispectral images with a resolution of 4 meters and the panchromatic spectral images with a resolution of 1 meter respectively; use the orthorectification process tool, in the ENVI5.6 software Toolbox, select RPC Orthorectification Workflow, in the File Selection panel, select multispectral data as Input File, and DEM File will select DEM data with a global resolution of 900 meters by default. In the RPCRefinement panel, switch to the Advanced tab, change the output pixel size OutputPixelSize to 4 meters (change the output pixel size to 1m for the panchromatic spectrum), select cubic convolution as the resampling method ImageResampling, and keep other parameters as default.

[0094] The orthorectified 4-meter multispectral image and 1-meter panchromatic image are fused to complete the data preprocessing of the 4-meter multispectral image and 1-meter panchromatic image. In the Toolbox, select NNDiffusePanSharpening to pop up the NNDiffusePanSharpening panel. Select the orthorectified multispectral data in InputLowResolutionRaster and the orthorectified panchromatic data in InputHighResolutionRaster. Keep other parameters as default.

[0095] In a preferred embodiment of the present invention, the specific steps of performing online data enhancement on the crater dataset and synthesizing new samples are as follows:

[0096] Lighting causes some troubles in the extraction of craters, especially for craters with weak lighting and darker colors, which are extremely difficult to identify and extract. Therefore, the three hyperparameters of Hue, Saturation, and Value are adjusted and optimized. hsv_h=0.015 means that in the color adjustment of the image, the hue will be randomly offset by ±0.015 of the original hue to simulate the color change under different lighting conditions; hsv_s=0.7 means that the saturation range will be ±70% of the original saturation, which can enhance or weaken the color intensity of the image; hsv_v=0.6 means that the brightness adjustment range is ±60% of the original brightness to simulate the change of light and dark;

[0097] The shapes of craters vary. In order to enhance the generalization of the model to shapes, the four hyperparameters degrees rotation angle, translate translation, shear shearing, and fliplr left and right flipping are adjusted for optimization. Degrees = 10.0 means that the image rotation angle range is ±10 degrees, which is used to randomly rotate the image and increase the angle diversity; translate = 0.2 means the ratio of image translation, and the maximum translation distance of the horizontal and vertical axes is 20% of the image width or height; shear = 2 is the strength of the shear transformation, and the maximum value of the shear angle is 2 degrees, which is used to distort the image shape; fliplr = 0.5 means the probability of horizontal flipping, which means that there is a 50% probability that the image will be flipped horizontally;

[0098] In order to improve the overall adaptability of the model, three hyperparameters, MixUp, Mosaic, and RandomErasing, are used for optimization. Mixup = 0.8 means that the mixing coefficient lambda is used to generate a new synthetic sample to increase the amount of data. The image and its corresponding label are controlled by lambda, which means that the training set samples and corresponding labels are divided into set A and set B according to the proportion:

[0099] x′=λxA+(1-λ)xB

[0100] y′=λyA+(1-λ)yB

[0101] Among them, x′ is the new sample image dataset, y′ is the new sample label dataset, λ is the mixing coefficient lambda, which is 0.8; xA and xB are the image data of sample A and sample B respectively, yA and yB are the label data of sample A and sample B respectively;

[0102] Mosaic=0.2 means that 20% of the area of ​​each image is replaced with low resolution; erasing=0.3 means that 30% of the area of ​​each image will be randomly erased.

[0103] In a preferred embodiment of the present invention, a method for constructing a crater detection network based on the YOLOv8-seg algorithm is as follows:

[0104] The architecture of the crater detection network includes backbone, neck, and head. The backbone performs feature extraction to capture the semantic information and contextual relevance of the input data. The neck further processes and fuses the multi-scale features extracted by the backbone network. The head predicts the location, category, and pixel-level mask of the target, predicts the mask image covering the original image, traverses and extracts the mask of each individual predicted target, and then puts it into the mask of each independent predicted target one by one according to the geographic data of the location on the original image.

[0105] The GhostNet network is used to reconstruct the backbone network of the network model, and highly correlated feature maps are generated through low-cost linear operations. GhostNet's unique lightweight feature generates highly correlated feature maps through low-cost linear operations instead of directly using standard convolutional layers. It can reduce the number of model parameters and computing costs while maintaining excellent recognition accuracy, providing a good foundation for applications in resource-constrained environments.

[0106] The CBAM (Convolutional Block Attention Module) attention mechanism is integrated to capture key features in the image and optimize the information processing process. Through channel and spatial modules, the model is given adaptive attention to features of different regions, enhancing its sensitivity to nuclear bomb features, thereby locating targets more accurately in complex and interfering backgrounds.

[0107] The crater detection network is optimized and improved, which improves the efficiency and accuracy of the crater recognition and detection model.

[0108] In a preferred embodiment of the present invention, the backbone includes 3 standard convolutional layers Conv, 2 lightweight Ghostconv convolutional layers, 4 C3ghost modules and 3 CBAM attention modules;

[0109] Input the data into the backbone feature extraction part. The specific steps are:

[0110] Input the RGB TIF format image with a width and height size of H*W and a resolution of 640*640 and a channel number C of 3 into the backbone Conv convolution layer Layer0, apply 64 3×3 convolution kernels with a step size of 2, and obtain the first-level feature map P1 with a resolution of 320*320;

[0111] The data output from Layer0 is input into the GhostConv convolution layer Layer1, and 128 3×3 convolution kernels are applied with a step size of 2 to obtain the second-level feature map P2 with a resolution of 160*160;

[0112] Input the data output from Layer1 into Layer2 of the C3Ghost module, apply the C3Ghost module, keep 128 channels, and enable residual connection;

[0113] The data output from Layer2 is input into the CBAM attention module Layer3, and the CBAM module is applied. The number of input channels is 128, and the attention pooling kernel size is 7×7.

[0114] The data output from Layer3 is input into the GhostConv convolution layer Layer4, and 256 3×3 convolution kernels are applied with a step size of 2 to obtain the third-level feature map P3 with a resolution of 80*80;

[0115] Input the data output from Layer4 into Layer5 of the C3Ghost module, apply the C3Ghost module, keep 256 channels, and enable residual connection;

[0116] The data output from Layer5 is input into the CBAM attention module Layer6, and the CBAM module is applied. The number of input channels is 256, and the attention pooling kernel size is 7×7;

[0117] The data output by Layer6 is input into the Conv convolution layer Layer7, and 512 3×3 convolution kernels are applied with a step size of 2 to obtain the fourth-level feature map P4 with a resolution of 40*40;

[0118] Input the data output from Layer7 into Layer8 of the C3Ghost module, apply the C3Ghost module, keep 512 channels, and enable residual connection;

[0119] The data output from Layer8 is input into the CBAM attention module Layer9, and the CBAM module is applied. The number of input channels is 512, and the attention pooling kernel size is 7×7;

[0120] The data output by Layer9 is input into the Conv convolution layer Layer10, and 1024 3×3 convolution kernels are applied with a step size of 2 to obtain the fifth-level feature map P5 with a resolution of 20*20;

[0121] Input the output data of Layer10 into the C3Ghost module Layer11, apply the C3Ghost module, keep 1024 channels, and enable residual connection.

[0122] In a preferred embodiment of the present invention, the output size W of the convolution operation is calculated out and H out :

[0123] W out =((W in -K+2*P) / S)+1

[0124] H out =((H in -K+2*P) / S)+1

[0125] Among them, W out is the width of the output size; W in is the width of the input size; Hout H is the height of the output size; in is the height of the output size; K is the convolution kernel size; P is the padding size; S is the step size. Accurately calculating the width and height of the output feature map after the convolution layer is crucial to ensuring the correctness of the network structure and adjusting the network parameters to achieve the desired effect.

[0126] In a preferred embodiment of the present invention, the GhostNet network uses the Swish activation function (the Swish activation function is a smooth and omnidirectional function, which helps the gradient propagation in the optimization process), and the gradient propagation in the optimization process is:

[0127] f(x)=x*sigmoid(x)

[0128] Where x represents the input of the neuron; f(x) represents the output of the neuron; sigmoid = 1 / (1+e -x ), Sigmoid is a nonlinear function that provides a nonlinear weight for the input value x.

[0129] In a preferred embodiment of the present invention, the CBAM attention module includes a channel attention module and a spatial attention module. The feature map of the previous layer is input into the CBAM attention module and sequentially passes through two independent dimensions (channel and space) to generate two attention maps. The attention maps respectively reflect the importance of the channel and the spatial position in the feature map.

[0130] The attention map is multiplied by the input feature map to perform adaptive feature modification; these two modules can enhance the important feature parts of the feature map while suppressing the less important parts. This adaptive feature modification helps the network better focus on the key areas in the input image, which can help the model locate and identify the target object more accurately.

[0131] In the channel attention module, the feature map F of the previous layer is input through global max pooling and global average pooling to obtain two 1×1×C feature maps and sent to a two-layer multilayer perceptron (MLP).

[0132] The features output by MLP are added element-wise, and then activated by sigmoid to generate the final channel feature map.

[0133] Perform element-wise multiplication on the channel feature map and the input feature map F to generate the F1 feature map as the input data of the spatial attention module:

[0134] M c (F)=σ(MLP(AvgPool(F))+MLP(MaxPool(F)))

[0135] =σ(W1(W0(F avg ))+W1(W0(F max )))

[0136] Among them, M c (F) represents the channel attention map; F represents the input feature map; σ represents the sigmoid function, which is used to convert the output of MLP into a value between 0 and 1, indicating the importance of each channel; AvgPool(F) represents average pooling of the feature map; MaxPool(F) represents maximum pooling of the feature map; MLP() represents inputting the feature map after average pooling and maximum pooling into the multilayer perceptron; W0 represents the first layer of the multilayer perceptron; W1 represents the second layer of the multilayer perceptron; F avg and F max Respectively represent the average pooling and maximum pooling of the feature map F;

[0137] In the spatial attention module, the feature map F1 operated by the channel attention module is subjected to channel-based global maximum pooling and global average pooling to obtain two H×W×1 feature maps and perform feature map channel splicing;

[0138] The concatenated feature map undergoes a 7×7 convolution operation, with the feature selection being 1 channel, and then passes through sigmoid to generate a spatial feature map. The spatial feature map is multiplied by the input feature map F1 to obtain the feature map of the final CBAM attention mechanism module:

[0139] M s (F1)=σ(f 7×7 ([AvgPool(F1);MaxPool(F1)]))

[0140] =σ(f 7×7 ([F 1avg ; F 1max ]))

[0141] Among them, M s (F1) represents the spatial attention map; F1 represents the feature map after the channel attention module operation; AvgPool(F1) represents average pooling; MaxPool(F1) represents maximum pooling; F1avg represents the feature map after average pooling, and F1max represents the feature map after maximum pooling; [F1avg; F1max] represents the concatenation of AvgPool(F1) and MaxPool(F1) in the channel dimension; f 7×7Represents a convolution operation with a convolution kernel size of 7×7.

[0142] In a preferred embodiment of the present invention, the area of ​​each mask is calculated by a geospatial image data processing calculation method, and the corresponding equivalent circle radius is deduced. The specific steps are as follows:

[0143] Data reading and preprocessing: Use the rasterio library to read the binary mask TIF file containing geographic reference information generated by the improved YOLOv8 target detection model. The white area (value 1) in the mask represents the target area, and the black area (value 0) is the non-target area.

[0144] Vectorization: Through the shapes function, the pixel-level binary mask is converted into vector polygon features, and continuous white pixel blocks are identified and converted into geometric objects to prepare for subsequent geospatial analysis;

[0145] Polygon optimization and validity check: During the conversion process, the buffer(0) method is used to try to close possible open polygons, and the is_valid attribute is used to filter out valid geometric objects, eliminating the interference of noise points in the process of model mask generation to ensure the accuracy of subsequent analysis;

[0146] Create GeoDataFrame: Use the geopandas library to organize valid polygon geometry objects into a GeoDataFrame while retaining the coordinate reference system of the original TIF for geographic information management and further spatial operations;

[0147] Area, radius calculation and threshold setting: Calculate the area of ​​each polygon and sort the polygons of different sizes from GeoDataFrame. Set a certain threshold and exclude polygons with an area smaller than the threshold. Eliminate the interference of noise points in the mask generation process of the model. Calculate the radius of the equivalent circle based on the area of ​​the polygon.

[0148] Graphic visualization: Use the matplotlib library to draw polygonal graphics to display the extracted region boundaries, area, and equivalent circle radius.

[0149] The improved YOLOv8 target detection model of this embodiment is compared with the unimproved yolov8-seg model. As shown in Table 1, the AP50 and AP50-95 accuracy are improved by 0.31% and 2.66% respectively compared with the original model. The speed is faster than the original model, and its FLOPs (G) is reduced by 16.16%, and the number of parameters is reduced by 17.71%. In summary, this model has achieved good results.

[0150] Evaluate the accuracy of the improved YOLOv8 target detection model by this invention:

[0151]

[0152] Among them, AP50 represents the average precision of the category when the IoU threshold is 0.5; P i ′ refers to the maximum precision value at and after the i-th recall level; n represents the number of different recall levels; AP50-95 represents the average of the average precisions calculated for this category when the IoU threshold ranges from 0.5 to 0.95 (increments by 0.05); m represents the number of different IoU thresholds; AP Ik Indicates the kth IoU threshold I k The average precision under .

[0153] Table 1 The accuracy of the YOLOv8 target detection model improved by the present invention

[0154] experiment AP50 AP50-95 FLOPs(G) Parameters(M) This model 0.962 0.734 35.8 45.15 No improved model 0.959 0.715 42.7 37.14 Contrast percentage ↑0.31% ↑2.66% ↓16.16% ↓17.71%

[0155] The present invention also provides a crater rapid identification and area detection system based on an improved Yolov8-seg algorithm, comprising a data acquisition unit and a processing unit, wherein the data acquisition unit is used to acquire high-resolution satellite image data.

[0156] The input end of the processing unit is electrically connected to the output end of the data acquisition unit, and the processing unit executes the method of the present invention to perform rapid crater identification and area detection. The system utilizes the data acquisition unit and the processing unit to achieve the required image acquisition, and realizes rapid identification and accurate area measurement and equivalent circle radius.

[0157] Rapid assessment of the aftereffects of nuclear explosions has become a key need in the field of national security and emergency response. The craters produced by nuclear bomb explosions are not only an important basis for evaluating the power of the explosion and determining the type of explosion, but also the basis for post-disaster reconstruction planning and environmental impact assessment. Traditional manual on-site survey methods are time-consuming, inefficient, and high-risk, and cannot meet the needs of immediate response. Therefore, the improved YOLOv8 target detection model of the present invention can quickly identify craters and accurately measure their area and equivalent circle radius.

[0158] The present invention uses the ghostnet network structure in the backbone to replace the original network structure, improves the detection speed, and adds the CBAM attention mechanism to highlight the edge features of the crater and improve the accuracy of extracting the crater mask;

[0159] Through the geospatial image data processing and calculation method, the accurate crater area and equivalent circular crater radius are calculated using high-precision masks. Target detection, instance segmentation, and spatial image data calculation are integrated to quantify the crater area.

[0160] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0161] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A method for rapid crater identification and area detection based on an improved Yolov8-seg algorithm, characterized in that: The steps include: Acquire high-resolution satellite image data and preprocess them to construct a crater dataset; Label the images of the crater dataset so that the images correspond to the labels one by one; Perform online data augmentation on the crater dataset and synthesize new samples; Based on the YOLOv8-seg algorithm, a crater detection network is constructed; The enhanced crater dataset is input into the crater detection network for model training and hyperparameter adjustment to obtain an improved YOLOv8 target detection model. Input the crater image to be tested into the improved YOLOv8 target detection model, and output a mask image with a separate mask and a mask image covering the original image; The area of ​​each mask is calculated through geospatial image data processing and calculation methods, and the corresponding equivalent circle radius is deduced.

2. The method for rapid crater identification and area detection based on the improved Yolov8-seg algorithm according to claim 1, characterized in that: The method of preprocessing the high-resolution satellite image data and constructing the crater dataset is as follows: Orthorectification was performed on the multispectral images with a resolution of 4 meters and the panchromatic spectral images with a resolution of 1 meter. The multispectral image with a resolution of 4 meters and the panchromatic image with a resolution of 1 meter that have completed orthorectification are fused to complete the data preprocessing of the multispectral image with a resolution of 4 meters and the panchromatic image with a resolution of 1 meter.

3. The method for rapid crater identification and area detection based on the improved Yolov8-seg algorithm according to claim 1, characterized in that: The specific steps for online data enhancement of the crater dataset and synthesizing new samples are as follows: Adjust the three hyperparameters of Hue, Saturation, and Value and optimize them. hsv_h=0.015 means that in the color adjustment of the image, the hue will be randomly offset by ±0.015 of the original hue to simulate the color changes under different lighting conditions; hsv_s=0.7 means that the saturation range will be ±70% of the original saturation, which can enhance or weaken the color intensity of the image; hsv_v=0.6 means that the brightness adjustment range is ±60% of the original brightness to simulate the change of light and dark; Adjust the four hyperparameters of degrees rotation angle, translate translation, shear shearing, and fliplr left and right flipping for optimization. Degrees = 10.0 means that the image rotation angle range is ±10 degrees, which is used to randomly rotate the image and increase the angle diversity; translate = 0.2 means the image translation ratio, which is the maximum translation distance of the horizontal and vertical axes is 20% of the image width or height; shear = 2 is the strength of the shear transformation, which is the maximum value of the shear angle of 2 degrees, which is used to distort the image shape; fliplr = 0.5 means the probability of horizontal flipping, which means that there is a 50% probability that the image will be flipped horizontally; MixUp, Mosaic, and RandomErasing are used for optimization. Mixup = 0.8 means that the mixing coefficient lambda is used to generate a new synthetic sample to increase the amount of data. The image and its corresponding label are controlled by lambda, which means that the training set samples and corresponding labels are divided into set A and set B according to the proportion: x′=λxA+(1-λ)xB y′=λyA+(1-λ)yB Among them, x′ is the new sample image dataset, y′ is the new sample label dataset, λ is the mixing coefficient lambda, which is 0.8; xA and xB are the image data of sample A and sample B respectively, yA and yB are the label data of sample A and sample B respectively; Mosaic=0.2 means that 20% of the area of ​​each image is replaced with low resolution; erasing=0.3 means that 30% of the area of ​​each image will be randomly erased.

4. The method for rapid crater identification and area detection based on the improved Yolov8-seg algorithm according to claim 1, characterized in that: Based on the YOLOv8-seg algorithm, the method of building a crater detection network is as follows: The architecture of the crater detection network includes backbone, neck, and head. The backbone performs feature extraction to capture the semantic information and contextual relevance of the input data. The neck further processes and fuses the multi-scale features extracted by the backbone network. The head predicts the location, category, and pixel-level mask of the target, predicts the mask image covering the original image, traverses and extracts the mask of each individual predicted target, and then puts it into the mask of each independent predicted target one by one according to the geographic data of the location on the original image. The GhostNet network is used to reconstruct the backbone network of the network model, generating highly correlated feature maps through low-cost linear operations; The CBAM attention mechanism is integrated to give the model adaptive attention to the characteristics of different regions through channel and spatial modules, thereby enhancing its sensitivity to nuclear bomb features.

5. The method for rapid crater identification and area detection based on the improved Yolov8-seg algorithm according to claim 4, characterized in that: The backbone contains 3 standard convolutional layers Conv, 2 lightweight Ghostconv convolutional layers, 4 C3ghost modules and 3 CBAM attention modules; Input the data into the backbone feature extraction part. The specific steps are: Input the RGB TIF format image with a width and height size of H*W and a resolution of 640*640 and a channel number C of 3 into the backbone Conv convolution layer Layer0, apply 64 3×3 convolution kernels with a step size of 2, and obtain the first-level feature map P1 with a resolution of 320*320; The data output from Layer0 is input into the GhostConv convolution layer Layer1, and 128 3×3 convolution kernels are applied with a step size of 2 to obtain the second-level feature map P2 with a resolution of 160*160; Input the data output from Layer1 into Layer2 of the C3Ghost module, apply the C3Ghost module, keep 128 channels, and enable residual connection; The data output from Layer2 is input into the CBAM attention module Layer3, and the CBAM module is applied. The number of input channels is 128, and the attention pooling kernel size is 7×7. The data output from Layer3 is input into the GhostConv convolution layer Layer4, and 256 3×3 convolution kernels are applied with a step size of 2 to obtain the third-level feature map P3 with a resolution of 80*80; Input the data output from Layer4 into Layer5 of the C3Ghost module, apply the C3Ghost module, keep 256 channels, and enable residual connection; The data output from Layer5 is input into the CBAM attention module Layer6, and the CBAM module is applied. The number of input channels is 256, and the attention pooling kernel size is 7×7; The data output by Layer6 is input into the Conv convolution layer Layer7, and 512 3×3 convolution kernels are applied with a step size of 2 to obtain the fourth-level feature map P4 with a resolution of 40*40; Input the data output from Layer7 into Layer8 of the C3Ghost module, apply the C3Ghost module, keep 512 channels, and enable residual connection; The data output from Layer8 is input into the CBAM attention module Layer9, and the CBAM module is applied. The number of input channels is 512, and the attention pooling kernel size is 7×7; The data output by Layer9 is input into the Conv convolution layer Layer10, and 1024 3×3 convolution kernels are applied with a step size of 2 to obtain the fifth-level feature map P5 with a resolution of 20*20; Input the output data of Layer10 into the C3Ghost module Layer11, apply the C3Ghost module, keep 1024 channels, and enable residual connection.

6. The method for rapid crater identification and area detection based on the improved Yolov8-seg algorithm according to claim 4, characterized in that: The GhostNet network uses the Swish activation function to optimize the gradient propagation during the process: f(x)=x*sigmoid(x) Where x represents the input of the neuron; f(x) represents the output of the neuron; sigmoid = 1 / (1+e -x ), Sigmoid is a nonlinear function that provides a nonlinear weight for the input value x.

7. The method for rapid crater identification and area detection based on the improved Yolov8-seg algorithm as claimed in claim 5, characterized in that: The CBAM attention module includes a channel attention module and a spatial attention module. The feature map of the previous layer is input into the CBAM attention module and sequentially passes through two independent dimensions to generate two attention maps. The attention maps respectively reflect the importance of the channel and spatial position in the feature map. Multiply the attention map by the input feature map for adaptive feature modification; In the channel attention module, the feature map F of the previous layer is input through global maximum pooling and global average pooling respectively to obtain two 1×1×C feature maps and send them to a two-layer multi-layer perceptron MLP respectively; The features output by MLP are added element-wise, and then activated by sigmoid to generate the final channel feature map. Perform element-wise multiplication on the channel feature map and the input feature map F to generate the F1 feature map as the input data of the spatial attention module: M c (F)=σ(MLP(AvgPool(F))+MLP(MaxPool(F))) =σ(W1(W0(F avg ))+W1(W0(F max ))) Among them, M c (F) represents the channel attention map; F represents the input feature map; σ represents the sigmoid function, which is used to convert the output of MLP into a value between 0 and 1, indicating the importance of each channel; AvgPool(F) represents average pooling of the feature map; MaxPool(F) represents maximum pooling of the feature map; MLP() represents inputting the feature map after average pooling and maximum pooling into the multilayer perceptron; W0 represents the first layer of the multilayer perceptron; W1 represents the second layer of the multilayer perceptron; F avg and F max Respectively represent the average pooling and maximum pooling of the feature map F; In the spatial attention module, the feature map F1 operated by the channel attention module is subjected to channel-based global maximum pooling and global average pooling to obtain two H×W×1 feature maps and perform feature map channel splicing; The concatenated feature map undergoes a 7×7 convolution operation, with the feature selection being 1 channel, and then passes through sigmoid to generate a spatial feature map. The spatial feature map is multiplied by the input feature map F1 to obtain the feature map of the final CBAM attention mechanism module: M s (F1)=σ(f 7×7 ([AvgPool(F1);MaxPool(F1)])) =σ(f 7×7 ([F 1avg ;F 1max ])) Among them, M s (F1) represents the spatial attention map; F1 represents the feature map after the channel attention module operation; AvgPool(F1) represents average pooling; MaxPool(F1) represents maximum pooling; F1avg represents the feature map after average pooling, and F1max represents the feature map after maximum pooling; [F1avg; F1max] represents the concatenation of AvgPool(F1) and MaxPool(F1) in the channel dimension; f 7×7 Represents a convolution operation with a convolution kernel size of 7×7.

8. The method for rapid crater identification and area detection based on the improved Yolov8-seg algorithm according to claim 1, characterized in that: The area of ​​each mask is calculated through geospatial image data processing and calculation methods, and the corresponding equivalent circle radius is deduced. The specific steps are as follows: Data reading and preprocessing: Use the rasterio library to read the binary mask TIF file containing geographic reference information generated by the improved YOLOv8 target detection model. The white area in the mask represents the target area, and the black area is the non-target area; Vectorization: The shapes function is used to convert the pixel-level binary mask into vector polygon features, identify continuous white pixel blocks and convert them into geometric objects. Polygon optimization and validity check: During the conversion process, the buffer(0) method is used to try to close possible open polygons, and the is_valid attribute is used to filter out valid geometric objects to eliminate the interference of noise points in the process of model generation mask; Create GeoDataFrame: Use the geopandas library to organize valid polygon geometry objects into a GeoDataFrame while preserving the coordinate reference system of the original TIF; Area, radius calculation and threshold setting: Calculate the area of ​​each polygon, sort the polygons of different sizes from GeoDataFrame, set a threshold and exclude polygons with an area smaller than the threshold, exclude the interference of noise points in the process of mask generation by the model, and calculate the radius of the equivalent circle based on the area of ​​the polygon; Graphic visualization: Use the matplotlib library to draw polygonal graphics and display the extracted region boundaries, area, and equivalent circle radius.

9. A crater rapid identification and area detection system based on improved Yolov8-seg algorithm, characterized in that: It includes a data acquisition unit and a processing unit, wherein the data acquisition unit is used to obtain high-resolution satellite image data; The input end of the processing unit is connected to the output end of the data acquisition unit, and the processing unit executes the method described in any one of claims 1 to 8 to perform rapid crater identification and area detection.