Unmanned aerial vehicle remote sensing image-oriented vehicle detection data enhancement method

By performing segmentation mask processing on UAV remote sensing images and random copying of vehicle targets, the problem of insufficient vehicle recognition capabilities in UAV remote sensing images is solved, and the recognition rate and model training quality of the traffic intelligent security system are improved.

CN118781502AActive Publication Date: 2024-10-15CEC YIZHIHANG (CHONGQING) TECH CO LTD

Patent Information

Application Number
CN202410915012.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-10-15
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

Existing technology makes it difficult to effectively train vehicle target recognition models through UAV remote sensing images, resulting in insufficient identification capabilities of UAVs in traffic intelligent security systems.

Method used

By performing segmentation mask processing on UAV remote sensing images, segmentation mask images of vehicle targets and roads are generated, and the vehicle targets are randomly copied to the road background to eliminate unnatural boundaries and generate data edge enhanced images for model training.

Benefits of technology

It significantly improves the vehicle recognition rate of UAVs in complex environments, enhances the assistance management capabilities of traffic intelligent security systems, and ensures the quality and diversity of training data for target recognition models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118781502A_ABST
    Figure CN118781502A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of traffic intelligent security and protection systems, and particularly relates to an unmanned aerial vehicle remote sensing image-oriented vehicle detection data enhancement method, which comprises the following steps of: S1, acquiring a remote sensing image of an unmanned aerial vehicle; s2, performing segmentation mask processing on the remote sensing image to obtain segmentation mask images of a vehicle target and a road in the remote sensing image; s3, taking the segmentation mask image of the road as a background image, and randomly copying each vehicle target to different positions of the road in each background image to obtain a foreground target copy image; s4, processing a vehicle target boundary in the foreground target copy image; obtaining a data edge enhanced image; and S5, taking the data edge enhanced image as training data, and training the target recognition model of the unmanned aerial vehicle remote sensing image. The method can improve the recognition capability of the target recognition model for the vehicle passing through the remote sensing image by the unmanned aerial vehicle, and guarantees the effectiveness of the auxiliary management of the unmanned aerial vehicle for the traffic intelligent security and protection system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent traffic security systems, and in particular relates to a vehicle detection data enhancement method for unmanned aerial vehicle remote sensing images. Background Art

[0002] In today's society, many critical scenes rely more than ever on surveillance cameras to detect abnormal events early. However, the monitoring capabilities of traditional fixed cameras are significantly limited due to their lack of flexibility, visual blind spots, and easy obstruction by obstacles.

[0003] In contrast, drones have shown great potential in the field of security monitoring due to their high mobility, and the research and use of drones in the field of security monitoring are increasing. As an important field of security monitoring, the use of drones in intelligent traffic security systems is also gradually increasing. In intelligent traffic security systems, vehicle target recognition plays a vital role, and more and more deep learning-based methods have proven their effectiveness. Therefore, if vehicle target recognition can be performed through drones, it will undoubtedly further improve the effectiveness of intelligent traffic security systems.

[0004] However, although there are many public datasets of natural images, the characteristics of these images are quite different from those of drone remote sensing images, and vehicle image training data based on drone perspectives is still scarce. Target data enhancement methods are basically limited to simple image transformations, such as cropping, flipping, and color adjustment, or adding noise to images. These methods do not essentially increase the number of instances of vehicle targets, nor do they effectively improve the model's ability to identify vehicle features and related background features. This makes it difficult to obtain sufficient training data that meets quality requirements for vehicle target recognition in drone remote sensing images, and it is difficult to ensure the training effect of the target recognition model, which means that when conducting traffic assistance management, the drone's ability to recognize vehicles in remote sensing images still needs to be improved.

[0005] Therefore, how to improve the target recognition model's ability to identify vehicles in remote sensing images from drones and ensure the effectiveness of drones' assistance in the management of intelligent traffic security systems has become a problem that needs to be solved urgently. Summary of the invention

[0006] In view of the above-mentioned deficiencies in the prior art, the present invention provides a vehicle detection data enhancement method for UAV remote sensing images, which can improve the target recognition model's ability to identify vehicles in remote sensing images passed by UAVs, and ensure the effectiveness of UAVs' assistance in the management of intelligent traffic security systems.

[0007] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0008] A vehicle detection data enhancement method for UAV remote sensing images includes the following steps:

[0009] S1, obtain remote sensing images from drones;

[0010] S2, performing segmentation mask processing on the remote sensing image to obtain segmentation mask images of the vehicle target and the road in the remote sensing image respectively;

[0011] S3, using the segmented mask image of the road as the background image, and randomly copying each vehicle target obtained in S2 to different positions of the road in each background image according to a preset random copying method, to obtain a foreground target copy image;

