Real-time target retrieval method and device based on aerial video of unmanned aerial vehicle

By using ResNet to extract global and local feature vectors in drone aerial videos, and performing two-step screening on the edge computing platform, the problem of too many candidate targets and long feature extraction time is solved, and the retrieval accuracy and real-time performance are improved. .

CN118643186APending Publication Date: 2024-09-13CHENGDU JOUAV DA PENG TECH CO LTD

Patent Information

Application Number
CN202410795550.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

In UAV aerial videos, there are too many candidate targets and the processing time of the feature extraction network is too long, resulting in poor accuracy of one-step screening of global features and slow precision screening of local features, affecting real-time applications.

Method used

By obtaining the global feature vector and local feature vector of the image to be queried, ResNet's Stage3 and Stage4 are used to output specified resolution features for inference, combined with fully connected mapping and pooling operations, the similarity distance between target categories is calculated, and two-step screening is performed. Improve retrieval accuracy and perform feature extraction on the edge computing platform to reduce the amount of calculation.

Benefits of technology

It improves the accuracy of video target retrieval, shortens the feature extraction time, and meets the real-time detection requirements for dozens of candidate targets in a single frame.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643186A
    Figure CN118643186A
Patent Text Reader

Abstract

The invention discloses a real-time target retrieval method and device based on an aerial video of an unmanned aerial vehicle, and the method comprises the steps: building a feature extraction network, obtaining a global feature vector and a local feature vector of a to-be-queried image Query, judging a target type through a target recognition network, transferring to an edge calculation platform, calculating a similarity distance between types, and carrying out the recognition of the similarity distance. Obtaining a distance interval for judging whether the image target exists or not; performing target detection on the sample video, and judging a target category to obtain a candidate target image; filling each candidate target image to construct batches with the same size, and extracting global features and local features of each candidate target image; calculating global feature cosine similarity and local feature cosine similarity, and performing judgment of a first screening process and a second screening process to obtain a target retrieval result; according to the method, the problems of too many candidate targets in each frame of video, too long processing time of a feature extraction network, one-step screening of global features, poor accuracy and quite slow inference speed of fine screening of local features are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target retrieval in unmanned aerial vehicle aerial video, and in particular to a real-time target retrieval method and device based on unmanned aerial vehicle aerial video. Background Art

[0002] Real-time retrieval of drone video targets is to determine whether the Query target exists in the current frame in the airborne aerial video frame by frame after the user uploads the target image Query to be retrieved; if it exists, the position and size of the target in the picture are given. This application is different from target detection and general image retrieval. Target detection determines whether certain categories of targets exist, but does not determine whether specific individuals exist; image retrieval uses all images in the gallery for matching, while this application only uses candidate targets in the video frame for matching. There is no large candidate image gallery, and most of the time there is no target in the picture at all. Image retrieval is to select the images with the highest feature similarity. In addition to matching similarity in each frame, real-time target retrieval also needs to determine whether the image with the highest similarity is the same target as the Query.

[0003] In common image retrieval, after extracting the global features of the query image, it is compared with the global features of all images in the database to calculate the similarity. There are two processing methods: one is a one-step screening, which directly selects the image with the most similar features to the query image from the candidate library; the other is a two-step screening, which selects N images with the closest distance to the query image features from the candidate library, and then calculates the local features of the query target and the N candidate targets, and selects the candidate target with the highest local feature matching. Overall, either the best match is selected directly using global features; or N candidates are selected using global features, and then the target with the most similar local features is selected from the N candidates.

[0004] Another part of image retrieval, after extracting the global features of the Query image, compares it with the M feature cluster centers in the database and finds the cluster center closest to it. This is actually classifying the target, not a true retrieval.

[0005] Global and local feature extraction has been gradually replaced by deep learning networks in recent years. Using only global features for one-step screening has poor accuracy. On the basis of one-step screening, using local features for fine screening has better accuracy. However, local feature extraction often uses an extraction network different from that of global features, and the inference speed is quite slow, which affects real-time applications. Summary of the invention

[0006] The present invention aims to provide a real-time target retrieval method and device based on drone aerial video, so as to solve the problems of too many candidate targets in each frame of video, too long feature extraction network processing time, poor accuracy of one-step screening of global features, and very slow reasoning speed using local feature fine screening.

[0007] In order to achieve the above object, the present invention provides the following method and device:

[0008] The present invention provides a real-time target retrieval method based on unmanned aerial video:

