Feature extraction method, target tracking method and electronic device
Through the feature extraction method of multi-stage sub-models, the problem of high computational resource consumption for complex target tracking on low-computing power devices is solved, and efficient target tracking and accuracy on low-computing power devices are achieved.
Patent Information
- Application Number
- CN202411084016.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-08-06
AI Technical Summary
In existing target tracking technology, the feature extraction model of complex targets is large, resulting in high consumption of computing resources, making it difficult to achieve efficient tracking on low-computing power devices, and affecting the calculation frame rate and tracking effect.
Using a multi-stage sub-model feature extraction method, target features are extracted step by step through a pre-trained target feature extraction model. Based on the confidence level, it is judged whether the preset conditions are met, and the number of stage sub-models that need to be run is flexibly selected to reduce computing resources and time-consuming .
It achieves accurate tracking of complex targets on low computing power devices, ensures the calculation frame rate, and improves the efficiency and accuracy of target tracking.
Smart Images

Figure CN118628762B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a feature extraction method, a target tracking method, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the rapid development of computer technology, image-based target tracking is increasingly used in production and life. For example, human body tracking, vehicle tracking, face tracking and other target tracking are performed through the captured images, so as to realize passenger flow analysis, autonomous driving, video surveillance and other functions through target tracking.
[0003] When the related technology performs target tracking, the target features in the image are usually extracted through a trained feature extraction model, so as to track the target based on the extracted features.
[0004] However, in order to handle complex targets and extract target features from images more accurately, the target feature extraction model is usually relatively large, and the computing resources required to run the model are also relatively large, resulting in the model taking a long time to extract target features. For some low-computing power devices, the excessive time consumption can easily lead to the calculation frame rate of target tracking not keeping up, affecting the tracking effect. Summary of the invention
[0005] The present application provides a feature extraction method, a feature extraction model training method, a target tracking method, an electronic device, and a computer-readable storage medium. It can not only track complex targets more accurately, but also reduce the time consumption of the model to extract target features, so that low-computing power devices can also guarantee the calculation frame rate when tracking targets, thereby better ensuring the tracking effect. The specific scheme is as follows.
[0006] In a first aspect, the present application provides a feature extraction method, the method comprising:
[0007] Obtaining an image to be extracted of target features to be extracted;
[0008] Extracting target features of the i-1th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model to obtain the i-th stage target features, wherein the target feature extraction model includes multiple stage sub-models, the 0th stage target features include images determined according to the image to be extracted, and the initial value of i is 1;
[0009] Detecting whether the target feature of the i-th stage meets the preset feature condition;
[0010] If satisfied, the target feature of the i-th stage is determined as the target feature corresponding to the image to be extracted;
[0011] If not satisfied, set i=i+1, and return to execute the step of performing target feature processing on the i-1th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model, wherein the Nth stage target feature satisfies the preset feature condition, and N is the number of stage sub-models included in the target feature extraction model.
[0012] Optionally, the i-th stage sub-model is also used to output the confidence level corresponding to the i-th stage target feature;
[0013] The detecting whether the target feature of the i-th stage meets the preset feature condition includes:
[0014] Check whether the confidence level corresponding to the target feature of the i-th stage is greater than a preset threshold.
[0015] Optionally, the confidence corresponding to the N-stage target feature output by the N-stage sub-model is greater than the preset threshold; or, the confidence corresponding to the N-stage target feature output by the N-stage sub-model is empty. When the confidence corresponding to the N-stage target feature is empty, it is determined that the confidence corresponding to the N-stage target feature is greater than the preset threshold.
[0016] Optionally, before the target feature processing is performed on the target features of the i-1th stage by the i-th stage sub-model of the pre-trained target feature extraction model, the method further comprises:
[0017] Preprocessing the image to be extracted to obtain a processed image;
[0018] The stage 0 target features include the processed image.
[0019] Optionally, preprocessing the image to be extracted to obtain a processed image includes:
[0020] A target area where the target feature is located is detected and marked from the image to be extracted, and the image to be extracted with the target area marked is determined as a processed image corresponding to the image to be extracted.
[0021] Optionally, preprocessing the image to be extracted to obtain a processed image includes:
[0022] Detecting a target area where the target feature is located from the image to be extracted;
[0023] A target area image corresponding to the target area is extracted from the image to be extracted, and a processed image corresponding to the image to be extracted is determined according to the target area image.
[0024] Optionally, determining a processed image corresponding to the image to be extracted according to the target area image includes:
[0025] Scaling the target area image to an image of a preset size to obtain a scaled image;
[0026] The scaled image is determined as a processed image corresponding to the image to be extracted.
[0027] Optionally, each stage sub-model of the target feature extraction model is run through each parallel thread respectively;
[0028] The target feature processing of the target feature of the i-1th stage by the i-th stage sub-model of the pre-trained target feature extraction model includes:
[0029] The i-th stage thread running the i-th stage sub-model performs target feature processing on the i-1-th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model.
[0030] Optionally, the i+1th stage thread is used to execute the detection of whether the i-th stage target feature meets the preset feature conditions. If so, the i-th stage target feature is determined as the target feature corresponding to the image to be extracted. If not, i=i+1 is set, and the process returns to execute the step of performing target feature processing on the i-1th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model.
[0031] Optionally, the i+1th stage thread is further used to track the object corresponding to the target feature according to the target feature corresponding to the image to be extracted when it is detected that the i-th stage target feature meets the preset feature condition.
[0032] Optionally, each of the threads is respectively provided with a corresponding buffer;
[0033] The method further comprises:
[0034] When the output data of the stage i sub-model is detected, the data outputted by the stage i sub-model is stored in the stage i buffer corresponding to the stage i thread;
[0035] The i-th stage thread running the i-th stage sub-model performs target feature processing on the i-1-th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model, including:
[0036] The i-th stage thread running the i-th stage sub-model performs target feature processing on the i-1th stage target features that have not been subjected to feature extraction and are stored in the i-1th stage buffer through the i-th stage sub-model of the pre-trained target feature extraction model.
[0037] Optionally, the i-th stage thread running the i-th stage sub-model performs target feature processing on the i-th stage target features that have not been subjected to feature extraction and are stored in the i-th stage buffer through the i-th stage sub-model of the pre-trained target feature extraction model, including:
[0038] When the i-th stage thread running the i-th stage sub-model detects that there is data in the i-1-th stage buffer, the i-th stage sub-model of the pre-trained target feature extraction model performs target feature processing on the i-1-th stage target features stored in the i-1-th stage buffer;
[0039] The method further comprises:
[0040] The data processed with target features in the i-1th stage buffer is deleted, wherein the 0th stage buffer is used to store the 0th stage target features.
[0041] Optionally, obtaining the image to be extracted from which the target features are to be extracted comprises:
[0042] The detection thread obtains the image to be extracted of the target feature to be extracted from the image buffer, wherein the image buffer is used to store the image acquired by the image acquisition device and used to extract the target feature;
[0043] In the case where the target feature of the stage 0 includes the processed image, and the scaled image is determined as the processed image corresponding to the image to be extracted, the step of detecting the target area where the target feature is located from the image to be extracted is performed by the detection thread;
[0044] The method further comprises:
[0045] The detection thread stores the image to be extracted and the corresponding target area into a detection buffer corresponding to the detection thread;
[0046] Extracting a target area image corresponding to the target area from the image to be extracted, and determining a processed image corresponding to the image to be extracted according to the target area image, comprises:
[0047] The preprocessing thread obtains the image to be extracted and the corresponding target area from the detection buffer, extracts the target area image corresponding to the target area from the image to be extracted, and determines the processed image corresponding to the image to be extracted according to the target area image;
[0048] The method further comprises:
[0049] The preprocessing thread stores the processed image into a preprocessing buffer corresponding to the preprocessing thread;
[0050] When the value of i is 1, the i-th stage thread running the i-th stage sub-model extracts target features from the i-1-th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model, including:
[0051] The first stage thread running the first stage sub-model obtains the processed image that has not been subjected to feature extraction from the pre-processing buffer, and performs target feature extraction on the processed image through the first stage sub-model of the target feature extraction model.
[0052] Optionally, the detection thread obtains the image to be extracted of the target feature to be extracted from the image buffer, including:
[0053] When the detection thread detects that there is an image to be extracted with target features to be extracted in the image buffer, the detection thread obtains the image to be extracted from the image buffer;
[0054] The method further comprises: when it is detected that the detection thread has acquired the image to be extracted in the image buffer, deleting the acquired image to be extracted in the image buffer;
[0055] The preprocessing thread obtains the image to be extracted and the corresponding target area from the detection buffer, including:
[0056] When the preprocessing thread detects that there is an image to be extracted and a corresponding target area in the detection buffer, the preprocessing thread obtains the image to be extracted and the corresponding target area from the detection buffer;
[0057] The method further includes: when it is detected that the preprocessing thread has acquired the image to be extracted and the corresponding target area in the detection buffer, deleting the image to be extracted and the corresponding target area acquired in the detection buffer.
[0058] Optionally, the first convolution layer of the target feature extraction model is used to normalize the pixel values of the processed image before extracting the target features.
[0059] Optionally, the function corresponding to the first convolutional layer is:
[0060]
[0061] in, , , represents the output of the first convolutional layer, Represents the processed image, Mean represents the normalized mean of the image, Std represents the normalized standard deviation of the image, represents the weight of the first convolutional layer, Represents the bias of the first convolutional layer.
[0062] In a second aspect, an embodiment of the present application provides a method for training a feature extraction model, the method comprising:
[0063] Acquire a first sample image, where the first sample image is marked with a target feature and an image complexity label corresponding to the first sample image;
[0064] Inputting the output j-1 stage target feature into the j-stage sub-model to be trained of the model to be trained, to obtain the output j-stage target feature and the confidence corresponding to the output j-stage target feature, wherein the model to be trained includes a plurality of sub-models to be trained stages, and the output 0-stage target feature includes the first sample image;
[0065] Based on the difference between the output j-stage target feature and the target feature marked by the first sample image, and the consistency between the confidence corresponding to the output j-stage target feature and the complexity label marked by the first sample image, the model parameters of the j-stage sub-model to be trained are adjusted to obtain the j-stage sub-model after training, where j traverses 1 to N, and N is the number of the sub-models to be trained included in the model to be trained;
[0066] The model composed of the post-training 1st stage sub-model to the Nth stage sub-model is determined as the post-training target feature extraction model.
[0067] Optionally, the method further comprises:
[0068] Acquire a second sample image, wherein the second sample image is marked with a target feature;
[0069] Inputting the second sample image into the trained target feature extraction model to obtain output target features;
[0070] Based on the difference between the output target feature and the target feature marked by the second sample image, the model parameters of the trained target feature extraction model are adjusted to obtain an optimized target feature extraction model.
[0071] In a third aspect, an embodiment of the present application further provides a target tracking method, the method comprising:
[0072] Acquire a tracking image for target tracking;
[0073] Extracting the tracked target feature from the tracking image by using the feature extraction method described in any one of the first aspects;
[0074] Tracking is performed according to the target features.
[0075] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor; when the processor executes the computer program instructions, it implements the method described in any one of the first to third aspects.
[0076] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement a method as described in any one of the first to third aspects.
[0077] Compared with the prior art, this application has the following advantages:
[0078] The feature extraction method provided by the present application obtains an image to be extracted of the target feature to be extracted, and extracts the target feature of the i-1th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model to obtain the i-th stage target feature, and detects whether the i-th stage target feature meets the preset feature condition. If it meets the preset feature condition, the i-th stage target feature is determined as the target feature corresponding to the image to be extracted. If it does not meet the preset feature condition, i=i+1 is set, and the method returns to execute the above-mentioned step of performing target feature processing on the i-1th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model. Since the target feature extraction model includes multiple stage sub-models, the stage 0 target feature includes an image determined according to the image to be extracted, and the initial value of i is 1, therefore, the target feature of the image determined according to the image to be extracted is firstly extracted through the first stage sub-model of the target feature extraction model to obtain the first stage target feature. If the first stage target feature meets the preset feature condition, the first stage target feature is determined as the target feature corresponding to the image to be extracted. If the first stage target feature does not meet the preset feature condition, i becomes 2, and then the first stage target feature is extracted through the second stage sub-model of the target feature extraction model. Perform target feature extraction to obtain the second-stage target feature. If the second-stage target feature meets the preset feature conditions, the second-stage target feature is determined as the target feature corresponding to the image to be extracted. If the second-stage target feature does not meet the preset feature conditions, i becomes 3, ..., until i becomes N. Since the Nth-stage target feature meets the preset feature conditions, N is the number of stage sub-models included in the target feature extraction model. Therefore, if the 1st to N-1st-stage target features do not meet the preset feature conditions, the Nth-stage target feature output by the Nth-stage sub-model will eventually be determined as the target feature corresponding to the image to be extracted.
[0079] It can be seen that the embodiment of the present application divides the target feature extraction model into multiple stage sub-models. If the target features output by the previous one or multiple stage sub-models meet the preset feature conditions, it means that the previous one or several stage sub-models can extract the target features that meet the preset feature conditions. In this case, there is no need to continue running the subsequent stage sub-models to extract the target features. In this way, for images with high clarity, no occlusion, normal lighting, obvious clothing texture and other image targets that are relatively easy to identify, the target features that meet the preset feature conditions can be obtained through a small number of previous stage sub-models without running the subsequent stage sub-models. For images with blurred, dark, occluded, unclear clothing texture and other image targets that are difficult to identify, a larger number of stage sub-models can be used to obtain the target features that meet the preset feature conditions. It can be seen that the solution provided by the present application can flexibly and dynamically select the number of stage sub-models that need to be run according to the difficulty of image target recognition, instead of running the entire feature extraction model in full for each image, thereby reducing the computing resources and time consumed in feature extraction and target tracking, so that low-computing power devices can also guarantee the computing frame rate well when tracking targets, thereby better ensuring the tracking effect, and at the same time, it can also perform relatively accurate feature extraction and target tracking for images with different recognition difficulties. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 It is a schematic diagram of the application scenario provided by this application.
[0081] Figure 2 It is a flowchart of an example of a feature extraction method provided in the first embodiment of the present application.
[0082] Figure 3 It is a flowchart of another example of the feature extraction method provided in the first embodiment of the present application.
[0083] Figure 4 It is a thread execution flow diagram of the feature extraction method provided in the first embodiment of the present application.
[0084] Figure 5 It is a schematic diagram comparing the feature extraction method provided in the first embodiment of the present application with the feature extraction method of the related art.
[0085] Figure 6 It is a flowchart of an example of a method for training a feature extraction model provided in the second embodiment of the present application.
[0086] Figure 7 It is a structural block diagram of an example of a feature extraction device provided in an embodiment of the present application.
[0087] Figure 8 It is a structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0088] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is described clearly and completely below in conjunction with the drawings in the embodiments of the present application. However, the present application can be implemented in many other ways different from the following description. Therefore, based on the embodiments provided by the present application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the scope of protection of the present application.
[0089] It should be noted that the terms "first", "source domain", "third", etc. in the claims, description and drawings of the present application are used to distinguish similar objects and are not used to describe a specific order or sequence. The data used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including", "having" and their variants are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0090] In order to facilitate understanding of the various embodiments of the present application, the application background of the embodiments is described.
[0091] With the rapid development of computer technology, image-based target tracking is increasingly used in production and life. For example, human body tracking, vehicle tracking, face tracking and other target tracking are performed through the captured images, so as to realize passenger flow analysis, autonomous driving, video surveillance and other functions through target tracking.
[0092] When the related technology performs target tracking, it usually extracts the target features in the image through a trained feature extraction model, so as to track the target according to the extracted features. Specifically, it usually extracts features from the image through an overall static feature extraction model.
[0093] However, in order to handle complex targets and extract target features from images more accurately, the target feature extraction model is usually set to be relatively large, with a large number of parameters and model layers. This results in a large amount of computing resources required to run the model, and the model takes a long time to extract target features. For some low-computing power devices, the excessive time consumption can easily lead to the calculation frame rate of target tracking not keeping up, affecting the tracking effect.
[0094] In order to solve the above problems, the embodiments of the present application provide a feature extraction method, a target tracking method, a device, an electronic device and a computer-readable storage medium. It can not only track complex targets more accurately, but also reduce the time consumption of the model to extract target features, so that low-computing power devices can also guarantee the calculation frame rate when tracking targets, thereby better ensuring the tracking effect.
[0095] The feature extraction and target tracking solutions provided in this application can be used for face tracking, body tracking, vehicle tracking, animal trajectory tracking, etc. to achieve video surveillance, autonomous driving, etc., but are not limited to these.
[0096] In order to facilitate understanding of the method embodiments of the present application, the application scenarios are introduced. Figure 1 , Figure 1 The following is a schematic diagram of an application scenario of the method embodiment of the present application. It can be applied to a target tracking system. This application scenario is a schematic illustration and is not intended to be a specific description of its application scenario. The target tracking system can be a video monitoring system, a drone monitoring system, an automatic driving system, etc. Figure 1 As shown, in this application scenario, an image acquisition device 101 for photographing the image to be extracted and a tracking processing device 102 for target tracking are provided. In this embodiment, the image acquisition device 101 and the tracking processing device 102 are connected via network communication.
[0097] The image acquisition device 101 may be an electronic device with an image acquisition function, such as a video camera, a camera head, a vehicle-mounted camera, or a drone camera. The image acquisition device 101 may be capable of acquiring pictures or videos.
[0098] A specific communication connection needs to be established between the image acquisition device 101 and the tracking processing device 102 to perform image transmission.
[0099] The tracking processing device can be an electronic device with strong computing power, such as a server, or an electronic device with weak computing power, such as an onboard computer, an onboard processor, a computer, a tablet computer, a laptop computer, a processor integrated on an image acquisition device, etc. The tracking processing device 102 can be a single server or a server cluster. The tracking processing device 102 is used to extract target features according to the image to be extracted provided by the image acquisition device, and to track the target according to the extracted target features.
[0100] The image acquisition device 101 can communicate with the tracking processing device 102. The image acquisition device 101 and the tracking processing device 102 can communicate using various communication systems, such as a wired communication system or a wireless communication system. The wireless communication system can be, for example, a global system for mobile communications (GSM) system, a code division multiple access (CDMA) system, a wideband code division multiple access (WCDMA) system, a general packet radio service (GPRS), a long term evolution (LTE) system, a LTE frequency division duplex (FDD) system, a LTE time division duplex (TDD) system, a universal mobile telecommunication system (UMTS), a worldwide interoperability for microwave access (WiMAX) communication system, a future fifth generation (5G) system or a new radio (NR), a satellite communication system, etc.
[0101] Embodiment 1
[0102] The first embodiment of the present application provides a feature extraction method, and the executor of the method can be an electronic device, which can be a desktop computer, a laptop computer, a smart mobile terminal, a smart TV, a wearable device, a VR device, an image acquisition device including a processor, an on-board processor, a server, etc., but is not limited thereto.
[0103] like Figure 2 , Figure 3 As shown, the feature extraction method provided in the first embodiment of the present application includes the following steps S110 to S150.
[0104] Step S110: obtaining an image to be extracted from which target features are to be extracted.
[0105] The above-mentioned image to be extracted can be an image captured by an image acquisition device, specifically a picture or video frame of a video captured by the image acquisition device. In the embodiment of the present application, the electronic device can obtain the image to be extracted of the target feature to be extracted from the image acquisition device in real time, that is, during the process of the image acquisition device acquiring the video image, the acquired video frame is sent to the electronic device in real time, so that the electronic device can obtain the image to be extracted from the image acquisition device in real time, so that the target can be tracked in time; or, the electronic device can also obtain the image to be extracted from the image storage library, which is not specifically limited in the present application.
[0106] The target features to be extracted may be human features, facial features, license plate features, vehicle features, animal features, etc., but are not limited thereto. Those skilled in the art may determine the specific content of the target features to be extracted according to specific tracking target requirements.
[0107] Step S120: extract target features from the i-1th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model to obtain the i-th stage target features.
[0108] Among them, the above-mentioned target feature extraction model includes multiple stage sub-models, the 0th stage target feature includes an image determined according to the above-mentioned image to be extracted, and the initial value of i is 1.
[0109] The target feature extraction model is used to extract target features from an image, for example, to extract target features such as faces, human bodies, and license plates. Specifically, the target features used by the target feature extraction model to extract are the same as the target features to be extracted in step S110. The target feature extraction model includes multiple stage sub-models, for example, 2 stage sub-models, 3 stage sub-models, 4 stage sub-models, etc., but is not limited thereto. Those skilled in the art can set the number of stage sub-models included in the target feature extraction model according to actual needs. When the number of stage sub-models is large, since the granularity of the stage sub-model division is smaller, the number of stage sub-models that better matches the image complexity of the image to be extracted can be more flexibly selected, and the waste of model calculation can be better avoided, thereby further reducing the time-consuming model to extract target features, so that low-computing power devices can also guarantee the calculation frame rate when tracking targets. When the number of stage sub-models is small, the training process of the model can be made simpler, and the output of some invalid stage sub-models can be better avoided, thereby improving the tracking efficiency. Therefore, those skilled in the art can flexibly select the number of stage sub-models by comprehensively considering factors such as model training complexity, model computing resource conditions, and the complexity of the actual target feature extraction task, and this application does not specifically limit it.
[0110] In an embodiment of the present application, the target feature extraction model includes multiple feature extraction layers, such as multiple convolutional layers and multiple fully connected layers. The target feature extraction model may also include an embedding layer, an attention layer, a recurrent neural network layer, an output layer, etc., which are not specifically limited in the present application. Among them, image processing tasks usually require multiple layers of convolution to extract features at different levels to identify and classify objects. Therefore, in an embodiment of the present application, the target feature extraction model may include multiple layers of convolutional layers, each of which is used to extract features at different levels, thereby extracting accurate target features. Each convolutional layer is arranged in order from front to back, and the output of the previous convolutional layer is used as the input of the next convolutional layer to perform model feature processing in sequence. The arrangement position of the data processing layer other than the convolutional layer can be determined according to the actual situation, which is not specifically limited in the present application. Each stage sub-model may include one feature extraction layer (such as a convolutional layer or a fully connected layer), or may include multiple feature extraction layers (convolutional layers or fully connected layers). The number of feature extraction layers included in the sub-models of each stage may be the same or different. For example, the first stage sub-model includes the 1st to 5th convolutional layers, the second stage sub-model includes the 6th to 10th convolutional layers, and the third stage sub-model includes the 11th to 20th convolutional layers.
[0111] The above-mentioned i-th stage sub-model is used to extract the target features of the i-1-th stage target features to obtain the i-th stage target features. The i-1-th stage target features are obtained through the i-1-th stage sub-model. Since there is no 0-th stage sub-model, when i is the initial value 1, the 0-th stage target features are images determined according to the image to be extracted. Among them, the image determined according to the image to be extracted can be the image to be extracted itself, or it can be an image after the image to be extracted is processed, for example, it can be an image after scaling the image to be extracted, an image after the target area is extracted, etc., which is not specifically limited in this application.
[0112] In one implementation, before step S120, the above method may further include the following step S120a.
[0113] Step S120a: pre-process the image to be extracted to obtain a processed image.
[0114] Accordingly, the stage 0 target features may include the above-mentioned processed images.
[0115] Preprocessing the image to be extracted can make the subsequent feature extraction more efficient and accurate. The preprocessing may include pixel normalization, image scaling, target area extraction, denoising, cropping, etc., but is not limited thereto.
[0116] Optionally, step S120a may pre-process the image to be extracted according to step A below to obtain a processed image.
[0117] Step A: Detect and mark the target area where the target feature is located from the image to be extracted, and determine the image to be extracted with the marked target area as the processed image corresponding to the image to be extracted.
[0118] Specifically, the target area can be marked by a target box. In step A, the target area where the target feature is located can be detected by a region recognition model. The region recognition model can be trained by supervised learning training, semi-supervised learning training, or semi-supervised learning training through sample images with the target area marked. The specific training method can refer to the relevant technology, and this application will not be introduced in detail. By marking the target area, this embodiment can enable the subsequent model to accurately locate the target area when performing feature extraction, thereby performing feature extraction more efficiently and accurately.
[0119] Optionally, step S120a may also pre-process the image to be extracted according to the following steps B to C to obtain a processed image.
[0120] Step B: Detect the target area where the target features are located from the image to be extracted.
[0121] Step C: extracting a target area image corresponding to the target area from the image to be extracted, and determining a processed image corresponding to the image to be extracted based on the target area image.
[0122] Specifically, in step C, the target area image can be determined as the processed image. Alternatively, the target area image can be scaled to an image of a preset size to obtain a scaled image, and the scaled image can be determined as the processed image corresponding to the image to be extracted. The preset size can be determined according to the input requirements of the target feature extraction model. After the scaled image is determined as the processed image, each processed image can be adjusted to a uniform size suitable for the target feature extraction model, thereby facilitating the model to extract features and improving the accuracy of feature extraction and target tracking.
[0123] This embodiment determines a processed image based on the target area image. The processed image is an image that only contains the target area after useless image information is removed. Therefore, the target feature extraction model can extract target features more efficiently and accurately.
[0124] The target feature of the i-1th stage is extracted through the i-th stage sub-model of the pre-trained target feature extraction model. Specifically, the i-1th stage target feature is input into the i-th stage sub-model of the target feature extraction model, so that the i-th stage sub-model outputs the i-th stage target feature.
[0125] The specific training method of the target feature extraction model will be introduced later.
[0126] Step S130: Detect whether the target feature of the i-th stage meets the preset feature conditions.
[0127] The above-mentioned preset conditions may include that the size of the feature satisfies the preset size, the shape of the feature satisfies the preset shape, the color histogram of the area where the feature is located satisfies the preset color conditions, the texture features of the area where the feature is located meet the preset texture features, the category corresponding to the feature meets the preset category, etc. The preset conditions may vary according to the needs of the specific application, and this application does not specifically limit them.
[0128] Step S140: If the target feature of the i-th stage meets the preset feature condition, the target feature of the i-th stage is determined as the target feature corresponding to the image to be extracted.
[0129] Step S150: If the target feature of the i-th stage does not meet the preset feature condition, set i=i+1 and return to execute steps S120 to S150.
[0130] Among them, the target feature of the Nth stage meets the above-mentioned preset feature conditions, and N is the number of stage sub-models included in the target feature extraction model.
[0131] Specifically, when the target feature extraction model is used to extract the target feature, since the target feature of the 0th stage includes an image determined according to the image to be extracted, the initial value of i is 1. Taking the image determined according to the image to be extracted as the above-mentioned target area image as an example, the embodiment of the present application will first perform target feature extraction on the target area image through the 1st stage sub-model of the target feature extraction model to obtain the 1st stage target feature. If the 1st stage target feature meets the preset feature condition, the 1st stage target feature is determined as the target feature corresponding to the image to be extracted. If the 1st stage target feature does not meet the preset feature condition, i becomes 2, and then the 1st stage target feature is extracted through the 2nd stage sub-model of the target feature extraction model to obtain the 2nd stage target feature. If the target feature of the second stage meets the preset feature conditions, the target feature of the second stage is determined as the target feature corresponding to the image to be extracted. If the target feature of the second stage does not meet the preset feature conditions, i becomes 3, and the target feature of the second stage is extracted by the third stage sub-model of the target feature extraction model to obtain the third stage target feature, ..., if the target feature of the N-1 stage still does not meet the preset feature conditions, i becomes N. Since the target feature of the N stage meets the preset feature conditions, N is the number of stage sub-models included in the target feature extraction model. Therefore, if the target features of the 1st to N-1st stages do not meet the preset feature conditions, the target feature of the Nth stage output by the Nth stage sub-model will eventually be determined as the target feature corresponding to the image to be extracted.
[0132] In one implementation, the i-th stage sub-model may also be used to output the confidence level corresponding to the i-th stage target feature, that is, step S120 may be specifically implemented by the following step S122.
[0133] Step S122: extract target features of the i-1th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model to obtain the i-th stage target features and the corresponding confidence levels.
[0134] The above confidence level is used to indicate the credibility or accuracy of the target features of the i-th stage obtained. It can be understood that if the target features in the image to be extracted are relatively easy to identify, the stage sub-model at the front position can perform relatively accurate feature extraction, so the stage sub-model at the front position can output a relatively high confidence level; if the target features in the image to be extracted are not easy to identify, the stage sub-model at the front position may not be able to fully and accurately extract the target features in the image to be extracted, so the confidence level output by the stage sub-model at the front position is relatively low. In this case, more stage sub-models are required to perform more layers of feature extraction until the confidence level corresponding to the target features output by the subsequent stage sub-models is higher and meets the requirements.
[0135] The above step S130 can be implemented according to the following steps S130.
[0136] Step S131: Detect whether the confidence level corresponding to the target feature of the i-th stage is greater than a preset threshold.
[0137] Correspondingly, whether the target feature of the i-th stage meets the preset feature conditions, that is, the confidence corresponding to the target feature of the i-th stage is greater than the preset threshold, and whether the target feature of the i-th stage does not meet the preset feature conditions, that is, the confidence corresponding to the target feature of the i-th stage is not greater than the preset threshold.
[0138] In the embodiment of the present application, since the target feature of the Nth stage meets the preset feature condition, the confidence corresponding to the target feature of the Nth stage is greater than the preset threshold. Since the embodiment of the present application divides the target feature extraction model into N stage sub-models in total, the target feature of the Nth stage output by the last Nth stage sub-model is the feature finally output by the target feature extraction model, and therefore, the confidence corresponding to the target feature of the Nth stage can be assumed to be greater than the preset threshold. Therefore, the Nth stage sub-model can output a confidence greater than the preset threshold as the confidence corresponding to the target feature of the Nth stage, or the confidence corresponding to the target feature of the Nth stage output by the Nth stage sub-model can be empty, that is, the confidence corresponding to the target feature of the Nth stage is not output. When the confidence corresponding to the target feature of the Nth stage is empty, it is determined that the confidence corresponding to the target feature of the Nth stage is greater than the preset threshold. Both of these methods can achieve the confidence corresponding to the target feature of the Nth stage greater than the preset threshold, and those skilled in the art can flexibly choose.
[0139] This embodiment determines whether the target features of each stage meet the preset conditions by means of the corresponding confidence levels output by the models of each sub-stage. Since the model is pre-trained with functions for obtaining the execution levels corresponding to the target features of each stage, it is possible to accurately determine whether the target features of each stage have achieved the required accuracy based on the confidence levels. The confidence levels are directly derived from the model without the need for the computer to use other algorithms or programs to additionally detect whether the preset conditions are met, which can improve the efficiency and accuracy of detection, thereby making the accuracy and efficiency of the extracted targets higher.
[0140] The embodiment of the present application divides the target feature extraction model into multiple stage sub-models. If the target features output by the previous one or multiple stage sub-models meet the preset feature conditions, it means that the previous one or several stage sub-models can extract the target features that meet the preset feature conditions. In this case, there is no need to continue running the subsequent stage sub-models to extract the target features. In this way, for images with high clarity, no occlusion, normal lighting, obvious clothing texture and other image targets that are relatively easy to identify, the target features that meet the preset feature conditions can be obtained through a small number of previous stage sub-models without running the subsequent stage sub-models. For images with blurred, dark, occluded, unclear clothing texture and other image targets that are difficult to identify, a larger number of stage sub-models can be used to obtain the target features that meet the preset feature conditions. It can be seen that the solution provided by the present application can flexibly and dynamically select the number of stage sub-models that need to be run according to the difficulty of image target recognition, instead of running the entire feature extraction model in full for each image, thereby reducing the computing resources and time consumed in feature extraction and target tracking, so that low-computing power devices can also guarantee the computing frame rate well when tracking targets, thereby better ensuring the tracking effect, and at the same time, it can also perform relatively accurate feature extraction and target tracking for images with different recognition difficulties.
[0141] In one embodiment, each stage sub-model of the target feature extraction model can be run through each parallel thread. For example, if the target feature extraction model includes N stage sub-models, the first stage sub-model is run through the first stage thread, the second stage sub-model is run through the second stage thread, ..., the Nth stage sub-model is run through the Nth stage thread, and each stage thread is a parallel thread.
[0142] Correspondingly, step S120 can be implemented according to the following step S121.
[0143] Step S121: The i-th stage thread running the i-th stage sub-model performs target feature extraction on the i-1-th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model.
[0144] In this embodiment, since each stage sub-model is run through each parallel thread, when the image to be extracted includes multiple target features, each stage sub-model corresponding to each of the multiple threads can extract features from each target feature at the same time, thereby improving the efficiency of extracting the target features in the image. For example, taking the target feature as a human face, if the image to be extracted includes two human faces, after the first stage thread extracts features from the first human face through the first stage sub-model, the second stage thread will further extract features from the first human face through the second stage sub-model. During the process of the second stage thread extracting features from the first human face, the first stage thread is in an idle state because it has completed the feature extraction of the first human face. Therefore, during the process of the second stage thread extracting features from the first target feature, the first stage thread can extract features from the second target feature in parallel at the same time. In this way, the first stage thread and the second stage thread can extract features from the second human face and the first human face respectively at the same time, thereby improving the feature extraction.
[0145] In a specific embodiment, the i+1th stage thread is used to execute the above steps S130 to S150. That is, the i-th stage thread corresponding to the i-th stage submodel is used to execute the above step S120, and the i+1th stage thread corresponding to the i+1th stage submodel is used to execute the above steps S130 to S150. Exemplarily, taking the target feature extraction model including two stage submodels as an example, the first stage thread obtains the first stage target feature, and the second stage thread detects whether the first stage target feature meets the preset feature condition. If it is detected that the preset feature condition is met, the second stage thread determines the first stage target feature as the target feature corresponding to the image to be extracted. If it is detected that the preset feature condition is not met, the second stage thread makes i=i+1=2, and extracts the target feature of the first stage target feature through the second stage submodel to obtain the second stage target feature. In this embodiment, the latter stage thread detects the feature obtained by the previous stage thread, and can reasonably allocate the running tasks of each thread, thereby smoothly realizing feature extraction.
[0146] In a specific embodiment, the i+1th stage thread is also used to track the object corresponding to the target feature according to the target feature corresponding to the image to be extracted when it is detected that the i-th stage target feature meets the preset feature condition. Specifically, the extracted target feature can be compared with the reference feature to achieve target tracking, for example, the extracted facial feature can be compared with the reference facial feature to achieve tracking of a specific face, or the extracted license plate number can be compared with the reference license plate number to achieve tracking of a specific vehicle, etc. The embodiment of the present application can achieve the purpose of target tracking by using the i+1th stage thread to track the target feature that meets the preset feature condition obtained by the previous stage thread.
[0147] In a specific embodiment, each thread is provided with a corresponding buffer, for example, a first-stage thread corresponds to a first-stage buffer, and a second-stage thread corresponds to a second-stage buffer. The buffer corresponding to the thread is used to store result data obtained by the thread running. The above method may further include the following step S160.
[0148] Step S160: when it is detected that the stage i sub-model outputs data, the data output by the stage i sub-model is stored in the stage i buffer corresponding to the stage i thread.
[0149] Step S160 may specifically be that when the i-th stage thread detects that the i-th stage sub-model outputs data, the i-th stage sub-model outputs data into the i-th stage buffer. Specifically, when the i-th stage thread detects that the i-th stage sub-model outputs the i-th stage target feature and the corresponding confidence, the i-th stage target feature and the corresponding confidence are stored in the i-th stage buffer. The i-th stage thread may mark the i-th stage target feature with an identification mark, and the identification mark is used to mark which target the i-th stage target feature belongs to. For example, if the image to be extracted includes 3 faces, the identification mark may mark whether each face is the first, second or third face in the image to be extracted, so as to facilitate subsequent identification of which target each target feature belongs to according to the identification mark, so as to achieve accurate target tracking.
[0150] The above step S121 can be implemented according to the following step S121a.
[0151] Step S121a: The i-th stage thread running the i-th stage sub-model performs target feature processing on the i-1-th stage target features that have not been subjected to feature extraction and are stored in the i-1-th stage buffer through the i-th stage sub-model of the pre-trained target feature extraction model.
[0152] The i-1th stage target feature that has not been feature extracted in the i-1th stage buffer refers to the i-1th stage target feature in the i-1th stage buffer that has not been feature extracted by the i-th stage thread through the i-th stage sub-model.
[0153] In the embodiment of the present application, after the i-th stage thread extracts the i-1th stage target features in the i-1th stage buffer through the i-th stage sub-model, the i-1th stage target features that have undergone feature extraction can be marked as extracted features, so as to facilitate the subsequent identification of which features have undergone feature extraction and which features have not undergone feature extraction. In this case, step S121a can be implemented according to the following steps: the i-th stage thread running the i-th stage sub-model performs target feature processing on the i-1th stage target features stored in the i-1th stage buffer and not marked as extracted features through the i-th stage sub-model of the pre-trained target feature extraction model.
[0154] Alternatively, the i-1th stage target features that have been feature extracted in the i-1th stage buffer may be deleted, so that what is always stored in the i-1th stage buffer is the i-1th stage target features that have not been feature extracted. Among them, the 0th stage buffer is used to store the 0th stage target features. Specifically, the 0th stage buffer is used to store images determined according to the images to be extracted. For example, the 0th stage buffer can be used to store the above-mentioned processed images. In this case, step S121a can be implemented according to the following steps: when the i-th stage thread running the i-th stage submodel detects that there is data in the i-1th stage buffer, the i-th stage submodel of the pre-trained target feature extraction model performs target feature processing on the i-1th stage target features stored in the i-1th stage buffer. In this embodiment, by deleting the target features that have been feature extracted in the buffer, more space can be made available in the buffer for data storage in a timely manner, and it can also be more convenient for the next stage thread to obtain features from the previous stage buffer for feature extraction.
[0155] By setting up a buffer, this embodiment can store the data output by the sub-model of each stage into the buffer for subsequent feature processing, thereby facilitating the orderly management of the output data and facilitating each parallel stage thread to flexibly obtain the data to be extracted from the buffer for feature extraction, thereby improving the orderliness of target tracking and the efficiency of parallel tracking.
[0156] Specifically, step S160 may be that when the i-th stage thread detects that the i-th stage sub-model outputs data, if the i-th stage buffer is not full, the data output by the i-th stage sub-model is stored in the i-th stage buffer; if the i-th stage buffer is full, when it is detected that the i-th stage buffer becomes not full, the data output by the i-th stage sub-model is stored in the i-th stage buffer. Optionally, when the i-th stage thread detects that the i-th stage sub-model outputs data, if the i-th stage buffer is full, the i-th stage thread may stop executing the step of extracting target features from the i-1-th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model, so as to avoid subsequent feature processing due to excessive output data not being able to be stored in the buffer in time, until it is detected that the i-th stage buffer becomes full, and the i-th stage thread restarts to execute the step of extracting target features from the i-1-th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model.
[0157] In a specific embodiment, step S110 can be implemented according to the following step S111.
[0158] Step S111: the detection thread obtains the image to be extracted of the target feature to be extracted from the image buffer, where the image buffer is used to store the image acquired by the image acquisition device and used to extract the target feature.
[0159] In the case where the target feature of the above-mentioned stage 0 includes the above-mentioned processed image, and the above-mentioned scaled image is determined as the processed image corresponding to the image to be extracted, the steps of detecting the target area where the target feature is located from the image to be extracted in the above-mentioned steps A and B can be performed by the above-mentioned detection thread. That is, after the detection thread obtains the image to be extracted of the target feature to be extracted from the image buffer, it detects the target area where the target feature is located from the image to be extracted, and can also mark the above-mentioned target area in the image to be extracted.
[0160] The method may further include the following step S170.
[0161] Step S170: the detection thread stores the image to be extracted and the corresponding target area into the detection buffer corresponding to the detection thread.
[0162] The above step C can be implemented according to the following steps: the preprocessing thread obtains the image to be extracted and the corresponding target area from the detection buffer, extracts the target area image corresponding to the target area from the image to be extracted, and determines the processed image corresponding to the image to be extracted based on the above target area image.
[0163] The above method may further include the following step S180.
[0164] Step S180: the preprocessing thread stores the processed image into a preprocessing buffer corresponding to the preprocessing thread.
[0165] When the value of i is 1, the above step S121 can be implemented according to the following steps: run the first stage thread of the first stage sub-model to obtain the processed image that has not been feature extracted from the above pre-processing buffer, and perform target feature extraction on the processed image through the first stage sub-model of the target feature extraction model.
[0166] The detection thread, the preprocessing thread, and the i-th stage thread are parallel threads.
[0167] In this embodiment, the parallel detection thread and preprocessing thread respectively detect the target area of the image to be extracted, cut out the target area image, and obtain the processed image, so that different preprocessing processes of the image can be executed by different parallel threads, thereby improving the efficiency of image preprocessing for each image to be extracted, ensuring high frame rate processing of the image, and thus improving the tracking efficiency. By setting a buffer for each thread, it can better ensure that the data processed by each thread is saved in time, so as to better ensure that the data is stored safely and not easily lost or erroneous, and it is also convenient for subsequent threads to quickly and easily obtain data from the buffer for further data processing, thereby improving the target tracking efficiency.
[0168] In a specific embodiment, step S111 may be implemented according to the following steps: when the detection thread detects that there is an image to be extracted with target features to be extracted in the image buffer, the detection thread obtains the image to be extracted from the image buffer;
[0169] The method may further include the following step S190.
[0170] Step S190: when it is detected that the detection thread has acquired the image to be extracted in the image buffer, the acquired image to be extracted in the image buffer is deleted.
[0171] The preprocessing thread obtains the image to be extracted and the corresponding target area from the detection buffer by the following steps: when the preprocessing thread detects that the image to be extracted and the corresponding target area exist in the detection buffer, the preprocessing thread obtains the image to be extracted and the corresponding target area from the detection buffer.
[0172] The method may further include the following step S1100.
[0173] Step S1100: when it is detected that the preprocessing thread has acquired the image to be extracted and the corresponding target area in the detection buffer, the acquired image to be extracted and the corresponding target area in the detection buffer are deleted.
[0174] Below, the entire process of feature extraction and target tracking is exemplarily described by taking the target feature extraction model including the first stage sub-model and the second stage sub-model as an example. Figure 4 As shown, in this embodiment, several threads and several buffers are provided. The image buffer is used to store the video frames collected by the video acquisition device, and the video frames are the images to be extracted of the target features to be extracted, until the image buffer is filled with video frames. When the detection thread has video frames in the image buffer, the detection thread takes out the video frames from the image buffer for target detection, obtains the corresponding target frame, and deletes the video frames taken out from the image buffer. If the detection buffer is not full, the detection thread will store the image to be extracted and the corresponding target frame in the detection buffer, and then perform the next frame detection process; if the detection buffer is full, the detection thread is in a waiting state until the detection buffer is not full. When the detection buffer is not empty, the preprocessing thread will take out the image to be extracted and the corresponding target frame from the detection buffer, and extract the target image area from the image to be extracted according to the target frame coordinates, and scale it to obtain the scaled image as the processed image. If the preprocessing buffer is not full, the processed image will be stored in the preprocessing buffer, otherwise wait. If the preprocessing buffer is not empty, the first-stage thread will take out the processed image from the preprocessing buffer to extract the target features, output the first-stage target features and the corresponding confidences, and if the first-stage buffer is not full, store the first-stage target features and the corresponding confidences corresponding to the current processed image in the first-stage buffer, otherwise wait. If the first-stage buffer is not empty, the second-stage thread will take out the first-stage target features and the corresponding confidences from the first-stage buffer, and determine whether the confidences corresponding to the first-stage target features of the current image to be extracted are higher than the preset threshold. If so, the target features corresponding to the current image to be extracted are expressed with the first-stage target features for tracking; otherwise, the first-stage target features of the current image to be extracted are input into the second-stage submodel for target feature extraction, and the second-stage target features are obtained as the targets corresponding to the current image to be extracted for tracking. At the same time, it is determined whether the second-stage buffer is not full. If not, the tracking results are stored in the second-stage buffer, otherwise wait.
[0175] This embodiment can release buffer space in time to store more data by promptly deleting data in the buffer that has been processed by the next thread, and can enable the next thread to conveniently obtain data from the buffer for the next step of data processing without having to determine whether the data has been processed, thereby improving the efficiency of feature extraction and target tracking, and further ensuring a high frame rate of target tracking.
[0176] In one embodiment, the target feature extraction model may include multiple convolutional layers, and the first convolutional layer of the target feature extraction model is used to perform pixel value normalization on the processed image before performing target feature extraction. Among them, the pixel value normalization of the processed image refers to converting each pixel value of the image to a specific range, such as scaling the pixel value to the range of [0, 1] or [-1, 1]. Specifically, the pixel value of each pixel of the processed image can be subtracted from the mean and then divided by the standard deviation. After the image is pixel value normalized, the numerical stability of the image processing process can be better ensured. Since the pixel value ranges of different images may be different, normalization can eliminate these differences, so that different images can be compared and analyzed under the same set of processing procedures, which is convenient for the target feature extraction model to perform feature extraction.
[0177] This implementation method performs pixel value normalization processing on the processed image through the first convolution layer of the target feature extraction model. Compared with the electronic device implementing normalization processing through the ARM CPU, since the normalization processing is a routine operation before model inference, the ARM CPU is required to run the normalization processing program for each model inference, which will occupy the precious bandwidth resources of the electronic device (such as embedded devices), thereby affecting the overall running time of the target tracking. This implementation method integrates the normalization processing into the first convolution layer of the target feature processing model, thereby eliminating the CPU operation of normalizing the image pixel values, thereby achieving the effect of acceleration.
[0178] In one embodiment, after the pixel values of the image are normalized in advance, the calculation function of the first convolutional layer is the following formula (1):
[0179] (1)
[0180] In formula (1), represents the output of the first convolutional layer, represents the weight of the first convolutional layer, represents the bias of the first convolutional layer, Xnorm Represents the image after the pixel value of the processed image is normalized.
[0181] because ,in, Xorg Represents the processed image, Mean represents the normalized mean of the image, Std represents the normalized standard deviation of the image, so formula (1) can be expressed as the following formula (2):
[0182] (2)
[0183] After combining and decomposing formula (2), we get the following formula (3):
[0184] (3)
[0185] make , , then formula (3) can be written as the following formula (4):
[0186] (4)
[0187] Therefore, after integrating the pixel value normalization operation into the first convolution layer, the function corresponding to the first convolution layer is the above formula (4).
[0188] The function of the first convolutional layer determined in this embodiment enables the first convolutional layer to realize the pixel value normalization operation on the processed image and perform feature extraction. That is to say, this embodiment preprocesses the target feature extraction model and integrates the mean and standard deviation into the target feature extraction model, so that the target feature extraction model has the function of normalizing the pixel values of the image, such as Figure 5 As shown, compared with the related art in which pixel value normalization is performed before model inference, the present application can omit the image pixel value normalization operation, thereby improving the efficiency of feature extraction.
[0189] Embodiment 2
[0190] The second embodiment of the present application provides a training method for a feature extraction model. The executor of the training method is an electronic device, which may be a desktop computer, a laptop computer, a smart mobile terminal, a smart TV, a wearable device, a VR device, a server, etc., but is not limited thereto.
[0191] like Figure 6 As shown, the training method of the feature extraction model provided in the second embodiment of the present application includes the following steps S210 to S240.
[0192] Step S210: Acquire a first sample image, where the first sample image is marked with a target feature and an image complexity label corresponding to the first sample image.
[0193] Specifically, if the trained feature extraction model is used to extract facial features, the first sample image is marked with the target feature of facial features. The image complexity label corresponding to the first sample image can be a complex label or a simple label; or, the image complexity label corresponding to the first sample image can also be a complexity label, and the number of levels of complexity division can be the same as the number of sub-models to be trained included in the model to be trained. For example, if the number of sub-models to be trained is N, the image complexity corresponding to the first sample image can be divided into N complexities, such as 1, 2, ..., N. The larger the complexity value, the more complex the first sample image. The complexity label corresponding to the first sample image can be determined based on the clarity, background complexity, occlusion, lighting conditions, etc. of the first sample image. When the image clarity is low, the background is complex and there is occlusion, and the lighting is weak, the first sample image can be marked with a complex label, otherwise, it can be marked with a simple label.
[0194] In the embodiment of the present application, the complexity label can be manually annotated, or the complexity of the first sample image can be detected by a detection model or a detection algorithm to obtain the complexity label. The target feature corresponding to the first sample image can be manually pre-determined and marked.
[0195] Step S220: input the output j-1 stage target feature into the j-stage sub-model to be trained of the model to be trained to obtain the output j-stage target feature and the confidence level corresponding to the output j-stage target feature.
[0196] The model to be trained includes multiple sub-models in the to-be-trained stages, and the output 0th stage target features include the above-mentioned first sample image.
[0197] Step S230: Based on the difference between the target features of the j-th stage output and the target features of the first sample image label, and the consistency between the confidence corresponding to the target features of the j-th stage output and the complexity label of the first sample image label, the model parameters of the j-th stage sub-model to be trained are adjusted to obtain the j-th stage sub-model after training.
[0198] j traverses 1~N, where N is the number of sub-models to be trained included in the model to be trained.
[0199] Exemplarily, when j is 1, the first sample image can be input into the first stage sub-model to be trained of the model to be trained to obtain the output first stage target feature and the confidence corresponding to the output first stage target feature, and then based on the difference between the first stage target feature and the target feature marked by the first sample image, the consistency between the confidence corresponding to the above-mentioned output first stage target feature and the complexity label marked by the above-mentioned first sample image, the model parameters of the first stage sub-model to be trained are adjusted to obtain the trained first stage sub-model. Since j traverses 1~N, the first stage sub-model can be fixed, and then the second stage sub-model can be trained in the same way, and the trained 1~N stage sub-models can be obtained in turn.
[0200] In step S230, based on the principle of making the difference between the target feature of the j-th stage output and the target feature of the first sample image label smaller than the preset difference and making the confidence corresponding to the target feature of the j-th stage output consistent with the complexity label of the first sample image label, the model parameters of the j-th stage sub-model to be trained can be adjusted to obtain the j-th stage sub-model after training.
[0201] The confidence corresponding to the target feature of the jth stage is outputted to be consistent with the complexity label of the first sample image, which may be that the confidence corresponding to the target feature of the jth stage is consistent with the complexity level label of the first sample image. For example, when the confidence corresponding to the target feature of the jth stage is higher than a preset threshold and the complexity label of the first sample image is simple, it is determined that the confidence corresponding to the target feature of the jth stage is outputted to be consistent with the complexity label of the first sample image; otherwise, it is determined that the confidence corresponding to the target feature of the jth stage is outputted to be inconsistent with the complexity label of the first sample image.
[0202] It is understandable that the complexity label of the first sample image is used to train the confidence level of the matching model output. The specific training process of the feature extraction model can adopt a supervised training algorithm, an unsupervised training algorithm or other training algorithm in the relevant technology, which is not specifically limited in this application.
[0203] Step S240: Determine the model composed of the trained 1st stage sub-model to the Nth stage sub-model as the trained target feature extraction model.
[0204] The training method provided in this embodiment can train a target feature extraction model including sub-models at each stage, and each stage sub-model can output a corresponding confidence level, so as to determine whether the target feature output by the stage sub-model meets the preset conditions based on the confidence level.
[0205] In one implementation, the above training method may further include the following steps S250 to S270.
[0206] Step S250: Acquire a second sample image, where the second sample image is marked with target features.
[0207] Step S260: input the second sample image into the trained target feature extraction model to obtain output target features.
[0208] Step S270: adjusting the model parameters of the trained target feature extraction model based on the difference between the output target feature and the target feature marked by the second sample image, to obtain an optimized target feature extraction model.
[0209] This implementation further optimizes and trains the above-mentioned trained target feature extraction model as a whole, so that the optimized target feature extraction model can extract target features in the image more accurately.
[0210] Embodiment 3
[0211] The third embodiment of the present application also provides a target tracking method, the executor of the method may be an electronic device, which may be a desktop computer, a laptop computer, a smart mobile terminal, a smart TV, a wearable device, a VR device, an image acquisition device including a processor, an on-board processor, a server, etc., but is not limited thereto.
[0212] The target tracking method provided in the third embodiment of the present application includes the following steps S310 to S330.
[0213] Step S310: Acquire a tracking image for target tracking.
[0214] The method for acquiring the tracking image can refer to the method for acquiring the image to be extracted in the first embodiment, which will not be described in detail here.
[0215] Step S320: extracting the tracked target features from the tracking image using any feature extraction method described in the first embodiment.
[0216] Step S330: Tracking according to target features.
[0217] Specifically, the extracted target features can be compared with the reference features to achieve target tracking, for example, the extracted facial features can be compared with the reference facial features to achieve tracking of a specific face, or the extracted license plate number can be compared with the reference license plate number to achieve tracking of a specific vehicle, etc.
[0218] This embodiment is an embodiment of running the feature extraction method of the first embodiment to perform target tracking. The relevant content has been described in detail in the first embodiment and will not be described in detail in this embodiment.
[0219] Embodiment 4
[0220] The fourth embodiment of the present application also provides a feature extraction device corresponding to the feature extraction method embodiment provided in the first embodiment above. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For the details of the relevant technical features and the effects achieved, please refer to the corresponding description of the feature extraction method embodiment provided above. Figure 7 As shown, the feature extraction device provided by the present application includes:
[0221] An acquisition module 410 is used to acquire an image to be extracted from which target features are to be extracted;
[0222] A model calculation module 420 is used to extract target features from the i-1th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model to obtain the i-th stage target features, wherein the target feature extraction model includes multiple stage sub-models, the 0th stage target features include images determined according to the image to be extracted, and the initial value of i is 1;
[0223] The detection module 430 is used to detect whether the target feature of the i-th stage meets the preset feature conditions; if so, the target feature of the i-th stage is determined as the target feature corresponding to the image to be extracted; if not, i=i+1, and the model calculation module is called to execute the step of performing target feature processing on the i-1-th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model, wherein the N-th stage target feature meets the preset feature conditions, and N is the number of stage sub-models included in the target feature extraction model.
[0224] Optionally, the i-th stage sub-model is also used to output the confidence level corresponding to the i-th stage target feature;
[0225] The detection module is specifically used to detect whether the confidence corresponding to the target feature of the i-th stage is greater than a preset threshold.
[0226] Optionally, the confidence corresponding to the N-stage target feature output by the N-stage sub-model is greater than the preset threshold; or, the confidence corresponding to the N-stage target feature output by the N-stage sub-model is empty. When the confidence corresponding to the N-stage target feature is empty, it is determined that the confidence corresponding to the N-stage target feature is greater than the preset threshold.
[0227] Optionally, the device further comprises:
[0228] An image processing module, used for preprocessing the image to be extracted to obtain a processed image;
[0229] The stage 0 target features include the processed image.
[0230] Optionally, the image processing module is specifically used for:
[0231] A target area where the target feature is located is detected and marked from the image to be extracted, and the image to be extracted with the target area marked is determined as a processed image corresponding to the image to be extracted.
[0232] Optionally, the image processing module is specifically used to: detect a target area where the target feature is located from the image to be extracted; extract a target area image corresponding to the target area from the image to be extracted, and determine a processed image corresponding to the image to be extracted based on the target area image.
[0233] Optionally, the image processing module is specifically used to: scale the target area image to an image of a preset size to obtain a scaled image; and determine the scaled image as a processed image corresponding to the image to be extracted.
[0234] Optionally, each stage sub-model of the target feature extraction model is run through each parallel thread respectively;
[0235] The model calculation module is specifically used to perform target feature processing on the i-1th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model by running the i-th stage thread of the i-th stage sub-model.
[0236] Optionally, the detection module is used to execute the detection of whether the i-th stage target feature meets the preset feature condition through the i+1 stage thread. If so, the i-th stage target feature is determined as the target feature corresponding to the image to be extracted. If not, i=i+1 is set, and the step of performing target feature processing on the i-1 stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model is returned.
[0237] Optionally, the detection module is further configured to track an object corresponding to the target feature according to the target feature corresponding to the image to be extracted when the i+1th stage thread detects that the i-th stage target feature satisfies the preset feature condition.
[0238] Optionally, each of the threads is respectively provided with a corresponding buffer;
[0239] The detection module is further used for: when detecting that the i-th stage sub-model outputs data, storing the data output by the i-th stage sub-model into the i-th stage buffer corresponding to the i-th stage thread;
[0240] The model calculation module is specifically used to perform target feature processing on the i-1th stage target features that have not been feature extracted and are stored in the i-1th stage buffer by running the i-th stage thread of the i-th stage sub-model and based on the i-th stage sub-model of the pre-trained target feature extraction model.
[0241] Optionally, the feature extraction device may further include an image acquisition module, which is used to acquire images through a lens, and output a video image after image signal processing, so that the acquisition module can acquire the video image output by the image acquisition module as the image to be extracted. The feature extraction device may further include an image processing module and a network communication module. The image processing module is used to pre-process the above-mentioned image to be extracted to obtain a processed image, and the network communication module is used to communicate with the camera over the network to obtain the video image acquired by the camera. The above-mentioned device may further include a control module and a storage medium. The control module is used to perform logical calculations in the target tracking process and the scheduling of calculation tasks of each module, and the storage module performs storage space management.
[0242] Embodiment 5
[0243] The fifth embodiment of the present application also provides a training device for a feature extraction model corresponding to the training method embodiment of the feature extraction model provided in the second embodiment above. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For the details of the relevant technical features and the effects achieved, please refer to the corresponding description of the feature extraction method embodiment provided above. The training device for the feature extraction model provided in the present application includes:
[0244] A sample acquisition module, configured to acquire a first sample image, wherein the first sample image is marked with a target feature and an image complexity label corresponding to the first sample image;
[0245] A model running module, used for inputting the output j-1 stage target feature into the j-stage sub-model to be trained of the model to be trained, to obtain the output j-stage target feature and the confidence corresponding to the output j-stage target feature, wherein the model to be trained includes a plurality of sub-models to be trained stages, and the output 0-stage target feature includes the first sample image;
[0246] A parameter adjustment module is used to adjust the model parameters of the j-stage sub-model to be trained based on the difference between the output j-stage target feature and the target feature marked by the first sample image, and the consistency between the confidence corresponding to the output j-stage target feature and the complexity label marked by the first sample image, so as to obtain the j-stage sub-model after training, where j traverses 1 to N, and N is the number of the sub-models of the to-be-trained stage included in the to-be-trained model;
[0247] The determination module is used to determine the model composed of the first stage sub-model to the Nth stage sub-model after training as the target feature extraction model after training.
[0248] Embodiment 6
[0249] The sixth embodiment of the present application also provides a target tracking device corresponding to the target tracking method embodiment provided in the third embodiment above. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For the details of the relevant technical features and the effects achieved, please refer to the corresponding description of the feature extraction method embodiment provided above. The target tracking device provided by the present application includes:
[0250] An image acquisition module, used for acquiring a tracking image for target tracking;
[0251] An extraction module, configured to extract the tracked target feature from the tracking image by using the feature extraction method described in any one of the first embodiments;
[0252] A tracking module is used to track the target according to the target features.
[0253] The seventh embodiment of the present application also provides an electronic device embodiment corresponding to the feature extraction method embodiment provided in the first embodiment above. The following description of the electronic device embodiment is only illustrative. The electronic device embodiment is as follows:
[0254] Please refer to Figure 8 Understand the above electronic devices, Figure 8 The electronic device provided in this embodiment includes: a processor 1001, a memory 1002, a communication bus 1003, and a communication interface 1004;
[0255] The memory 1002 is used to store computer instructions for data processing. When the computer instructions are read and executed by the processor 1001, the following steps are performed:
[0256] Obtaining an image to be extracted of target features to be extracted;
[0257] Extracting target features of the i-1th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model to obtain the i-th stage target features, wherein the target feature extraction model includes multiple stage sub-models, the 0th stage target features include images determined according to the image to be extracted, and the initial value of i is 1;
[0258] Detecting whether the target feature of the i-th stage meets the preset feature condition;
[0259] If satisfied, the target feature of the i-th stage is determined as the target feature corresponding to the image to be extracted;
[0260] If not satisfied, set i=i+1, and return to execute the step of performing target feature processing on the i-1th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model, wherein the Nth stage target feature satisfies the preset feature condition, and N is the number of stage sub-models included in the target feature extraction model.
[0261] The eighth embodiment of the present application also provides an electronic device embodiment corresponding to the training method embodiment of the feature extraction model provided in the second embodiment above. The following description of the electronic device embodiment is only illustrative. The electronic device embodiment is as follows:
[0262] The electronic device provided in this embodiment includes: a processor, a memory, a communication bus, and a communication interface;
[0263] The memory is used to store computer instructions for data processing, and when the computer instructions are read and executed by the processor, the following steps are performed:
[0264] Acquire a first sample image, where the first sample image is marked with a target feature and an image complexity label corresponding to the first sample image;
[0265] Inputting the output j-1 stage target feature into the j-stage sub-model to be trained of the model to be trained, to obtain the output j-stage target feature and the confidence corresponding to the output j-stage target feature, wherein the model to be trained includes a plurality of sub-models to be trained stages, and the output 0-stage target feature includes the first sample image;
[0266] Based on the difference between the output j-stage target feature and the target feature marked by the first sample image, and the consistency between the confidence corresponding to the output j-stage target feature and the complexity label marked by the first sample image, the model parameters of the j-stage sub-model to be trained are adjusted to obtain the j-stage sub-model after training, where j traverses 1 to N, and N is the number of the sub-models to be trained included in the model to be trained;
[0267] The model composed of the post-training 1st stage sub-model to the Nth stage sub-model is determined as the post-training target feature extraction model.
[0268] The ninth embodiment of the present application also provides an electronic device embodiment corresponding to the target tracking method embodiment provided in the third embodiment above. The following description of the electronic device embodiment is only illustrative. The electronic device embodiment is as follows:
[0269] The electronic device provided in this embodiment includes: a processor, a memory, a communication bus, and a communication interface;
[0270] The memory is used to store computer instructions for data processing, and when the computer instructions are read and executed by the processor, the following steps are performed:
[0271] Acquire a tracking image for target tracking;
[0272] Extracting the tracked target feature from the tracking image by using the feature extraction method described in any one of the first embodiments;
[0273] Tracking is performed according to the target features.
[0274] The tenth embodiment of the present application also provides a computer-readable storage medium for implementing the above feature extraction method. The computer-readable storage medium embodiment provided in this application is described relatively simply. For the relevant parts, please refer to the corresponding description of the above method embodiment. The following described embodiment is only illustrative.
[0275] The computer readable storage medium provided in this embodiment stores computer instructions, and when the instructions are executed by a processor, the following steps are implemented:
[0276] Obtaining an image to be extracted of target features to be extracted;
[0277] Extracting target features of the i-1th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model to obtain the i-th stage target features, wherein the target feature extraction model includes multiple stage sub-models, the 0th stage target features include images determined according to the image to be extracted, and the initial value of i is 1;
[0278] Detecting whether the target feature of the i-th stage meets the preset feature condition;
[0279] If satisfied, the target feature of the i-th stage is determined as the target feature corresponding to the image to be extracted;
[0280] If not satisfied, set i=i+1, and return to execute the step of performing target feature processing on the i-1th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model, wherein the Nth stage target feature satisfies the preset feature condition, and N is the number of stage sub-models included in the target feature extraction model.
[0281] The eleventh embodiment of the present application also provides a computer-readable storage medium for implementing the training method of the above-mentioned feature extraction model. The computer-readable storage medium embodiment provided in this application is described relatively simply. For the relevant parts, please refer to the corresponding description of the above-mentioned method embodiment. The embodiment described below is merely illustrative.
[0282] The computer readable storage medium provided in this embodiment stores computer instructions, and when the instructions are executed by a processor, the following steps are implemented:
[0283] Acquire a first sample image, where the first sample image is marked with a target feature and an image complexity label corresponding to the first sample image;
[0284] Inputting the output j-1 stage target feature into the j-stage sub-model to be trained of the model to be trained, to obtain the output j-stage target feature and the confidence corresponding to the output j-stage target feature, wherein the model to be trained includes a plurality of sub-models to be trained stages, and the output 0-stage target feature includes the first sample image;
[0285] Based on the difference between the output j-stage target feature and the target feature marked by the first sample image, and the consistency between the confidence corresponding to the output j-stage target feature and the complexity label marked by the first sample image, the model parameters of the j-stage sub-model to be trained are adjusted to obtain the j-stage sub-model after training, where j traverses 1 to N, and N is the number of the sub-models to be trained included in the model to be trained;
[0286] The model composed of the post-training 1st stage sub-model to the Nth stage sub-model is determined as the post-training target feature extraction model.
[0287] The twelfth embodiment of the present application also provides a computer-readable storage medium for implementing the above target tracking method. The computer-readable storage medium embodiment provided in this application is described relatively simply. For the relevant parts, please refer to the corresponding description of the above method embodiment. The following described embodiment is only illustrative.
[0288] The computer readable storage medium provided in this embodiment stores computer instructions, and when the instructions are executed by a processor, the following steps are implemented:
[0289] Acquire a tracking image for target tracking;
[0290] Extracting the tracked target feature from the tracking image by using the feature extraction method described in any one of the first embodiments;
[0291] Tracking is performed according to the target features.
[0292] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0293] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0294] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0295] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0296] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A feature extraction method, characterized in that: The method comprises: Obtaining an image to be extracted of target features to be extracted; Extracting target features of the i-1th stage target features through the i-th stage sub-model of the pre-trained target feature extraction model to obtain the i-th stage target features, wherein the target feature extraction model includes multiple stage sub-models, the 0th stage target features include images determined according to the image to be extracted, and the initial value of i is 1; Detecting whether the target feature of the i-th stage meets the preset feature condition; If satisfied, the target feature of the i-th stage is determined as the target feature corresponding to the image to be extracted; If not satisfied, set i=i+1, and return to execute the step of performing target feature processing on the i-1th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model, wherein the Nth stage target feature satisfies the preset feature condition, and N is the number of stage sub-models included in the target feature extraction model.
2. The feature extraction method according to claim 1, characterized in that: The i-th stage sub-model is also used to output the confidence level corresponding to the i-th stage target feature; The detecting whether the target feature of the i-th stage meets the preset feature condition includes: Check whether the confidence level corresponding to the target feature of the i-th stage is greater than a preset threshold.
3. The feature extraction method according to claim 2, characterized in that: The confidence corresponding to the N-stage target feature output by the N-stage sub-model is greater than the preset threshold; or, the confidence corresponding to the N-stage target feature output by the N-stage sub-model is empty. When the confidence corresponding to the N-stage target feature is empty, it is determined that the confidence corresponding to the N-stage target feature is greater than the preset threshold.
4. The feature extraction method according to claim 1, characterized in that: Before the target feature processing is performed on the target feature of the i-1th stage by the i-th stage sub-model of the pre-trained target feature extraction model, the method further includes: Preprocessing the image to be extracted to obtain a processed image; The stage 0 target features include the processed image.
5. The feature extraction method according to claim 4, characterized in that: The preprocessing of the image to be extracted to obtain a processed image includes: A target area where the target feature is located is detected and marked from the image to be extracted, and the image to be extracted with the target area marked is determined as a processed image corresponding to the image to be extracted.
6. The feature extraction method according to claim 4, characterized in that: The preprocessing of the image to be extracted to obtain a processed image includes: Detecting a target area where the target feature is located from the image to be extracted; A target area image corresponding to the target area is extracted from the image to be extracted, and a processed image corresponding to the image to be extracted is determined according to the target area image.
7. The feature extraction method according to claim 6, characterized in that: The step of determining the processed image corresponding to the image to be extracted according to the target area image includes: Scaling the target area image to an image of a preset size to obtain a scaled image; The scaled image is determined as a processed image corresponding to the image to be extracted.
8. The feature extraction method according to any one of claims 1 to 7, characterized in that: Each stage sub-model of the target feature extraction model is respectively run through each parallel thread; The target feature processing of the target feature of the i-1th stage by the i-th stage sub-model of the pre-trained target feature extraction model includes: The i-th stage thread running the i-th stage sub-model performs target feature processing on the i-1-th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model.
9. The feature extraction method according to claim 8, characterized in that: Each of the threads is respectively provided with a corresponding buffer; The method further comprises: When the output data of the stage i sub-model is detected, the data outputted by the stage i sub-model is stored in the stage i buffer corresponding to the stage i thread; The i-th stage thread running the i-th stage sub-model performs target feature processing on the i-1-th stage target feature through the i-th stage sub-model of the pre-trained target feature extraction model, including: The i-th stage thread running the i-th stage sub-model performs target feature processing on the i-1th stage target features that have not been subjected to feature extraction and are stored in the i-1th stage buffer through the i-th stage sub-model of the pre-trained target feature extraction model.
10. The feature extraction method according to any one of claims 4 to 7, characterized in that: The first convolutional layer of the target feature extraction model is used to perform pixel value normalization on the processed image before extracting target features.
11. The feature extraction method according to claim 10, characterized in that: The function corresponding to the first convolutional layer is: in, , , represents the output of the first convolutional layer, Represents the processed image, Mean represents the normalized mean of the image, Std represents the normalized standard deviation of the image, represents the weight of the first convolutional layer, Represents the bias of the first convolutional layer.
12. A method for training a feature extraction model, characterized in that: The method comprises: Acquire a first sample image, where the first sample image is marked with a target feature and an image complexity label corresponding to the first sample image; Inputting the output j-1 stage target feature into the j-stage sub-model to be trained of the model to be trained, to obtain the output j-stage target feature and the confidence corresponding to the output j-stage target feature, wherein the model to be trained includes a plurality of sub-models to be trained stages, and the output 0-stage target feature includes the first sample image; Based on the difference between the output j-stage target feature and the target feature marked by the first sample image, and the consistency between the confidence corresponding to the output j-stage target feature and the complexity label marked by the first sample image, the model parameters of the j-stage sub-model to be trained are adjusted to obtain the j-stage sub-model after training, where j traverses 1 to N, and N is the number of the sub-models to be trained included in the model to be trained; The model composed of the post-training 1st stage sub-model to the Nth stage sub-model is determined as the post-training target feature extraction model.
13. A target tracking method, characterized in that: The method comprises: Acquire a tracking image for target tracking; Extracting the tracked target features from the tracking image by the feature extraction method according to any one of claims 1 to 11; Tracking is performed according to the target features.
14. An electronic device, characterized in that: include: A processor, a memory, and computer program instructions stored on the memory and executable on the processor; When the processor executes the computer program instructions, the method according to any one of claims 1 to 13 is implemented.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method described in any one of claims 1 to 13 when executed by a processor.
Citation Information
Patent Citations
Complex road scene target detection method based on YOLOX model
CN117237612A
Face key point detection method capable of utilizing label-free video training
CN118015671A
Target tracking method and device, computer equipment, storage medium and program product
CN118115927A
Gesture recognition method, computer device and storage medium
WO2022120669A1
Face tracking method and system, terminal and storage medium
WO2022126905A1