[0012] S4, processing the vehicle target boundary in the foreground target copy image, eliminating unnatural boundaries, and making the vehicle target boundary and the background image seamlessly merged; obtaining a data edge enhanced image;

[0013] S5. Use the data edge enhanced image obtained in S4 as training data to train the target recognition model of the UAV remote sensing image.

[0014] Compared with the prior art, the present invention has the following beneficial effects:

[0015] 1. After acquiring the remote sensing image of the drone, this method will perform segmentation mask processing on it to obtain the segmentation mask images of the vehicle targets and roads in the remote sensing image. On this basis, this method uses the segmented road segmentation mask image as the background image and randomly pastes the segmented vehicle targets into the road of the background image. In this way, the position and number of vehicles can be randomly changed while maintaining the consistency of the background environment, thereby generating a new image scene.

[0016] This method can greatly increase the diversity and quantity of image samples, especially the frequency of small target vehicles in complex environments. In this way, through the random combination of vehicles and roads, as well as the randomness of vehicle positions, sufficient remote sensing images can be obtained using a limited number of remote sensing images, and the complexity of their backgrounds can be guaranteed.

[0017] 2. In addition, this method processes the pasted vehicle target boundary, eliminates unnatural boundaries, and makes the vehicle target boundary and the background image seamlessly merged. In this way, the overall quality of the image used for target recognition model training can be guaranteed.

[0018] It is then used to train a target recognition model for UAV remote sensing images. The target recognition model obtained in this way can significantly improve the recognition rate of various types of vehicles in remote sensing images of complex environments.

[0019] In summary, this method can improve the target recognition model's ability to identify vehicles (especially small vehicles) in remote sensing images passed by drones, and ensure the effectiveness of drones' assistance in the management of intelligent traffic security systems.

[0020] Preferably, in S2, segmentation masks of vehicle targets and roads are performed based on the segmentation everything model SAM; wherein, the vehicle target segmentation mask is performed based on the prompt box, and the road segmentation mask is performed based on the prompt word.

[0021] Preferably, the process of vehicle target segmentation mask includes:

[0022] Acquire the image features of the vehicle target in the remote sensing image through an image encoder;

[0023] The vehicle calibration frame information is used as the prompt box input of the SAM model;

[0024] Using the lightweight mask decoding module in the SAM model, the image features of the vehicle target are combined with the prompt information of the corresponding prompt box through the cross-attention mechanism to obtain the segmentation mask image of the vehicle.

[0025] Such a setting, through the advanced segmentation function of the SAM model, can realize the segmentation mask operation of accurately identifying vehicle targets and roads, ensuring the subsequent increase in the diversity of the training data set, and thus ensuring the effectiveness of the subsequent training of the target recognition model.

[0026] Preferably, in S3, when a vehicle target is randomly copied to a different position on a road, a new vehicle position is randomly generated in the road area through a position generation and verification algorithm.

[0027] Preferably, the process of the location generation and verification algorithm includes:

[0028] a. Randomly generate the upper left corner position of the vehicle to be copied within the image coordinate range, and calculate whether its rectangular copy area will exceed the road mask area based on the length and width of the vehicle; if it does not exceed the road mask area, proceed to step b, otherwise regenerate;

[0029] b. Traverse the target frame coordinate information of all existing targets in the image, and compare the target frame of each existing target with the target frame of the rectangular copy area in step a;

[0030] c. Determine whether the target frame of the rectangular copy area intersects with the target frames of each existing target; if not, determine that the rectangular copy area meets the requirements; if intersecting, return to step a to generate a new rectangular copy area.

[0031] In this way, this method focuses on the replication of vehicles in the road area as the main scene for enhancement. By identifying the road area in the image and randomly replicating the existing vehicle targets to different locations in the road area, the number and layout diversity of vehicles in the image can be effectively increased. This targeted enhancement method is specifically designed to improve the model's ability to detect vehicle targets, increase the diversity and number of image datasets through technical means, and thus improve the generalization ability of the vehicle target recognition model.

[0032] Preferably, the process of determining whether the target frame of the rectangular copy area intersects with the target frame of an existing target includes:

[0033] Calculate the smallest horizontal starting point MinX and vertical starting point MinY of the two target frame coordinates as the possible leftmost and uppermost boundaries of the overlapping area, and calculate the largest horizontal end point MaxX and vertical end point MaxY of the two target frame coordinates as the possible rightmost and lowermost boundaries of the overlapping area;

[0034] Then, the width W of the overlapping area is calculated by the following formula: overlap and height H overlap :

[0035] W overlap =(X2-X1)+(x2-x1)-(MaxX-MinX);

[0036] H overlap =(Y2-Y1)+(y2-y1)-(MaxY-MinY);

[0037] Among them, (X1, Y1) and (X2, Y2) are the coordinates of the upper left corner and lower right corner of the target box of the rectangular copy area; (x1, y1) and (x2, y2) are the coordinates of the upper left corner and lower right corner of the target box of the existing target;