[0009] S1: Get the global feature vector F of the query image Query g and the local feature vector F l , use the target recognition network to determine the target category;

[0010] S2: extracting features from all training samples on the edge computer, calculating the similarity distances between different target categories, and obtaining a distance interval for determining whether the image target exists;

[0011] S3: Detect the target in the sample video using the target detection network, determine the target category, and select an image that is consistent with the category of the query image Query as a candidate target image;

[0012] S4: Fill the candidate target image, construct a batch with an indefinite number of samples, and send it to a feature extraction network to obtain global features and local features of the candidate target image;

[0013] S5: Calculate the global feature cosine similarity between the candidate target image and the query image Query, and perform a first screening process through the distance interval for determining whether the image target exists;

[0014] S6: After the first screening of the candidate targets, calculate the local feature cosine similarity between the candidate target image and the query image Query, and obtain the candidate target image with the largest local feature cosine similarity;

[0015] S7: Perform a second screening process on the distance interval between the candidate target image with the largest local feature cosine similarity and the determination image to determine whether the target exists, and obtain a target retrieval result.

[0016] Preferably, the global feature vector F of the query image Query is obtained g and the local feature vector F lThe steps include: performing one-step reasoning through the specified resolution features output by Stage3 and Stage4 in ResNet, wherein the Stage3 output includes global features and local features, and the Stage4 output includes global features; pooling the global features output by the Stage4, and mapping them to the specified length through full connection to obtain a global feature vector F g ; Pool the global features and local features output by Stage 3, remove the global features, and obtain the local feature vector F by the orthogonal method l ; classify the target Query to be queried to obtain the target category to be queried; preprocess the image Query to be queried, and the preprocessing process includes: successively performing scaling and normalization operations; inputting the preprocessed image into the pre-trained model to obtain the global feature vector F of the image Query to be queried g and the local feature vector F l .

[0017] Preferably, the global features output by the Stage 4 are pooled and mapped to a specified length through full connection to obtain a global feature vector F g The steps include: assuming that the feature map output by Stage 4 is F4, and the F4 output is subjected to universal pooling MePool to obtain a vector map F′4 with a length of 2048, and the formula is:

[0018]

[0019] The vector graph F′4 is mapped to a global feature vector F with a length of 1024 through a fully connected Linear g , the formula is:

[0020] F g =Linea(F′4), c_in=2048, c_out=1024

[0021] Among them, h is the height of the stage4 output feature map, w is the width of the stage4 output feature map, c is the feature map channel number, c_in is the input length of Linear, and c_out is the output length of Linear.

[0022] Preferably, the global features and local features output by the Stage 3 are pooled to remove the global features, and the local feature vector F is obtained by an orthogonal method. l The steps include: assuming that the output feature map of Stage 3 is F3, performing output pooling on F3 to obtain a vector map A with a length of 1024, and the formula is:

[0023] A=AdaptiveAvgPool(F3)

[0024] AdaptiveAvgPool is adaptive average pooling;

[0025] The global features in the vector graph A are removed to obtain a vector graph F′3 containing only local features;

[0026] The local feature vector F is obtained by using the orthogonal method on the vector map F′3 containing only local features. l , the formula is:

[0027]

[0028] Among them, |F g |2 is F g The L2 norm of .

[0029] Preferably, the step of extracting features from all training samples on the edge computer, calculating the similarity distances between different target categories, and obtaining the distance interval for determining whether the image target exists includes: converting the global feature vector F g and the local feature vector F l Merge, map to a vector with a length of N classification number through a fully connected layer in the feature network; after ArcFace operation, calculate softmax, use cross entropy as training loss, and train the classification network; migrate the trained classification network to the edge computing platform, recalculate the similarity distance between the different target categories for all training samples on the edge computing platform, and obtain the distance interval for judging whether the image target exists.

[0030] Preferably, the target recognition network is used to determine the category of the query image Query, and the feature extraction network is used to extract the global feature vector F g and the local feature vector F l The steps include: classifying the target of the query image Query to obtain the target category of the query; preprocessing the query image Query, wherein the preprocessing process includes: successively performing scaling and normalization operations; inputting the preprocessed image into the pre-trained model to obtain the global feature vector F of the query image Query. g and the local feature vector F l .

