A remote sensing image target detection and recognition method, device, equipment and medium

By performing label format conversion, data augmentation, and improvements on the YOLOv5 model, the problem of insufficient target detection accuracy in remote sensing images was solved, achieving high-precision and rapid detection.

CN114120138BActive Publication Date: 2025-12-09SUN YAT SEN UNIVERSITY SHENZHEN +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111286355.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-02
Publication Date
2025-12-09
Estimated Expiration
2041-11-02

AI Technical Summary

Technical Problem

The existing YOLOv5 algorithm has insufficient detection accuracy for targets at arbitrary angles in remote sensing images, and the description of horizontal rectangular bounding box parameters is inadequate.

Method used

By converting the label format of the dataset, performing data augmentation, improving the detection head of the YOLOv5 model, and adding an angle classification loss function, a target YOLOv5 model suitable for remote sensing imagery is trained.

Benefits of technology

It achieves high-precision detection of targets at any angle in remote sensing images, maintains a fast detection speed, and avoids computational overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114120138B_ABST
    Figure CN114120138B_ABST
Patent Text Reader

Abstract

The application discloses a remote sensing image target detection and recognition method, device and equipment and a medium, and relates to the artificial intelligence technical field.The method comprises the following steps: according to a label format required by model training, extracting label information of a detection target in a data set; according to a combined data enhancement method, expanding the data set after extracting the label information to obtain target data; improving a detection head of an initial YOLOv5 model to obtain a target YOLOv5 model; training the target YOLOv5 model according to the target data to obtain a detection model; and detecting to-be-recognized images according to the detection model to obtain a detection and recognition result.The application can detect and recognize the target of remote sensing images with any angle, has high practicability, can obtain high detection precision and fast detection speed, and can be widely applied to the artificial intelligence technical field.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a remote sensing image target detection and recognition method, device, equipment and medium. BACKGROUND

[0002] In recent years, target detection and recognition technology in remote sensing images has been widely used in military and civilian fields. The current mainstream detection algorithm can be divided into two branches: Two-Stage and One-Stage. One-Stage detection algorithm, because it does not need Region Proposal stage, directly produces the class probability and position coordinate value of the object, and the final detection result can be obtained through single detection, so it has faster detection speed, and the typical algorithm is YOLO, SSD, Retina-Net.

[0003] Recently, the YOLO series algorithm represented by YOLOv5 has made breakthroughs in speed and accuracy. YOLOv5 inherits the speed advantage of traditional YOLO algorithm, makes up for the disadvantage in accuracy, especially for the improvement of small target detection accuracy, so that YOLOv5 becomes a One-Stage target detection algorithm with comparable speed and accuracy.

[0004] The algorithm is applied to general scene target detection, and the target position is defined by using a horizontal rectangular bounding box, and the target is detected by regression of the bounding box parameters {x, y, w, h}. If applied to the remote sensing image scene, since the target has an arbitrary angle distribution characteristic, obviously, the horizontal rectangular box parameters {x, y, w, h} are not sufficient to describe the information of such targets, and corresponding algorithms need to be researched and designed to solve the problem. SUMMARY

[0005] Therefore, the embodiments of the present application provide a remote sensing image target detection and recognition method, device, equipment and medium, which realizes target detection and recognition of remote sensing images with arbitrary angles.

[0006] One aspect of the present application provides a remote sensing image target detection and recognition method, comprising:

[0007] According to the label format required by the model training, the detection target in the data set is labeled with information extraction;

[0008] According to the combined data enhancement method, the data set after extracting the label information is expanded to obtain target data;

[0009] The detection head of the initial YOLOv5 model is improved to obtain a target YOLOv5 model;

[0010] Training the target YOLOv5 model according to the target data to obtain a detection model;

[0011] According to the detection model, the to-be-recognized image is detected to obtain a detection recognition result.

[0012] Optionally, the label format according to the model training requirement is used to extract the annotation information of the detection target in the data set, including:

[0013] Obtaining a remote sensing image and corresponding original annotation information;

[0014] A slope-based label format conversion algorithm is used to convert the format of the original annotation information to a target format;

[0015] The label data conversion result is divided into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0016] Optionally, the combined data augmentation method includes at least one of a flip transformation method, a color gamut transformation method, a scale transformation method, a random pruning method, or a noise disturbance method.

[0017] The data set after extracting the label information is expanded to obtain target data, including:

[0018] Four images are randomly extracted from the augmented data set and are tiled in a 2x2 grid.

[0019] The center point of the mask of a predetermined size is randomly generated for the augmented result to adjust the annotation.

[0020] Optionally, the detection head of the initial YOLOv5 model is improved to obtain a target YOLOv5 model, including:

[0021] The detection head of the initial YOLOv5 model is improved.

[0022] According to the improved detection head, a target angle is predicted; wherein the target angle includes 90 categories.

[0023] The multi-scale output result of the CSPDarknet53 network is embedded in a spatial channel attention mechanism network.

[0024] According to a preset weight, an angle classification loss is added to the original loss function of the initial YOLOv5 model to obtain a loss function of the target YOLOv5 model.

[0025] Optionally, the format of the original annotation information is a combination of horizontal coordinates and vertical coordinates; and the target format is a combination of horizontal coordinates, vertical coordinates, width information, length information, and direction slope.

[0026] Another aspect of the embodiment of the present application provides a remote sensing image target detection and recognition device, comprising:

[0027] An extraction module is configured to extract label information of a detection target in a data set according to a label format required by model training;

[0028] An expansion module is configured to expand the data set after the label information is extracted according to a combined data enhancement method to obtain target data;

[0029] A model improvement module is configured to improve a detection head of an initial YOLOv5 model to obtain a target YOLOv5 model;

[0030] A training module is configured to train the target YOLOv5 model according to the target data to obtain a detection model;

[0031] A detection module is configured to detect a to-be-recognized image according to the detection model to obtain a detection and recognition result.

[0032] Optionally, the extraction module comprises:

[0033] An acquisition unit is configured to acquire a remote sensing image and corresponding original label information;

[0034] A conversion unit is configured to convert a format of the original label information to a target format based on a slope-based label format conversion algorithm;

[0035] A segmentation unit is configured to segment a data set into a training set, a validation set and a test set in a proportion of 8:1:1 according to a label data conversion result.

[0036] Optionally, the model improvement module comprises:

[0037] An improvement unit is configured to improve a detection head of an initial YOLOv5 model;

[0038] An angle detection unit is configured to predict a target angle according to the improved detection head; wherein the target angle comprises 90 categories;

[0039] An embedding unit is configured to embed a multi-scale output result of a CSPDarknet53 network into a spatial channel attention mechanism network;

[0040] A loss function construction unit is configured to add an angle classification loss in an original loss function of the initial YOLOv5 model according to a preset weight to obtain a loss function of the target YOLOv5 model.

[0041] Another aspect of the embodiment of the present application provides an electronic device comprising a processor and a memory;

[0042] The memory is configured to store a program;

[0043] The processor executes the program to implement the method as described above.

[0044] Another aspect of the embodiment of the present application provides a computer readable storage medium, the storage medium stores a program, and the program is executed by a processor to implement the method as described above.

[0045] The embodiment of the present application also discloses a computer program product or a computer program, the computer program product or the computer program comprises computer instructions stored in a computer readable storage medium. The processor of the computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method as described above.

[0046] The embodiment of the present application first extracts the label information of the detection target in the data set according to the required label format of the model training; the data set after the label information extraction is expanded according to the combined data enhancement method, and the target data is obtained; the detection head of the initial YOLOv5 model is improved, and the target YOLOv5 model is obtained; the detection model is obtained by training the target YOLOv5 model according to the target data; the detection model is used to detect the to-be-recognized image, and the detection recognition result is obtained. The present application can detect and recognize the target of the remote sensing image with any angle. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0048] Figure 1 The overall step flowchart provided by the embodiment of the present application is provided;

[0049] Figure 2 The label format conversion flowchart provided by the embodiment of the present application is provided;

[0050] Figure 3 The data combination enhancement result schematic diagram provided by the embodiment of the present application is provided;

[0051] Figure 4 The data expansion process schematic diagram provided by the embodiment of the present application is provided;

[0052] Figure 5 The data expansion result schematic diagram provided by the embodiment of the present application is provided;

[0053] Figure 6 The three methods of angle prediction provided by the embodiment of the application are shown in the schematic diagram.

[0054] Figure 7 The Neck module of the improved model provided by the embodiment of the application is shown in the schematic diagram.

[0055] Figure 8 The comparison between the horizontal frame detection result and the rotated frame detection result provided by the embodiment of the application is shown in the schematic diagram. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0057] In view of the problems existing in the prior art, the embodiment of the application provides a remote sensing image target detection and recognition method, comprising:

[0058] According to the label format required by model training, the label information of the detection target in the data set is extracted;

[0059] According to the combined data augmentation method, the data set after extracting the label information is expanded to obtain target data;

[0060] The detection head of the initial YOLOv5 model is improved to obtain a target YOLOv5 model;

[0061] The target YOLOv5 model is trained according to the target data to obtain a detection model;

[0062] The detection model is used to detect the image to be recognized to obtain a detection and recognition result.

[0063] Optionally, the extraction of the label information of the detection target in the data set according to the label format required by model training comprises:

[0064] The remote sensing image and the corresponding original label information are obtained;

[0065] The original label information is converted to a target format based on a slope-based label format conversion algorithm;

[0066] The label data conversion result is divided into a training set, a validation set and a test set in a ratio of 8:1:1.

[0067] Optionally, the combined data enhancement method comprises at least one of a flip transformation method, a color gamut transformation method, a scale transformation method, a random pruning method or a noise disturbance method.

[0068] The data set after the extraction of the mark information is subjected to data augmentation to obtain target data, comprising:

[0069] Four images are randomly extracted from the augmented data set for a field mosaic;

[0070] The center point is randomly generated by a mask of a preset size, and the augmented result is labeled and adjusted.

[0071] Optionally, the detection head of the initial YOLOv5 model is improved to obtain a target YOLOv5 model, comprising:

[0072] The detection head of the initial YOLOv5 model is improved;

[0073] The target angle is predicted according to the improved detection head; wherein the target angle comprises 90 categories;

[0074] The multi-scale output result of the CSPDarknet53 network is embedded into a spatial channel attention mechanism network;

[0075] According to a preset weight, an angle classification loss is added to the original loss function of the initial YOLOv5 model to obtain a loss function of the target YOLOv5 model.

[0076] Optionally, the format of the original label information is a combination of horizontal coordinates and vertical coordinates; and the target format is a combination of horizontal coordinates, vertical coordinates, width information, length information and direction slope.

[0077] Another aspect of the embodiment of the application provides a remote sensing image target detection and recognition device, comprising:

[0078] The extraction module is configured to extract label information of a detection target in a data set according to a label format required by model training;

[0079] The augmentation module is configured to augment the data set after the extraction of the mark information according to a combined data enhancement method to obtain target data;

[0080] The model improvement module is configured to improve a detection head of an initial YOLOv5 model to obtain a target YOLOv5 model;

[0081] The training module is configured to train the target YOLOv5 model according to the target data to obtain a detection model;

[0082] A detection module is configured to detect the to-be-identified image according to the detection model to obtain a detection result.

[0083] Optionally, the extraction module comprises:

[0084] An acquisition unit is configured to acquire a remote sensing image and corresponding original annotation information.

[0085] A conversion unit is configured to convert a format of the original annotation information to a target format based on a slope label format conversion algorithm.

[0086] A segmentation unit is configured to segment a data set into a training set, a validation set and a test set in a proportion of 8:1:1 according to the label data conversion result.

[0087] Optionally, the model improvement module comprises:

[0088] An improvement unit is configured to improve a detection head of an initial YOLOv5 model.

[0089] An angle detection unit is configured to predict a target angle according to the improved detection head, wherein the target angle comprises 90 categories.

[0090] An embedding unit is configured to embed a multi-scale output result of a CSPDarknet53 network into a spatial channel attention mechanism network.

[0091] A loss function construction unit is configured to add an angle classification loss in an original loss function of the initial YOLOv5 model according to a preset weight to obtain a loss function of a target YOLOv5 model.

[0092] Another aspect of the embodiment of the present application provides an electronic device comprising a processor and a memory.

[0093] The memory is configured to store a program.

[0094] The processor executes the program to implement the method as described above.

[0095] Another aspect of the embodiment of the present application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the method as described above.

[0096] The embodiment of the present application further discloses a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to execute the method as described above.

[0097] The implementation process of the remote sensing image target detection and recognition method provided by the embodiment of the application is described in detail below with reference to the drawings in the specification.

[0098] S1, extracting label information of the detected target in the data set image, and converting to a label format required by model training;

[0099] The step S1 of the embodiment includes S11, S12 and S13:

[0100] S11, obtaining a remote sensing image and corresponding original label information; the original label information is in the format of {x1, y1, ··· x4, y4};