[0038] If the width of the overlapping area is W overlap and height H overlap If both are less than 0, the two target boxes do not intersect; otherwise, the two target boxes intersect.

[0039] In this way, a new vehicle position is randomly generated in the identified road area through the position generation and verification algorithm. The position generation and verification algorithm attempts to generate a new position in the segmented road area for each selected vehicle target. This method sets the positions of different vehicles to be independent and non-overlapping to increase the diversity of vehicle positions.

[0040] Preferably, in S4, the vehicle target boundary in the foreground target copy image is processed by setting a multi-stream image fusion network MMLF based on visual Mamba;

[0041] The processing process of the multi-stream image fusion network MMLF for the vehicle target boundary in the foreground target copy image includes: the scene target copy image and the corresponding background image are respectively subjected to the same feature encoding processing through the visual Manba encoder and then input into the decoder; at different decoding levels of the decoder, the feature map is upsampled by deconvolution and connected with the feature maps of the same level from the two encoders, and at the end of the decoder, the fused feature map is reconstructed into the final image as a data edge enhanced image.

[0042] Due to the accuracy limitation of the target segmentation algorithm or the environmental difference between the target boundary and the copy area, the target segmentation boundary and the background are not coordinated, which can easily affect the detection accuracy. This setting can achieve a smooth transition between the vehicle target and the new background, further ensuring the visual effect of the image and the detection accuracy.

[0043] Preferably, the process of performing feature encoding processing on the scene target copy image or the background image includes:

[0044] First, the 2D image Divide into J image blocks of size P×P×C Get serialized image blocks Where (H, W) is the image size, C is the number of image channels, P is the size of the image block, and J is the number of image blocks;

[0045] Then, each image block Through a learnable projection matrix Linear projection to an embedding vector of size D At the same time, a learnable category label t with dimension D is introduced cls ; and add a position embedding for each image patch Add the category label and the embedding vectors of all image patches to the position embedding to form the initial sequence T0:

[0046]

[0047] Then, the T0 input is sent to the visual Mamba encoder for feature extraction, and the output tag sequence T is obtained. l ; The visual Mamba encoder includes multiple Mamba encoder layers; when the visual Mamba encoder is working, T0 is input into the first visual Mamba encoder layer for processing to obtain a new sequence T1, and T1 is sent to the second visual Mamba encoder layer for processing; the processing process is repeated to obtain the output tag sequence T of the visual Mamba encoder l .

[0048] With this setup, the encoders of foreground and background are able to adaptively learn their inherent feature representations, thereby achieving accurate and natural image fusion in the decoder, ensuring natural transitions and detail fidelity at the fusion boundary.

[0049] Preferably, the working process of the i-th visual Mamba encoder layer includes:

[0050] a. Through the normalization layer, the input tag sequence T i-1 Perform normalization operation, denoted as Among them, 1≤i≤l;

[0051] b. Use a linear layer to normalize the labeled sequence Mapped to x and z with dimensions E;

[0052] c. Send x to the forward propagation and backward propagation branches for encoding, and combine the bidirectional state space SSM model to obtain the output y of the forward branch forward and the output y of the backward branch backward ;

[0053] d. Through z, y forward and backward Gating is performed and the gated outputs are added together to obtain the output tag sequence T i .

[0054] In this way, the Visual Mamba Encoder extracts features from foreground and background images through a bidirectional sequence model; not only processing the forward information flow, but also considering the reverse information flow, thereby capturing details and contextual information at different spatial levels.

[0055] Preferably, the loss function of the MMLF network is:

[0056] L all =L1+λ P L P ;

[0057] Where L1 represents L1 loss, L P represents the perceptual loss, λ P Represents the weight of the perceptual loss.

[0058] With this setting, the perceptual loss is specifically aimed at improving the visual naturalness and realism of the synthesized images, while maintaining efficient computation without sacrificing image quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:

[0060] Figure 1 A flowchart of the method is shown in FIG.

[0061] Figure 2 Schematic diagram of the process of generating a data edge enhanced image in an embodiment;

[0062] Figure 3 This is a schematic diagram of the location generation and verification algorithm flow in the embodiment;

[0063] Figure 4 Schematic diagram of the MMLF network structure in the embodiment. DETAILED DESCRIPTION

[0064] The following is a further detailed description through specific implementation methods:

[0065] Example:

[0066] like Figure 1 , Figure 2 As shown, this embodiment discloses a vehicle detection data enhancement method for UAV remote sensing images, including the following steps:

[0067] S1. Obtain remote sensing images from drones.

[0068] S2. Segmentation masks of vehicle targets and roads are performed based on the Segmentation Everything Model (SAM), and segmentation mask images of vehicle targets and roads in the remote sensing image are obtained respectively. The vehicle target segmentation mask is performed based on the prompt box, and the road segmentation mask is performed based on the prompt word.