[0031] Preferably, the step of using a target detection network to perform target detection on a sample video, determine the target category, and select an image that is consistent with the Query category of the image to be queried as a candidate target image includes: intercepting the sample video by frames and performing target detection on each frame to obtain a sample image target; comparing and determining the target category of the sample image in combination with the Query target category of the image to be queried: if the target category of the sample image is the same as the Query target category of the image to be queried, retaining the sample image; if the target category of the sample image is different from the Query target category of the image to be queried, filtering out the sample image.

[0032] Preferably, the step of padding the candidate target image, constructing a batch with an indefinite number of samples, and sending it into a feature extraction network to obtain global features of the candidate target image and local features of the candidate target image includes: normalizing the candidate target image and converting it into a uniform image size; padding the edge of the candidate target image so that the candidate target image has a uniform image edge, and constructing a batch with an indefinite number of samples for the candidate target image; and placing the batch into a feature extraction network to extract global features of the candidate target image and local features of the candidate target image.

[0033] Preferably, the step of calculating the global feature cosine similarity between the candidate target image and the image to be queried Query, and performing a first screening process through the distance interval for judging whether the image target exists, includes: calculating the global feature cosine similarity between the candidate target image and the image to be queried Query to obtain the target global feature cosine similarity; filtering and screening the target global cosine feature similarity through the distance interval for judging whether the image target exists, and performing a first screening process; screening and removing the candidate target images whose target global cosine feature similarity is lower than the distance interval for judging whether the image target exists.

[0034] Preferably, the step of calculating the local feature cosine similarity between the candidate target image and the image to be queried Query after the first screening to obtain the candidate target image with the largest local feature cosine similarity includes: calculating the local feature cosine similarity between the candidate target image and the image to be queried Query to obtain target local feature cosine similarity; establishing a target local feature cosine similarity ranking according to the target local feature cosine similarity; and obtaining the candidate target image with the largest local feature cosine similarity according to the target local feature cosine similarity ranking.

[0035] Preferably, the step of performing a second screening process on the candidate target image with the largest local feature cosine similarity and the distance interval for judging whether the image target exists to obtain the target retrieval result includes: judging the candidate target image with the largest local feature cosine similarity through the distance interval for judging whether the image target exists; if the candidate target image with the largest local feature cosine similarity exceeds the distance interval for judging whether the image target exists, the target image is retrieved; if the candidate target image with the largest local feature cosine similarity does not exceed the distance interval for judging whether the image target exists, the target image is not retrieved.

[0036] The present invention provides a real-time target retrieval device based on unmanned aerial vehicle aerial video, characterized in that the device comprises:

[0037] Acquisition module: acquires the global feature vector and local feature vector of the query image Query;

[0038] Feature conversion module: converts global features and local features into feature vector graphs;

[0039] Distance generation module: Migrate the feature extraction network to the edge computing platform, calculate the similarity distance between target categories, and obtain the distance interval for judging whether the image target exists;

[0040] Target category screening module: screening candidate targets that are consistent with the Query category of the image to be queried frame by frame in the video image;

[0041] Image filling module: fills the candidate targets, constructs a batch and sends it to the feature extraction network to obtain the global features and local features of the candidate target images;

[0042] The first screening module: calculates the global feature cosine similarity between the candidate target image and the query image Query and the distance interval between the image target to be judged to determine whether it exists;

[0043] The second screening module: calculates the local feature cosine similarity between the candidate target image and the query image Query and the distance interval for judging whether the image target exists to obtain the retrieval result.

[0044] The beneficial effect of the present invention is embodied in that: a global feature vector F of the image to be queried is obtained by outputting a specified resolution through Stage 3 and Stage 4 in ResNet and performing a one-step reasoning process. g and the local feature vector F l, and then perform universal pooling on the Stage 4 output feature map to obtain a vector map, and obtain the global feature vector F through full connection mapping g , perform output pooling on the Stage 3 output feature map and use the orthogonal method to obtain the local feature vector F l , one inference process outputs global features and local features, taking advantage of the double matching of global features and local features, and consuming the same time as global feature matching. g and the local feature vector F l A feature extraction network is established to calculate the similarity distance between categories and obtain the distance interval for judging whether the image target exists. Based on the edge computing platform, a reasonable category similarity distance threshold is obtained using the training data set to avoid missed detection or false detection caused by too large or too small a threshold. The target detection network is used to detect targets in sample videos, and targets with the same category as the Query are retained as candidate targets, reducing the computational complexity of the feature extraction network. After constructing a batch, the feature extraction network is used to obtain the global features of the target image and the local features of the candidate target image. The first screening process is performed through the global feature cosine similarity between the candidate target image and the image to be queried Query, and the second screening process is performed through the local feature cosine similarity between the candidate target image and the image to be queried Query. The two-step matching of global and local features improves the accuracy of video target retrieval compared to matching using only global features, further reducing the number of outputs of the feature extraction network, and can meet the real-time detection of dozens of candidate targets in a single frame. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.