[0101] S12, converting the format of the original label information to {x, y, w, h, θ} format based on a slope-based label format conversion algorithm; the specific process principle of the slope-based label format conversion algorithm is as shown in Figure 2 . Wherein: x represents the center of gravity coordinate of the detection target in the x-axis direction, y represents the center of gravity coordinate of the detection target in the y-axis direction, w represents the width of the detection target, h represents the length of the detection target, represents the slope of the detection target, θ = arctank represents the inclination angle of the detection target, k i is the slope of the four edges of the rotated frame, D ij = |k i - j | represents the absolute value of the difference between the two slopes, represents the distance between two points.

[0102] S13, dividing the data set into a training set, a validation set and a test set in a ratio of 8:1:1 according to the label data conversion result;

[0103] S2, a combination-based data enhancement method is used to expand the data set;

[0104] The combination-based data enhancement method is used to expand the data set: the combination-based data enhancement method has randomness, and combines flip transformation, color gamut transformation, scale transformation, random pruning, noise disturbance and other data enhancement methods in a random ratio, as shown in Figure 3 . In the data expansion, 4 images are randomly selected from the enhanced data set for a grid mosaic, as shown in Figure 4 . Then a 608*608 size mask is used to randomly generate a center point for cropping, as shown in Figure 5 . The expanded result is labeled and adjusted, and is applied to the training of the model.

[0105] S3, modifying the YOLOv5 algorithm framework for general scenes to obtain an algorithm framework suitable for rotating targets;

[0106] The step S1 of the embodiment includes S31, S32 and S33:

[0107] S31, improve the detection head of the existing YOLOv5 model, so that it can predict the target angle; the detection head is the Head part of YOLOv5. The prediction of the target angle is to divide the target angle into 90 categories, and the angle prediction is performed through the target category prediction. The category prediction method has less calculation amount than the setting of the rotation anchor, and has higher precision than the single parameter regression. The three methods are as follows: Figure 6 Illustration.

[0108] S32, embed the SENet module after the multi-scale output of the backbone network; the backbone network refers to CSPDarknet53, and in the multi-scale output of the Backbone, an SENet module is introduced respectively, and the original Neck part is input to form the modified Neck part. The SENet is a spatial channel attention mechanism network, and the specific network structure is as shown in Figure 7 .

[0109] S33, add the angle classification loss to the original loss function according to the weight; in the original loss function L total = cls + reg +L conf , the angle classification loss is L total =L cls +L reg +L conf +L angl e, wherein L angle =BCEWithLogitsLoss(pangle,tangle), wherein BCEWithLogitsLoss() is a binary cross entropy loss function containing sigmod processing, pangle is the network prediction target angle classification result, and tangle is the Gaussian kernel distribution data generated by the angle label.

[0110] The complete implementation process of the method of the application will be further described in detail below:

[0111] The processing process of the remote sensing image target detection and recognition method based on YOLOv5 includes five steps of label format conversion, data enhancement, model modification, model retraining and model testing.

[0112] In the label format conversion stage, the following operations are performed: 1) read the original format label {x1, y1, …·x4, y4}; 2) convert to {x, y, w, h, θ} format based on the slope conversion algorithm.

[0113] In the data enhancement stage, the following operations are performed: 1) the data set is enhanced by combining with conventional data enhancement methods; 2) label adjustment is performed; 3) four images after random combination enhancement are field spliced, and a new data image is generated by randomly generating a center point of the mask with a size of 608*608; 4) label adjustment is performed on the newly generated image.

[0114] In the model modification stage, the following operations are performed: 1) a spatial channel self-attention mechanism is introduced to the Neck of the existing YOLOv5 model; 2) the Head part of the original YOLOv5 model is modified to additionally output a 90-layer feature map for target angle prediction; 3) the Loss Function part of the existing YOLOv5 model is modified to add an angle classification loss according to the weight.

[0115] In the model retraining stage, the following operations are performed: 1) the yolov5.yaml file of the existing YOLOv5 model is modified; 2) the training set image is trained using the modified YOLOv5 model, and the weight file is obtained by iterating until the loss function no longer decreases.

[0116] In the model test stage, the following operations are performed: 1) the test set image is tested using the trained remote sensing target detection model.