[0069] In order to achieve the purpose of completing data enhancement of vehicle targets in designated areas from the perspective of drones, the present invention adopts a segmentation method to obtain vehicle targets and road areas of interest. Most existing target segmentation models are mainly suitable for single or common scenarios, and there is little research on target segmentation from the perspective of drones. Therefore, for the vehicle target and road segmentation tasks from the perspective of drones, a segmentation model with strong generalization ability is required. The present invention adopts an advanced "Segment Anything Model" (SAM) to complete the task of segmenting targets of interest. SAM is an efficient model that can achieve accurate foreground target segmentation. It is pre-trained on a wide range of data sets, effectively solves a series of downstream segmentation problems when encountering new data distributions, and shows excellent segmentation effects in a variety of scenarios. The model uses an improved image encoder E img (·) and the prompt word encoder E prompt (·), with an efficient mask decoder D mask (·) can effectively process vehicle images and road segmentation from the perspective of drones in complex scenes. The specific segmentation scheme is as follows:

[0070] (1) Vehicle target segmentation algorithm based on prompt box

[0071] Since the vehicle calibration frame information is relatively easy to obtain, and the target prompt frame SAM model can better segment the corresponding target. Therefore, the present invention uses the vehicle calibration frame information as the prompt frame input of the SAM model, and combines it with the corresponding drone image to obtain the vehicle segmentation mask. The specific algorithm flow is as follows:

[0072] a. Image feature extraction

[0073] The drone image with a resolution of 1024×1024 is used as the image encoder E img (·) input. img (·) The encoder structure of the Vision Transformer (ViT) is adopted, and its initialization parameters are obtained by pre-training the Masked Autoencoders (MAE). img (·) is equipped with a 14×14 window size attention mechanism and four evenly distributed global attention blocks. Through the self-attention mechanism, the encoder can accurately capture the key features in the image and can accurately segment small target vehicles in UAV remote sensing images. The input image is img (·) The encoder is downsampled by a factor of 16 to obtain an output feature map of size 64×64 with 256 channels.

[0074] b. Vehicle labeling box prompt feature extraction

[0075] The present invention uses the vehicle annotation box as prompt information to guide the SAM model to accurately segment the vehicle. The prompt information mapping of the annotation box consists of two parts: one is the position encoding of the two points in the upper left corner and the lower right corner; the other is the one-dimensional vector describing these points, identifying whether the point is "upper left" or "lower right".

[0076] The position encoding is done by normalizing the coordinates of the box corners (dividing them by the image size so that the coordinate values ​​are between 0 and 1), and then applying a randomly generated Gaussian matrix to obtain the results of sine and cosine transforms, thereby mapping to produce a code with certain frequency characteristics. This code can effectively express the position information of the vehicle annotation box. After the position encoding is generated, the code of each corner is further distinguished by adding a specific weight vector to the corner type (upper left corner or lower right corner). These specific weight vectors are in the prompt word encoder E prompt (·) Created during initialization, word embedding is used to assign a unique embedding vector to each point type. These embedding vectors are added on top of the positional encoding to form the final description vector.

[0077] For example, for the upper left point of the prompt box, the information is mapped to the position code plus the description vector of the feature "upper left"; the lower right point is mapped to the position code plus the description vector of the feature "lower right". This way of mapping prompt information not only improves the flexibility of the model according to different operation requirements or scene changes, but also significantly enhances the adaptability and accuracy of the model.

[0078] c. Vehicle segmentation mask image output

[0079] The present invention adopts an efficient vehicle segmentation mask image output technology, that is, using the lightweight mask decoding module in the SAM model to efficiently combine image features with prompt information through a cross-attention mechanism to generate an accurate vehicle segmentation mask.

[0080] The specific calculation process of the mask decoding module is as follows:

[0081] a. The module takes image features and prompt information as input. These input data are processed by an improved Transformer decoder. An additional output token embedding is introduced in the decoder, which is combined with the input data through self-attention and cross-attention mechanisms to generate a temporary decoding result.

[0082] b. During decoding, each decoder layer performs the following steps: 1) self-attention on the tokens; 2) cross-attention to adjust the tokens based on the image embedding; 3) update the tokens through a multi-layer perceptron; 4) update the tokens again through cross-attention based on the image embedding. Each step is equipped with residual connections, normalization layers, and dropout processing to improve model stability and efficiency.

[0083] To further improve the spatial perception of the model, position encoding is added to the attention processing to enhance the model's ability to capture geometric information. In addition, the updated data of image embedding and hint tags are combined again to ensure that the decoder fully understands and utilizes the spatial and type information of the input data.

