Target tracking method and system, electronic equipment and storage medium
By using a self-designed feature extraction model to replace the residual network structure under high-altitude aerial photography conditions, the problem of slow multi-target tracking and detection caused by insufficient UAV hardware computing power is solved, and the efficiency and accuracy of visual target tracking are improved.
Patent Information
- Application Number
- CN202410500586.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2024-09-10
AI Technical Summary
Under high-altitude aerial photography conditions, UAV hardware has insufficient computing power. When faced with multi-target tracking and detection, the existing re-identification model relies on the residual network structure, and the inference speed is slow, resulting in low visual target tracking efficiency.
A self-designed feature extraction model is used, including sequentially connected convolution modules, fusion modules, transition modules, pooling modules and connection modules, to replace the residual network structure for target detection and feature extraction, improving the inference speed of target tracking and detection.
Through the self-designed feature extraction model, the efficiency of visual target tracking is improved, the amount of calculation is reduced, the quality and accuracy of feature extraction by the model are improved, and it adapts to the needs of multi-target tracking under high-altitude aerial photography conditions.
Smart Images

Figure CN118628526A
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a target tracking method and system, an electronic device and a storage medium. Background Art
[0002] Visual target tracking refers to extracting features of moving targets in a video given an area of interest (such as a person, vehicle, etc.) in the initial frame of a video, and predicting the position and size of the moving target in future time frames based on the extracted target features, thereby completing the target tracking task.
[0003] Under the condition of high-altitude aerial photography, the hardware computing power of the drone is often insufficient, and there are many shooting targets, so the re-identification model needs to be called multiple times for calculation. However, most of the current re-identification models rely on residual network structures to achieve feature extraction, and the reasoning speed is slow when facing multi-target tracking detection, thereby reducing the efficiency of visual target tracking. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a target tracking method and system, an electronic device and a storage medium, aiming to improve the reasoning speed of target tracking detection, thereby improving the efficiency of visual target tracking.
[0005] To achieve the above object, a first aspect of an embodiment of the present application provides a target tracking method, the method comprising:
[0006] Acquire a target acquisition image to be tracked;
[0007] Performing object detection on the target acquisition image based on a preset target detection network to obtain a detection frame of the target tracking object on the target acquisition image and geometric information of the detection frame; wherein the size of the detection frame is within a preset size range;
[0008] Based on a preset feature extraction model, feature extraction is performed on the area corresponding to the detection frame to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence;
[0009] Matching processing is performed based on the geometric information, the target feature and the historical object data of multiple historical tracking objects to obtain a historical tracking object corresponding to the target tracking object, and the historical object data corresponding to the historical tracking object is updated based on the target feature.
[0010] In some embodiments, extracting features from the area corresponding to the detection frame based on a preset feature extraction model to obtain target features includes:
[0011] Inputting the area corresponding to the detection frame into the first convolution module to obtain a first feature;
[0012] Inputting the first feature into the first fusion module to obtain a second feature;
[0013] Inputting the second feature into the first transition module to obtain a third feature;
[0014] Inputting the third feature into the second fusion module to obtain a fourth feature;
[0015] Inputting the fourth feature into the second transition module to obtain a fifth feature;
[0016] Inputting the fifth feature into the third fusion module to obtain a sixth feature;
[0017] Inputting the sixth feature into the second convolution module to obtain a seventh feature;
[0018] Inputting the seventh feature into the pooling module to obtain an eighth feature;
[0019] The eighth feature is input into the connection module to obtain the target feature.
[0020] In some embodiments, the first fusion module includes three cascaded fusion modules; and inputting the first feature into the first fusion module to obtain the second feature includes:
[0021] Inputting the first feature into the first fusion module of the three cascaded fusion modules to obtain a first fusion feature;
[0022] Inputting the first fusion feature into a second fusion module of three cascaded fusion modules to obtain a second fusion feature;
[0023] The second fusion feature is input into the third fusion module of the three cascaded fusion modules to obtain the second feature.
[0024] In some embodiments, the fusion module includes a first processing module, a second processing module, a third processing module, and a fourth processing module; the inputting the first feature into the first fusion module of the three cascaded fusion modules to obtain the first fusion feature includes:
[0025] Performing a first convolution process on the first feature to obtain a first sub-feature;
[0026] Inputting the first sub-feature into the first processing module to obtain a first processing result;
[0027] Inputting the first sub-feature into the second processing module to obtain a second processing result;
[0028] Inputting the first sub-feature into the third processing module to obtain a third processing result;
[0029] Inputting the first sub-feature into the fourth processing module to obtain a fourth processing result;
[0030] Perform a first fusion process based on the first processing result and the second processing result to obtain a fifth processing result;
[0031] Performing a second fusion process based on the third processing result, the fourth processing result, and the fifth processing result to obtain a sixth processing result;
[0032] A third fusion process is performed based on the sixth processing result and the first feature to obtain the first fusion feature.
[0033] In some embodiments, the first processing module includes a first sub-convolution module, a second sub-convolution module, a third sub-convolution module, and a first maximum pooling module; inputting the first sub-feature into the first processing module to obtain a first processing result includes:
[0034] Inputting the first sub-feature into the first sub-convolution module to obtain a first sub-convolution feature;
[0035] Inputting the first sub-convolution feature into the second sub-convolution module to obtain a second sub-convolution feature;
[0036] Inputting the first sub-convolution feature into the third sub-convolution module to obtain a third sub-convolution feature;
[0037] Adding the second sub-convolution feature and the third sub-convolution feature to obtain a first added feature;
[0038] Inputting the first added feature into the first maximum pooling module to obtain a first maximum pooling feature;
[0039] Perform dot multiplication processing on the first added feature and the first maximum pooling feature to obtain the first processing result.
[0040] In some embodiments, the third processing module includes a first feature extraction module, a second feature extraction module, a third feature extraction module, and a first average pooling module; the step of inputting the first sub-feature into the third processing module to obtain a third processing result includes:
[0041] Inputting the first sub-feature into the first feature extraction module to obtain a first extracted feature;
[0042] Inputting the first extracted features into the second feature extraction module to obtain second extracted features;
[0043] Inputting the second extracted features into the third feature extraction module to obtain third extracted features;
[0044] Inputting the third extracted feature into the first average pooling module to obtain a first average pooling feature;
[0045] Perform dot multiplication processing on the third extracted feature and the first average pooling feature to obtain the third processing result.
[0046] In some embodiments, before acquiring the collected image, the method further includes:
[0047] Training the target detection network includes:
[0048] Inputting the sample acquisition image into the initial detection network for object detection, and obtaining a sample detection frame of the sample tracking object in the sample acquisition image, wherein the initial detection model includes multiple feature layers, and the sample detection frame includes multiple layer sample detection frames corresponding to each feature layer;
[0049] For each of the feature layers, a receptive field calculation is performed according to each of the layer sample detection frames to obtain a receptive field, and a fitting calculation is performed according to a plurality of preset label tracking objects to obtain a fitted Gaussian two-dimensional feature ellipse; the receptive field corresponds to the layer sample detection frame one-to-one, and the fitted Gaussian two-dimensional feature ellipse corresponds to the label tracking object one-to-one;
[0050] At each of the feature layers, performing a difference calculation on each of the receptive fields and each of the fitted Gaussian two-dimensional feature ellipses to obtain a difference matrix;
[0051] Perform matching processing on each of the layer sample detection frames and each of the label tracking objects based on the difference matrix, and determine a positive sample of each of the label tracking objects from a plurality of the layer sample detection frames;
[0052] The parameters of the initial detection network are adjusted based on the positive samples to obtain the target detection network.
[0053] To achieve the above object, a second aspect of an embodiment of the present application provides a target tracking system, the system comprising:
[0054] An image acquisition module is used to acquire an image of a target to be tracked;
[0055] An object detection module is used to perform object detection on the target acquisition image based on a preset target detection network, and obtain a detection frame of the target tracking object on the target acquisition image, and geometric information of the detection frame; wherein the size of the detection frame is within a preset size range;
[0056] A feature extraction module, used to extract features from the area corresponding to the detection frame based on a preset feature extraction model to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence;
[0057] The matching update module is used to perform matching processing based on the geometric information, target features and historical object data of multiple historical tracking objects to obtain a historical tracking object corresponding to the target tracking object, and update the historical object data corresponding to the historical tracking object based on the target features.
[0058] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0059] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0060] The target tracking method and system, electronic device and storage medium proposed in the present application obtain a target acquisition image to be tracked; perform object detection on the target acquisition image based on a preset target detection network to obtain a detection frame of the target tracking object on the target acquisition image and geometric information of the detection frame; wherein the size of the detection frame is within a preset size range; perform feature extraction on the area corresponding to the detection frame based on a preset feature extraction model to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence; perform matching processing based on geometric information, target features and historical object data of multiple historical tracking objects to obtain a historical tracking object corresponding to the target tracking object, and update the historical object data corresponding to the historical tracking object based on the target features. This method improves the inference speed of target tracking detection by replacing the residual network structure with a self-designed feature extraction model, thereby improving the efficiency of visual target tracking. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 is a flow chart of a target tracking method provided by an embodiment of the present application;
[0062] Figure 2 is a flow chart of training a target detection network in a target tracking method provided in an embodiment of the present application;
[0063] Figure 3 yes Figure 1 Flow chart of step S103;
[0064] Figure 4 yes Figure 3 Flow chart of step S302;
[0065] Figure 5 yes Figure 4 Flow chart of step S401 in FIG.
[0066] Figure 6 yes Figure 5 Flow chart of step S502;
[0067] Figure 7 yes Figure 5 Flow chart of step S504;
[0068] Figure 8 It is a specific structural diagram of the feature extraction network in the target tracking method provided in the embodiment of the present application;
[0069] Fig. 9 is a specific structural diagram of the fusion module in the target tracking method provided in the embodiment of the present application;
[0070] Fig.10 is a schematic diagram of the structure of a target tracking system provided in an embodiment of the present application;
[0071] Fig.11 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0073] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0074] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0075] First, some nouns involved in this application are analyzed:
[0076] Artificial Intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0077] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages (such as Chinese and English). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.
[0078] Information Extraction: A text processing technology that extracts specified types of entity, relationship, event and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data are all text information extraction. Of course, the information extracted by text information extraction technology can be various types of information.
[0079] Visual target tracking refers to extracting features of moving targets in a video given an area of interest (such as a person, vehicle, etc.) in the initial frame of a video, and predicting the position and size of the moving target in future time frames based on the extracted target features, thereby completing the target tracking task.
[0080] Under the condition of high-altitude aerial photography, the hardware computing power of the drone is often insufficient, and there are many shooting targets, so the re-identification model needs to be called multiple times for calculation. However, most of the current re-identification models rely on residual network structures to achieve feature extraction, and the reasoning speed is slow when facing multi-target tracking detection, thereby reducing the efficiency of visual target tracking.
[0081] Based on this, the embodiments of the present application provide a target tracking method and system, an electronic device and a storage medium, which aim to improve the reasoning speed of target tracking detection, thereby improving the efficiency of visual target tracking.
[0082] The target tracking method and system, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the target tracking method in the embodiments of the present application is described.
[0083] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0084] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0085] The target tracking method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The target tracking method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the target tracking method, etc., but is not limited to the above forms.
[0086] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0087] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the identity or characteristics of the object, such as object information, object behavior data, object historical data, and object location information, the permission or consent of the object will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain sensitive personal information of the object, the separate permission or separate consent of the object will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the separate permission or separate consent of the object, the necessary object-related data for the normal operation of the embodiment of the present application will be obtained.
[0088] See also Figure 1 , Figure 1 is an optional flowchart of the target tracking method provided in the embodiment of the present application. Figure 1The method may include but is not limited to steps S101 to S104:
[0089] Step S101, obtaining a captured image of a target to be tracked;
[0090] Step S102, performing object detection on the target acquisition image based on a preset target detection network, obtaining a detection frame of the target tracking object on the target acquisition image, and geometric information of the detection frame; wherein the size of the detection frame is within a preset size range;
[0091] Step S103, extracting features from the area corresponding to the detection frame based on a preset feature extraction model to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence;
[0092] Step S104 , performing matching processing based on the geometric information, the target features and the historical object data of the multiple historical tracking objects to obtain the historical tracking object corresponding to the target tracking object, and updating the historical object data corresponding to the historical tracking object based on the target features.
[0093] Steps S101 to S104 shown in the embodiment of the present application are to obtain a target acquisition image to be tracked; perform object detection on the target acquisition image based on a preset target detection network to obtain a detection frame of the target tracking object on the target acquisition image and geometric information of the detection frame; wherein the size of the detection frame is within a preset size range; perform feature extraction on the area corresponding to the detection frame based on a preset feature extraction model to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence; perform matching processing based on geometric information, target features, and historical object data of multiple historical tracking objects to obtain a historical tracking object corresponding to the target tracking object, and update the historical object data corresponding to the historical tracking object based on the target features. This method improves the inference speed of target tracking detection by replacing the residual network structure with a self-designed feature extraction model, thereby improving the efficiency of visual target tracking.
[0094] In step S101 of some embodiments, the target acquisition image to be tracked refers to image data including the target tracking object to be tracked. Among them, the target tracking object can be various objects such as people or cars. The target acquisition image to be tracked can be image data obtained by aerial photography using a drone equipped with a gimbal camera. The target acquisition image to be tracked can be used as training data for a neural network. In order to improve the generalization of the neural network and adapt to different weather, terrain, different altitude and other usage scenarios, through multi-batch, multi-scene, multi-climate scene shooting, etc., the object category to be tracked is image data collected to train the neural network based on the collected image data. The target acquisition image to be tracked can also be image data obtained by image enhancement of aerial images, wherein the image enhancement technology includes multi-scale transformation technology, mosaic image random cropping and splicing technology, image fusion technology, etc. The target acquisition image to be tracked can also be image data obtained by cutting images in a data set from a public data set through a script, which can increase the scene diversity of the image, wherein the data set can be an xView data set.
[0095] In step S102 of some embodiments, the preset target detection network is obtained based on training the initial detection network. The target detection network is used to perform object detection on the target acquisition image to obtain a detection frame of the target tracking object on the target acquisition image, and the geometric information of the detection frame. Among them, the detection frame of the target tracking object on the target acquisition image is the bounding box of the target tracking object on the target acquisition image. The geometric information of the detection frame includes the center point position of the detection frame, the width of the detection frame, the height of the detection frame, and the rotation angle of the detection frame. Among them, the center point position includes the x-coordinate of the center point and the y-coordinate of the center point. The size of the detection frame is within a preset size range, and the preset size range is 16*16-32*32 pixels. The target tracking object within the preset size range is defined as a small target in this application.
[0096] In other embodiments, when the target detection network performs object detection, it calculates the confidence of the identified object, and screens the objects based on a preset confidence threshold, screens out objects with lower confidence, and then obtains the detection frame for objects with higher confidence. The preset confidence threshold is generally set to 0.6. By screening objects with lower confidence, the efficiency of object detection can be improved.
[0097] Before step S101 in some embodiments, the target tracking method further includes: training a target detection network. The process of training a target detection network may include but is not limited to steps S201 to S205:
[0098] Step S201, inputting the sample acquisition image into the initial detection network for object detection, and obtaining a sample detection frame of the sample tracking object in the sample acquisition image, wherein the initial detection model includes multiple feature layers, and the sample detection frame includes multiple layer sample detection frames corresponding to each feature layer;
[0099] Step S202: for each feature layer, a receptive field calculation is performed according to each layer sample detection frame to obtain a receptive field, and a fitting calculation is performed according to a plurality of preset label tracking objects to obtain a fitted Gaussian two-dimensional feature ellipse; the receptive field corresponds to the layer sample detection frame one-to-one, and the fitted Gaussian two-dimensional feature ellipse corresponds to the label tracking object one-to-one;
[0100] Step S203, at each feature layer, performing difference calculation on each receptive field and each fitted Gaussian two-dimensional feature ellipse to obtain a difference matrix;
[0101] Step S204, matching each layer of sample detection frames with each label tracking object based on the difference matrix, and determining a positive sample of each label tracking object from multiple layers of sample detection frames;
[0102] Step S205: adjusting parameters of the initial detection network based on the positive samples to obtain a target detection network.
[0103] In step S201 of some embodiments, the sample acquisition image refers to image data containing sample tracking objects used to train the initial detection network. The sample tracking object refers to the tracking object identified in the sample acquisition image. The initial detection network is used to perform object detection on the sample acquisition image. The initial detection network can be improved based on the YOLOV5 network. Specifically, in terms of network structure, the output layer of the YOLOV5 network is modified so that the Detect module in the YOLOV5 network is expanded to add channels to achieve the output of the rotation angle. The sample detection frame is the bounding box of the sample tracking object detected by the initial detection network in the sample acquisition image, that is, the sample detection frame is used to frame the position of the sample tracking object in the sample acquisition image. The feature layer is the output of the middle layer of the initial detection model, which is used to extract feature information at different levels. The initial detection model includes multiple feature layers, each feature layer includes multiple sample detection frames of the feature layer, that is, layer sample detection frames. Object detection is to detect the tracking object in the image, so as to obtain the detection frame of the tracking object and the geometric information of the detection frame.
[0104] In step S202 of some embodiments, the receptive field refers to the area size of the input image corresponding to a unit in a certain layer output feature map of the initial detection network. The receptive field of this embodiment specifically refers to the effective receptive field (ERF), which represents the features that each corresponding detection frame in the feature layer can perceive. The effective receptive field is also called the effective convolution field of view. The effective convolution field of view is a Gaussian distribution and is part of the complete convolution field of view (RF), that is, the effective convolution field of view is the area in the complete convolution field of view that has the most significant impact on neurons. The preset multiple label tracking objects are multiple tracking objects pre-annotated in the sample acquisition image, and the positions of the tracking objects in the sample acquisition image are also marked. The Gaussian Fitting Ellipse (GRF) refers to the feature data of the label tracking object in the feature layer. Among them, the receptive field corresponds to the layer sample detection frame one by one, and the Gaussian Fitting Ellipse corresponds to the label tracking one by one. In the specific implementation, the effective convolution field of view is calculated as follows:
[0105] First, the radius of the complete convolutional field of view of the nth feature layer is obtained by formula (1).
[0106]
[0107] Where n is the nth feature layer; r n-1 is the radius of the complete convolutional field of view of the n-1th feature layer; r n is the radius of the complete convolutional field of view of the nth feature layer; k n is the size of the convolution kernel of the nth feature layer; s i is the stride of the convolution of the nth feature layer.
[0108] Secondly, the radius r of the complete convolutional field of view of the nth feature layer is obtained n Then, r n 1 / 3 of the effective convolution field of view of the nth feature layer is the radius R n , where 1 / 3 is the prior value. Assume that the height and width of the current feature layer are H n xW n , where x n The value range is 0~W n , where y n The value range is 0~H n ,(x n ,y n ) corresponds to the position of the center point of the detection box in the current feature layer.
[0109] Finally, we obtain the radius R of the effective convolutional field of view of the nth feature layer. n After that, R n The square of is used as the covariance to detect the center point of the box (x n ,y n ) is used as the center to establish a Gaussian two-dimensional region N with an effective convolution field of view. n (μ n ,∑ n ),in,
[0110] The fitted Gaussian 2D characteristic ellipse is calculated as follows:
[0111] Track the center point of the object with a label (x g ,y g ) as the center, establish a Gaussian fitting two-dimensional region N g (μ g ,∑ g ). Assume that the width and height of the current feature layer are H n xW n , where x g The value range is 0~W n , where y g The value range is 0~H n ,(x g ,y g ) corresponds to the position of the center point of the label tracking object in the current feature layer. Specifically, assuming that the width and height of the target detection model input are 640x640, and the original width and height of the label tracking object are 64x32, then the width w of the label tracking object in the current feature layer is g 64 / 640*W n , high h g 32 / 640*H n , w r w g Half of r h g half of
[0112] In step S203 of some embodiments, the difference matrix is composed of difference data between each receptive field and each fitted Gaussian two-dimensional feature ellipse, each row of the difference matrix corresponds to a layer sample detection frame, and each column of the difference matrix corresponds to a label tracking object. The matrix elements corresponding to the rows and columns are the difference data between the receptive field of the layer sample detection frame and the fitted Gaussian two-dimensional feature ellipse of the label tracking object. The difference data is used to measure the difference between the layer sample detection frame and the label tracking object. The difference data can be the sum of the JS divergence and the Wassertein distance. The calculation formula of the difference data is shown in formula (2).
[0113]
[0114] Among them, WJ is the difference data; N n With N g The second-order Wassertein distance between n ,N g ) is N n With N g JS divergence between .
[0115] The Wasserstein distance is used to measure two non-overlapping distributions. The calculation formula of the second-order Wasserstein distance is shown in formula (3).
[0116]
[0117] Among them, JS divergence mainly relies on KL divergence to calculate the difference between ERF and GRF. KL divergence is used to measure the distance between two probability distributions. The calculation formula of JS divergence is shown in formula (4).
[0118] GJSD(N n ,N g )=(0.5)*KL(N n ,N g )+(0.5)*KL(N n ,N g ), formula (4)
[0119] Among them, KL(N n ,N g ) is N n With N g The KL divergence between .
[0120] In step S204 of some embodiments, the positive sample refers to a sample containing a label tracking object in the layer sample detection frame. The matching process can use the Hungarian algorithm to calculate the correspondence between the minimum cost layer sample detection frame and the label tracking object, and based on the correspondence, the layer sample detection frame in the correspondence is used as a positive sample of the label tracking object in the correspondence.
[0121] In step S205 of some embodiments, after obtaining the positive sample, the initial detection network is trained based on the positive sample to adjust the parameters of the initial detection network, and the target detection network is obtained when the number of iterations reaches a predetermined number or the recognition accuracy of the network reaches a predetermined threshold.
[0122] It should be noted that the clustering of small targets is very common, which is reflected in the fact that multiple small targets are gathered in a small area and are relatively close to each other. The targets themselves are very small, and there are often multiple target tracking objects in a detection box. When there are multiple target tracking objects in a detection box, the original YOLOV5 strategy of selecting positive samples by relying on the relative positions of the center points of the target tracking objects in the detection boxes of each output layer will become inefficient, and its step-change positive sample distribution is not conducive to small targets.
[0123] Through the above steps S201 to S205, the JS divergence and Wassertein distance can be combined to obtain the difference data between the layer sample detection box and the label tracking object, which can take into account the position and shape differences between the Gaussian distributions, improve the accuracy and comprehensiveness of the difference data, and thus improve the recognition accuracy of the target detection network.
[0124] In step S103 of some embodiments, the area corresponding to the detection frame refers to the local image framed by the detection frame on the target acquisition image. The preset feature extraction model is used to extract features from the area corresponding to the detection frame, and the feature extraction model includes a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence. The target feature refers to the feature information of the area corresponding to the detection frame.
[0125] See also Figure 3 In step S103 of some embodiments, the target tracking method may include but is not limited to steps S301 to S309:
[0126] Step S301, inputting the area corresponding to the detection box into the first convolution module to obtain the first feature;
[0127] Step S302, inputting the first feature into the first fusion module to obtain the second feature;
[0128] Step S303, inputting the second feature into the first transition module to obtain the third feature;
[0129] Step S304, inputting the third feature into the second fusion module to obtain the fourth feature;
[0130] Step S305, inputting the fourth feature into the second transition module to obtain the fifth feature;
[0131] Step S306, inputting the fifth feature into the third fusion module to obtain the sixth feature;
[0132] Step S307, input the sixth feature into the second convolution module to obtain the seventh feature;
[0133] Step S308, inputting the seventh feature into a pooling module to obtain an eighth feature;
[0134] Step S309: input the eighth feature into the connection module to obtain the target feature.
[0135] In step S301 of some embodiments, the first convolution module is used to expand the network channel and downsample the area corresponding to the detection frame. The first convolution module includes a convolution layer and a maximum pooling layer connected in sequence. In one example, the first convolution module includes a 1*1 convolution layer with a step size of 2 and a 3*3 maximum pooling layer with a step size of 2 connected in sequence. The first feature is a feature representation obtained after processing by the first convolution module, and its expression is a high-dimensional vector or tensor.
[0136] In step S302 of some embodiments, the first fusion module is used to perform multi-scale perceptual fusion on the first feature. The second feature is a feature representation obtained after being processed by the first fusion module, and its expression form is a high-dimensional vector or tensor.
[0137] See also Figure 4 The first fusion module includes three cascaded fusion modules, and the target tracking method may include but is not limited to steps S401 to S403:
[0138] Step S401, inputting the first feature into the first fusion module of the three cascaded fusion modules to obtain a first fusion feature;
[0139] Step S402, inputting the first fusion feature into the second fusion module of the three cascaded fusion modules to obtain a second fusion feature;
[0140] Step S403: input the second fusion feature into the third fusion module of the three cascaded fusion modules to obtain the second feature.
[0141] In step S401 of some embodiments, cascading refers to connecting in sequence. The structures of the first fusion module, the second fusion module, and the third fusion module are the same, the output of the first fusion module is used as the input of the second fusion module, and the output of the second fusion module is used as the input of the third fusion module. The first fusion feature is a feature representation obtained after being processed by the first fusion module, and is a new feature obtained through a multi-scale perception fusion operation. By inputting the first feature into the first fusion module for multi-scale perception fusion, the expressive power of the feature can be enhanced, so that it can better capture different scales and spatial information in the image.
[0142] See also Figure 5 The first fusion module includes a first processing module, a second processing module, a third processing module and a fourth processing module. The target tracking method may include but is not limited to steps S501 to S508:
[0143] Step S501, performing a first convolution process on the first feature to obtain a first sub-feature;
[0144] Step S502, inputting the first sub-feature into a first processing module to obtain a first processing result;
[0145] Step S503, inputting the first sub-feature into a second processing module to obtain a second processing result;
[0146] Step S504, inputting the first sub-feature into a third processing module to obtain a third processing result;
[0147] Step S505, inputting the first sub-feature into a fourth processing module to obtain a fourth processing result;
[0148] Step S506, performing a first fusion process based on the first processing result and the second processing result to obtain a fifth processing result;
[0149] Step S507, performing a second fusion process based on the third processing result, the fourth processing result, and the fifth processing result to obtain a sixth processing result;
[0150] Step S508: Perform a third fusion process based on the sixth processing result and the first feature to obtain a first fusion feature.
[0151] In step S501 of some embodiments, the first convolution process is used to perform convolution process on the first feature. The first convolution process is specifically to make the first feature pass through the convolution layer, batch normalization layer (BN), and rectified linear unit layer (Re lu) connected in sequence to obtain the first sub-feature. In one example, the convolution kernel of the convolution layer in the first convolution process is 1*1, and the step size is 1. Through the convolution operation, the local information in the first feature can be extracted, the understanding of the image details can be deepened, and the abstract ability and discriminability of the feature can be improved.
[0152] In step S502 of some embodiments, the first processing result is a feature obtained by processing the first sub-feature through the first processing module.
[0153] See also Figure 6 The first processing module includes a first sub-convolution module, a second sub-convolution module, a third sub-convolution module, and a first maximum pooling module. The target tracking method may include but is not limited to steps S601 to S606:
[0154] Step S601, inputting the first sub-feature into the first sub-convolution module to obtain the first sub-convolution feature;
[0155] Step S602, inputting the first sub-convolution feature into the second sub-convolution module to obtain the second sub-convolution feature;
[0156] Step S603, inputting the first sub-convolution feature into the third sub-convolution module to obtain the third sub-convolution feature;
[0157] Step S604, adding the second sub-convolution feature and the third sub-convolution feature to obtain a first added feature;
[0158] Step S605, inputting the first added feature into the first maximum pooling module to obtain the first maximum pooling feature;
[0159] Step S606: perform dot multiplication processing on the first added feature and the first maximum pooling feature to obtain a first processing result.
[0160] In step S601 of some embodiments, the first sub-convolution module is used to extract features from the first sub-feature, and the first sub-convolution module includes a convolution layer, a BN layer, and a Re lu layer connected in sequence. In one example, the convolution kernel of the convolution layer in the first sub-convolution module is 1*1, and the step size is 1. Through the convolution operation, local information in the first sub-feature can be extracted, the understanding of image details can be deepened, and the abstraction ability and discriminability of the features can be improved.
[0161] In step S602 of some embodiments, the second sub-convolution module is used to extract features from the first sub-convolution feature, and the second sub-convolution module includes a convolution layer, a BN layer, and a Re lu layer connected in sequence. In one example, the convolution kernel of the convolution layer in the second sub-convolution module is 3*3, and the step size is 1. The second sub-convolution feature is a feature representation obtained by processing the second sub-convolution module.
[0162] In step S603 of some embodiments, the third sub-convolution module is used to extract features from the second sub-convolution feature, and the third sub-convolution module includes a convolution layer, a BN layer, and a Re lu layer connected in sequence. In one example, the convolution kernel of the convolution layer in the third sub-convolution module is 1*1, and the step size is 1. The third sub-convolution feature is a feature representation obtained by processing the third sub-convolution module.
[0163] In step S604 of some embodiments, the first added feature is obtained by adding the second sub-convolution feature and the third sub-convolution feature. By adding the second sub-convolution feature and the third sub-convolution feature, relevant information between features can be further extracted to enhance the expressiveness of the features.
[0164] In step S605 of some embodiments, the first maximum pooling module is used to perform maximum pooling on the first added feature, and the first maximum pooling module includes a maximum pooling layer. The first maximum pooling feature is a feature representation obtained by processing the first maximum pooling layer. The maximum pooling operation can reduce the size of the feature map while retaining the main feature information, which helps to reduce the computational complexity and parameter amount of the model and enhance the robustness of the model.
[0165] In step S606 of some embodiments, the first processing result is obtained by performing a dot multiplication process on the first added feature and the first maximum pooling feature. The dot multiplication process specifically performs element-by-element multiplication on the second sub-convolution feature and the third sub-convolution feature. By performing a dot multiplication process on the first added feature and the first maximum pooling feature, the information of both can be comprehensively utilized to improve the diversity and richness of the features and enhance the expressiveness of the features.
[0166] Through the above steps S601 to S606, the multi-level and multi-scale information of the input features can be gradually extracted and fused through the combination of multiple sub-convolution modules and the maximum pooling module, so as to achieve more accurate and comprehensive tracking of the target tracking object. At the same time, through multiple convolution operations and feature fusion, the high-level semantic information of the input features can be gradually extracted and processed. At the same time, the maximum pooling module can effectively reduce the dimension of the feature map, improve the computational efficiency and the generalization ability of the model, and finally obtain a more expressive and discriminative feature representation, which helps to improve the accuracy and robustness of the target tracking method.
[0167] In step S503 of some embodiments, the second processing module includes a fourth sub-convolution module, a fifth sub-convolution module, a sixth sub-convolution module, a seventh sub-convolution module, an eighth sub-convolution module, a ninth sub-convolution module, and a second maximum pooling module. The structures of the fourth sub-convolution module, the fifth sub-convolution module, the sixth sub-convolution module, the seventh sub-convolution module, the eighth sub-convolution module, and the ninth sub-convolution module are substantially the same as those of the first sub-convolution module, and the structure of the second maximum pooling module is substantially the same as that of the first maximum pooling module. In an example, the convolution kernel of the convolution layer in the fourth sub-convolution module is 1*1, and the step size is 1; the convolution kernel of the convolution layer in the fifth sub-convolution module is 3*3, and the step size is 1; the convolution kernel of the convolution layer in the sixth sub-convolution module is 1*1, and the step size is 1; the convolution kernel of the convolution layer in the seventh sub-convolution module is 1*1, and the step size is 1; the convolution kernel of the convolution layer in the eighth sub-convolution module is 3*3, and the step size is 1; the convolution kernel of the convolution layer in the ninth sub-convolution module is 1*1, and the step size is 1. In a specific implementation, the first sub-feature is input into the fourth sub-convolution module to obtain the fourth sub-convolution feature; the fourth sub-convolution feature is input into the fifth sub-convolution module to obtain the fifth sub-convolution feature; the fourth sub-convolution feature is input into the sixth sub-convolution module to obtain the sixth sub-convolution feature; the fifth sub-convolution feature and the sixth sub-convolution feature are added to obtain the second added feature; the third product feature is input into the seventh sub-convolution module to obtain the seventh sub-convolution feature; the seventh sub-convolution feature is input into the eighth sub-convolution module to obtain the eighth sub-convolution feature; the seventh sub-convolution feature is input into the ninth sub-convolution module to obtain the ninth sub-convolution feature; the eighth sub-convolution feature and the ninth sub-convolution feature are added to obtain the third added feature; the third added feature is input into the second maximum pooling module to obtain the second maximum pooling feature; the third added feature and the second maximum pooling feature are dot-multiplied to obtain the second processing result.
[0168] In step S504 of some embodiments, the third processing module is used to extract features from the first sub-feature. The third processing result is a feature representation obtained by processing by the third processing module.
[0169] See also Figure 7 The third processing module includes a first feature extraction module, a second feature extraction module, a third feature extraction module, and a first average pooling module. The target tracking method may include but is not limited to steps S701 to S705:
[0170] Step S701, inputting the first sub-feature into a first feature extraction module to obtain a first extracted feature;
[0171] Step S702, inputting the first extracted feature into a second feature extraction module to obtain a second extracted feature;
[0172] Step S703, inputting the second extracted features into a third feature extraction module to obtain third extracted features;
[0173] Step S704, inputting the third extracted feature into the first average pooling module to obtain the first average pooling feature;
[0174] Step S705: perform dot multiplication processing on the third extracted feature and the first average pooling feature to obtain a third processing result.
[0175] In step S701 of some embodiments, the first feature extraction module includes a convolution layer, a grouped convolution layer, a batch normalization layer, and a rectified linear unit layer. Grouped convolution refers to dividing the input channels into multiple groups, and the channels in each group share a group of convolution kernels for convolution operations. That is, in the grouped convolution operation, each group will have an independent set of convolution kernels, and the independent convolution kernels will only perform convolution operations with the channels of the corresponding group in the input data. The first extracted feature is obtained by processing the first feature extraction module. In one example, the convolution kernel of the convolution layer in the first feature extraction module is 1*1, and the step size is 1; the convolution kernel of the grouped convolution layer in the first feature extraction module is 3*3, the step size is 1, and the grouping is a preset value.
[0176] In step S702 of some embodiments, the second feature extraction module is substantially the same as the first feature extraction module. The second extracted feature is obtained by processing the second feature extraction module. In one example, the convolution kernel of the convolution layer in the second feature extraction module is 1*1, and the step size is 1; the convolution kernel of the grouped convolution layer in the second feature extraction module is 3*3, the step size is 1, and the grouping is a preset value.
[0177] In step S703 of some embodiments, the third feature extraction module is substantially the same as the first feature extraction module. The third extracted feature is obtained by processing the third feature extraction module. In one example, the convolution kernel of the convolution layer in the third feature extraction module is 1*1, and the step size is 1; the convolution kernel of the grouped convolution layer in the third feature extraction module is 3*3, the step size is 1, and the grouping is a preset value.
[0178] In step S704 of some embodiments, the first average pooling module is used to perform average pooling processing on the third extracted feature, and the first average pooling module includes an average pooling layer. The first average pooling feature is obtained by processing the first average pooling module. The average pooling operation helps to reduce the dimension of the feature map, retains the main feature information while reducing the number of features, thereby improving computational efficiency and reducing the risk of overfitting.
[0179] In step S705 of some embodiments, the third processing result is obtained by performing a dot product process on the third extracted feature and the first average pooling feature. Through the dot product process, the information of the third extracted feature and the first average pooling feature can be integrated, and the information of both can be comprehensively utilized to improve the diversity and richness of the features and enhance the expressiveness of the features.
[0180] Through the above steps S701 to S705, the abstract information of the input features can be gradually extracted and fused through the series connection and feature fusion operation of multiple feature extraction modules, and finally the final feature representation is obtained through average pooling and point multiplication processing operations. At the same time, the network can obtain different levels of feature representation at different levels, so as to fully capture the multi-level and multi-scale semantic information of the input data, improve the representation ability and discrimination of the features, and help to achieve more accurate and robust target feature extraction and tracking.
[0181] In step S505 of some embodiments, the fourth processing module is used to extract features from the first sub-feature, and the fourth processing module includes a fourth feature extraction module, a fifth feature extraction module, a sixth feature extraction module, a seventh feature extraction module, and a second average pooling module. Among them, the structures of the fourth feature extraction module, the fifth feature extraction module, the sixth feature extraction module, and the seventh feature extraction module are substantially the same as those of the first feature extraction module, and the structure of the second average pooling module is substantially the same as that of the first average pooling module. In one example, the convolution kernel of the convolution layer in the fourth feature extraction module is 1*1, and the step size is 1; the convolution kernel of the grouped convolution layer in the fourth feature extraction module is 3*3, the step size is 1, and the grouping is a preset value; and the specific structures of the fifth feature extraction module, the sixth feature extraction module, and the seventh feature extraction module are consistent with the fourth feature extraction module. In a specific implementation, the first sub-feature is input into the fourth feature extraction module to obtain the fourth extracted feature; the fourth extracted feature is input into the fifth feature extraction module to obtain the fifth extracted feature; the fifth extracted feature is input into the sixth feature extraction module to obtain the sixth extracted feature; the sixth extracted feature is input into the seventh feature extraction module to obtain the seventh extracted feature; the seventh extracted feature is input into the second average pooling module to obtain the second average pooling feature; the seventh extracted feature and the second average pooling feature are subjected to dot multiplication processing to obtain the fourth processing result.
[0182] In step S506 of some embodiments, the fifth processing result is obtained by performing a first fusion process on the first processing result and the second processing result. The first fusion process is specifically to add the first processing result and the second processing result to obtain the fifth processing result.
[0183] In step S507 of some embodiments, the sixth processing result is obtained by performing a second fusion process on the third processing result, the fourth processing result, and the fifth processing result. The second fusion process specifically first performs the same process as the first convolution process on the fifth processing result to obtain the seventh processing result, and then performs an addition process on the third processing result, the fourth processing result, and the seventh processing result to obtain the sixth processing result.
[0184] In step S508 of some embodiments, the third fusion result is obtained by performing a third fusion process on the sixth processing result and the first feature. The third fusion process is to first perform the same process as the first convolution process on the sixth processing result to obtain an eighth processing result, then perform an addition process on the eighth processing result and the first feature to obtain a fourth addition feature, and finally activate the fourth addition feature based on the Re lu layer to obtain the third fusion result.
[0185] It should be noted that the first maximum pooling module includes a maximum pooling layer, a first convolutional layer, a rectified linear unit layer, a second convolutional layer, and a normalization layer connected in sequence. In one example, the convolution kernels of the first convolutional layer and the second convolutional layer are both 1*1, and the step size is 1. The specific structure of the second maximum pooling module is consistent with that of the first maximum pooling module. The first average pooling module includes an average pooling layer, a third convolutional layer, a rectified linear unit layer, a fourth convolutional layer, and a normalization layer connected in sequence. In one example, the convolution kernels of the third convolutional layer and the fourth convolutional layer are both 1*1, and the step size is 1.
[0186] Through the above steps S501 to S508, feature representations of different scales can be obtained in network structures of different levels, and the feature information of targets at different scales can be comprehensively considered, so that the network can represent the target more comprehensively and accurately, thereby improving the target tracking effect. At the same time, by fusing the processed features with the features obtained by deeper processing, the influence of the original features under the residual connection is reduced.
[0187] In step S402 of some embodiments, the second fused feature is a feature representation obtained after being processed by the second fusion module, and is a feature fused after a deeper multi-scale perception. By inputting the first fused feature into the second fusion module, the multi-scale expression capability of the feature can be further improved, and the model's ability to understand the image can be enhanced.
[0188] In step S403 of some embodiments, the second feature is a feature representation obtained after being processed by the third fusion module, and is a feature after being fused by a deeper multi-scale perception. By inputting the second fused feature into the third fusion module, the multi-scale expression capability of the feature can be further enhanced, making the model more capable of adapting to different scales, thereby improving the understanding of the image and the accuracy of classification.
[0189] Through the above steps S401 to S403, three fusions can be performed in sequence in the three cascaded fusion modules. Multiple fusions at different depth levels of the network can expand the receptive field of the model, so that the model can better capture local and global information in the image, gradually improve the feature expression ability, and enable the model to more accurately distinguish the feature differences between different categories, improve the accuracy of feature extraction, and thus improve the accuracy of target visual tracking.
[0190] In step S303 of some embodiments, the first transition module is used to mix and downsample the channel data of the second feature, and the first transition module includes a 1*1 convolution layer and a 2*2 average pooling layer with a step size of 2 connected in sequence. The third feature is a feature representation obtained after being processed by the first transition module, and its expression is a high-dimensional vector or tensor. The second feature is mixed with the number of channels through the first transition module, and the dimension and size of the feature map are reduced through the downsampling operation and important feature information is retained.
[0191] In step S304 of some embodiments, the second fusion module is used to perform multi-scale perception fusion processing on the third feature, and the second fusion module includes a fusion module. The fourth feature is a feature representation obtained after processing by the second fusion module, and its expression form is a high-dimensional vector or tensor. By performing multi-scale deep feature extraction and fusion on the third feature, the expression ability of the feature is further enhanced.
[0192] In step S305 of some embodiments, the second transition module is used to mix and downsample the channel data of the fourth feature, and the second transition module includes a 1*1 convolution layer and a 2*2 average pooling layer with a step size of 2 connected in sequence. The fifth feature is a feature representation obtained after processing by the second transition module, and its expression is a high-dimensional vector or tensor. The fourth feature is mixed by the second transition module, and the dimension and size of the feature map are reduced by downsampling operation and important feature information is retained.
[0193] In step S306 of some embodiments, the third fusion module is used to perform multi-scale perception fusion processing on the fifth feature, and the third fusion module includes a fusion module. The sixth feature is a feature representation obtained after processing by the third fusion module, and its expression is a high-dimensional vector or tensor. Multi-scale deep feature extraction and fusion are further performed through the third fusion module.
[0194] In step S307 of some embodiments, the second convolution module is used to perform convolution processing on the sixth feature, and the second convolution module includes a 1*1 convolution layer. The seventh feature is a feature representation obtained after processing by the second convolution module, and its expression is a high-dimensional vector or tensor. The feature dimension of the sixth feature is adjusted by the second convolution module so that subsequent modules can process inputs of appropriate dimensions.
[0195] In step S308 of some embodiments, a pooling module is used to pool the seventh feature, and the pooling module includes a global average pooling layer. The eighth feature is a feature representation obtained after processing by the pooling module, and its expression is a high-dimensional vector or tensor. The pooling module can reduce the spatial dimension of the seventh feature, and average pool the features on each channel, thereby reducing the number of parameters and the amount of calculation of the feature map, and retaining the main information of the feature map.
[0196] In step S309 of some embodiments, the connection module is used to perform a linear transformation on the eighth feature, and the connection module includes a fully connected layer. The target feature is a feature representation obtained after processing by the connection module, and its expression is a high-dimensional vector or tensor. The connection module can linearly transform and nonlinearly map the global features obtained by the pooling operation to obtain a higher-level and more abstract feature representation, that is, to interact and fuse the information between different channels in the feature map, so that the target feature finally outputted can comprehensively consider the global information and local details of the image, thereby improving the expressiveness and robustness of the feature.
[0197] It should be noted that under the conditions of high-altitude aerial photography, problems such as insufficient computing power of drone hardware, a large number of shooting targets, the need to call the re-identification model multiple times for calculations, and unclear target features are often encountered. Currently, the more common re-identification models mostly rely on the residual network structure to realize the feature extraction function, and when there are many detection targets, their running speed can easily become the speed bottleneck of the overall process.
[0198] Through the above steps S301 to S309, the fusion module can replace the cyclic residual network structure, greatly reducing the amount of model calculation and improving the running speed. At the same time, the fusion module considers the fusion of different scales of perception vision, paying attention to local information while also paying attention to global information, improving the quality of feature extraction of the model, thereby improving the accuracy of target visual tracking.
[0199] In step S104 of some embodiments, the historical tracking object is a tracking object obtained from an image taken before the target acquisition image. The historical object data includes geometric information of the historical tracking object and features of the historical tracking object. Among them, the features of the historical tracking object refer to the exponential average of at least one target feature of the same tracking object. The matching process is to match the target tracking object with the historical tracking object, specifically through geometric information and target features. The update is to update the features in the historical object data corresponding to the historical tracking object based on the target features. Matching processing is performed based on geometric information, target features and historical object data of multiple historical tracking objects to obtain the historical tracking object corresponding to the target tracking object, and the historical object data corresponding to the historical tracking object is updated based on the target features. In a specific implementation, when performing the tracking task, for the acquisition image of the first frame, the first tracking object, the detection frame corresponding to the first tracking object, the geometric information of the detection frame, and the target features of the first tracking object are obtained through object detection and feature extraction, and a corresponding tracking track is created for each first tracking object, and the detection frame corresponding to the first tracking object, the geometric information of the detection frame, and the target features of the first tracking object are stored in the tracking track. For the captured image of the second frame, the second tracking object, the detection frame corresponding to the second tracking object, the geometric information of the detection frame and the target features of the second tracking object are obtained through object detection and feature extraction. Then, the difference between the second tracking object and the tracking track is calculated, and a difference matrix is formed based on multiple differences. Then, the Hungarian algorithm is called based on the minimum matching value to calculate the difference matrix, so that when the minimum matching value is met, the difference between each second tracking object and the tracking track is minimized, thereby obtaining the tracking track corresponding to the second tracking object, and the exponential average is calculated based on the features of the second tracking object and the features stored in the tracking track, and the features stored in the tracking track are updated based on the calculation results. Among them, when calling the Hungarian algorithm, there will be a situation where the difference value exceeds the set minimum matching value, which means that there is a situation where the second tracking object and the tracking track cannot match, and a new tracking track needs to be created for the second tracking object. For subsequent frames, the Kalman filter is used to predict the geometric information of the new tracking track. This method introduces the exponential average for the situation where small target tracking is prone to errors, and optimizes the correction ability after tracking errors.
[0200] See also Figure 8In one example, the feature extraction model includes 9 modules, specifically, a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence. The RGB image (256*256) is input into the feature extraction model. Specifically, the feature (128*128,16) is output through the 1*1 convolution layer with a step size of 2 in the first convolution module; the feature (128*128,16) output by the convolution layer in the first convolution module is output through the maximum pooling layer with a step size of 3*3 and a step size of 2 in the first convolution module; the feature (64*64,64) output by the maximum pooling layer in the first convolution module is output through the cascaded The three fusion modules output features (64*64, 256); the features (64*64, 256) output by the first fusion module are output through the 1*1 convolution layer in the first transition module (64*64, 256); the features (64*64, 256) output by the convolution layer in the first transition module are output through the 2*2 average pooling layer with a step size of 2 in the first transition module (32*32, 256); the features (32*32, 256) output by the first transition module are output through the second fusion module The fusion module in the output feature (32*32,384); the feature (32*32,384) output in the second fusion module passes through the 1*1 convolution layer in the second transition module to output the feature (32*32,384); the feature (32*32,384) output by the convolution layer in the second transition module passes through the 2*2 average pooling layer with a step size of 2 in the second transition module to output the feature (16*16,384); the feature (16*16,384) output by the second transition module passes through the third fusion module. The fusion module in the module outputs features (16*16,512); the features (16*16,512) output by the third fusion module pass through the 1*1 convolution layer in the second convolution module to output features (16*16,512); the features (16*16,512) output by the second convolution module pass through the global average pooling layer in the pooling module to output features (1*1,512); the features (1*1,512) output by the pooling module pass through the fully connected layer in the connection module to output features (1*1,512).
[0201] See also Fig. 9In one example, first, the feature (1,256,64,64) is input into the fusion module for the first convolution processing, and the feature (1,64,64,64) is output. The specific implementation process is similar to the specific implementation process of step S501, which will not be described in detail here. Secondly, the feature (1,64,64,64) is input into the four branches respectively, and the feature (1,64,64,64) output by the first convolution processing is input into the first branch to output the feature (1,64,64,64). The specific implementation process is similar to the specific implementation process of steps S601 to S606, which will not be described in detail here. The feature (1,64,64,64) output by the first convolution processing is input into the second branch to output the feature (1,64,64,64). The specific implementation process is similar to the specific implementation process of step S503, which will not be described in detail here. The feature (1,64,64,64) output by the first convolution processing is input into the third branch output feature (1,64,64,64). The specific implementation process is similar to the specific implementation process of step S701 to step S705, which will not be repeated here. The feature (1,64,64,64) output by the first convolution processing is input into the fourth branch output feature (1,64,64,64). The specific implementation process is similar to the specific implementation process of step S505, which will not be repeated here. Then, the feature (1,64,64,64) output by the first branch and the feature (1,64,64,64) output by the second branch are subjected to the first fusion processing to output the feature (1,64,64,64). The specific implementation process is similar to the specific implementation process of step S506, which will not be repeated here. Subsequently, the feature (1,64,64,64) output by the third branch, the feature (1,64,64,64) output by the fourth branch, and the feature (1,64,64,64) obtained by the first fusion process are subjected to a second fusion process to output the feature (1,64,64,64). The specific implementation process is similar to the specific implementation process of step S507 and is not described in detail here. Finally, the feature (1,64,64,64) obtained by the second fusion process is subjected to a third fusion process to output the feature (1,256,64,64). The specific implementation process is similar to the specific implementation process of step S508 and is not described in detail here.
[0202] See also Fig.10 The embodiment of the present application also provides a target tracking system, which can implement the above target tracking method, and the system includes:
[0203] An image acquisition module 1001 is used to acquire an image of a target to be tracked;
[0204] The object detection module 1002 is used to perform object detection on the target acquisition image based on a preset target detection network, and obtain a detection frame of the target tracking object on the target acquisition image, and geometric information of the detection frame; wherein the size of the detection frame is within a preset size range;
[0205] The feature extraction module 1003 is used to extract features of the area corresponding to the detection frame based on a preset feature extraction model to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence;
[0206] The matching update module 1004 is used to perform matching processing based on geometric information, target features and historical object data of multiple historical tracking objects to obtain a historical tracking object corresponding to the target tracking object, and update the historical object data corresponding to the historical tracking object based on the target features.
[0207] The specific implementation of the target tracking system is basically the same as the specific implementation of the above-mentioned target tracking method, and will not be repeated here.
[0208] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above target tracking method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0209] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0210] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0211] The memory 1102 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the target tracking method of the embodiment of this application;
[0212] Input / output interface 1103, used to implement information input and output;
[0213] The communication interface 1104 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);
[0214] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);
[0215] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .
[0216] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned target tracking method is implemented.
[0217] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0218] The target tracking method, target tracking system, electronic device and storage medium provided by the embodiment of the present application obtain the target acquisition image to be tracked; perform object detection on the target acquisition image based on a preset target detection network to obtain a detection frame of the target tracking object on the target acquisition image and the geometric information of the detection frame; wherein the size of the detection frame is within a preset size range; perform feature extraction on the area corresponding to the detection frame based on a preset feature extraction model to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence; perform matching processing based on geometric information, target features and historical object data of multiple historical tracking objects to obtain a historical tracking object corresponding to the target tracking object, and update the historical object data corresponding to the historical tracking object based on the target features. This method improves the inference speed of target tracking detection by replacing the residual network structure with a self-designed feature extraction model, thereby improving the efficiency of visual target tracking.
[0219] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0220] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0221] The system embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0222] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0223] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0224] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0225] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.
[0226] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0227] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0228] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0229] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A target tracking method, characterized in that: The method comprises: Acquire a target acquisition image to be tracked; Performing object detection on the target acquisition image based on a preset target detection network to obtain a detection frame of the target tracking object on the target acquisition image and geometric information of the detection frame; wherein the size of the detection frame is within a preset size range; Based on a preset feature extraction model, feature extraction is performed on the area corresponding to the detection frame to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence; Matching processing is performed based on the geometric information, the target feature and the historical object data of multiple historical tracking objects to obtain a historical tracking object corresponding to the target tracking object, and the historical object data corresponding to the historical tracking object is updated based on the target feature.
2. The method according to claim 1, characterized in that The extracting features of the area corresponding to the detection frame based on a preset feature extraction model to obtain target features includes: Inputting the area corresponding to the detection frame into the first convolution module to obtain a first feature; Inputting the first feature into the first fusion module to obtain a second feature; Inputting the second feature into the first transition module to obtain a third feature; Inputting the third feature into the second fusion module to obtain a fourth feature; Inputting the fourth feature into the second transition module to obtain a fifth feature; Inputting the fifth feature into the third fusion module to obtain a sixth feature; Inputting the sixth feature into the second convolution module to obtain a seventh feature; Inputting the seventh feature into the pooling module to obtain an eighth feature; The eighth feature is input into the connection module to obtain the target feature.
3. The method according to claim 2, characterized in that The first fusion module includes three cascaded fusion modules; the step of inputting the first feature into the first fusion module to obtain the second feature includes: Inputting the first feature into the first fusion module of the three cascaded fusion modules to obtain a first fusion feature; Inputting the first fusion feature into a second fusion module of three cascaded fusion modules to obtain a second fusion feature; The second fusion feature is input into the third fusion module of the three cascaded fusion modules to obtain the second feature.
4. The method according to claim 3, characterized in that The fusion module includes a first processing module, a second processing module, a third processing module and a fourth processing module; the first feature is input into the first fusion module of the three fusion modules in cascade to obtain the first fusion feature, including: Performing a first convolution process on the first feature to obtain a first sub-feature; Inputting the first sub-feature into the first processing module to obtain a first processing result; Inputting the first sub-feature into the second processing module to obtain a second processing result; Inputting the first sub-feature into the third processing module to obtain a third processing result; Inputting the first sub-feature into the fourth processing module to obtain a fourth processing result; Perform a first fusion process based on the first processing result and the second processing result to obtain a fifth processing result; Performing a second fusion process based on the third processing result, the fourth processing result, and the fifth processing result to obtain a sixth processing result; A third fusion process is performed based on the sixth processing result and the first feature to obtain the first fusion feature.
5. The method according to claim 4, characterized in that The first processing module includes a first sub-convolution module, a second sub-convolution module, a third sub-convolution module, and a first maximum pooling module; the first sub-feature is input into the first processing module to obtain a first processing result, including: Inputting the first sub-feature into the first sub-convolution module to obtain a first sub-convolution feature; Inputting the first sub-convolution feature into the second sub-convolution module to obtain a second sub-convolution feature; Inputting the first sub-convolution feature into the third sub-convolution module to obtain a third sub-convolution feature; Adding the second sub-convolution feature and the third sub-convolution feature to obtain a first added feature; Inputting the first added feature into the first maximum pooling module to obtain a first maximum pooling feature; Perform dot multiplication processing on the first added feature and the first maximum pooling feature to obtain the first processing result.
6. The method according to claim 4, characterized in that The third processing module includes a first feature extraction module, a second feature extraction module, a third feature extraction module, and a first average pooling module; the first sub-feature is input into the third processing module to obtain a third processing result, including: Inputting the first sub-feature into the first feature extraction module to obtain a first extracted feature; Inputting the first extracted features into the second feature extraction module to obtain second extracted features; Inputting the second extracted features into the third feature extraction module to obtain third extracted features; Inputting the third extracted feature into the first average pooling module to obtain a first average pooling feature; Perform dot multiplication processing on the third extracted feature and the first average pooling feature to obtain the third processing result.
7. The method according to any one of claims 1 to 6, characterized in that: Before acquiring the collected image, the method further includes: Training the target detection network includes: Inputting the sample acquisition image into the initial detection network for object detection, and obtaining a sample detection frame of the sample tracking object in the sample acquisition image, wherein the initial detection model includes multiple feature layers, and the sample detection frame includes multiple layer sample detection frames corresponding to each feature layer; For each of the feature layers, a receptive field calculation is performed according to each of the layer sample detection frames to obtain a receptive field, and a fitting calculation is performed according to a plurality of preset label tracking objects to obtain a fitted Gaussian two-dimensional feature ellipse; the receptive field corresponds to the layer sample detection frame one-to-one, and the fitted Gaussian two-dimensional feature ellipse corresponds to the label tracking object one-to-one; At each of the feature layers, performing a difference calculation on each of the receptive fields and each of the fitted Gaussian two-dimensional feature ellipses to obtain a difference matrix; Perform matching processing on each of the layer sample detection frames and each of the label tracking objects based on the difference matrix, and determine a positive sample of each of the label tracking objects from a plurality of the layer sample detection frames; The parameters of the initial detection network are adjusted based on the positive samples to obtain the target detection network.
8. A target tracking system, characterized in that: The system comprises: An image acquisition module is used to acquire an image of a target to be tracked; An object detection module is used to perform object detection on the target acquisition image based on a preset target detection network, and obtain a detection frame of the target tracking object on the target acquisition image, and geometric information of the detection frame; wherein the size of the detection frame is within a preset size range; A feature extraction module, used to extract features from the area corresponding to the detection frame based on a preset feature extraction model to obtain target features; wherein the feature extraction model includes: a first convolution module, a first fusion module, a first transition module, a second fusion module, a second transition module, a third fusion module, a second convolution module, a pooling module, and a connection module connected in sequence; The matching update module is used to perform matching processing based on the geometric information, target features and historical object data of multiple historical tracking objects to obtain a historical tracking object corresponding to the target tracking object, and update the historical object data corresponding to the historical tracking object based on the target features.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the target tracking method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the target tracking method according to any one of claims 1 to 7 is implemented.