[0046] Figure 1 It is a schematic diagram of the steps of a real-time target retrieval method based on unmanned aerial vehicle aerial video provided by an embodiment of the present invention.

[0047] Figure 2 The present invention provides a flowchart of a method for real-time target retrieval based on unmanned aerial vehicle aerial video.

[0048] Figure 3 It is a structural schematic diagram of a real-time target retrieval device based on unmanned aerial vehicle aerial video provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following embodiments of the technical solution of the present invention are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and are therefore only used as examples, and cannot be used to limit the protection scope of the present invention.

[0050] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by those skilled in the art to which the present invention belongs.

[0051] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0052] In common image retrieval, after extracting the global features of the query image, it is compared with the global features of all images in the database to calculate the similarity. There are two processing methods: one is a one-step screening, which directly selects the image with the most similar features to the query image from the candidate library; the other is a two-step screening, which selects N images with the closest distance to the query image features from the candidate library, and then calculates the local features of the query target and the N candidate targets, and selects the candidate target with the highest local feature matching. Overall, either the best match is selected directly using global features; or N candidates are selected using global features, and then the target with the most similar local features is selected from the N candidates.

[0053] Another part of image retrieval, after extracting the global features of the Query image, compares it with the M feature cluster centers in the database and finds the cluster center closest to it. This is actually classifying the target, not a true retrieval.

[0054] Global and local feature extraction has been gradually replaced by deep learning networks in recent years. Using only global features for one-step screening has poor accuracy. On the basis of one-step screening, using local features for fine screening has better accuracy. However, local feature extraction often uses an extraction network different from that of global features, and the inference speed is quite slow, which affects real-time applications.

[0055] The present invention aims to provide a real-time target retrieval method and device based on drone aerial video, so as to solve the problems of too many candidate targets in each frame of video, too long feature extraction network processing time, poor accuracy of one-step screening of global features, and very slow reasoning speed using local feature fine screening.

[0056] Embodiment 1:

[0057] The specific embodiment of the present invention provides a real-time target retrieval method based on unmanned aerial video. Figure 1 , Figure 2 As shown, the following steps are included:

[0058] In step S1, the global feature vector F of the query image Query is obtained. g and the local feature vector F l Use the object recognition network to determine the target category.

[0059] In the embodiment of the present invention, one-step reasoning is performed by outputting the specified resolution features through Stage3 and Stage4 in ResNet, wherein the Stage3 output includes global features and local features, and the Stage4 output includes global features; the global features output by the Stage4 are pooled and mapped to the specified length through full connection to obtain the global feature vector F g ; Pool the global features and local features output by Stage 3, remove the global features, and obtain the local feature vector F by the orthogonal method l ,ResNet is a widely used CNN network. Stage 3 outputs a feature map with 1024 channels and a resolution of 1 / 16 of the original image. It contains more details and can be considered to contain global and local features. Based on Stage 3, Stage 4 outputs a feature map with 2048 channels and a resolution of 1 / 32 of the original image. It can be considered that the network extracts global features from it;

[0060] Assume that the output feature map of Stage 4 is F4, and the F4 output is subjected to universal pooling MePool to obtain a vector map F′4 with a length of 2048. The formula is:

[0061]

[0062] The F′4 is mapped to a global feature vector F with a length of 1024 through a fully connected Linear map g , the formula is:

[0063] F g =Linea(F′4), c_in=2048, c_out=1024

[0064] Among them, h is the height of the stage4 output feature map, w is the width of the stage4 output feature map, c is the feature map channel number, c_in is the input length of Linear, and c_out is the output length of Linear;

[0065] Assume that the output feature map of Stage 3 is F3, and perform output pooling on F3 to obtain a vector map A with a length of 1024. The formula is:

[0066] A=AdaptiveAvgPool(F3)

[0067] AdaptiveAvgPool is adaptive average pooling;

[0068] The global features in the vector graph A are removed to obtain a vector graph F′3 containing only local features;

[0069] The local feature vector F is obtained by using the orthogonal method on the vector map F′3 containing only local features. l , the formula is:

[0070]