[0117] Figure 8 is the effect diagram of the remote sensing image target detection method of the present application, and the method of the present application is used for ship detection and recognition of remote sensing images. Among them, Figure 8 In (a), the original YOLOv5 model ship detection and recognition result is shown, which represents the target information as a horizontal frame. Figure 8 In (b), the ship detection and recognition result of the method of the present application is shown, which represents the target information as a rotating frame, and achieves higher detection accuracy and faster detection speed.

[0118] In summary, the present application can migrate the general scene YOLOv5 algorithm to the rotating target detection of remote sensing images, achieve higher detection accuracy and faster detection speed, and skillfully avoid large calculation overhead, and has high practicability.

[0119] In some alternative embodiments, the function / operations mentioned in the block diagrams can not occur in the order mentioned in the operational illustrations. For example, depending on the involved function / operation, two blocks shown in succession can in fact be executed substantially concurrently or the blocks can sometimes be executed in reverse order, depending upon the functionality / operations involved. Furthermore, embodiments presented and described in the flowcharts are only examples of implementing the present application. Alternative embodiments are possible where some of the steps are omitted, wherein additional steps are added, or wherein some of the steps are performed in a different order. Additionally, the disclosed methods are not limited to the order of operations presented in the flowcharts.

[0120] Furthermore, although the present application is described in the context of functional modules, it is to be understood that one or more of the functions and / or features described can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It will also be appreciated that detailed discussion of the actual implementation of each module is not necessary to an understanding of the present application. Rather, the actual implementation of the modules, in light of the attributes, functions, and internal relationships of the various functional modules disclosed herein, will be apparent to one of ordinary skill in the art, given the benefit of this disclosure. Accordingly, the present application is not limited to the specific embodiments illustrated herein, but is capable of conforming to any number of variations within the scope of the present application as described in the claims appended hereto. It is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. It is also to be understood that the terminology used in the description is not intended to limit the scope of the present application to the specific embodiments described. Rather, the scope of the present application is limited solely by the claims and the present application is intended to cover any adaptations or variations of the specific embodiments described herein.

[0121] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the present application or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0122] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be embodied in non-transitory computer-readable media, executed by one or more computing devices, and / or in any other way. The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered a list of executable instructions for implementing logic functions, and can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber (optical), and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example via an optical scanner, then compiled, interpreted, or otherwise processed, and stored in a computer memory in a form that can be later executed by a computer. In this context, a "computer-readable medium" can be any means that can store the program for use by or in connection with the instruction execution system, apparatus, or device.

[0123] The foregoing description of various embodiments of the application has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the application to the precise form disclosed, and various modifications and variations are possible in light of the above teachings. It is intended that the scope of the application be limited not with this detailed description, but rather by the claims appended hereto.

[0124] It will be appreciated that portions of the present application can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following technologies known in the art, or a combination thereof, can be used: discrete logic circuitry having logic gates for implementing logic functions upon an application of data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.

[0125] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Also, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in one or more embodiments or examples.

[0126] While the embodiments of the application have been shown and described, it is to be understood that the embodiments described are merely exemplary and are not to be taken as limiting the scope of the application. The scope of the application is defined by the claims and their equivalents.

[0127] The above is a specific description of the preferred embodiment of the present application, but the present application is not limited to the described embodiment, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A remote sensing image target detection and recognition method, characterized in that, The application relates to a method for training a detection model based on a remote sensing image, and belongs to the technical field of computer vision. According to a label format required by model training, label information of a detection target in a data set is extracted, including: Obtaining a remote sensing image and corresponding original label information; A label format conversion algorithm based on a slope is used to convert the format of the original label information to a target format, and the original label information format is a combination of four corner horizontal coordinates and four corner vertical coordinates; According to an 8:1:1 proportion, a data set is divided into a training set, a verification set and a test set; According to a combined data enhancement method, the data set after the label information is extracted is expanded to obtain target data, and the format of the data set after the label information is extracted is a combination of a barycentric horizontal coordinate, a barycentric vertical coordinate, width information, length information and a direction slope; An initial YOLOv5 model detection head is improved to obtain a target YOLOv5 model; The target YOLOv5 model is trained according to the target data to obtain a detection model; The detection model is used to detect a to-be-recognized image to obtain a detection recognition result; The initial YOLOv5 model detection head is improved to obtain the target YOLOv5 model, including: The initial YOLOv5 model detection head is improved; A target angle is predicted according to the improved detection head; wherein the target angle includes 90 categories; A multi-scale output result of a CSPDarknet53 network is embedded into a spatial channel attention mechanism network; According to a preset weight, an angle classification loss is added to an original loss function of the initial YOLOv5 model to obtain a loss function of the target YOLOv5 model; The label format conversion algorithm based on the slope is used to convert the format of the original label information to a target format, including: According to the four corner horizontal coordinates and the four corner vertical coordinates, slopes of four edges of a rotating frame are calculated; According to the slopes, opposite edge slope differences are calculated; The average value of the two slopes in the opposite edge slope difference with a smaller size is taken as a direction slope by judging the size of one opposite edge slope difference and another opposite edge slope difference; An inclination angle is calculated based on the direction slope; Width information and length information are calculated based on the average value of the length of one edge of the rotating frame and the length of the opposite edge; The average value of the four corner horizontal coordinates and the four corner vertical coordinates is calculated to obtain a barycentric horizontal coordinate and a barycentric vertical coordinate.