[0084] The output of the decoder is upsampled through two transposed convolutional layers to expand the image size to match the original input image size. Finally, this data is further processed through a small multi-layer perceptron to generate the final vehicle segmentation mask image output.

[0085] (2) Road segmentation algorithm based on prompt words

[0086] The computational process of the prompt word based road segmentation algorithm is roughly the same as that of the prompt box based road segmentation algorithm. The difference is that the prompt word uses the text encoder in the large-scale contrastive language-image pre-training model CLIP (Contrastive Language-Image Pre-Training) to extract text features, which can be trained without any explicit text supervision when using text-based prompts for reasoning.

[0087] S3, using the segmented mask image of the road as the background image, and randomly copying each vehicle target obtained in S2 to different positions of the road in each background image according to a preset random copying method, to obtain a foreground target copy image. When a vehicle target is randomly copied to different positions of a road, a new vehicle position is randomly generated in the road area through a position generation and verification algorithm.

[0088] The present invention adopts a random replication enhancement technology for vehicle targets in UAV remote sensing images. In particular, the method focuses on vehicle replication in road areas as the main scene for enhancement. The technology effectively increases the number and layout diversity of vehicles in the image by identifying the road area in the image and randomly replicating existing vehicle targets in the road area to different locations. This targeted enhancement method is specifically designed to improve the model's detection ability for vehicle targets, and to increase the diversity and number of image data sets through technical means, thereby improving the generalization ability of the model. Its process is as follows Figure 3 shown.

[0089] 1) Vehicle and road segmentation mask extraction

[0090] Through the above-mentioned vehicle and road segmentation method based on the SAM model, accurate extraction of vehicle and road segmentation masks is achieved.

[0091] 2) Random selection and replication strategy

[0092] The probability parameter is set to control whether to copy the selected vehicle target and determine the number of copies to enhance data diversity. In terms of parameter setting, the probability parameter prob is set to 0.5 (that is, half of the vehicle targets will be copied); the number of copies of each vehicle target is controlled by the copy_times parameter and is set to 1. The copy strategy can choose to copy all segmented vehicle targets or randomly select a single target to simulate different traffic scenarios.

[0093] 3) Generate and verify new replication location

[0094] Through the position generation and verification algorithm, a new vehicle position is randomly generated in the identified road area. The position generation and verification algorithm attempts to generate a new position in the segmented road area for each selected vehicle target. The present invention sets the positions of different vehicles to be independent and non-overlapping to increase the diversity of vehicle positions.

[0095] The position generation and verification algorithm flow is as follows:

[0096] a. Randomly generate the upper left corner position of the vehicle to be copied within the image coordinate range, and calculate whether its rectangular copy area (upper left corner and lower right corner coordinates are (X1, Y1) and (X2, Y2)) will exceed the road mask area based on the length and width of the vehicle; if it does not exceed the road mask area, go to step b, otherwise regenerate;

[0097] b. Traverse the target frame coordinate information of all existing targets in the image, and compare the target frame of each existing target (the coordinates of the upper left corner and the lower right corner are (x1, y1) and (x2, y2)) with the target frame of the rectangular copy area in step a respectively;

[0098] c. Determine whether the target frame of the rectangular copy area intersects with the target frames of each existing target; if not, determine that the rectangular copy area meets the requirements; if intersecting, return to step a to generate a new rectangular copy area.

[0099] The process of determining whether the target frame of the rectangular copy area intersects with the target frame of an existing target includes:

[0100] Calculate the smallest horizontal starting point MinX and vertical starting point MinY of the two target frame coordinates as the possible leftmost and uppermost boundaries of the overlapping area, and calculate the largest horizontal end point MaxX and vertical end point MaxY of the two target frame coordinates as the possible rightmost and lowermost boundaries of the overlapping area;

[0101] Then, the width W of the overlapping area is calculated by the following formula: overlap and height H overlap :

[0102] W overlap =(X2-X1)+(x2-x1)-(MaxX-MinX);

[0103] H overlap =(Y2-Y1)+(y2-y1)-(MaxY-MinY);

[0104] Among them, (X1, Y1) and (X2, Y2) are the coordinates of the upper left corner and lower right corner of the target box of the rectangular copy area; (x1, y1) and (x2, y2) are the coordinates of the upper left corner and lower right corner of the target box of the existing target;

[0105] If the width of the overlapping area is W overlap and height H overlap If both are less than 0, the two target boxes do not intersect; otherwise, the two target boxes intersect.

[0106] In this way, a new vehicle position is randomly generated in the identified road area through the position generation and verification algorithm. The position generation and verification algorithm attempts to generate a new position in the segmented road area for each selected vehicle target. This method sets the positions of different vehicles to be independent and non-overlapping to increase the diversity of vehicle positions.

