Target tracking method and device and storage medium
By introducing feature matching and updating strategies for tagged and untagged databases, the problem of accurately identifying and tracking key and unfamiliar personnel in important locations has been solved, improving security and monitoring efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2025-01-17
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, target identification methods in important locations cannot accurately identify and track key personnel and strangers, resulting in reduced security.
A tagged database and an untagged database are introduced. A feature matching and update strategy is used to distinguish between known and unknown personnel. The tagged database stores the features of personnel who have been authenticated, while the untagged database stores the features of personnel who have not been authenticated. A feature fusion algorithm is used to maintain the timeliness and accuracy of the database.
It effectively distinguishes between known and unknown personnel, improves the security of important locations, ensures that the characteristic information of known personnel reflects changes in a timely manner, continuously monitors the behavior of unknown personnel, and achieves accurate identification and tracking of key personnel and unknown personnel.
Smart Images

Figure CN119963604B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a target tracking method, apparatus, and storage medium. Background Technology
[0002] In some important locations (such as schools and factories), in order to facilitate the tracking of the movement of people entering these locations and ensure their safety, target recognition is performed on images captured by cameras to monitor dangerous actions of people in these locations in a timely manner and to issue alarms promptly, thus ensuring the safety of these important locations.
[0003] Currently, target recognition methods in dangerous action recognition scenarios use deep learning technology to identify dangerous actions of people based on video. However, during the recognition process, due to the poor accuracy of personnel tracking algorithms, it is difficult to associate dangerous actions with personnel IDs, resulting in the inability to accurately identify and track key personnel and strangers in important locations, thus affecting the security of important locations. Summary of the Invention
[0004] This application provides a target tracking method, apparatus, and storage medium to at least solve the problem in related technologies of the inability to accurately identify and track key personnel and unfamiliar personnel in important locations.
[0005] According to one embodiment of this application, a target tracking method is provided, comprising: performing target recognition on an image to be detected to obtain a set of target object features; the set of target object features is a set of object features of target objects whose object type is consistent with a preset category; matching the set of target object features with object features in a specified database; the specified database includes a labeled database and an unlabeled database; the object features stored in the labeled database are authenticated object features; the object features stored in the unlabeled database are unauthenticated object features; if a first set of object features in the set of target object features matches the object features in the labeled database, using the first set of object features to update the object features in the labeled database, and performing target object tracking based on the object features in the labeled database; if a second set of object features in the set of target object features matches the object features in the unlabeled database, storing the second set of object features in the unlabeled database, and performing target object tracking based on the object features in the unlabeled database.
[0006] According to another embodiment of this application, a target tracking device is provided, comprising: a target recognition module, configured to perform target recognition on an image to be detected to obtain a set of target object features; the set of target object features is a set of object features of target objects whose object type is consistent with a preset category; a target matching module, configured to match the set of target object features with object features in a specified database; the specified database includes a label database and an unlabeled database; the object features stored in the label database are object features that have passed authentication; the object features stored in the unlabeled database are object features that have not passed authentication; and a target tracking module, configured to, when there is a first set of object features in the set of target object features that matches the object features in the label database, update the object features in the label database using the first set of object features, and perform target object tracking based on the object features in the label database; and, when there is a second set of object features in the set of target object features that matches the object features in the unlabeled database, store the second set of object features in the unlabeled database, and perform target object tracking based on the object features in the unlabeled database.
[0007] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0008] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0009] According to yet another embodiment of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0010] This application introduces a tagged database and an untagged database. The tagged database stores the characteristics of verified personnel, while the untagged database stores the characteristics of unverified personnel. This dual-database matching and updating strategy effectively distinguishes between known and unknown personnel, significantly improving the security of important locations. When a set of target object characteristics matches a set of object characteristics in the tagged database, the first set of object characteristics is used to update the object characteristics in the tagged database. This not only confirms individual identity but also maintains the timeliness and accuracy of the tagged database through the update mechanism, ensuring that the characteristic information of known personnel can reflect changes in a timely manner, improving the efficiency and accuracy of subsequent tracking. When a set of target object characteristics matches a set of object characteristics in the untagged database, the second set of object characteristics is stored in the untagged database. This helps to continuously monitor the behavior of unknown personnel, enabling continuous tracking even without clear identity. This solves the problem in related technologies of accurately identifying and tracking key personnel and unknown personnel in important locations, improving the security of important locations. Attached Figure Description
[0011] Figure 1 This is a hardware structure block diagram of a terminal device for an optional target tracking method according to an embodiment of this application; Figure 2 This is a flowchart of an optional target tracking method according to an embodiment of this application; Figure 3 This is a flowchart of another optional target tracking method according to an embodiment of this application; Figure 4 This is a flowchart of an optional target detection network according to an embodiment of this application; Figure 5 This is a flowchart of an optional feature enhancement network according to an embodiment of this application; Figure 6 This is a structural block diagram of an optional first attention mechanism module according to an embodiment of this application; Figure 7 This is a structural block diagram of an optional current attention module according to an embodiment of this application; Figure 8 This is a structural diagram of an optional target tracking device according to an embodiment of this application. Detailed Implementation
[0012] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0013] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0014] The methods and embodiments provided in this application can be executed in a terminal device or a similar computing device. Taking running on a terminal device as an example, Figure 1 This is a hardware structure block diagram of a terminal device for a target tracking method according to an embodiment of this application. For example... Figure 1 As shown, the terminal device may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The terminal device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal device described above. For example, the terminal device may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0015] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the target tracking method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the aforementioned method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to terminal devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0016] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the terminal device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0017] This embodiment provides a target tracking method. Figure 2 This is a flowchart of a target tracking method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps: Step S202: Perform target recognition on the image to be detected to obtain a set of target object features; the set of target object features is a set of target object features whose object type is consistent with the preset category.
[0018] In this context, the images to be detected refer to raw image data captured by multiple cameras within important locations (such as campuses and factories) for personnel tracking and hazardous behavior identification. These images typically contain individuals engaged in multiple activities within the important locations, requiring target recognition technology to locate and identify these individuals for subsequent tracking and behavioral analysis. Target recognition is the process of automatically detecting and identifying specific objects from the images to be detected using deep learning techniques (such as convolutional neural networks, CNNs). Target recognition is one of the key steps in the entire personnel tracking method; it can accurately locate and identify people in images, maintaining high recognition accuracy even in complex campus environments and under multi-camera perspectives.
[0019] Each object in the image to be detected corresponds to an entity type. For example, the image to be detected includes not only people engaged in various activities within an important location, but also objects of the type of item and objects of the type of obstacle. The object type refers to the type of entity of interest in the target recognition process; for example, the object type can be "person" or "item".
[0020] In target recognition, multiple object types may be identified. To facilitate tracking of a specific object type, this embodiment sets the object type to be detected as a preset category. A preset category refers to a category of objects of interest pre-defined in the target detection and recognition algorithm. For example, the preset category could be "personnel," meaning the target recognition algorithm is specifically designed to identify and locate people in images. The preset category ensures that the algorithm focuses only on personnel objects related to security in important locations, rather than other irrelevant objects, which helps improve the algorithm's efficiency and accuracy.
[0021] In the target recognition step, the set of features extracted from the image to be detected that match a preset category (e.g., "person") is called a set of target object features. This set of target object features is used for subsequent identification and tracking of objects within the preset category. For example, if the preset category is "person," then a set of target object features refers to the set of object features corresponding to a group of objects in the image to be detected whose object type is "person," including but not limited to descriptions of a person's appearance, posture, and location information. This set of target object features is the foundation for subsequent person re-identification and tracking. It is also the basis for identifying whether a specific individual is a known person or a stranger.
[0022] Optionally, the terminal device acquires the image to be detected, performs preprocessing on the image to be detected to remove noise, and scales the image to be detected to a specific size, preferably 640. 640: During the scaling process of the image to be detected, the aspect ratio of the image is not changed. The largest side is scaled to 640, and the smaller sides are filled with grayscale. The terminal device performs target recognition on the image to be detected, obtaining multiple objects. Each object has a corresponding object type. From the multiple objects, a group of target objects whose object types match the preset category is extracted. The set of features corresponding to a group of target objects is determined as a set of target object features.
[0023] Step S204: Match a set of target object features with object features in a specified database; the specified database includes a labeled database and an unlabeled database; the object features stored in the labeled database are those of authenticated objects; the object features stored in the unlabeled database are those of unauthenticated objects.
[0024] In step S202, only the object type is identified. To determine the specific identity information of the object, a set of target object features (person features extracted from newly detected images) is compared with object features stored in a designated database during the target recognition process. This process utilizes techniques such as feature encoding, self-attention mechanisms, and CAM modules to improve the accuracy and efficiency of feature matching. Through feature matching, the system can determine whether the currently detected person is a known person and can continuously track the same person under different cameras, which is crucial for achieving comprehensive personnel tracking and management.
[0025] The designated database is used in the personnel tracking system to store and manage the characteristics of individuals. It consists of two parts: a tagged database and an untagged database. The tagged database stores the characteristics of authenticated personnel, meaning the characteristic data of individuals whose identity information (such as name, student ID, employee number) is known to the terminal device. In the tagged database, each person's facial image is represented by an coded signature and includes a name tag. This characteristic data is obtained through facial recognition or identity registration when personnel enter important areas and then encoded and stored in the database. The existence of the tagged database enables the system to quickly locate and track known personnel, while simultaneously monitoring and managing personnel activities, playing a crucial role in maintaining order and security in important areas. The untagged database is a database of personnel characteristics without fixed tags, i.e., an unknown personnel coding database. It stores the characteristics of individuals who have not passed identity verification, meaning the terminal device cannot temporarily identify their identity, or whose identity is not registered in the tagged database. The existence of tagless databases is intended to capture and record unfamiliar visitors or potential unauthorized entrants in important locations. Through continuous personnel feature matching and learning, terminal devices can gradually improve their tracking and identification of unknown individuals. This is particularly important for the timely detection and response to potential security threats in important locations. The design and maintenance of designated databases, including tagged and tagless databases, are key to achieving personnel re-identification and tracking. They help terminal devices distinguish between known individuals and unidentified strangers, thereby effectively improving the security monitoring of important locations.
[0026] Optionally, the terminal device matches a set of target object features with all object features in a specified database, extracts object features one by one from the tag database according to the following formula, and calculates the probability of similarity between each target object feature in the set of target object features and all object features in the tag database: ,
[0027] in, This is the transpose of the feature value corresponding to the i-th object feature in the specified database; This represents the expected value of all object features in the label database. This represents the expected value of all object features in the unlabeled database; The feature value is the encoded feature of the detected target object. is a hyperparameter value used to adjust the value of the exponential function; L is the total number of labeled databases; Q is the number of unlabeled databases; furthermore, Q is generally set to a value between 1.2 and 2 times L.
[0028] Then, the highest probability is selected. If the highest probability is greater than or equal to a preset probability threshold, the detected target object feature is determined to be an object feature stored in the tag database, and the target object with that target object feature is an authenticated person. If the highest probability is less than the preset probability threshold, the detected target object feature is an object feature stored in the untagged database, and the target object with that target object feature is an unauthenticated person.
[0029] Step S206: If a set of first object features exists in a set of target object features that matches the object features in the tag database, the object features in the tag database are updated using the set of first object features, and target object tracking is performed based on the object features in the tag database.
[0030] In the process of matching a set of target object features with object features in a specified database, if a target object feature in the set matches an object feature in the label database, the successfully matched target object feature is called the first object feature. Multiple first object features in a set of target object features are defined as a set of first object features. It can be understood that a first object feature refers to a specific person feature identified from the image to be detected that has a high degree of matching with the object features in the label database. A set of first object features is usually obtained in the target detection and person feature extraction process, including but not limited to a person's appearance features, body posture, actions, and location information. First object features are key information that enables terminal devices to accurately identify known persons, providing a foundation for subsequent personnel tracking and security incident early warning.
[0031] The existing database updates rely on preset time periods, which may lead to untimely updates of the characteristics of personnel who frequently enter and exit important locations, affecting the recognition rate. The characteristics of occasionally visiting personnel may be prematurely deleted, reducing the ability to identify temporary visitors. To improve the accuracy of target recognition, this application uses a set of first object features to update the object features in the tag database. Specifically, during real-time monitoring, when a set of target object features is identified as highly matching a certain object feature in the tag database (i.e., forming a set of first object features), a feature fusion algorithm (such as weighted average fusion, deep feature fusion, attention mechanism fusion, or gating fusion) is used to perform feature fusion processing on the set of first object features and the object features in the tag database to update the object feature information of the known person in the tag database. The purpose of this update mechanism is to maintain the timeliness and accuracy of the tag database, ensuring that terminal devices can effectively track personnel based on the latest characteristics. Updating the object features in the tag database can adapt to subtle changes in a person's appearance (such as changing clothes or hairstyle) or adjustments in behavioral patterns, improving the accuracy of personnel re-identification and thus enhancing the overall effectiveness of the security monitoring system.
[0032] Target object tracking refers to the process of continuously tracking the movement path and behavior of a specific individual across a series of consecutive video frames. For example, in the context of campus security, target object tracking is one of the core functions of a surveillance system. It not only monitors personnel activities on campus in real time but also records personnel trajectories continuously from different camera perspectives, which is crucial for the timely detection and response to potential campus security threats. The accuracy of target object tracking depends on the extraction of target object features and the matching of object features in a database. When a set of initial object features successfully matches object features in a tag database, the terminal device can quickly locate and continuously track known individuals, ensuring the comprehensiveness and effectiveness of campus surveillance.
[0033] Optionally, if the terminal device has a set of first object features that match the object features in the tag database, it can use a feature fusion algorithm (such as weighted average fusion, deep feature fusion, attention mechanism fusion, gating fusion) to perform feature fusion processing on the set of first object features and the object features in the tag database, so as to update the object features in the tag database and perform target object tracking based on the object features of the same object at different times in the tag database.
[0034] Step S208: If a set of second object features exists in a set of target object features that matches the object features in the unlabeled database, the set of second object features is stored in the unlabeled database, and target object tracking is performed based on the object features in the unlabeled database.
[0035] In the process of matching a set of target object features with object features in a specified database, if any target object feature in the set does not match any object feature in the labeled database, then the unmatched target object feature is called a second object feature. Multiple second object features in a set of target object features are then defined as a set of second object features. In essence, a second object feature refers to a feature identified from a set of target object features during real-time monitoring that matches an object feature in the unlabeled database, through target detection and personnel feature extraction processes. For example, in a campus security monitoring system, the unlabeled database stores the features of unverified personnel, such as first-time visitors, students, or temporary changes in appearance of faculty or staff. When a terminal device detects that a set of target object features highly matches a feature in the unlabeled database, this set of features is defined as a set of second object features, indicating that the system has identified a recorded but unidentified individual.
[0036] After obtaining a set of second object features, the terminal device stores these features in the unlabeled database to update the object feature information in the database. This process aims to improve the feature records in the unlabeled database, enhancing the model's adaptability and generalization ability, especially when dealing with changes in target features caused by strangers or environmental changes. For example, in the context of campus security monitoring, this update mechanism is crucial for continuously tracking unlabeled individuals, such as new visitors or students' new attire, helping the terminal device to continuously track target individuals from different camera perspectives.
[0037] Target object tracking is a core function of a monitoring system. It involves continuously tracking the movement path of a specific individual based on the object's characteristic information across a series of consecutive video frames. In this embodiment, tracking relies not only on known personnel characteristics in a tagged database but also on second-object characteristic information stored in an untagged database to continuously monitor unidentified individuals. This ensures that all personnel entering and leaving important locations have an effective trajectory record. This strategy ensures that the system can accurately track known personnel and effectively manage strangers or unknown individuals within important locations, enhancing the comprehensiveness and responsiveness of the entire important location security monitoring system.
[0038] Optionally, if the terminal device has a set of second object features that do not match any of the object features in the tag database, it stores the set of second object features into the untagged database to update the object features in the untagged database, and performs target object tracking based on the object features of the same object at different times in the untagged database.
[0039] Through the above steps, a tagged database and an untagged database are introduced. The tagged database stores the characteristics of verified personnel, while the untagged database stores the characteristics of unverified personnel. This dual-database matching and updating strategy effectively distinguishes between known and unknown personnel, significantly improving the security of important locations. When a set of target object characteristics contains a first set of object characteristics that match those in the tagged database, these first set of object characteristics are used to update the object characteristics in the tagged database. This not only confirms individual identity but also maintains the timeliness and accuracy of the tagged database through the update mechanism, ensuring that the characteristic information of known personnel can reflect changes in a timely manner, improving the efficiency and accuracy of subsequent tracking. When a set of target object characteristics contains a second set of object characteristics that match those in the untagged database, these second set of object characteristics are stored in the untagged database. This helps to continuously monitor the behavior of unknown personnel, enabling continuous tracking even without clear identity. This solves the problem of accurately identifying and tracking key personnel and unknown personnel in important locations in related technologies, thus improving the security of important locations.
[0040] In one exemplary embodiment, target recognition is performed on the image to be detected to obtain a set of target object features, including: 1. Input the image to be detected into the object detection network to obtain a set of object recognition results output by the object detection network. The set of object recognition results is used to represent a set of candidate objects identified. Each object recognition result in the set of object recognition results includes the object detection box size, object box position, object label, and confidence information. The object label in each object recognition result is used to represent the object category of the corresponding candidate object. The confidence information in each object recognition result is used to represent that the object category of the corresponding candidate object is the identified object.
[0041] The object detection network is a type of neural network in deep learning specifically designed for identifying and locating objects in images. In this embodiment, the object detection network is used to process video images from important locations to identify and locate personnel within them. Through a series of convolutional, pooling, and fully connected layers, it extracts features representing different objects from the input image and uses these features to generate multiple object detection boxes. Each detection box contains the size and location information of the target object, as well as a target label and confidence score associated with the object category. The output of the object detection network is a set of object recognition results, representing a set of candidate objects identified by the network that possess personnel characteristics. Each object recognition result includes the size of the object detection box, the location of the box, the target label, and confidence information. In the security monitoring scenario of important locations, a set of object recognition results means that the terminal device can simultaneously identify and locate multiple potential personnel targets in the image to be detected, rather than just a single object. The target label identifies the object category in each detection box, while the confidence information reflects the reliability of the recognition result, i.e., the level of confidence the terminal device has in the category to which the identified object belongs. By analyzing a set of object recognition results, non-personnel objects can be quickly filtered out, allowing the focus to be placed on personnel identification, thereby improving the efficiency and accuracy of the entire monitoring system.
[0042] Optionally, Figure 3 This is a flowchart of another optional target tracking method according to an embodiment of this application, such as... Figure 3 As shown, after the terminal device acquires the image to be detected, it performs preprocessing to obtain the preprocessed image to be detected. The preprocessed image to be detected is then input into the target detection network to obtain a set of object recognition results output by the target detection network. The set of object recognition results is used to characterize a set of candidate objects identified. Each object recognition result in the set of object recognition results includes the target detection box size, target box position, target label, and confidence information.
[0043] 2. Based on the target label and confidence score in a set of object recognition results, identify a set of target objects from a set of candidate objects whose object categories are consistent with the preset categories and whose confidence scores are higher than the preset confidence threshold.
[0044] If the confidence scores of all object recognition results in a set of object recognition results are less than a preset confidence threshold, then the next image to be detected is obtained, and the target detection process continues.
[0045] 3. Based on the size and position of the target detection box in the object recognition results corresponding to a set of target objects, extract a set of target object images from the image to be detected.
[0046] Fourth, a set of target object images are input into a feature enhancement network to perform image enhancement processing on the set of target object images through the feature enhancement network, and then object features are extracted from the set of target object images after image enhancement processing to obtain a set of target object features.
[0047] The Feature Enhancement Network (FEN) is a specially designed deep learning network aimed at improving the quality of feature descriptions of target objects (such as people on campus) and enhancing the accuracy of people re-identification through image enhancement processing and advanced feature extraction. By preprocessing the input image and learning features, it can capture and highlight key features of objects, such as facial contours, body posture, and clothing style, while reducing the influence of background noise and other interfering factors. Specifically, after the object detection network identifies a set of candidate objects, the corresponding target object images are passed to the Feature Enhancement Network. The Feature Enhancement Network first preprocesses the target object images, including noise removal and resizing, to facilitate the extraction of deep features. Subsequently, the Feature Enhancement Network extracts and enhances features of the target object through a series of convolutional, pooling, and normalization layers, improving the expressive power and discriminative power of the features.
[0048] In this embodiment, a target detection network is used to accurately locate a group of target objects in the image to be detected. By using the size and position information of the output target detection bounding box, the image region containing each target object can be accurately cropped, ensuring the accuracy of subsequent feature enhancement and extraction processes, avoiding interference from background noise and irrelevant objects, and providing a foundation for accurate capture of personnel features. The cropped image of the target objects is then input into the feature enhancement network. First, image enhancement processing is performed, which includes preprocessing steps such as noise removal and image resizing, as well as the extraction and enhancement of deep features through convolution, pooling, and normalization layers of the neural network. Image enhancement processing can improve image quality and highlight key features of the target objects, such as facial details and body contours, which is particularly important for personnel recognition in complex environments. Especially in campus environments, changes in lighting, crowds, and occlusion can all affect personnel recognition, and image enhancement processing can effectively solve these problems, improving the robustness of features and recognition accuracy.
[0049] In one exemplary embodiment, Figure 4 This is a flowchart of an optional target detection network according to an embodiment of this application, such as... Figure 4 As shown, the object detection network includes a first feature processing module, a first attention mechanism module, and a first feature extraction network.
[0050] In some embodiments, the image to be detected is input into an object detection network to obtain a set of object recognition results output by the object detection network, including: 1. The image to be detected is scaled to obtain an image of a specified size. The image of the specified size is then input into the first feature processing module. The first feature processing module sequentially performs feature extraction, pooling, flattening, position encoding, and normalization on the image of the specified size to obtain a first feature vector, a second feature vector, and a third feature vector. The first feature vector represents the feature information corresponding to all positions. The second feature vector represents the information of interest in the first feature vector. The third feature vector represents the feature information queried at the current time.
[0051] Scaling refers to adjusting the size of the image to be detected to a preset specified size to accommodate subsequent feature processing modules. In this embodiment, scaling particularly emphasizes maintaining the aspect ratio of the image. Typically, the largest side is scaled to 640 pixels, while the smaller sides are filled with grayscale to ensure a consistent input image size, facilitating processing by the object detection network.
[0052] The first feature processing module is a computer vision algorithm module consisting of multiple processing steps, used to extract feature information from the scaled image to be detected. It includes steps such as feature extraction, pooling, flattening, position encoding, and normalization, and can generate a first feature vector, a second feature vector, and a third feature vector, representing different levels of image feature representation. Figure 4 As shown, the first feature processing module includes multiple feature extraction networks, a max pooling layer, a flattening layer, a positional encoding layer, and a normalization layer. The number of feature extraction networks can be dynamically set according to actual needs, such as... Figure 4As shown, in this embodiment, the first feature processing module includes three feature extraction networks. Each feature extraction network includes Conv (convolution), BN (batch normalization), and ReLU (corrected linear unit). The first feature extraction network extracts features from the input image to be detected, obtaining a new feature map. This new feature map serves as the input to the next feature extraction network to obtain the next new feature map, and so on, until the last feature extraction network outputs the last new feature map. During positional encoding, the positional encoding layer performs positional encoding on the features at each position in the output features of the flattening layer based on the added positional encoding values, obtaining positional encoded features. The normalization layer normalizes the positional encoded features output by the positional encoding layer, obtaining a first feature vector, a second feature vector, and a third feature vector. The first feature vector (K) is the result obtained by the first feature processing module after feature extraction, pooling, flattening, positional encoding, and normalization of the image to be detected of a specified size. It integrates feature information from all positions in the image, reflecting the global features of the image. In the personnel feature extraction process, the first feature vector (V) refers to the preliminary feature representation directly extracted from the target object image (such as people on campus). It typically contains direct visual information about the target object, such as shape, texture, and color. The second feature vector (V) is the result of extracting particularly relevant information from the first feature vector. It contains key information of interest among the feature information corresponding to all locations, usually obtained through a self-attention mechanism (such as CAM attention). It focuses on local features in the image that are highly correlated with the target (such as people), further highlighting features related to personnel identification. The second feature vector (V) plays a role in strengthening key information in the personnel feature enhancement network process. Through the self-attention mechanism, the terminal device can pay more attention to human features, improving the accuracy of recognition. The third feature vector (Q) represents the feature information queried at the current moment. It is the portrait image feature extracted from the prediction results of the object detection network, reflecting the feature details of the person at the current moment. The third feature vector is crucial in the object detection and personnel feature matching process. It is used to compare with features in the label database to identify and track specific personnel.
[0053] Optionally, in the target detection process, the terminal device preprocesses the image to be detected, including noise removal and scaling to 640. The image is scaled to 640 pixels, maintaining the aspect ratio, with grayscale fill on the smaller side. The preprocessed image to be detected is input into the first feature processing module. The first feature processing module uses a Conv+BN+ReLU network to process the scaled image, extract preliminary features, perform max pooling on the extracted features to reduce feature dimensionality and enhance the model's translation invariance, convert the pooled feature map into a one-dimensional vector, add positional information to the one-dimensional vector to facilitate the processing of temporal data, and use Layer Normalization to ensure that the features are at the same scale, improving the model's learning efficiency. The resulting first feature vector (K) reflects global information, the second feature vector (V) emphasizes features of interest, and the third feature vector (Q) focuses on features for immediate query, which are used for subsequent matching, recognition, and tracking, respectively.
[0054] Second, the first feature vector, the second feature vector, and the third feature vector are input into the first attention mechanism module, so that the first attention mechanism module performs pooling operation on the first feature vector, the second feature vector, and the third feature vector to obtain the first attention feature map.
[0055] The first attention mechanism module is a network component in a computer vision model used to highlight key information in an image while suppressing irrelevant regions. It adaptively adjusts feature weights by calculating the correlation between different features, enabling the model to focus more on the features of the target object, thereby improving the accuracy of recognition and analysis. Specifically implemented as CAMattention (Channel Attention Module attention), the first attention mechanism module uses the first, second, and third feature vectors as input to identify and enhance information related to the target (person), achieving refined processing of image features and obtaining the first attention feature map.
[0056] The first attention feature map reflects the weighted features, emphasizing features highly relevant to the target object. In this embodiment, the first attention feature map is generated by pooling the feature vectors and then using an attention mechanism, and is used in subsequent feature matching and recognition processes. The first attention feature map is a key output in the target detection process, used to generate more accurate personnel feature codes, improving the accuracy of personnel re-identification in images captured by different cameras. By comparing the first attention feature map with features in the database, the target person can be accurately identified, even in complex and changing campus environments.
[0057] Optionally, the object detection network imports the first feature vector (K), second feature vector (V), and third feature vector (Q) obtained through preprocessing and feature extraction into the first attention mechanism module. The first attention mechanism module first performs pooling on the input feature vectors, including max pooling and average pooling, aiming to reduce feature dimensionality while capturing key information. Subsequently, the first attention mechanism module calculates the attention weights between each feature vector, determines the importance of features through a self-attention mechanism (such as CAM attention), and weights and fuses the first feature vectors based on the calculated attention weights to generate a first attention feature map that more prominently highlights the points of interest and provides immediate query information.
[0058] Third, the first attention feature map is input into the first feature extraction network to extract features from the first attention feature map through the first feature extraction network, and the target detection network outputs a set of object recognition results.
[0059] The first feature extraction network (FIN) is a neural network component in a deep learning model used to further extract and learn features from the first attention feature map. It typically consists of a series of convolutional layers, batch normalization layers, and rectified linear units (RCUs), enabling it to capture deeper feature representations from the attention feature map and provide richer information for object recognition. In this embodiment, the FIN receives the first attention feature map as input and extracts information such as the location, size, label, and score of the target object in the image through multiple Conv+BN+ReLU operations. The FIN is the core of person tracking and re-identification; it can accurately locate people in an image and output a set of object recognition results.
[0060] Optionally, the object detection network uses the first attention feature map, processed by the first attention mechanism module, as input to the first feature extraction network. The first feature extraction network begins processing, first extracting preliminary features from the attention feature map through Conv+BN+ReLU layers. The Conv layer captures spatial structure, the BN layer normalizes the feature distribution, and the ReLU layer activates the features. The first feature extraction network continues to refine the feature representation through multiple layers of Conv+BN+ReLU operations. Each convolutional layer aims to enhance the recognition ability for specific patterns, laying the foundation for subsequent accurate object recognition. After multiple rounds of feature extraction, the first feature extraction network outputs the predicted bounding box and its location, category label (person), and confidence score for each target. The object detection network integrates the recognition results of all targets, outputting a complete set of object recognition results, including the location coordinates, size, person label, and corresponding confidence scores of multiple detection boxes.
[0061] In this embodiment, the image to be detected is scaled to a specified size, such as 640x640, ensuring that images captured by different cameras have a uniform size when input into the target detection network. This avoids recognition errors caused by differences in image size and improves the robustness and recognition performance of the target detection network. The first feature processing module performs feature extraction, pooling, flattening, position encoding, and normalization to obtain three feature vectors of different dimensions. The first feature vector integrates feature information from all positions, increasing the target detection network's ability to understand time-series data. The second feature vector emphasizes the information of interest in the first feature vector, i.e., key features. The third feature vector represents the feature information queried at the current moment, focusing on immediate detection needs. Through this multi-level feature extraction, the target detection network can analyze personnel information in the image more comprehensively and precisely. The first attention mechanism module performs pooling operations on the above three feature vectors to generate a first attention feature map. This map emphasizes the features most relevant to personnel identification, reduces background noise interference, and improves the accuracy of the target detection network in identifying target objects (key personnel and unfamiliar personnel). The attention mechanism enables the object detection network to automatically learn which features are crucial in the recognition and tracking process, thus focusing more accurately on target individuals in complex scenes. The first attention feature map is input into the first feature extraction network, and after further processing, the object detection network outputs a set of object recognition results. This set of results includes the size, position, label, and score of the person's bounding box. In other words, for each detected person, not only is their identity confirmed (whether they are a known person or a stranger), but their location in the image is also precisely pinpointed. This process significantly improves the accuracy of recognition and tracking, ensuring that terminal devices can accurately track and manage key personnel and unfamiliar individuals in important locations.
[0062] In one exemplary embodiment, Figure 5 This is a flowchart of an optional feature enhancement network according to an embodiment of this application. The feature enhancement network is a deep learning architecture, such as... Figure 5 As shown, the feature enhancement network includes a second feature processing module, a third feature processing module, a second attention mechanism module, and a second feature extraction network. Its purpose is to refine the features of the target object to improve recognition accuracy. In this embodiment, the feature enhancement network is mainly used to extract the person image from the target bounding box output by the target detection network, and then enlarge and process it further. Through this series of steps, the detailed features of the target object (such as a person) can be captured more accurately, thereby improving the accuracy of person re-identification.
[0063] In some embodiments, a set of target object images are input into a feature enhancement network to perform image enhancement processing on the set of target object images, and object features are extracted from the enhanced set of target object images to obtain a set of target object features, including: First, a set of target object images are magnified according to a preset scaling factor to obtain a magnified set of target object images. The magnified set of target object images is then input into the second feature processing module, which performs feature extraction, pooling, flattening, position encoding, and normalization on the magnified set of target object images to obtain a fourth feature vector and a fifth feature vector. The fourth feature vector represents the feature information corresponding to all positions, and the fifth feature vector represents the information of interest in the fourth feature vector.
[0064] The preset scaling factor refers to the scaling factor used to scale a set of target object images. For example, the preset scaling factor is... During the scaling process, the target object image is enlarged. This refers to magnifying both the length and width of the target object image, centered on a line point. times; among which, Preferably During the extraction of target object images, appropriately magnifying the image by a certain factor can effectively increase the similarity value of personnel matching. For example, the recognition efficiency is higher when a person is holding certain specific items. However, the magnification factor should be limited by a specific ratio. Placing the matching area too large will introduce background interference.
[0065] The second feature processing module, part of the feature enhancement network, performs feature extraction, pooling, flattening, position encoding, and normalization on a set of magnified target object images to generate a fourth and fifth feature vectors. In this embodiment, the second feature processing module performs deep feature extraction on the magnified person images. Through multi-layer operations of a convolutional neural network (CNN), it can extract deeper feature representations, such as texture and morphology, thereby improving the model's sensitivity to person features and recognition accuracy. The structural features of the second feature processing module are similar to those of the first feature processing module and will not be described again here.
[0066] The fourth feature vector output by the second feature processing module is a feature representation obtained by processing the magnified target object image in the feature enhancement network. It integrates feature information corresponding to all positions, helping the feature enhancement network to better understand the dynamic changes of the target object in time-series data processing, thereby improving the stability of feature matching and recognition. The fourth feature vector is similar to the first feature vector mentioned above, and its definition and application will not be repeated here.
[0067] The fifth feature vector output by the second feature processing module is a feature vector that highlights the information of interest after processing the fourth feature vector, such as a person's specific posture or the items they are carrying. This allows the feature enhancement network to focus more on important feature points during the recognition and tracking process, thereby improving the accuracy of person re-identification. The fifth feature vector is similar to the second feature vector mentioned above, and its definition and application will not be repeated here.
[0068] Optionally, in the feature enhancement process, the terminal device preprocesses the target object image and enlarges a set of target object images according to a preset scaling factor to obtain an enlarged set of target object images. The preprocessed target object images are then input into the second feature processing module. The second feature processing module uses a Conv+BN+ReLU network to process the enlarged images, extract preliminary features, perform max pooling on the extracted features to reduce feature dimensionality and enhance the model's translation invariance, transform the pooled feature map into a one-dimensional vector, add positional information to the one-dimensional vector to facilitate the processing of temporal data, and use Layer Normalization to ensure that the features are at the same scale, improving the model's learning efficiency. The final fourth feature vector reflects global information, and the fifth feature vector emphasizes features of interest.
[0069] Second, the magnified set of target object images is input into the third feature processing module, so that the third feature processing module can perform feature extraction, flattening, position encoding and normalization on the magnified set of target object images to obtain the sixth feature vector; the sixth feature vector represents the feature information queried at the current time; the feature obtained by the third feature processing module from the magnified set of target object images is the first feature.
[0070] The third feature processing module is a key component of the feature enhancement network, responsible for deep feature extraction and preprocessing of each target object image in the magnified set of target object images. It transforms and optimizes the feature representation of the target object images through a series of operations, including convolution (Conv), batch normalization (BN), activation functions (such as ReLU), flattening, positional encoding, and normalization, providing high-quality feature vectors for subsequent feature matching and recognition. In this embodiment, the third feature processing module is used to further process the person images extracted from the magnified target boxes, performing feature extraction on the images through a multi-layer convolutional neural network (CNN). These operations help capture more detailed features, such as clothing styles and carried items, which is crucial for improving the accuracy of person re-identification. The structure and processing flow of the third feature processing module are similar to those of the second feature processing module, and will not be described in detail here.
[0071] The sixth feature vector output by the third feature processing module is a feature representation generated after processing the magnified target object image by the third feature processing module. It specifically represents the feature information queried at the current moment, that is, the feature data most relevant to the current detection and recognition task. In this embodiment, the sixth feature vector represents the features of the person image detected in real time. It not only includes basic appearance features, but may also include details such as dynamic behavior or carried items. By comparing this feature vector with the personnel features in the database, real-time re-identification and tracking of personnel can be achieved, and the dynamic information of personnel on campus can be updated in a timely manner.
[0072] The first feature refers to the original deep learning features obtained by the third feature processing module through feature extraction from a set of magnified target object images. It is a fundamental component of the sixth feature vector and contains the appearance and behavioral features of the target object at a specific moment. For example... Figure 5 As shown, the first feature is obtained through the preliminary feature extraction step of the third feature processing module. It has undergone processing such as convolution, batch normalization and activation function, aiming to capture the basic appearance features of people from the magnified image.
[0073] Optionally, in the feature enhancement process, a set of magnified target object images from the terminal device are input to the second feature processing module. The second feature processing module uses a Conv+BN+ReLU network to process the scaled image, extract preliminary features to obtain the first feature, performs max pooling on the extracted first feature to reduce the feature dimension and enhance the model's translation invariance, transforms the pooled feature map into a one-dimensional vector, adds positional information to the one-dimensional vector to facilitate the processing of temporal data, and uses Layer Normalization to ensure that the features are at the same scale, improving the model's learning efficiency. The final sixth feature vector focuses on the real-time query features and is used for subsequent matching, recognition, and tracking.
[0074] Third, the fourth, fifth, and sixth feature vectors are input into the second attention mechanism module to perform pooling operations on the fourth, fifth, and sixth feature vectors to obtain the second attention feature map.
[0075] The second attention mechanism module is a crucial component of the feature enhancement network. Its role is to further highlight key features closely related to the target recognition task by performing attention operations on the input feature vectors. It receives a fourth feature vector (representing feature information at all locations), a fifth feature vector (highlighted information), and a sixth feature vector (feature information queried at the current time), and enhances the expressive power of the features and the model's recognition accuracy through pooling operations. In this embodiment, the second attention mechanism module plays a core role in the personnel feature enhancement process. Based on the other-attention mechanism, it reduces the dimensionality of spatial features through pooling operations while enhancing the temporal dimension of feature representation, making the model better suited to identifying and tracking target objects, especially key personnel and unfamiliar individuals, in complex backgrounds and dynamically changing scenes.
[0076] The second attention feature map is a feature representation generated after the second attention mechanism module processes the feature vectors. It integrates information from the fourth, fifth, and sixth feature vectors, and through pooling operations, emphasizes the key features most relevant to personnel identification and tracking in the image. The second attention feature map is the output of the personnel feature enhancement network process. It generates a more refined and focused feature representation of the target object by comparing and fusing real-time detected personnel features (sixth feature vector) with historical features (fourth and fifth feature vectors). This feature map helps improve the model's ability to continuously track and re-identify personnel in multi-camera environments, especially in campus security monitoring systems, enabling more accurate identification of dangerous behaviors and management of key personnel.
[0077] Optionally, the feature enhancement network feeds the fourth, fifth, and sixth feature vectors into the second attention mechanism module. The second attention mechanism module first performs pooling on the input feature vectors, including max pooling and average pooling, to reduce feature dimensionality while capturing key information. Subsequently, the second attention mechanism module calculates the attention weights between each feature vector, determines the importance of features through a self-attention mechanism (such as CAM attention), and weights and fuses the fourth feature vector based on the calculated attention weights to generate a second attention feature map that more prominently features the points of interest and provides immediate query information.
[0078] Fourth, the second attention feature map is input into the second feature extraction network to extract features from the second attention feature map to obtain the second feature. The first feature and the second feature are then merged through the second feature extraction network to obtain the first merged feature. Feature extraction is then performed on the first merged feature to obtain a set of target object features.
[0079] The second feature extraction network is a deep learning component within the feature enhancement network. Its main task is to further extract and process features from the second attention feature map generated by the second attention mechanism module, resulting in a more refined and representative feature representation, known as the second feature. The first and second features represent feature extraction results at different stages in the feature enhancement network. The first feature is a preliminary feature extracted directly from the magnified image of the target object (e.g., a person), which is relatively raw and comprehensive, covering the direct visual information of the target object. The second feature, on the other hand, is a feature further refined by the second feature extraction network after processing by the second attention mechanism module. It focuses more on extracting and enhancing key information, such as highlighting detailed features through the attention mechanism. The connection between the two lies in the fact that the generation of the second feature depends on the first feature. Through multi-layer processing and the enhancement of the attention mechanism, the second feature becomes more focused and representative than the first feature, making it more conducive to subsequent feature matching and person re-identification.
[0080] like Figure 5 As shown, the second feature extraction network comprises three feature extraction networks and one feature merging layer. Each feature extraction network includes Conv (convolutional layer), BN (batch normalization), and ReLU (rectified linear unit). The first two feature extraction networks further extract features from the second attention feature map to obtain the second features. The feature merging layer merges the first and second features obtained from the feature extraction by the third feature processing module to obtain the first merged feature. The last feature extraction network extracts features from the first merged feature to obtain a set of target object features.
[0081] The first merged feature is the product of the second feature extraction network fusing the first feature (the preliminary features of the magnified target object image) and the second feature (the refined features of the second attention feature map). Through merging, a complete feature representation that integrates the feature information of the target object at the current and historical moments is obtained. In this embodiment, the first merged feature is an intermediate output of the feature enhancement network. It fuses the feature information of the target object at the current and past moments. This fused feature representation helps the model understand the dynamic changes and behavioral patterns of the target object, thereby improving the accuracy and robustness of person re-identification.
[0082] Optionally, the feature enhancement network inputs the second attention feature map into the second feature extraction network, and extracts features from the second attention feature map through multiple feature extraction networks in the second feature extraction network to obtain the second feature. The first feature and the second feature are then merged through the feature merging layer in the second feature extraction network to obtain the first merged feature. Finally, the first merged feature is extracted through the feature extraction network to obtain a set of target object features.
[0083] In this embodiment, a second feature processing module and a third feature processing module are set in the feature enhancement network to enable the feature enhancement network to perform multi-level feature extraction on the target object image. The fourth and fifth feature vectors generated by the second feature processing module integrate feature information from different times and focus on key features, while the sixth feature vector generated by the third feature processing module captures the feature information queried at the current time, thereby providing multi-dimensional feature support for accurate identification and tracking of personnel. The second attention mechanism module in the feature enhancement network adopts an other-attention model to increase the feature extraction capability of the feature enhancement network, and modifies the attention format, adds receptive field enhancement and feature fusion modules to improve the feature extraction capability of the feature enhancement network.
[0084] In one exemplary embodiment, Figure 6 This is a structural block diagram of an optional first attention mechanism module according to an embodiment of this application, such as... Figure 6 As shown, the first attention mechanism module includes at least one attention module; each attention module has the same structure. Each attention module is used to perform pooling processing on the input first feature vector, second feature vector, and third feature vector. The attention module is a mechanism in feature enhancement networks used to strengthen key features and suppress unimportant features. It dynamically adjusts the model's attention to different features by calculating the similarity between different feature vectors, thereby generating more focused and representative feature representations. In multi-camera people search and tracking scenarios, the attention module helps the model focus on the key features of the target object, such as face, clothing, or actions, improving recognition accuracy even with complex backgrounds or changing target poses. Furthermore, by stacking multiple attention modules to increase attention during feature extraction, the model's feature extraction and generalization capabilities can be further enhanced. In this embodiment, the model complexity can be increased or decreased according to the actual amount of training data to prevent overfitting while improving model accuracy. Therefore, the number of attention modules in this embodiment is M.
[0085] It should be noted that the structure and principle of the second attention mechanism module are the same as those of the first attention mechanism module, and the structure and principle of the second attention mechanism module will not be described again here.
[0086] In some embodiments, a first feature vector, a second feature vector, and a third feature vector are input to a first attention mechanism module to perform pooling operations on the first feature vector, the second feature vector, and the third feature vector to obtain a first attention feature map, including: 1. Take at least one attention module as the current attention module and perform the following pooling operation to obtain the attention features corresponding to at least one attention module: Input the first feature vector, the second feature vector and the third feature vector into the current attention module, and perform pooling operation on the first feature vector, the second feature vector and the third feature vector through the current attention module to obtain the attention features corresponding to the current attention module.
[0087] In this diagram, the first and second feature vectors represent the overall image encoding features of the image to be detected. The third feature vector represents the human face encoding features in the image to be detected. Therefore, the overall image encoding features are labeled K and V, and the human face encoding features are labeled Q.
[0088] Second, sum the attention features corresponding to at least one attention module to obtain the second merged feature. Add the second merged feature to the third feature vector point by point according to position to obtain the third merged feature. Then, perform layer normalization and convolution on the third merged feature to obtain the first attention feature map.
[0089] The attention feature corresponding to each attention module is the result of the corresponding attention module processing. It reflects the key feature information that the model focuses on after the pooling operation and attention mechanism.
[0090] The second merged feature refers to the comprehensive feature representation obtained by summing the attention features output by multiple attention modules. The third merged feature is a feature representation obtained by further adding the second merged feature to the third feature vector (the feature information queried at the current moment) point by point according to position. In the process of personnel tracking and identification, the generation of the third merged feature integrates historical feature information (second merged feature) with real-time feature information in the current frame (third feature vector), ensuring that the model can not only utilize the patterns and regularities of historical data, but also adapt to changes in the current environment in a timely manner. This is crucial for processing dynamic and time-series video surveillance data, especially in campus security monitoring, where it can instantly identify and track the dynamic changes of newly appearing personnel or key personnel.
[0091] Optionally, in the current attention module, the current attention module performs pooling operations on the first feature vector, the second feature vector, and the third feature vector, such as max pooling or average pooling, to extract key information and reduce data dimensionality. The pooled feature values are input into the attention mechanism to calculate the weights of each feature value and generate attention features corresponding to the current attention module. The first attention mechanism module sums the attention features corresponding to all attention modules to obtain the second merged feature, which integrates the outputs of different attention modules and enhances the representational power of the features. The second merged feature is added to the third feature vector (the query feature at the current time) point by point according to position to obtain the third merged feature, which combines the direct information at the current time and the historical attention information. Layer normalization is performed on the third merged feature to stabilize the feature distribution and avoid gradient vanishing or exploding problems. The third merged feature after layer normalization is then convolved to further improve the representational power of the features and remove redundant information to obtain the first attention feature map. This map highlights the key features of the target object and provides an optimized feature representation for subsequent recognition and tracking.
[0092] In this embodiment, the first feature vector (historical feature information), the second feature vector (features of interest), and the third feature vector (features for querying at the current moment) are input into different attention modules. This allows for the extraction and enhancement of key features of a person from multiple perspectives and at different time points. This is crucial for processing data in multi-camera scenarios, as each camera may capture different parts or postures of a person. The attention modules can selectively focus on these key information, reducing the impact of background noise and improving recognition accuracy. By summing the attention features corresponding to each attention module, a second merged feature is obtained. This feature is then added point-by-point to the third feature vector (features for querying at the current moment) to generate the third merged feature. This process effectively integrates historical and real-time information, ensuring that the model can consider both historical patterns and current changes when processing time-series data. Subsequent layer normalization and convolution processing further enhance the representational power and generalization ability of the features. The generated first attention feature map is more focused on the salient features of the target person, improving the robustness of recognition and tracking.
[0093] In one exemplary embodiment, Figure 7 This is a structural block diagram of an optional current attention module according to an embodiment of this application, such as... Figure 7 As shown, the current attention module includes a first pooling module, a third feature extraction network, and a second pooling module.
[0094] The first pooling module, a submodule of the attention module, primarily performs pooling operations on the input feature vector. During the recognition and enhancement of human features, this module reduces the dimensionality of features through max pooling and average pooling operations, while preserving and enhancing key information. These operations help reduce computational complexity, prevent overfitting, and extract more representative features, facilitating human re-identification in cross-camera environments.
[0095] The third feature extraction network is a neural network module specifically designed for deep feature extraction of the fourth merged feature in a personnel search and tracking system. It typically consists of multiple convolutional layers, batch normalization layers, and activation functions, aiming to further enhance feature representation and capture deeper visual features. In this embodiment, the third feature extraction network is the core of the feature enhancement process. Through three convolutional layers, it extracts and optimizes key information from the fourth merged feature, making it more suitable for final matching of personnel identities. This is particularly beneficial when processing complex video data such as campus security monitoring, as it helps improve the model's recognition accuracy and generalization ability. In the three convolutional layers (Conv) of the third feature extraction network, the middle layer has the fewest channels, while the two end Conv layers have the same number of channels and size, increasing the receptive field of the features during processing.
[0096] The second pooling module is a key component of the attention module. Its function is to perform pooling operations on the input feature vectors to further optimize and refine feature information. In this embodiment, the second pooling module is used after the initial feature extraction (such as through a third feature extraction network) to perform deeper processing on the features. Through pooling operations, it can reduce the feature dimensionality while retaining or enhancing important visual features. This is crucial for people search and tracking in multi-camera environments, as pooling operations help the model extract more consistent and robust feature representations from different camera perspectives.
[0097] In some embodiments, the first feature vector, the second feature vector, and the third feature vector are input to the current attention module, and the current attention module performs a pooling operation on the first feature vector, the second feature vector, and the third feature vector to obtain the attention features corresponding to the current attention module, including: First, the first and second eigenvectors are multiplied by a matrix to obtain the third feature. The third feature is then input into the first pooling module to perform max pooling on the third feature to obtain the fourth feature. The third feature is then subjected to average pooling on the third feature to obtain the fifth feature. Finally, the fourth and fifth features are merged by the first pooling module to obtain the fourth merged feature.
[0098] Among them, such as Figure 7 As shown, the third feature is the feature representation of a specific person (such as a student or visitor on campus) extracted from the detected bounding box after processing by the object detection network at the current moment. It is obtained by matrix multiplication of the first feature vector (generally the feature representation of the person region) and the second feature vector (which may represent the background information of the entire image or specific visual attributes), aiming to emphasize and highlight the key features of the current target object.
[0099] The fourth feature is the feature vector obtained by max pooling the third feature in the first pooling module. Max pooling tends to preserve and highlight the maximum value in the feature map, which means that the fourth feature focuses more on the peak information of the target object's features. This is particularly useful in people recognition because it can focus on the most prominent visual features, such as face, clothing style, or carried items, thereby improving the accuracy of recognition.
[0100] The fifth feature is the feature vector obtained by the first pooling module after performing average pooling on the third feature. Compared with max pooling, average pooling averages the overall information in the feature map. The fifth feature reflects the average distribution of the target object's features, which helps to capture the consistent features of the target object. It can maintain the stability of features even under changes in lighting or slight pose changes, which is crucial for people tracking across cameras and over time.
[0101] The fourth merged feature is a feature representation generated by merging the fourth and fifth features obtained after the first pooling module. It combines the advantages of max pooling and average pooling, including both the peak information of the target object and its overall feature distribution, thus enabling a more comprehensive and robust representation of the target object's features.
[0102] Second, the fourth merged feature is input into the third feature extraction network to extract features from the fourth merged feature, thus obtaining the sixth feature.
[0103] The sixth feature is the final feature representation obtained by the third feature extraction network after performing deep feature extraction on the fourth merged feature. It contains the deepest features of the target object after processing by multiple layers of neural networks, and can highlight key visual attributes in personnel identification, such as facial features, clothing style, and carried items.
[0104] Third, the sixth feature is input into the second pooling module to perform max pooling on the sixth feature to obtain the seventh feature. The sixth feature is then subjected to average pooling on the second pooling module to obtain the eighth feature. Finally, the seventh and eighth features are added point by point according to their positions to obtain the fifth merged feature.
[0105] The seventh feature is a feature vector obtained by max pooling the sixth feature. Max pooling tends to preserve local maxima in the input features, meaning the seventh feature focuses more on the salient visual features of the target object (such as people on campus), such as facial expressions, patterns on specific clothing, or items carried. These salient features help the model quickly locate and identify targets in complex environments, especially when identifying key personnel or monitoring potentially dangerous behaviors, thus improving the model's response speed and recognition accuracy.
[0106] The eighth feature is a feature vector obtained by performing average pooling on the sixth feature. Average pooling averages the values of the feature map, helping to capture global features and consistency information of the target object, such as the continuity of clothing style and the similarity of body posture. The generation of the eighth feature enables the model to match the target more stably when handling cross-camera person recognition, maintaining a high recognition rate even when the target's posture changes or is occluded.
[0107] The fifth merged feature is a comprehensive feature vector obtained by adding the seventh and eighth features point-by-point according to their positions. It integrates the outputs of both max pooling and average pooling operations, aiming to construct a feature representation that includes both significant local features and global information. The generation of the fifth merged feature provides the model with a more comprehensive and robust feature description, effectively improving the adaptability and recognition accuracy of personnel search and tracking methods in various environments. Especially in campus security monitoring, the high quality of the fifth merged feature helps to accurately distinguish between key personnel and unfamiliar individuals.
[0108] Fourth, perform matrix multiplication of the fifth merged feature and the second feature vector to obtain the attention feature corresponding to the current attention module.
[0109] The core part of the attention mechanism involves multiplying the fifth merged feature and the second feature vector to obtain the attention feature corresponding to the current attention module. Through matrix multiplication, the model can extract the target feature most relevant to the current query from the fifth merged feature, guided by the second feature vector. This enables high-precision identification and tracking of the target object in subsequent feature matching and identity verification.
[0110] In this embodiment, the first pooling module performs max pooling and average pooling on the initially extracted third feature (i.e., the matrix multiplication result of the first and second feature vectors) to obtain the fourth and fifth features, respectively. This process effectively reduces the dimensionality of the feature vectors while retaining the most significant and consistent information, laying the foundation for subsequent feature extraction and matching. The fourth merged feature is further processed by the third feature extraction network to generate the sixth feature. This network typically contains multiple convolutions, which can capture deeper visual information and enhance the representational ability of the features, especially in handling person recognition under multiple perspectives, changing backgrounds, and different lighting conditions, thus improving the model's generalization ability. After the sixth feature is input into the second pooling module, max pooling and average pooling operations are applied again to obtain the seventh and eighth features, respectively. These two features are then fused into the fifth merged feature by adding them point by point. This operation further strengthens the robustness of the features, ensuring that the identity features can be accurately captured even when people are moving quickly or changing their posture. Finally, the fifth merged feature is combined with the second feature vector by matrix multiplication to generate the attention feature corresponding to the current attention module. This feature integrates key information about the target object with the environmental context, enabling the model to more accurately identify and track specific individuals in complex environments, significantly improving the accuracy and efficiency of cross-camera person re-identification.
[0111] In one exemplary embodiment, updating object features in a tag database using a first set of object features includes: The following update operation is performed on each of the first object features in a set of first object features as the current first object features to obtain the updated label database: according to the preset weight, the object feature in the label database with the highest matching degree with the current first object feature and the current first object feature are weighted and summed to obtain the weighted object feature, and the weighted object feature is used to replace the object feature in the label database with the highest matching degree with the current first object feature.
[0112] In this context, the current first object feature refers to the feature representation of a person extracted by the target detection network or the person feature enhancement network at the current time point in multi-camera person tracking.
[0113] The update operation refers to the process of updating the tag database with the object feature that has the highest matching degree with the current first object feature after a person is identified. This process follows a preset weight, performing a weighted sum of the current first object feature and the object feature with the highest matching degree in the database to generate a new weighted object feature. Then, this weighted object feature replaces the object feature in the original database that has the highest matching degree with the current first object feature. The tag database can be updated according to the following formula:
[0114] in, The detected personnel characteristics are encoded object feature values; For the object feature values in the label database, and The probability is greater than the set threshold; These are hyperparameters. For example, if the feature value of an object in the label database is 100, and the feature value of a newly detected object is 80, If set to 0.5, the new weighted object feature will be 90, replacing 100 in the label database with 90.
[0115] In some embodiments, updates to the existing database rely on a preset time period, which may result in untimely updates to the characteristics of people who frequently enter and exit important locations, affecting the recognition rate. Characteristics of occasionally visiting personnel may be prematurely deleted, reducing the ability to identify temporary visitors. To address these issues, in this embodiment, the database update strategy can be a dynamic update strategy. For example, a dynamic update strategy can be based on behavioral patterns and historical trajectories. Before performing a weighted summation of the object features in the tag database that have the highest matching degree with the current first object feature and the current first object feature according to preset weights, the following steps are also included: Step 1: Initialize the tagged database and the untagged database.
[0116] Step 2: Behavioral Pattern Recognition. Real-time video streams from multiple cameras are collected, and the location, behavior, and identity tags (if available) of target objects are extracted using an object detection network. Features for each target object are extracted using a feature enhancement network and encoded. The number of times a target object enters and exits the camera's field of view within a preset time period (e.g., one hour) is recorded, the average dwell time of the target object in a specific area is calculated, and the movement trajectory of people is analyzed. Common routes and abnormal behaviors are identified, and the frequency of entry and exit, dwell time, and movement routes of target objects are analyzed to construct a behavioral pattern for each target object.
[0117] Step 3: Calculate the activity score. Based on factors such as entry / exit frequency, dwell time, and stability of movement routes, assign an activity score to the behavioral patterns of each target object. This score integrates the above indicators (a weighted average method can be used, assigning different weights to different indicators as needed), reflecting the activity level of the target object in the monitored area. Different activity scores correspond to different update cycles; generally, the higher the activity score, the shorter the update cycle.
[0118] Step 4: Historical Trajectory Evaluation. Record the historical trajectory data of each target object, including its appearance time, location, and behavior under different cameras. Based on the historical trajectory, use a time series analysis model, such as LSTM, to predict the target object's movement pattern. Different movement patterns correspond to different update cycles; generally, the more stable the movement pattern, the shorter the update cycle.
[0119] Step 5: Dynamic Update Decision. Based on the activity score and historical trajectory evaluation of each target object, a dynamic update strategy is formulated. For example, a first update cycle matching the activity score of each object and a second update cycle matching the movement pattern of each object are determined. The first and second update cycles are then weighted and summed to obtain the target update cycle. Throughout this process, the update cycle of the feature information of each target object is dynamically adjusted based on the comprehensive evaluation of each object, ensuring that the feature information in the database best matches the current state of the target object.
[0120] Step 6: Feature Update. Through the feature matching process, calculate the similarity between the newly captured target object features and the object features in the specified database. When the target object's update cycle is reached, perform the above-mentioned step of weighted summation of the object features in the tag database that have the highest matching degree with the current first object features and the current first object features, according to preset weights.
[0121] Step 7: Database Maintenance. For the management of the unlabeled database: check the number of features in the unlabeled database. If it exceeds a set threshold, delete the least active and least important feature information based on historical trajectory evaluation and activity score. For the maintenance of the labeled database: maintain the labeled database to ensure that the personnel feature information in the database is up-to-date, while monitoring feature quality and eliminating abnormal or low-quality features.
[0122] The database update strategy based on behavioral patterns and historical trajectories described above can update the characteristics of people who frequently enter and exit important locations in a timely manner, improve the recognition rate, prevent the premature deletion of the characteristics of occasional visitors, and enhance the ability to identify temporary visitors.
[0123] In this embodiment, the update operation is a key step in maintaining the real-time and accuracy of the tag database information. By utilizing time-series information and real-time detection results, it is possible to continuously optimize its ability to identify and track personnel. Especially in campus security monitoring, this mechanism helps the system adapt to minor changes in personnel appearance, such as changes in clothing under different weather conditions, ensuring the continuity and accuracy of identification.
[0124] Optionally, such as Figure 3As shown, the terminal device calculates the matching degree between the current first object feature and all object features in the tag database, finds the object feature with the highest matching degree, and performs a weighted sum of the found highest matching degree object feature and the current first object feature according to the preset weights of the object feature values in the tag database and the current first object feature. This generates a weighted object feature, which replaces the original highest matching degree object feature in the tag database to update the database and reflect the latest changes in personnel features. The above steps are performed one by one for each first object feature in a set of first object features, ensuring that all relevant records in the tag database are updated in real time and accurately, improving the accuracy and efficiency of personnel tracking.
[0125] In this embodiment, the input images during real-time detection are continuous time-series data. This means that two images taken at similar times will have a high degree of similarity in appearance features and location information of the same person. Through update operations, these subtle changes can be captured and reflected in a timely manner, ensuring that the feature values in the database are up-to-date, thereby improving the accuracy of subsequent identification and enhancing the representativeness of features in the label database. Because images taken at similar times have high similarity, the weighted object features obtained through weighted summation better reflect the true characteristics of the person in the current environment, reducing misjudgments during the identification process. Traditional database update methods may be too static and cannot reflect changes in the appearance of people or environmental conditions in a timely manner, while the weighted update strategy allows the database to be dynamically adjusted based on real-time detection results. This not only improves the efficiency of feature matching but also ensures the real-time nature and effectiveness of the database, enabling rapid responses to dynamic changes in people, such as changes in clothing due to seasonal changes, ensuring the stability and accuracy of the identification algorithm.
[0126] In one exemplary embodiment, storing a set of second object features in an unlabeled database includes: If the remaining capacity of the unlabeled database is greater than or equal to the capacity required to store the object features in a set of second object features, the set of second object features is stored in the unlabeled database. If the remaining capacity of the unlabeled database is less than the capacity required to store the object features in a set of second object features, at least some object features are removed from the unlabeled database according to the order of their storage timestamps, so that the remaining capacity of the unlabeled database is greater than or equal to the capacity required to store the object features in a set of second object features. The set of second object features is then stored in the unlabeled database after the removal of some object features.
[0127] The remaining capacity of the unlabeled database refers to the number of feature vectors or the size of data that the database can still hold when storing encoded second object features (i.e., personnel features for which no corresponding ID is found in the label database). In this embodiment, the capacity of the unlabeled database is limited and is used to store newly discovered or unmatched personnel features during real-time detection for subsequent training or identification of unfamiliar persons.
[0128] When the remaining capacity of the unlabeled database is less than the capacity required to store the object features in a set of second object features, it is necessary to remove some object features. Removing some object features means that when the remaining capacity of the unlabeled database is insufficient to store a set of second object features, the earliest feature vectors are deleted from the unlabeled database according to the order in which they were stored (based on their timestamps), in order to free up sufficient storage space. This operation not only ensures that the unlabeled database can continuously receive new data, but also prioritizes the retention of newer personnel feature information through timestamp sorting, helping the system to quickly adapt to environmental changes and improve the efficiency and accuracy of personnel identification and tracking.
[0129] Optionally, such as Figure 3 As shown, the terminal device calculates the capacity required to store a set of second object features and checks whether the current remaining capacity of the unlabeled database is greater than or equal to this requirement. If the remaining capacity of the unlabeled database meets the requirement, the terminal device directly stores a set of second object features into the unlabeled database. If the remaining capacity is insufficient, the terminal device deletes the oldest object features from the unlabeled database in the order of their storage timestamps until the remaining capacity is sufficient to store the newly extracted set of second object features. After removing some object features, the terminal device checks the remaining capacity again to ensure that the storage conditions are met, and then stores a set of second object features into the unlabeled database.
[0130] This embodiment sets a capacity threshold for the unlabeled database and dynamically adjusts the storage space, avoiding database overload due to excessive data storage, which reduces processing speed and efficiency. Simultaneously, periodically removing old data maintains the database's update frequency, helping to improve model training performance, avoiding data redundancy and over-complexity during training, and reducing model training oscillations. The unlabeled database stores the features of unfamiliar individuals. By continuously receiving, storing, and removing features, the unlabeled database can continuously accumulate and update personnel appearance information in various environments, providing the model with richer and more diverse training samples. This helps the model better identify people under different camera angles and environmental conditions, improving the algorithm's generalization ability and adaptability to new scenarios, demonstrating significant advantages for personnel identification in dynamic environments such as campus security monitoring.
[0131] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0132] This embodiment also provides a target tracking device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0133] Figure 8 This is a structural block diagram of a target tracking device according to an embodiment of this application, such as... Figure 8 As shown, the device includes: The target recognition module 802 is used to perform target recognition on the image to be detected and obtain a set of target object features; the set of target object features is a set of target object features whose object type is consistent with the preset category; The target matching module 804 is used to match a set of target object features with object features in a specified database; the specified database includes a labeled database and an unlabeled database; the object features stored in the labeled database are those of authenticated objects; the object features stored in the unlabeled database are those of unauthenticated objects. The target tracking module 806 is used to update the object features in the label database using a set of first object features when there is a set of first object features in a set of target object features that match the object features in the label database, and to track the target object based on the object features in the label database; and to store a set of second object features in the unlabeled database when there is a set of second object features in a set of target object features that match the object features in the unlabeled database, and to track the target object based on the object features in the unlabeled database.
[0134] In an exemplary embodiment, the target recognition module 802 is further configured to input the image to be detected into a target detection network to obtain a set of object recognition results output by the target detection network; the set of object recognition results is used to characterize a set of candidate objects identified, and each object recognition result in the set of object recognition results includes target detection box size, target box position, target label, and confidence information; the target label in each object recognition result is used to characterize the object category of the identified corresponding candidate object; the confidence information in each object recognition result is used to characterize the object category of the corresponding candidate object as the identified object; based on the target label and confidence score in the set of object recognition results, a set of target objects is determined from the set of candidate objects whose identified object category is consistent with the preset category and whose confidence is higher than the preset confidence threshold; based on the target detection box size and target box position in the object recognition results corresponding to the set of target objects, a set of target object images is extracted from the image to be detected; the set of target object images is input into a feature enhancement network to perform image enhancement processing on the set of target object images through the feature enhancement network, and object features are extracted from the set of target object images after image enhancement processing to obtain a set of target object features.
[0135] In an exemplary embodiment, the object detection network includes a first feature processing module, a first attention mechanism module, and a first feature extraction network; the object recognition module 802 is further configured to scale the image to be detected to obtain an image to be detected of a specified size, and input the image to be detected of the specified size into the first feature processing module, so that the first feature processing module sequentially performs feature extraction, pooling, flattening, position encoding, and normalization processing on the image to be detected of the specified size to obtain a first feature vector, a second feature vector, and a third feature vector; the first feature vector represents the feature information corresponding to all positions; the second feature vector represents the information of interest in the first feature vector; the third feature vector represents the feature information queried at the current time; the first feature vector, the second feature vector, and the third feature vector are input into the first attention mechanism module, so that the first attention mechanism module performs pooling operation on the first feature vector, the second feature vector, and the third feature vector to obtain a first attention feature map; the first attention feature map is input into the first feature extraction network, so that the first feature extraction network performs feature extraction on the first attention feature map, and the object detection network outputs a set of object recognition results.
[0136] In an exemplary embodiment, the feature enhancement network includes a second feature processing module, a third feature processing module, a second attention mechanism module, and a second feature extraction network; the target recognition module 802 is further configured to enlarge a set of target object images according to a preset scaling factor to obtain an enlarged set of target object images, and input the enlarged set of target object images to the second feature processing module for feature extraction, pooling, flattening, position encoding, and normalization processing of the enlarged set of target object images to obtain a fourth feature vector and a fifth feature vector; the fourth feature vector represents the feature information corresponding to all positions; the fifth feature vector represents the attention information in the fourth feature vector; and the enlarged set of target object images is input to the third feature processing module for further processing. The process involves feature extraction, flattening, position encoding, and normalization to obtain a sixth feature vector. This sixth feature vector represents the feature information queried at the current time. The third feature processing module extracts features from a magnified set of target object images to obtain the first feature. The fourth, fifth, and sixth feature vectors are input into the second attention mechanism module, which performs pooling operations on them to obtain a second attention feature map. This second attention feature map is then input into the second feature extraction network to extract features from it, resulting in the second feature. The first and second features are then merged by the second feature extraction network to obtain the first merged feature, which is then used for feature extraction to obtain a set of target object features.
[0137] In an exemplary embodiment, the first attention mechanism module includes at least one attention module; the target recognition module 802 is further configured to take the attention modules in the at least one attention module as the current attention module and perform the following pooling operation to obtain attention features corresponding to the at least one attention module: inputting the first feature vector, the second feature vector, and the third feature vector into the current attention module, performing pooling operation on the first feature vector, the second feature vector, and the third feature vector through the current attention module to obtain attention features corresponding to the current attention module; performing summation processing on the attention features corresponding to the at least one attention module to obtain a second merged feature; adding the second merged feature and the third feature vector point by point according to position to obtain a third merged feature; and performing layer normalization processing and convolution processing on the third merged feature to obtain a first attention feature map.
[0138] In an exemplary embodiment, the current attention module includes a first pooling module, a third feature extraction network, and a second pooling module. The target recognition module 802 is further configured to perform matrix multiplication on the first feature vector and the second feature vector to obtain a third feature, and input the third feature into the first pooling module to perform max pooling on the third feature to obtain a fourth feature, perform average pooling on the third feature through the first pooling module to obtain a fifth feature, and merge the fourth feature and the fifth feature through the first pooling module to obtain a fourth merged feature; input the fourth merged feature into the third feature extraction network to extract features from the fourth merged feature through the third feature extraction network to obtain a sixth feature; input the sixth feature into the second pooling module to perform max pooling on the sixth feature to obtain a seventh feature, perform average pooling on the sixth feature through the second pooling module to obtain an eighth feature, and add the seventh feature and the eighth feature point by point through the second pooling module to obtain a fifth merged feature; and multiply the fifth merged feature and the second feature vector by matrix multiplication to obtain the attention feature corresponding to the current attention module.
[0139] In an exemplary embodiment, the target tracking module 806 is further configured to perform the following update operation on the first object features in a set of first object features as the current first object features, to obtain an updated tag database: according to a preset weight, the object feature in the tag database with the highest matching degree with the current first object feature and the current first object feature are weighted and summed to obtain a weighted object feature, and the weighted object feature is used to replace the object feature in the tag database with the highest matching degree with the current first object feature.
[0140] In an exemplary embodiment, the target tracking module 806 is further configured to: store a set of second object features into the unlabeled database when the remaining capacity of the unlabeled database is greater than or equal to the capacity required to store object features in a set of second object features; and, when the remaining capacity of the unlabeled database is less than the capacity required to store object features in a set of second object features, remove at least some object features from the unlabeled database according to the order of their storage timestamps, so that the remaining capacity of the unlabeled database is greater than or equal to the capacity required to store object features in a set of second object features; and store the set of second object features into the unlabeled database after the removal of some object features.
[0141] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0142] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0143] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0144] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0145] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0146] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0147] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0148] The embodiments described herein also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0149] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0150] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0151] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A target tracking method, characterized in that, include: Target recognition is performed on the image to be detected to obtain a set of target object features; the set of target object features is a set of object features of target objects whose object type is consistent with a preset category. The set of target object features is matched with object features in a specified database; the specified database includes a tagged database and an untagged database; the object features stored in the tagged database are those of authenticated objects; the object features stored in the untagged database are those of unauthenticated objects. If a set of first object features exists in the set of target object features that matches the object features in the tag database, the tag database and the unlabeled database are initialized; video streams from multiple cameras are collected, and the location, behavior, and identity tags of the target objects are extracted using a target detection network; features of each target object are extracted using a feature enhancement network and encoded; the number of times a target object enters and exits the camera's field of view within a preset time period is recorded, the average dwell time of the target object in a specific area is counted, and the entry / exit frequency, dwell time, and movement route of the target object are analyzed to construct a behavior pattern for each target object; based on the stability of the target object's entry / exit frequency, dwell time, and movement route, an activity score is assigned to the behavior pattern of each target object; different activity scores correspond to different update cycles; historical trajectory data of each target object is recorded, including the appearance time, location, and behavior under different cameras; based on the historical trajectory, The movement pattern of the target object is predicted using a time series analysis model; different movement patterns correspond to different update cycles; a first update cycle matching the activity score of each target object and a second update cycle matching the movement pattern of each target object are determined; the first update cycle and the second update cycle are weighted and summed to obtain the target update cycle; when the target update cycle of the target object is reached, the first object features in the set of first object features are respectively used as the current first object features, and the following update operation is performed to obtain the updated tag database: according to preset weights, the object feature in the tag database with the highest matching degree with the current first object feature and the current first object feature are weighted and summed to obtain the weighted object feature; the weighted object feature is used to replace the object feature in the tag database with the highest matching degree with the current first object feature; and the target object is tracked according to the object features in the tag database. If a set of second object features exists in the set of target object features that matches the object features in the unlabeled database, the set of second object features is stored in the unlabeled database, and target object tracking is performed based on the object features in the unlabeled database.
2. The method according to claim 1, characterized in that, The process of target recognition in the image to be detected yields a set of target object features, including: The image to be detected is input into an object detection network to obtain a set of object recognition results output by the object detection network. The set of object recognition results is used to characterize a set of identified candidate objects. Each object recognition result in the set includes the object detection box size, object box position, object label, and confidence information. The object label in each object recognition result is used to characterize the object category of the identified corresponding candidate object. The confidence information in each object recognition result is used to characterize the confidence level of the corresponding candidate object's object category. Based on the target label and confidence score in the set of object recognition results, determine the set of target objects whose object category is consistent with the preset category and whose confidence score is higher than the preset confidence threshold from the set of candidate objects; Based on the size and position of the target detection box in the object recognition results corresponding to the set of target objects, a set of target object images are extracted from the image to be detected; The set of target object images is input into a feature enhancement network to perform image enhancement processing on the set of target object images, and object features are extracted from the set of target object images after image enhancement processing to obtain the set of target object features.
3. The method according to claim 2, characterized in that, The target detection network includes a first feature processing module, a first attention mechanism module, and a first feature extraction network; The step of inputting the image to be detected into the target detection network to obtain a set of object recognition results output by the target detection network includes: The image to be detected is scaled to obtain an image of a specified size, and then input into the first feature processing module. The first feature processing module sequentially performs feature extraction, pooling, flattening, position encoding, and normalization on the image of the specified size to obtain a first feature vector, a second feature vector, and a third feature vector. The first feature vector represents the feature information corresponding to all positions; the second feature vector represents the information of interest in the first feature vector; and the third feature vector represents the feature information queried at the current time. The first feature vector, the second feature vector, and the third feature vector are input into the first attention mechanism module, so that the first attention mechanism module performs pooling operation on the first feature vector, the second feature vector, and the third feature vector to obtain the first attention feature map; The first attention feature map is input into the first feature extraction network to extract features from the first attention feature map, and the object detection network outputs the set of object recognition results.
4. The method according to claim 2, characterized in that, The feature enhancement network includes a second feature processing module, a third feature processing module, a second attention mechanism module, and a second feature extraction network; The step of inputting the set of target object images into a feature enhancement network to perform image enhancement processing on the set of target object images through the feature enhancement network, and extracting object features from the enhanced set of target object images to obtain the set of target object features, includes: The set of target object images is enlarged according to a preset scaling factor to obtain the enlarged set of target object images. The enlarged set of target object images is then input into the second feature processing module, where feature extraction, pooling, flattening, position encoding, and normalization are performed on the enlarged set of target object images to obtain a fourth feature vector and a fifth feature vector. The fourth feature vector represents the feature information corresponding to all positions, and the fifth feature vector represents the information of interest in the fourth feature vector. The magnified set of target object images is input to the third feature processing module, which performs feature extraction, flattening, position encoding, and normalization on the magnified set of target object images to obtain a sixth feature vector; the sixth feature vector represents the feature information queried at the current time; the feature obtained by the third feature processing module from the magnified set of target object images is the first feature; The fourth feature vector, the fifth feature vector, and the sixth feature vector are input into the second attention mechanism module, so that the second attention mechanism module performs pooling operation on the fourth feature vector, the fifth feature vector, and the sixth feature vector to obtain the second attention feature map; The second attention feature map is input into the second feature extraction network to extract features from the second attention feature map to obtain the second feature. The first feature and the second feature are then merged through the second feature extraction network to obtain the first merged feature. Feature extraction is then performed on the first merged feature to obtain the set of target object features.
5. The method according to claim 3, characterized in that, The first attention mechanism module includes at least one attention module; The step of inputting the first feature vector, the second feature vector, and the third feature vector into the first attention mechanism module, and performing pooling operations on the first feature vector, the second feature vector, and the third feature vector through the first attention mechanism module to obtain a first attention feature map, includes: The attention modules in the at least one attention module are respectively taken as the current attention module, and the following pooling operation is performed to obtain the attention features corresponding to the at least one attention module: the first feature vector, the second feature vector and the third feature vector are input to the current attention module, and the first feature vector, the second feature vector and the third feature vector are pooled by the current attention module to obtain the attention features corresponding to the current attention module; The attention features corresponding to the at least one attention module are summed to obtain a second merged feature. The second merged feature is then added to the third feature vector point by point according to position to obtain a third merged feature. The third merged feature is then subjected to layer normalization and convolution to obtain the first attention feature map.
6. The method according to claim 5, characterized in that, The current attention module includes a first pooling module, a third feature extraction network, and a second pooling module; the step of inputting the first feature vector, the second feature vector, and the third feature vector into the current attention module, and performing a pooling operation on the first feature vector, the second feature vector, and the third feature vector through the current attention module to obtain the attention features corresponding to the current attention module includes: The first feature vector and the second feature vector are multiplied by matrix to obtain the third feature. The third feature is then input into the first pooling module to perform max pooling on the third feature to obtain the fourth feature. The third feature is then subjected to average pooling on the third feature to obtain the fifth feature. Finally, the fourth feature and the fifth feature are merged by the first pooling module to obtain the fourth merged feature. The fourth merged feature is input into the third feature extraction network to extract features from the fourth merged feature, thereby obtaining the sixth feature; The sixth feature is input to the second pooling module, which performs max pooling on the sixth feature to obtain the seventh feature. The second pooling module then performs average pooling on the sixth feature to obtain the eighth feature. Finally, the second pooling module adds the seventh feature and the eighth feature point by point according to their positions to obtain the fifth merged feature. The fifth merged feature and the second feature vector are multiplied by a matrix to obtain the attention feature corresponding to the current attention module.
7. The method according to any one of claims 1 to 6, characterized in that, The step of storing the set of second object features into the unlabeled database includes: If the remaining capacity of the unlabeled database is greater than or equal to the capacity required to store the object features in the set of second object features, the set of second object features shall be stored in the unlabeled database. If the remaining capacity of the unlabeled database is less than the capacity required to store the object features in the set of second object features, at least some object features are removed from the unlabeled database according to the order of their storage timestamps, so that the remaining capacity of the unlabeled database is greater than or equal to the capacity required to store the object features in the set of second object features; the set of second object features is then stored in the unlabeled database after the removal of some object features.
8. A target tracking device, characterized in that, include: The target recognition module is used to perform target recognition on the image to be detected and obtain a set of target object features; the set of target object features is a set of target object features whose object type is consistent with a preset category; The target matching module is used to match the set of target object features with object features in a specified database, wherein the specified database includes a labeled database and an unlabeled database; the object features stored in the labeled database are those of authenticated objects; and the object features stored in the unlabeled database are those of unauthenticated objects. The target tracking module is used to initialize the label database and the unlabeled database when a set of first object features matching the object features in the label database exists in the set of target object features; collect video streams from multiple cameras and extract the location, behavior, and identity labels of the target objects through a target detection network; extract and encode the features of each target object using a feature enhancement network; record the number of times the target object enters and exits the camera's field of view within a preset time period, count the average dwell time of the target object in a specific area, analyze the entry and exit frequency, dwell time, and movement route of the target object, and construct a behavior pattern for each target object; assign an activity score to the behavior pattern of each target object based on the stability of the entry and exit frequency, dwell time, and movement route; different activity scores correspond to different update cycles; record the historical trajectory data of each target object, including the appearance time, location, and behavior under different cameras; predict the movement pattern of the target object using a time series analysis model based on the historical trajectory; different movement patterns correspond to different update cycles; and determine... A first update cycle matching the activity score of each target object and a second update cycle matching the movement pattern of each target object are used. The first update cycle and the second update cycle are weighted and summed to obtain the target update cycle. When the target update cycle of the target object is reached, the first object features in the set of first object features are used as the current first object features and the following update operations are performed to obtain the updated tag database: according to preset weights, the object feature in the tag database with the highest matching degree with the current first object feature and the current first object feature are weighted and summed to obtain the weighted object feature. The weighted object feature is used to replace the object feature in the tag database with the highest matching degree with the current first object feature, and the target object is tracked according to the object features in the tag database. If there is a set of second object features in the set of target object features that matches the object features in the unlabeled database, the set of second object features is stored in the unlabeled database, and the target object is tracked according to the object features in the unlabeled database.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 7.