[0071] Among them, |F g |2 is F g The L2 norm of l is the local eigenvector; the meaning of the above formula is to first convert F′3 to F g Directional projection, the resulting projection is the global feature contained in F′3, and F′3 is decomposed into local feature vectors F l and the projection.

[0072] Extract the global feature vector F from the query image Query g and the local feature vector F l; load a pre-trained model through the network; train the pre-trained model on large-scale image data to extract high-level features in the image; pre-process the query image Query, the pre-processing process includes: scaling and normalization operations, image scaling is to adjust the size of the digital image, balance the processing efficiency and the smoothness and clarity of the result, make the pixel visibility of the image higher, enhance its smoothness and clarity; image normalization is to use the invariant moment of the image to find a set of parameters that can eliminate the influence of other transformation functions on the image transformation, and convert it into a unique standard form to offset Anti-affine transformation, avoid the input variables with different physical meanings and dimensions cannot be used equally, prevent the neuron output saturation caused by the excessive absolute value of the net input, and ensure that the small values ​​in the output data are not swallowed. First, use the moment in the image that is invariant to the affine transformation to determine the parameters of the transformation function, and then use the transformation function determined by this parameter to transform the original image into a standard form of the image. The image normalization process includes 4 steps, namely coordinate centering, X-shearing normalization, scaling normalization and rotation normalization. For example: after the expression image is cut by feature blocks, the feature blocks generated by cutting are of different sizes. At this time, it is necessary to take a normalization operation to unify the size of the feature block image; in order to facilitate the calculation of subsequent feature extraction and reduce the dimension of the feature, the feature block image is normalized to an image of 2028 pixels in the experimental simulation, that is, if the size of the feature block image after cutting is not 2028 pixels, they are normalized to 2028 pixels; the reason why the feature block image is normalized to 2028 pixels is that the shape of the feature block is rectangular, which is more in line with the natural form of the feature block. Normalization is to convert the image into a floating point representation and remove the influence of lighting and contrast.

[0073] The feature downsampling is achieved through the pooling layer to reduce the size of the feature map, the pooled feature map is input into the fully connected layer, the feature description is achieved through the fully connected layer, the nonlinear mapping of the feature is achieved through the activation function, and the image classification or regression task is achieved through the output layer; the preprocessed image is input into the pre-trained model to obtain the global feature vector F of the image to be queried g and the local feature vector F l .

[0074] In step S2, feature extraction is performed on all training samples on the edge computer, and the similarity distances between different target categories are calculated to obtain a distance interval for determining whether the image target exists.

[0075] In the embodiment of the present invention, by extracting the global feature vector F g and the local feature vector F l The network needs to be trained with a proxy classification task; gand F l Merge, map to a vector with a length of N, the number of categories, through a fully connected layer, and calculate softmax after ArcFace operation, using cross entropy as training loss; migrate the trained classification network to the edge computing platform, recalculate the similarity distance between the target categories for all training samples on the edge computing platform, and obtain the distance interval for judging whether the image target exists;

[0076] In step S3, the target detection network is used to perform target detection on the sample video, and the target category is determined, and an image that is consistent with the category of the query image Query is selected as a candidate target image.

[0077] In an embodiment of the present invention, the sample video is frame-cut and target detection is performed on each frame image to obtain a sample image target; the target category of the sample image is compared and judged in combination with the target category of the image to be queried Query: if the target category of the sample image is the same as the target category of the image to be queried Query, the sample image is retained; if the target category of the sample image is different from the target category of the image to be queried Query, the sample image is filtered out. This step can reduce the computational complexity of the feature extraction network.

[0078] In step S4, the candidate target image is padded to construct a batch with an indefinite number of samples, and is sent to a feature extraction network to obtain global features of the candidate target image and local features of the candidate target image.

[0079] In an embodiment of the present invention, the candidate target image is normalized to a normalized image size, and the candidate target image is converted into a uniform image size; the edge of the candidate target image is filled so that the candidate target image has a uniform image edge, and the method of filling the edge of the image includes a constant method, which fills the expanded boundary value with a constant pixel value, and a symmetric method, that is, taking the edge pixel as the axis, symmetrically copying and repeatedly filling, that is, repeating the edge pixel value of the image, and expanding the new boundary pixel value with the edge pixel value; the candidate target images are grouped into a batch; the batch is placed in the feature extraction network to extract the global features of the candidate target image and the local features of the candidate target image.