[0107] This method focuses on the replication of vehicles in the road area as the main scenario for enhancement. By identifying the road area in the image and randomly replicating the existing vehicle targets to different locations in the road area, the number and layout diversity of vehicles in the image can be effectively increased. This targeted enhancement method is specifically designed to improve the model's ability to detect vehicle targets, and to increase the diversity and number of image datasets through technical means, thereby improving the generalization ability of the vehicle target recognition model.

[0108] S4, processing the boundary of the vehicle target in the foreground target copy image, eliminating the unnatural boundary, and making the boundary of the vehicle target seamlessly merge with the background image; obtaining a data edge enhanced image. In the specific implementation, the boundary of the vehicle target in the foreground target copy image is processed by setting a multi-stream image fusion network MMLF based on visual Mamba.

[0109] In S3, the vehicle target has been copied to the designated road area. However, due to the accuracy limitation of the target segmentation algorithm or the environmental difference between the target boundary and the copy area, the target segmentation boundary and the background are not coordinated, which easily affects the detection accuracy. Therefore, the present invention designs a multi-stream image fusion network based on visual Mamba (Mamba-based Multi-stream Fusion Netwrok, MMLF) to achieve seamless fusion between the vehicle target boundary and the background. Its structure is as follows Figure 4 As shown in the figure, Norm refers to RMS Normalization; Linear Projection refers to the linear projection layer; and embedded patches refer to the processed image patches.

[0110] Inspired by the Laplacian pyramid image fusion method, the MMLF network adopts a densely connected structure to fuse foreground and background image information of different scales, and designs a visual Mamba sub-network as an image encoder based on a bidirectional state space model (SSM) to provide a more refined foreground and background feature expression.

[0111] The processing process of the multi-stream image fusion network MMLF for the vehicle target boundary in the foreground target copy image includes: the scene target copy image and the corresponding background image are respectively processed by the visual Manba encoder with the same feature encoding and then input to the decoder; at different decoding levels of the decoder, the feature map is upsampled by deconvolution and connected with the feature maps of the same level from the two encoders; at the end of the decoder, the synthesized image is reconstructed from the fused feature map. This process is similar to the fusion and reconstruction process of Laplacian pyramid fusion. By dynamically optimizing the global representation of features through the SSM model, the encoders of the foreground and background can adaptively learn their inherent feature representations, thereby achieving accurate and natural image fusion in the decoder, ensuring natural transitions and detail fidelity at the fusion boundary.

[0112] In specific implementation, each Mamba encoder layer contains self-attention mechanism, feedforward network, LayerNorm and residual connection. Self-attention mechanism is used to capture the dependencies between elements in the sequence, feedforward network is used to increase nonlinear transformation capability, LayerNorm is used to stabilize the training process, and residual connection is used to accelerate convergence.

[0113] The decoder layer also uses a Transformer-like structure, but may contain a cross-attention mechanism to fuse the information of the encoder. Each layer of the decoder also includes a self-attention mechanism, a feedforward network, LayerNorm, and a residual connection. When the decoder decodes, at different decoding levels, the feature map is upsampled using a transposed convolution or interpolation method to restore it to a size similar to the original image; at the same time, the upsampled feature map is connected with the feature map from the same level of the encoder to fuse more contextual information;.

[0114] The process of performing feature encoding processing on the scene target copy image or the background image includes:

[0115] First, the 2D image Divide into J image blocks of size P×P×C Get serialized image blocks Where (H, W) is the image size, C is the number of image channels, P is the size of the image block, and J is the number of image blocks;

[0116] Then, each image block Through a learnable projection matrix Linear projection to an embedding vector of size D At the same time, a learnable category label t with dimension D is introduced cls ; and add a position embedding for each image patch The category labels and the embedding vectors of all image patches are added to the position embedding to form the initial sequence T0 to maintain the coherence of spatial information.

[0117]

[0118] Then, the T0 input is sent to the visual Mamba encoder for feature extraction, and the output tag sequence T is obtained. l ; The visual Mamba encoder includes multiple Mamba encoder layers; when the visual Mamba encoder is working, T0 is input into the first visual Mamba encoder layer for processing to obtain a new sequence T1, and T1 is sent to the second visual Mamba encoder layer for processing; the processing process is repeated to obtain the output tag sequence T of the visual Mamba encoder l .

[0119] The working process of the i-th visual Mamba encoder layer includes:

[0120] a. Through the normalization layer, the input tag sequence T i-1 Perform normalization operation, denoted as Among them, 1≤i≤l;

[0121] b. Use a linear layer to normalize the labeled sequence Mapped to x and z with dimensions E;

[0122] c. Send x to the forward propagation and backward propagation branches for encoding, and combine the bidirectional state space SSM model to obtain the output y of the forward branch forward and the output y of the backward branch backward ;

[0123] d. Through z, y forward and backward Gating is performed and the gated outputs are added together to obtain the output tag sequence T i .