2. The remote sensing image target detection and recognition method according to claim 1, characterized in that, The combined data enhancement method includes at least one of a flip transformation method, a color domain transformation method, a scale transformation method, a random pruning method or a noise disturbance method; The data set after the label information is extracted is expanded to obtain target data, including: Four images in the enhanced data set are randomly extracted to perform a Tian Gong grid splicing; A center point is randomly generated by using a mask with a preset size to perform cutting, and the expanded result is labeled and adjusted.

3. A remote sensing image target detection and recognition device, characterized in that, The application relates to a method for training a detection model based on a remote sensing image, and belongs to the technical field of computer vision. An extraction module is used to extract label information of a detection target in a data set according to a label format required by model training. An expansion module is configured to perform data expansion on the data set after extracting the mark information according to a combined data enhancement method to obtain target data, wherein the format of the data set after extracting the mark information is a combination of the barycentric horizontal coordinate, the barycentric vertical coordinate, the width information, the length information and the direction slope; A model improvement module is configured to improve the detection head of the initial YOLOv5 model to obtain a target YOLOv5 model; A training module is configured to train the target YOLOv5 model according to the target data to obtain a detection model; A detection module is configured to detect the to-be-recognized image according to the detection model to obtain a detection recognition result. The model improvement module comprises: An improvement unit is configured to improve the detection head of the initial YOLOv5 model; An angle detection unit is configured to predict a target angle according to the improved detection head; wherein the target angle comprises 90 categories; An embedding unit is configured to embed the multi-scale output result of the CSPDarknet53 network into a spatial channel attention mechanism network; A loss function construction unit is configured to add an angle classification loss in the original loss function of the initial YOLOv5 model according to a preset weight to obtain a loss function of the target YOLOv5 model. The extraction module comprises: An acquisition unit is configured to acquire a remote sensing image and corresponding original annotation information; A conversion unit is configured to convert the format of the original annotation information to a target format based on a slope-based label format conversion algorithm; wherein the format of the original annotation information is a combination of the four-corner horizontal coordinates and the four-corner vertical coordinates; A segmentation unit is configured to segment the label data conversion result into three parts of a training set, a validation set and a test set according to a proportion of 8:1:1; The conversion unit is specifically configured to: calculate the slope of the four edges of the rotated frame according to the four-corner horizontal coordinates and the four-corner vertical coordinates; calculate the opposite edge slope difference according to the slope; determine the size of one of the opposite edge slope differences and the other opposite edge slope difference, and take the average value of the two slopes in the smaller opposite edge slope difference as the direction slope; calculate the inclination angle based on the direction slope; calculate the width information and the length information based on the average value of the length of one edge of the rotated frame and the length of the opposite edge; calculate the barycentric horizontal coordinate and the barycentric vertical coordinate by calculating the average value of the four-corner horizontal coordinates and the four-corner vertical coordinates.

4. An electronic device, comprising: A processor and a memory are included; The memory is configured to store a program; The processor executes the program to implement the method of any one of claims 1-2.

5. A computer readable storage medium, characterized in that, The storage medium stores a program, and the program is executed by the processor to implement the method of any one of claims 1-2.

Citation Information

Patent Citations

  • Insulator defect detection method based on improved YOLOv5 convolutional neural network

    CN112819804A

  • Garbage detection and identification method based on improved yolov5 network

    CN113158956A

  • Anchor-frame-free remote sensing image rotating target detection method

    CN113468968A