[0080] In step S5, the global feature cosine similarity between the candidate target image and the query image Query is calculated, and a first screening process is performed through the distance interval for determining whether the image target exists.

[0081] In an embodiment of the present invention, the global feature cosine similarity between the candidate target image and the image to be queried Query is calculated to obtain the target global feature cosine similarity; the target global cosine feature similarity is filtered and screened by the distance interval for judging whether the image target exists, and a first screening process is performed; the candidate target images whose target global cosine feature similarity is lower than the similarity of the distance interval for judging whether the image target exists are screened and removed.

[0082] In step S6, after the first screening of the candidate targets, the local feature cosine similarity between the candidate target image and the query image Query is calculated to obtain the candidate target image with the largest local feature cosine similarity.

[0083] In an embodiment of the present invention, the local feature cosine similarity between the candidate target image and the query image Query is calculated to obtain the target local feature cosine similarity; a target local feature cosine similarity ranking is established according to the target local feature cosine similarity; and the candidate target image with the largest local feature cosine similarity is obtained according to the target local feature cosine similarity ranking.

[0084] In step S7, a second screening process is performed on the distance interval between the candidate target image with the largest local feature cosine similarity and the determination image target to obtain a target retrieval result.

[0085] In an embodiment of the present invention, the candidate target image with the largest local feature cosine similarity is judged by the distance interval for judging whether the image target exists; if the candidate target image with the largest local feature cosine similarity exceeds the distance interval for judging whether the image target exists, the target image is retrieved; if the candidate target image with the largest local feature cosine similarity does not exceed the distance interval for judging whether the image target exists, the target image is not retrieved.

[0086] Embodiment 2

[0087] The specific embodiment of the present invention provides a real-time target retrieval device based on drone aerial video. Figure 3 As shown, it includes the following modules:

[0088] Acquisition module: acquires the global feature vector and local feature vector of the query image Query;

[0089] Feature conversion module: converts global features and local features into feature vector graphs;

[0090] Distance generation module: Migrate the feature extraction network to the edge computing platform, calculate the similarity distance between target categories, and obtain the distance interval for judging whether the image target exists;

[0091] Target category screening module: screening candidate targets that are consistent with the Query category of the image to be queried frame by frame in the video image;

[0092] Image filling module: fills the candidate targets, constructs a batch and sends it to the feature extraction network to obtain the global features and local features of the candidate target images;

[0093] The first screening module: calculates the global feature cosine similarity between the candidate target image and the query image Query and the distance interval between the image target to be judged to determine whether it exists;

[0094] The second screening module: calculates the local feature cosine similarity between the candidate target image and the query image Query and the distance interval for judging whether the image target exists to obtain the retrieval result.

[0095] In an embodiment of the present invention, an acquisition module extracts global features and local features through ResNet and then inputs them into a feature conversion module to convert the global features and local features into a feature vector graph; a feature extraction network is established through a distance generation module and migrated to an edge computing platform, and the similarity distance between categories is calculated to obtain a distance interval for judging whether an image target exists; a target category screening module is used to obtain target categories of a query image Query and a sample video; an image filling module is used to fill and transform the candidate target image to obtain global features of the candidate target image and local features of the candidate target image; finally, a first screening module is used to calculate the global feature cosine similarity between the candidate target image and the query image Query and jointly judge the distance interval for judging whether an image target exists to complete a first screening and judgment process; a second screening module is used to calculate the local feature cosine similarity between the candidate target image and the query image Query and the distance interval for judging whether an image target exists to perform a second screening and judgment process to obtain a retrieval result.

[0096] The beneficial effect of the present invention is embodied in that: a global feature vector F of the image to be queried is obtained by outputting a specified resolution through Stage 3 and Stage 4 in ResNet and performing a one-step reasoning process. g and the local feature vector F l , and then perform universal pooling on the Stage 4 output feature map to obtain a vector map, and obtain the global feature vector F through full connection mapping g, perform output pooling on the Stage 3 output feature map and use the orthogonal method to obtain the local feature vector F l , one inference process outputs global features and local features, taking advantage of the double matching of global features and local features, and consuming the same time as global feature matching. g and the local feature vector F l A feature extraction network is established to calculate the similarity distance between categories and obtain the distance interval for judging whether the image target exists. Based on the edge computing platform, a reasonable category similarity distance threshold is obtained using the training data set to avoid missed detection or false detection caused by too large or too small a threshold. The target detection network is used to detect targets in sample videos, and targets with the same category as the Query are retained as candidate targets, reducing the computational complexity of the feature extraction network. After constructing a batch, the feature extraction network is used to obtain the global features of the target image and the local features of the candidate target image. The first screening process is performed through the global feature cosine similarity between the candidate target image and the image to be queried Query, and the second screening process is performed through the local feature cosine similarity between the candidate target image and the image to be queried Query. The two-step matching of global and local features improves the accuracy of video target retrieval compared to matching using only global features, further reducing the number of outputs of the feature extraction network, and can meet the real-time detection of dozens of candidate targets in a single frame.