[0124] In this way, the visual Mamba encoder extracts features from foreground and background images through a bidirectional sequence model; it not only processes the forward information flow, but also considers the reverse information flow, thereby capturing details and contextual information at different spatial levels.

[0125] The encoders of foreground and background are able to adaptively learn their inherent feature representations, thereby achieving accurate and natural image fusion in the decoder, ensuring natural transitions and detail fidelity at the fusion boundary.

[0126] Due to the accuracy limitation of the target segmentation algorithm or the environmental difference between the target boundary and the copy area, the target segmentation boundary and the background are not coordinated, which can easily affect the detection accuracy. This setting can achieve a smooth transition between the vehicle target and the new background, further ensuring the visual effect of the image and the detection accuracy.

[0127] The loss function of the MMLF network is:

[0128] L all =L1+λ P L P ;

[0129] Where L1 represents L1 loss, L P represents the perceptual loss, λ P Represents the weight of the perceptual loss.

[0130] With this setting, the perceptual loss is specifically aimed at improving the visual naturalness and realism of the synthesized images, while maintaining efficient computation without sacrificing image quality.

[0131] S5. Use the data edge enhanced image obtained in S4 as training data to train the target recognition model of the UAV remote sensing image.

[0132] After acquiring the remote sensing image of the drone, this method will perform segmentation mask processing on it, and obtain the segmentation mask images of the vehicle target and the road in the remote sensing image respectively. On this basis, this method uses the segmentation mask image of the segmented road as the background image, and randomly pastes each segmented vehicle target into the road of the background image. In this way, through the random combination of vehicles and roads, and the randomness of vehicle positions, sufficient remote sensing images can be obtained using a limited number of remote sensing images, and the complexity of the background can be guaranteed. In addition, this method processes the boundary of the pasted vehicle target, eliminates unnatural boundaries, and seamlessly integrates the boundary of the vehicle target with the background image. In this way, the overall quality of the image used for training the target recognition model can be guaranteed. Then it is used for the target recognition model training of the drone remote sensing image. The target recognition model obtained in this way can significantly improve its recognition rate of various types of vehicles in remote sensing images of complex environments. In summary, this method can improve the target recognition model's ability to recognize vehicles (especially small vehicles) in remote sensing images passed by drones, and ensure the effectiveness of drones' assistance management of traffic intelligent security systems.

[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.

Claims

1. A vehicle detection data enhancement method for UAV remote sensing images, characterized in that: The following steps are involved: S1, obtain remote sensing images from drones; S2, performing segmentation mask processing on the remote sensing image to obtain segmentation mask images of the vehicle target and the road in the remote sensing image respectively; S3, using the segmented mask image of the road as the background image, and randomly copying each vehicle target obtained in S2 to different positions of the road in each background image according to a preset random copying method, to obtain a foreground target copy image; S4, processing the vehicle target boundary in the foreground target copy image to eliminate unnatural boundaries and make the vehicle target boundary and the background image seamlessly merged; Obtain a data edge enhanced image; S5. Use the data edge enhanced image obtained in S4 as training data to train the target recognition model of the UAV remote sensing image.

2. The vehicle detection data enhancement method for UAV remote sensing images according to claim 1, characterized in that: In S2, the segmentation mask of the vehicle target and the road is performed based on the segmentation everything model SAM; wherein, the vehicle target segmentation mask is performed based on the prompt box, and the road segmentation mask is performed based on the prompt word.

3. The vehicle detection data enhancement method for UAV remote sensing images as claimed in claim 2, characterized in that: The process of vehicle target segmentation mask includes: Acquire the image features of the vehicle target in the remote sensing image through an image encoder; The vehicle calibration frame information is used as the prompt box input of the SAM model; Using the lightweight mask decoding module in the SAM model, the image features of the vehicle target are combined with the prompt information of the corresponding prompt box through the cross-attention mechanism to obtain the segmentation mask image of the vehicle.

4. The vehicle detection data enhancement method for UAV remote sensing images according to claim 1, characterized in that: In S3, when a vehicle target is randomly copied to a different position on a road, a new vehicle position is randomly generated within the road area through the position generation and verification algorithm.

5. The vehicle detection data enhancement method for UAV remote sensing images as claimed in claim 4, characterized in that: The flow of the location generation and verification algorithm includes: a. Randomly generate the upper left corner position of the vehicle to be copied within the image coordinate range, and calculate whether its rectangular copy area will exceed the road mask area based on the length and width of the vehicle; if it does not exceed the road mask area, proceed to step b, otherwise regenerate; b. Traverse the target frame coordinate information of all existing targets in the image, and compare the target frame of each existing target with the target frame of the rectangular copy area in step a; c. Determine whether the target frame of the rectangular copy area intersects with the target frames of each existing target; if not, determine that the rectangular copy area meets the requirements; if intersecting, return to step a to generate a new rectangular copy area.

6. The vehicle detection data enhancement method for UAV remote sensing images according to claim 5, characterized in that: The process of determining whether the target frame of the rectangular copy area intersects with the target frame of an existing target includes: Calculate the smallest horizontal starting point MinX and vertical starting point MinY of the two target frame coordinates as the possible leftmost and uppermost boundaries of the overlapping area, and calculate the largest horizontal end point MaxX and vertical end point MaxY of the two target frame coordinates as the possible rightmost and lowermost boundaries of the overlapping area; Then, the width W of the overlapping area is calculated by the following formula: overlap and height H overlap : Wovertapp=(X2-X)+(x2-x1)-(MaxX-MinX); Hoverlap=(Y2-)+(y2y1)-(MaxY-MinY); Among them, (X1, Y1) and (X2, Y2) are the coordinates of the upper left corner and lower right corner of the target box of the rectangular copy area; (x1, y1) and (x2, y2) are the coordinates of the upper left corner and lower right corner of the target box of the existing target; If the width of the overlapping area is W overlap and height H overlap If both are less than 0, the two target boxes do not intersect; otherwise, the two target boxes intersect.

7. The vehicle detection data enhancement method for UAV remote sensing images according to claim 1, characterized in that: In S4, the vehicle target boundary in the foreground target copy image is processed by setting a multi-stream image fusion network MMLF based on visual Mamba; The processing process of the multi-stream image fusion network MMLF on the vehicle target boundary in the foreground target copy image includes: performing the same feature encoding processing on the scene target copy image and the corresponding background image through the visual Manba encoder respectively and then inputting them into the decoder; At different decoding levels of the decoder, the feature maps are upsampled by deconvolution and concatenated with the feature maps of the same level from the two encoders, and at the end of the decoder, the fused feature maps are reconstructed into the final image as a data edge enhanced image.

8. The vehicle detection data enhancement method for UAV remote sensing images according to claim 7, characterized in that: The process of feature encoding processing for the scene target copy image or background image includes: First, the 2D image Divide into J image blocks of size P×P×C Get serialized image blocks Where (H, W) is the image size, C is the number of image channels, P is the size of the image block, and J is the number of image blocks; Then, each image block Through a learnable projection matrix Linear projection to an embedding vector of size D At the same time, a learnable category tag tcls with dimension D is introduced; and a position embedding is added to each image block Add the category label and the embedding vectors of all image patches to the position embedding to form the initial sequence T0: Then, the T0 input is sent to the visual Mamba encoder for feature extraction, and the output tag sequence T is obtained. l ; The visual Mamba encoder includes multiple Mamba encoder layers; when the visual Mamba encoder is working, T0 is input into the first visual Mamba encoder layer for processing to obtain a new sequence T1, and T1 is sent to the second visual Mamba encoder layer for processing; the processing process is repeated to obtain the output tag sequence T of the visual Mamba encoder l .

9. The vehicle detection data enhancement method for UAV remote sensing images according to claim 8, characterized in that: The working process of the i-th visual Mamba encoder layer includes: a. Through the normalization layer, the input tag sequence T i-1 Perform normalization operation, denoted as Among them, 1≤i≤l; b. Use a linear layer to normalize the labeled sequence Mapped to x and z with dimensions E; c. Send x to the forward propagation and backward propagation branches for encoding, and combine the bidirectional state space SSM model to obtain the output y of the forward branch forward and the output y of the backward branch backward ; d. Through z, y forward and backward Gating is performed and the gated outputs are added together to obtain the output tag sequence T i .

10. The vehicle detection data enhancement method for UAV remote sensing images according to claim 7, characterized in that: The loss function of the MMLF network is: L all =L1+λ P L P ; Where L1 represents L1 loss, L P represents the perceptual loss, λ P Represents the weight of the perceptual loss.

Citation Information

Patent Citations

  • Optical remote sensing image data enhancement method and target recognition method

    CN112348758A

  • Weak supervision remote sensing image semantic segmentation method and system based on basic model

    CN117456187A

  • Target segmentation method and device for remote sensing image, equipment and storage medium

    CN117934830A

  • Cross-modal deformable medical image registration method and system

    CN118196153A

  • Seismic data denoising method fusing self-attention and Mama architecture

    CN118295029A

Cited By

  • Farmland road automatic segmentation method, system, equipment and medium

    CN119399467A

  • Remote sensing change detection method based on edge enhanced cross attention and multi-dimensional loss

    CN119671934A

  • Industrial abnormal image segmentation method and system based on large model

    CN119693390A

  • Selective state space model road segmentation method based on frequency domain feature compensation

    CN119723078A

  • Remote sensing image segmentation method and system based on Mama architecture

    CN119850654A