[0097] The above is only an embodiment of the present invention, and the common knowledge such as the known specific technical solutions or characteristics in the solution is not described in detail here. It should be pointed out that for those skilled in the art, without departing from the solution of the present invention, several modifications and improvements can be made, which should also be regarded as the protection scope of the present invention, and these will not affect the effect of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. A real-time target retrieval method based on drone aerial video, characterized in that: The method comprises: S1: Get the global feature vector F of the query image Query g and the local feature vector F l , use the target recognition network to determine the target category; S2: extracting features from all training samples on the edge computer, calculating the similarity distances between different target categories, and obtaining a distance interval for determining whether the image target exists; S3: Detect the target in the sample video using the target detection network, determine the target category, and select an image that is consistent with the category of the query image Query as a candidate target image; S4: Fill the candidate target image, construct a batch with an indefinite number of samples, and send it to a feature extraction network to obtain global features and local features of the candidate target image; S5: Calculate the global feature cosine similarity between the candidate target image and the query image Query, and perform a first screening process through the distance interval for judging whether the image target exists; S6: After the first screening of the candidate targets, calculate the local feature cosine similarity between the candidate target image and the query image Query, and obtain the candidate target image with the largest local feature cosine similarity; S7: Perform a second screening process on the distance interval between the candidate target image with the largest local feature cosine similarity and the determination image to determine whether the target exists, and obtain a target retrieval result.

2. The method for real-time target retrieval based on drone aerial video according to claim 1 is characterized in that: Get the global feature vector F of the query image Query g and the local feature vector F l The steps include: One-step reasoning is performed by outputting the specified resolution features through Stage3 and Stage4 in ResNet, wherein the Stage3 output includes global features and local features, and the Stage4 output includes global features; The global features output by Stage 4 are pooled and mapped to the specified length through full connection to obtain the global feature vector F g ; Pool the global features and local features output by Stage 3, remove the global features, and obtain the local feature vector F by the orthogonal method. l ; Performing target classification on the image to be queried Query to obtain a target category to be queried; Preprocessing the image Query to be queried, wherein the preprocessing process includes successively performing scaling and normalization operations; The preprocessed image is input into the pre-trained model to obtain the global feature vector F of the query image Query. g and the local feature vector F l .

3. The method for real-time target retrieval based on drone aerial video according to claim 2 is characterized in that: The global features output by Stage 4 are pooled and mapped to a specified length through full connection to obtain a global feature vector F g The steps include: Assume that the output feature map of Stage 4 is F4, and the F4 output is subjected to universal pooling MePool to obtain a vector map F′4 with a length of 2048. The formula is: The vector graph F′4 is mapped to a global feature vector F with a length of 1024 through a fully connected Linear g , the formula is: F g =Linear(F4),c_in=2048,c_out=1024 Among them, h is the height of the stage4 output feature map, w is the width of the stage4 output feature map, c is the feature map channel number, c_in is the input length of Linear, and c_out is the output length of Linear.

4. The method for real-time target retrieval based on drone aerial video according to claim 3 is characterized in that: The step of pooling the global features and local features output by the Stage 3, removing the global features, and obtaining the local feature vector F1 by an orthogonal method includes: Assume that the output feature map of Stage 3 is F3, and perform output pooling on F3 to obtain a vector map A with a length of 1024. The formula is: A=AdaptiveAvgPool(F3) AdaptiveAvgPool is adaptive average pooling; The global features in the vector diagram A are removed to obtain a vector diagram F3′ containing only local features; The local feature vector F is obtained by using the orthogonal method on the vector map F3′ containing only local features. l , the formula is: Among them, |F g |2 is F g The L2 norm of .

5. The method for real-time target retrieval based on drone aerial video according to claim 4 is characterized in that: The step of extracting features from all training samples on the edge computer, calculating the similarity distances between different target categories, and obtaining a distance interval for determining whether an image target exists includes: The global feature vector F g and the local feature vector F l Merge, and map it to a vector of length N, the number of categories, through a fully connected layer in the feature network; After the ArcFace operation, the softmax is calculated, and the cross entropy is used as the training loss to train the classification network; The trained classification network is migrated to an edge computing platform, and the similarity distance between the target categories is recalculated for all training samples on the edge computing platform to obtain the distance interval for determining whether the image target exists.

6. The method for real-time target retrieval based on drone aerial video according to claim 1, characterized in that: The step of using the target detection network to perform target detection on the sample video, determining the target category, and selecting an image consistent with the category of the query image Query as a candidate target image includes: Cut the sample video by frames and perform target detection on each frame image to obtain a sample image target; Compare and judge the target category of the sample image with the target category of the query image: If the target category of the sample image is the same as the target category of the query image, retain the sample image; If the target category of the sample image is different from the target category of the query image, the sample image is filtered out.

7. The method for real-time target retrieval based on drone aerial video according to claim 6 is characterized in that: The step of padding the candidate target image, constructing a batch with an indefinite number of samples, and sending the batch to a feature extraction network to obtain global features and local features of the candidate target image includes: Normalizing the candidate target image and converting it into a uniform image size; Filling the edge of the candidate target image so that the candidate target image has a uniform image edge, and constructing a batch with an unfixed number of samples of the candidate target image; The batch is put into a feature extraction network to extract global features of the candidate target image and local features of the candidate target image.

8. The method for real-time target retrieval based on drone aerial video according to claim 7 is characterized in that: The step of calculating the global feature cosine similarity between the candidate target image and the query image Query, and performing a first screening process through the distance interval for determining whether the image target exists, comprises: Calculate the global feature cosine similarity between the candidate target image and the query image Query to obtain the target global feature cosine similarity; The first screening process is performed by filtering and screening the target global cosine feature similarity through the distance interval for judging whether the image target exists; The candidate target images whose target global cosine feature similarity is lower than the distance interval for determining whether the image target exists are screened and removed.

9. The method for real-time target retrieval based on drone aerial video according to claim 8, characterized in that: The step of calculating the local feature cosine similarity between the candidate target image and the query image Query after the first screening, and obtaining the candidate target image with the largest local feature cosine similarity, comprises: Calculate the local feature cosine similarity between the candidate target image and the query image Query to obtain the target local feature cosine similarity; Establishing a target local feature cosine similarity ranking according to the target local feature cosine similarity; The candidate target image having the largest local feature cosine similarity is obtained by sorting the target local feature cosine similarity.

10. The method for real-time target retrieval based on drone aerial video according to claim 9, characterized in that: The step of performing a second screening process on the distance interval between the candidate target image with the largest local feature cosine similarity and the judgment image target to obtain the target retrieval result comprises: Judging the candidate target image with the largest local feature cosine similarity by using the distance interval for judging whether the image target exists; If the candidate target image with the largest local feature cosine similarity exceeds the distance interval for determining whether the image target exists, the target image is retrieved; If the candidate target image with the largest local feature cosine similarity does not exceed the distance interval for determining whether the image target exists, the target image is not retrieved.

11. A real-time target retrieval device based on drone aerial video, characterized in that: The device comprises: Acquisition module: acquires the global feature vector and local feature vector of the query image Query; Feature conversion module: converts global features and local features into feature vector graphs; Distance generation module: Migrate the feature extraction network to the edge computing platform, calculate the similarity distance between target categories, and obtain the distance interval for judging whether the image target exists; Target category screening module: screening candidate targets that are consistent with the Query category of the image to be queried frame by frame in the video image; Image filling module: fills the candidate targets, constructs a batch and sends it to the feature extraction network to obtain the global features and local features of the candidate target images; The first screening module: calculates the global feature cosine similarity between the candidate target image and the query image Query and the distance interval between the image target to be judged to determine whether it exists; The second screening module: calculates the local feature cosine similarity between the candidate target image and the query image Query and the distance interval for judging whether the image target exists to obtain the retrieval result.

Citation Information

Patent Citations

  • Image retrieval method, device and equipment and readable storage medium

    CN109857889A

  • Pedestrian retrieval method and system for full-picture monitoring scene

    CN110781350A

  • Image retrieval method and device, equipment and storage medium

    CN113239226A

  • Image retrieval method and device, electronic equipment and storage medium

    CN113849679A

Cited By

  • Small sample ancient character recognition method based on structural features and evolution modes

    CN119206739A