Trajectory recognition method and device, storage medium and electronic device
By establishing a node connectivity dictionary and using connection count, connection rate, and distance information to identify clustering error files, the problem of the inability to effectively remove clustering error files in existing technologies is solved, thus improving identification efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG DAHUA TECH CO LTD
- Filing Date
- 2023-03-15
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies cannot effectively remove clustering errors from the clustering archives, which negatively impacts the portrait clustering system.
By establishing a node connectivity dictionary and utilizing the connection count, connection rate, and distance information in the dictionary, the system identifies target clustering files whose abnormal probability exceeds a preset threshold, thereby locating and filtering out incorrectly clustered files.
It improves the efficiency and accuracy of identifying clustering error files, enabling rapid and comprehensive location and screening of clustering error files.
Smart Images

Figure CN116168222B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of security and image processing, and more specifically, to a trajectory recognition method and apparatus, a storage medium, and an electronic device. Background Technology
[0002] With the advancement of technology and the human need for a more convenient life, various data collection applications have become widespread and are taking root in all walks of life, generating a large amount of target trajectory data. How to effectively utilize this trajectory data to positively impact social progress and stability is a key question.
[0003] Currently, the most common application of target trajectory data is target clustering, which groups target trajectory data belonging to an individual into a single profile. Traditional target clustering, due to inaccurate facial recognition and issues such as image quality and shooting angle, sometimes clusters facial images of different individuals into the same profile; these are collectively referred to as erroneous clustering profiles. The generation of these erroneous profiles negatively impacts facial clustering systems, making the identification and removal of these erroneous profiles a meaningful research direction.
[0004] There is currently no effective solution to the problem that existing technologies cannot effectively remove clustering errors from clustered archives. Summary of the Invention
[0005] This invention provides a trajectory recognition method and apparatus, storage medium and electronic device, to at least solve the problem that the prior art cannot effectively remove clustered error files from clustered archives.
[0006] According to one aspect of the present invention, a trajectory recognition method is provided, comprising: acquiring cluster archives of different target objects, wherein the cluster archives include trajectory data of the target objects collected at different nodes; establishing a node connectivity dictionary between the different nodes, wherein the node connectivity dictionary is used to indicate at least the number of connections and the connection rate between the different nodes, as well as the distance between the different nodes; determining a target cluster archive from the cluster archives based on the node connectivity dictionary, wherein the probability that the target cluster archive is an abnormal archive is greater than a first preset threshold.
[0007] According to another aspect of the present invention, a trajectory recognition method apparatus is also provided, comprising: an acquisition module for acquiring cluster archives of different target objects, wherein the cluster archives include trajectory data of the target objects collected at different nodes; an establishment module for establishing a node connectivity dictionary between the different nodes, wherein the node connectivity dictionary is used to at least indicate the number of connections and the connection rate between the different nodes, as well as the distance between the different nodes; and a determination module for determining a target cluster archive from the cluster archives based on the node connectivity dictionary, wherein the probability that the target cluster archive is an abnormal archive is greater than a first preset threshold.
[0008] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the method in any of the method embodiments at runtime.
[0009] According to another aspect of the present invention, 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 perform the method in any of the above-described method embodiments through the computer program.
[0010] In this embodiment of the invention, cluster archives of different target objects are obtained, wherein the cluster archives include trajectory data of the target objects collected at different nodes; a node connectivity dictionary is established between different nodes, wherein the node connectivity dictionary is used to indicate at least the number and connection rate between different nodes, as well as the distance between different nodes; a target cluster archive is determined from the cluster archives based on the node connectivity dictionary, wherein the probability that the target cluster archive is an abnormal archive is greater than a first preset threshold, that is, the suspected abnormal target cluster archives in the cluster archives are located by the node connectivity rule strategy, which greatly improves the identification efficiency of cluster archives with abnormal trajectories, thereby more quickly and comprehensively perceiving the cluster error archives in the cluster archives, realizing the effect of abnormal location and screening of cluster error archives, and thus solving the problem that the existing technology cannot effectively remove cluster error archives in the cluster archives. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0012] Figure 1 This is a hardware structure block diagram of a target terminal according to an embodiment of the present invention for a trajectory recognition method;
[0013] Figure 2This is a flowchart of a trajectory recognition method according to an embodiment of the present invention;
[0014] Figure 3 This is a schematic diagram of the overall process for abnormal face trajectory recognition based on spatiotemporal patterns according to an optional embodiment of the present invention.
[0015] Figure 4 This is a schematic diagram illustrating the process of establishing a node connectivity dictionary according to an optional embodiment of the present invention;
[0016] Figure 5 This is a schematic diagram of the trajectory recognition device according to an embodiment of the present invention. Detailed Implementation
[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0018] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0019] The method embodiments provided in this application can be executed on a target terminal, mobile terminal, or similar computing device. Taking running on a target terminal as an example, Figure 1 This is a hardware structure block diagram of a target terminal for a trajectory recognition method according to an embodiment of the present invention. Figure 1 As shown, the target terminal 10 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. Optionally, the target terminal 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 target terminal described above. For example, the target terminal 10 may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 Equivalent functions or ratios shown Figure 1 The functions shown have more different configurations.
[0020] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the trajectory recognition method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include 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 the target terminal 10 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.
[0021] 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 target terminal 10. 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.
[0022] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the above trajectory recognition method includes:
[0023] Step S202: Obtain clustering profiles for different target objects, wherein the clustering profiles include trajectory data of the target objects collected at different nodes;
[0024] It should be noted that trajectory data of the same target object belong to the same cluster archive. Therefore, the trajectory sequence of the target object at different nodes and at different times can be determined through the cluster archive. The target object may include people, robots, or physical equipment, but is not limited to these.
[0025] Step S204: Establish a node connectivity dictionary between the different nodes, wherein the node connectivity dictionary is used to indicate at least the number of connections and the connection rate between the different nodes, as well as the distance between the different nodes;
[0026] Step S206: Determine the target cluster file from the cluster files according to the node connectivity dictionary, wherein the probability that the target cluster file is an abnormal file is greater than a first preset threshold.
[0027] It is understandable that, since the node connectivity dictionary contains information such as the number of connections and connection rate between different nodes, as well as the distance between different nodes, when it is determined that the connection rate between different nodes is less than the second preset threshold, it indicates that the trajectory data of two target objects may have been clustered into one file; the aforementioned first preset threshold is a preset reference value for determining that the clustered file is an abnormal file.
[0028] Through the above steps, cluster archives of different target objects are obtained, including trajectory data of target objects collected at different nodes; a node connectivity dictionary is established between different nodes, which at least indicates the number and rate of connections between different nodes, as well as the distance between different nodes; target cluster archives are determined from the cluster archives based on the node connectivity dictionary, wherein the probability of a target cluster archive being an abnormal archive is greater than a first preset threshold. That is, the suspected abnormal target cluster archives in the cluster archives are located by the node connectivity rule strategy, which greatly improves the efficiency of identifying cluster archives with abnormal trajectories, thereby more quickly and comprehensively perceiving cluster error archives in the cluster archives, achieving the effect of abnormal location and screening of cluster error archives, and thus solving the problem that existing technologies cannot effectively remove cluster error archives from cluster archives.
[0029] In an exemplary embodiment, before determining the target cluster archive from the cluster archive based on the node connectivity dictionary, the method further includes: sorting the trajectory points in the cluster archive according to time; determining the shooting speed between the first trajectory point and the second trajectory point, wherein the first trajectory point and the second trajectory point are two trajectory points in the cluster archive that are temporally adjacent, the first trajectory point is the trajectory point captured at a first moment, and the second trajectory point is the trajectory point captured at a second moment, the first moment being earlier than the second moment; if the shooting speed is greater than or equal to a preset outlier value, determining the cluster archive as an incorrectly clustered cluster archive, wherein the target cluster archive includes: incorrectly clustered cluster archives.
[0030] Understandably, in cases of erroneous file aggregation, the trajectories of two or more target objects are often asynchronous. Therefore, it's possible to first sort the files by time and calculate the speed between successively captured trajectory points to simply filter out abnormal file trajectories. If spatiotemporal inconsistencies occur, the speed between successively captured trajectory points will exceed the abnormal value. However, it should be noted that the above method is only effective for erroneous file aggregation where two target objects are active simultaneously. For files active at different times, due to the large time difference, even if the distance is far, the speed will be lower than the filtering threshold. In such cases, other detection methods must be selected to identify abnormal trajectories.
[0031] Optionally, determining the shooting speed between the first trajectory point and the second trajectory point includes the following steps:
[0032] Step 302: Determine the first recording time and first dimension corresponding to the first trajectory point, and the second recording time and second dimension corresponding to the second trajectory point;
[0033] It should be noted that since the trajectory data is determined by images taken by camera devices placed at different nodes, the recording time and dimensions can be determined based on the image capture time and the geographical location of the camera device.
[0034] Step 304: Determine the time difference between the first recording time and the second recording time, and use a preset conversion function to process the first dimension and the second dimension to obtain the dimensional distance between the first trajectory point and the second trajectory point;
[0035] Step 306: Divide the dimensional distance by the time difference to obtain the shooting speed between the first trajectory point and the second trajectory point.
[0036] It should be noted that, in order to better align with practical applications, after determining the shooting speed, it is necessary to convert the shooting speed into kilometers per hour, so as to more intuitively understand the changes in the file trajectory corresponding to the cluster file of the target object.
[0037] By following the steps above, erroneous cluster archives in which two target objects are active simultaneously can be effectively identified, thereby improving the efficiency of cluster archive identification and reducing identification delay.
[0038] There are multiple ways to determine the target cluster archive from the cluster archive based on the node connectivity dictionary in step S206 above. In one optional embodiment, it can be implemented by the following scheme: obtaining the first connection rate between the first node and the second node in the cluster archive; finding the second preset threshold corresponding to the connection rate between the first node and the second node from the node connectivity dictionary; and determining the current cluster archive as the target cluster archive when the first connection rate is less than the second preset threshold.
[0039] As an optional implementation, establishing a node connectivity dictionary between the different nodes includes: obtaining file identifiers corresponding to all clustered files; grouping the clustered files of the different target objects according to the file identifiers to obtain multiple file groups; sorting the clustered files included in each of the multiple file groups according to the shooting time to obtain a trajectory sequence corresponding to each group; and establishing the node connectivity dictionary when the trajectory data corresponding to the target objects collected by different nodes in the trajectory sequence is obtained, wherein the trajectory data includes multiple images of the target objects corresponding to the current node.
[0040] Optionally, when the trajectory data corresponding to the target object collected from different nodes in the trajectory sequence is obtained, the node connectivity dictionary is established, including: determining the node connectivity information and the distance between the different nodes based on the trajectory sequence and the trajectory data; wherein, the node connectivity information includes: the number of connections between any two nodes and the connectivity rate between any two nodes; and establishing the node connectivity dictionary based on the different nodes, the node connectivity information, and the distance between the nodes.
[0041] Optionally, determining the node connectivity information and inter-node distances between different nodes based on the trajectory sequence and the trajectory data includes: traversing the trajectory sequence to determine the number of node changes corresponding to capturing images of the same target object, and determining the connectivity number between different nodes in the trajectory sequence based on the number of changes; and determining the node connectivity rate between different nodes according to the following formula: Where count(A,B) is the connectivity between the third node and the fourth node, count(A) is the first number of images corresponding to the target object captured by the third node, count(B) is the second number of images corresponding to the target object captured by the fourth node, and max(count(A), count(B)) is the maximum value of the number of images corresponding to the third node and the fourth node. The third node and the fourth node are any two nodes among the different nodes. The distance between the nodes corresponding to the different nodes is determined according to the following formula: dist(A,B)=6371000*acos(dist_angle(A,B)); where dist_angle(A,B)=sin(latA*π / 180)*sin(latB*π / 180)+cos(latA*π / 180)*cos(latB*π / 180)*cos((longA-longB)*π / 180); where latA is the latitude corresponding to the third node, latB is the latitude corresponding to the fourth node, and longA is the length corresponding to the third node.
[0042] In an exemplary embodiment, establishing a node connectivity dictionary based on the different nodes, the node connectivity information, and the distance between nodes includes: decomposing the different nodes into multiple node pairs, wherein each node pair includes any two nodes; determining a tag value corresponding to each of the multiple node pairs, and filling the data content corresponding to the tag value with a target tuple, wherein the target tuple includes: the node connectivity number corresponding to the arbitrary two nodes, the node connectivity rate corresponding to the arbitrary two nodes, and the distance between the arbitrary two nodes; and establishing the node connectivity dictionary based on the tag value and the target tuple.
[0043] Optionally, the process of building a node connectivity dictionary based on historical archives includes:
[0044] The first step is to obtain all historical archive trajectories clustered together. Each archive usually has an archive ID. The archives are grouped according to their archive IDs, and within each group, they are sorted from front to back according to the capture time to obtain a sequential trajectory sequence.
[0045] The second step is to count the number of images captured at each capture node in the historical archive trajectory. This step is relatively simple; just group the images according to each capture node and count the number of images appearing in each group.
[0046] The third step involves operating on each file ID group based on the sorted sequence (i.e., the sequential trajectory sequence) obtained in the first step. Traverse the sorted sequence; if consecutive capture nodes are different, increment their connectivity by one. Repeat this process for each file ID group until the final result is obtained.
[0047] The fourth step is to calculate the node connectivity rate based on the number of connections between nodes and the total number of snapshots taken at each node. The formula for calculating the connectivity rate is as follows:
[0048]
[0049] Here, count(A,B) is the connectivity of the two nodes, count(A) is the number of snapshots taken by the node, and the denominator is the maximum number of snapshots taken by the two nodes.
[0050] Fifth step, calculate the distance between the two nodes, as shown in the formula below:
[0051] dist_angle(A,B)=sin(latA*π / 180)*sin(latB*π / 180)+cos(latA*π / 180)*cos(latB*π / 180)*cos((longA-longB)*π / 180);
[0052] dist(A,B)=6371000*acos(dist_angle);
[0053] Step 6: Build a node dictionary. The key of the dictionary is a node pair consisting of two nodes, and the value of the dictionary is a tuple consisting of the node connectivity, node connectivity rate, and distance between nodes.
[0054] In an exemplary embodiment, after determining the target cluster archive from the cluster archive based on the node connectivity dictionary, the method further includes: acquiring a first image taken by a fifth node and a second image taken by a sixth node in the target cluster archive, wherein the fifth node is the first node existing before the sixth node; determining a first similarity between the first image and the second image; and determining that the target cluster archive is an abnormal trajectory archive if the first similarity is less than a third preset threshold.
[0055] In other words, after identifying suspected error files based on rules, the similarity of images captured by the nodes before and after the suspected error files that are abnormal (speed exceeds the threshold, or node connection rate is less than the threshold) is calculated. If the similarity is less than the threshold, the final abnormal trajectory file can be further clarified.
[0056] To better understand the technical solutions of the embodiments and optional embodiments of the present invention, the flow of the above trajectory recognition method is explained below with reference to examples, but it is not intended to limit the technical solutions of the embodiments of the present invention.
[0057] As an optional implementation, a method for identifying abnormal facial trajectories based on spatiotemporal patterns is proposed. This method identifies erroneous facial profiles within clusters based on the spatiotemporal patterns of their trajectories, specifically by analyzing the trajectory patterns of these erroneous profiles. First, the patterns of all facial profiles from historical clustering are collected, and the travel patterns of capture checkpoints (equivalent to nodes in the above embodiment) are summarized. Preliminary screening is performed based on the travel patterns and the time difference between two trajectory points in the profiles to identify suspected erroneous profiles. Further, profile attribute analysis and similarity analysis are conducted on these suspected erroneous profiles to determine the final list of erroneous profiles.
[0058] like Figure 3 The diagram shown is a schematic representation of the overall process for abnormal face trajectory recognition based on spatiotemporal patterns according to an optional embodiment of the present invention, including the following steps:
[0059] Step S302: Obtain clustering profiles for different portraits, as follows:
[0060] Step S402: Obtain trajectory sequence data of personnel within a certain time range and a certain spatial range. For example, the trajectory generated by personnel A's activities on that day {A1,A2,A3,A4,A5} (this example is only to show that personnel A has a trajectory sequence. In fact, without file clustering, it is unknown that A1 to A5 belong to the same person. They are just five scattered and disordered trajectory points). A1 includes the time and area of the capture, as well as the image features of the captured image. If it is a face image captured by a vehicle checkpoint, it also includes the captured vehicle license plate information.
[0061] Step S404: According to the activity time sequence, calculate and compare the similarity of the personnel trajectory image features with the average features of the previously existing files. For example, take the image features of personnel A's trajectory A1 and calculate the similarity with the average features of all files. If the similarity calculated with file B meets the preset threshold, then A1 is assigned to file B. If all files are traversed and the threshold is not met, then create a new file C and assign A1 to file C. Then, compare the features of other trajectory points of personnel A in turn. Generally, all trajectory points of personnel A will be assigned to the same file.
[0062] Step S406: Repeat steps S402 and S404 until the facial activity trajectories of all personnel are included in the archive, thus obtaining the cluster archive.
[0063] It should be noted that step S302 is a preliminary step in the overall identity matching process. Its purpose is to cluster the discrete images of people into a single profile, with each profile belonging to a specific person. This profile contains all the person's activity trajectory information, including facial features, time, and location information. Only through this clustering can the facial trajectory of the person to whom the profile belongs be obtained, which is then used for relationship matching in subsequent steps. This step can be implemented through feature value comparison or by using popular clustering methods such as K-means clustering. In practice, for efficiency, various optimized clustering methods are generally used to cluster the facial profiles.
[0064] Furthermore, only after image clustering can the profile trajectory of each individual be obtained. Optionally, the aforementioned erroneous clustering of profiles occurs because the average features of the profiles drift when merging all the images in the profile, introducing some noise. Due to the influence of this noise, images that do not belong to this person are also attracted to the profile.
[0065] Step S304: Establish a checkpoint connectivity dictionary (equivalent to the node connectivity dictionary mentioned above) based on historical archives. Optional, such as... Figure 4 The diagram shown is a flowchart illustrating the process of establishing a checkpoint connectivity dictionary according to an optional embodiment of the present invention. The specific process includes:
[0066] Step S502: Obtain all historical archive trajectories clustered together. Each archive usually has an archive ID. Group the archives according to the archive ID, and sort them from front to back according to the capture time within each group to obtain a sequential trajectory sequence.
[0067] Step S504: Count the number of images captured by each capture checkpoint in the historical archive trajectory. This step is relatively simple. Just group the images by each capture checkpoint and count the number of images captured in each group.
[0068] Step S506: Based on the sorted sequence (i.e., the sequential trajectory sequence) obtained in the first step, operate according to each file ID group. Traverse the sorted sequence; if the capture checkpoints appearing before and after are different, increment their connectivity by one; traverse each file ID group until the final result is obtained.
[0069] Optionally, the checkpoint connectivity rate can be calculated based on the number of connections between checkpoints and the total number of images captured at each checkpoint. The formula for calculating the connectivity rate is as follows:
[0070]
[0071] Where count(A,B) is the connectivity of the two checkpoints, count(A) is the number of photos captured at the checkpoint, and the denominator is the maximum number of photos captured at the two checkpoints.
[0072] Optionally, the distance between the two checkpoints can be calculated using the following formula: dist_angle(A, B) = sin(latA*π / 180)*sin(latB*π / 180) + cos(latA*π / 180)*cos(latB*π / 180)*cos((longA-longB)*π / 180);
[0073] dist(A,B)=6371000*acos(dist_angle);
[0074] Step S508: Establish a checkpoint dictionary. The key value of the dictionary is a checkpoint pair consisting of two checkpoints, and the value of the dictionary is a tuple consisting of the checkpoint connectivity, checkpoint connectivity rate, and distance between checkpoints.
[0075] Step S306: Preliminary file filtering to narrow down the search scope. Specifically, files can be initially filtered by identifying patterns in file activity patterns to reduce the number of files to search. For example, the regions where files appear can be analyzed. Generally speaking, file activity patterns that consistently occur within a single region are very unlikely to be incorrectly merged files, so all file activity patterns within that range can be filtered out.
[0076] It should be noted that there are many ways to divide the archive area. It can be divided based on the latitude and longitude of the capture point, directly using latitude and longitude to define upper and lower limits for the blocks; alternatively, it can be divided based on geohash blocks. For example, in the above optional implementation scheme, when using the geohash scheme for block division, all archive trajectories active within the geohash6 block will be filtered out. The above is merely an example and does not limit the implementation scheme of this application.
[0077] Step S308: Obtaining suspected abnormal files.
[0078] There are two optional methods for obtaining suspected abnormal file trajectories.
[0079] Method 1: Utilizing the spatiotemporal contradiction pattern, files that are erroneously clustered are generally due to the asynchronous trajectories of two or more people. Therefore, the files can be sorted by time, and the speed between the trajectory points captured at different times can be calculated to simply filter out abnormal file trajectories. If a spatiotemporal contradiction occurs, the speed between the trajectory points captured at different times will exceed the abnormal value. The speed calculation formula is as follows: dist_angle(A, B)=sin(latA*π / 180)*sin(latB*π / 180)+cos(latA*π / 180)*cos(latB*π / 180)*cos((longA-longB)*π / 180);
[0080] dist(A,B)=6371000*acos(dist_angle);
[0081] Optionally, calculate the time difference between the two records:
[0082] time_dis(A,B)=cap_timeA-cap_timeB;
[0083] Optionally, divide the distance by the time difference and then convert it to kilometers per hour;
[0084] speed(A,B)=(dist(A,B) / time_dis(A,B))*3.6;
[0085] It should be noted that the above-mentioned spatiotemporal contradiction method is only effective for erroneous archives where two people are active at the same time. For archives where people are active at different times, the speed will be lower than the screening threshold even if the distance is far due to the large time difference. In this case, other detection methods should be selected to identify abnormal trajectories.
[0086] Method 2: Utilize the checkpoint connection dictionary obtained from S304. This dictionary contains the number of connections and the connection rate between checkpoints. It is generally assumed that the connection rate between checkpoints is less than a threshold. Therefore, there should be no correlation between the two checkpoints. If the connectivity rate of checkpoints for a certain file trajectory is too low, it is possible that two incorrect individuals have grouped together a file. Based on the checkpoint connectivity rules, filter out checkpoints in the file trajectory where the connectivity rate of the preceding and following trajectory points is less than a threshold. Furthermore, files with a distance greater than the threshold dis can be filtered to identify erroneous files from different time periods.
[0087] Step S310: Determine the final abnormal trajectory file based on the similarity threshold. After identifying the suspected error file based on the rules, calculate the similarity of the images captured by the checkpoints before and after the suspected error file shows anomalies (speed exceeds the threshold, or checkpoint connection rate is less than the threshold). If the similarity is less than the threshold, the final abnormal trajectory file can be further clarified.
[0088] The above embodiments provide a method for identifying abnormal face trajectories based on spatiotemporal patterns. In terms of facial recognition clustering and data mining, machine learning techniques are used to identify abnormal face trajectories in facial clustering archives. Preliminary screening is performed based on travel patterns and the time difference between two trajectory points in the archive to identify suspected erroneous archives. Further, archive attribute analysis and similarity analysis are conducted on suspected erroneous archives to determine the final erroneous archives. In other words, the above technical solution uses a spatiotemporal contradiction strategy to screen abnormal archives and a historical checkpoint connectivity strategy to locate suspected abnormal archives, improving the efficiency and accuracy of identifying erroneous clusters within clustered archives. Compared to existing technologies, it offers higher accuracy and utilization, making its application scenarios more extensive.
[0089] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0090] 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 the present invention, 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 the present invention.
[0091] According to another aspect of the present invention, a trajectory recognition apparatus for implementing the above-described trajectory recognition method is also provided. For example... Figure 5 As shown, the device includes:
[0092] The acquisition module 52 is used to acquire cluster files of different target objects, wherein the cluster files include trajectory data of target objects collected at different nodes;
[0093] Module 54 is used to establish a node connectivity dictionary between the different nodes, wherein the node connectivity dictionary is used to indicate at least the number of connections and the connection rate between the different nodes, as well as the distance between the different nodes;
[0094] The determining module 56 is used to determine a target cluster file from the cluster files based on the node connectivity dictionary, wherein the probability that the target cluster file is an abnormal file is greater than a first preset threshold.
[0095] Through the above modules, cluster archives of different target objects are obtained, including trajectory data of the target objects collected at different nodes; a node connectivity dictionary is established between different nodes, which at least indicates the number and rate of connections between different nodes, as well as the distance between different nodes; the target cluster archive is determined from the cluster archive based on the node connectivity dictionary, wherein the probability of the target cluster archive being an abnormal archive is greater than a first preset threshold. That is, the suspected abnormal target cluster archive in the cluster archive is located by the node connectivity rule strategy, which greatly improves the identification efficiency of cluster archives with abnormal trajectories, thereby more quickly and comprehensively perceiving cluster error archives in the cluster archive, realizing the effect of abnormal location and screening of cluster error archives, and thus solving the problem that existing technologies cannot effectively remove cluster error archives from cluster archives.
[0096] In an exemplary embodiment, the apparatus further includes: a speed module, configured to sort trajectory points in a clustering archive according to time; determine the shooting speed between a first trajectory point and a second trajectory point, wherein the first trajectory point and the second trajectory point are two trajectory points in the clustering archive that are temporally adjacent, the first trajectory point being a trajectory point captured at a first moment, and the second trajectory point being a trajectory point captured at a second moment, the first moment being earlier than the second moment; and, if the shooting speed is greater than or equal to a preset outlier value, determine the clustering archive as an incorrectly clustered clustering archive, wherein the target clustering archive includes: incorrectly clustered clustering archives.
[0097] Understandably, in cases of erroneous file aggregation, the trajectories of two or more target objects are often asynchronous. Therefore, it's possible to first sort the files by time and calculate the speed between successively captured trajectory points to simply filter out abnormal file trajectories. If spatiotemporal inconsistencies occur, the speed between successively captured trajectory points will exceed the abnormal value. However, it should be noted that the above method is only effective for erroneous file aggregation where two target objects are active simultaneously. For files active at different times, due to the large time difference, even if the distance is far, the speed will be lower than the filtering threshold. In such cases, other detection methods must be selected to identify abnormal trajectories.
[0098] Optionally, the speed module is further configured to determine the first recording time and the first dimension corresponding to the first trajectory point, and the second recording time and the second dimension corresponding to the second trajectory point; determine the time difference between the first recording time and the second recording time, and process the first dimension and the second dimension using a preset conversion function to obtain the dimensional distance between the first trajectory point and the second trajectory point; and divide the dimensional distance by the time difference to obtain the shooting speed between the first trajectory point and the second trajectory point.
[0099] It should be noted that since the trajectory data is determined through images captured by cameras placed at different nodes, the recording time and dimensions can be determined based on the image capture time and the geographical location of the camera. Furthermore, to better align with practical applications, after determining the capture speed, it needs to be converted to kilometers per hour (km / h) for a more intuitive understanding of the trajectory changes within the cluster containing the target object. Moreover, this allows for the effective identification of erroneous clusters where two target objects are simultaneously active, improving the efficiency of cluster identification and reducing latency.
[0100] In an optional embodiment, the determining module is further configured to obtain a first connection rate between a first node and a second node in the clustering archive; find a second preset threshold corresponding to the connection rate between the first node and the second node from the node connectivity dictionary; and determine the current clustering archive as a target clustering archive if the first connection rate is less than the second preset threshold.
[0101] As an optional implementation, the above-mentioned establishment module is further configured to obtain the file identifiers corresponding to all clustered files; group the clustered files of different target objects according to the file identifiers to obtain multiple file groups; sort the clustered files included in each of the multiple file groups according to the shooting time to obtain the trajectory sequence corresponding to each group; and, when the trajectory data corresponding to the target objects collected at different nodes in the trajectory sequence is obtained, establish the node connectivity dictionary, wherein the trajectory data includes multiple images of the target object corresponding to the current node.
[0102] Optionally, the above-mentioned establishment module is further configured to determine the node connectivity information and inter-node distances between the different nodes based on the trajectory sequence and the trajectory data; wherein, the node connectivity information includes: the number of connections between any two nodes and the connectivity rate between any two nodes; and to establish a node connectivity dictionary based on the different nodes, the node connectivity information, and the inter-node distances.
[0103] Optionally, the aforementioned establishment module is further configured to traverse the trajectory sequence to determine the number of node changes corresponding to the capture of the same target object image, and determine the connectivity between different nodes in the trajectory sequence based on the number of changes; and determine the node connectivity rate between the different nodes according to the following formula: Where count(A,B) is the connectivity between the third node and the fourth node, count(A) is the first number of images corresponding to the target object captured by the third node, count(B) is the second number of images corresponding to the target object captured by the fourth node, and max(count(A), count(B)) is the maximum value of the number of images corresponding to the third node and the fourth node. The third node and the fourth node are any two nodes among the different nodes. The distance between the nodes corresponding to the different nodes is determined according to the following formula: dist(A,B)=6371000*acos(dist_angle(A,B)); where dist_angle(A,B)=sin(latA*π / 180)*sin(latB*π / 180)+cos(latA*π / 180)*cos(latB*π / 180)*cos((longA-longB)*π / 180); where latA is the latitude corresponding to the third node, latB is the latitude corresponding to the fourth node, and longA is the length corresponding to the third node.
[0104] In an exemplary embodiment, the above-described establishment module is further configured to decompose the different nodes into multiple node pairs, wherein each node pair includes any two nodes; determine a tag value corresponding to each node pair in the multiple node pairs, and fill the data content corresponding to the tag value with a target tuple, wherein the target tuple includes: the node connectivity number corresponding to the arbitrary two nodes, the node connectivity rate corresponding to the arbitrary two nodes, and the distance between the nodes corresponding to the arbitrary two nodes; and establish the node connectivity dictionary based on the tag value and the target tuple.
[0105] Optionally, the process of building a node connectivity dictionary based on historical archives includes:
[0106] The first step is to obtain all historical archive trajectories clustered together. Each archive usually has an archive ID. The archives are grouped according to their archive IDs, and within each group, they are sorted from front to back according to the capture time to obtain a sequential trajectory sequence.
[0107] The second step is to count the number of images captured at each capture node in the historical archive trajectory. This step is relatively simple; just group the images according to each capture node and count the number of images appearing in each group.
[0108] The third step involves operating on each file ID group based on the sorted sequence (i.e., the sequential trajectory sequence) obtained in the first step. Traverse the sorted sequence; if consecutive capture nodes are different, increment their connectivity by one. Repeat this process for each file ID group until the final result is obtained.
[0109] The fourth step is to calculate the node connectivity rate based on the number of connections between nodes and the total number of snapshots taken at each node. The formula for calculating the connectivity rate is as follows:
[0110]
[0111] Here, count(A,B) is the connectivity of the two nodes, count(A) is the number of snapshots taken by the node, and the denominator is the maximum number of snapshots taken by the two nodes.
[0112] The fifth step is to calculate the distance between the two nodes, as shown in the formula below: dist_angle(A, B)=sin(latA*π / 180)*sin(latB*π / 180)+cos(latA*π / 180)*cos(latB*π / 180)*cos((longA-longB)*π / 180);
[0113] dist(A,B)=6371000*acos(dist_angle);
[0114] Step 6: Build a node dictionary. The key of the dictionary is a node pair consisting of two nodes, and the value of the dictionary is a tuple consisting of the node connectivity, node connectivity rate, and distance between nodes.
[0115] In an exemplary embodiment, the above apparatus further includes: a similarity module, configured to acquire a first image captured by a fifth node and a second image captured by a sixth node in the target clustering file, wherein the fifth node is the first node existing before the sixth node; determine a first similarity between the first image and the second image; and determine that the target clustering file is an abnormal trajectory file if the first similarity is less than a third preset threshold.
[0116] In other words, after identifying suspected error files based on rules, the similarity of images captured by the nodes before and after the suspected error files that are abnormal (speed exceeds the threshold, or node connection rate is less than the threshold) is calculated. If the similarity is less than the threshold, the final abnormal trajectory file can be further clarified.
[0117] 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.
[0118] Embodiments of the present invention also provide a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0119] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0120] S1. Obtain clustering files for different target objects, wherein the clustering files include trajectory data of the target objects collected at different nodes;
[0121] S2. Establish a node connectivity dictionary between the different nodes, wherein the node connectivity dictionary is used to indicate at least the number of connections and the connection rate between the different nodes, as well as the distance between the different nodes;
[0122] S3. Determine the target cluster file from the cluster files based on the node connectivity dictionary, wherein the probability that the target cluster file is an abnormal file is greater than a first preset threshold.
[0123] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0124] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0125] Embodiments of the present invention 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.
[0126] Optionally, 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.
[0127] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0128] S1. Obtain clustering files for different target objects, wherein the clustering files include trajectory data of the target objects collected at different nodes;
[0129] S2. Establish a node connectivity dictionary between the different nodes, wherein the node connectivity dictionary is used to indicate at least the number of connections and the connection rate between the different nodes, as well as the distance between the different nodes;
[0130] S3. Determine the target cluster file from the cluster files based on the node connectivity dictionary, wherein the probability that the target cluster file is an abnormal file is greater than a first preset threshold.
[0131] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0132] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0133] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0134] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0135] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0136] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0137] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0138] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A trajectory recognition method, characterized in that, include: Obtain cluster profiles for different target objects, wherein the cluster profiles include trajectory data of the target objects collected at different nodes; Establish a node connectivity dictionary among the different nodes, wherein the node connectivity dictionary is used to indicate at least the number of connections and the connection rate among the different nodes, as well as the distance between the different nodes; The target cluster file is determined from the cluster files based on the node connectivity dictionary, wherein the probability that the target cluster file is an abnormal file is greater than a first preset threshold. The step of establishing a node connectivity dictionary between different nodes includes: obtaining file identifiers corresponding to all clustered files; grouping the clustered files of different target objects according to the file identifiers to obtain multiple file groups; sorting the clustered files included in each of the multiple file groups according to the shooting time to obtain a trajectory sequence corresponding to each group; and, given the trajectory data of the target objects collected by different nodes in the trajectory sequence, determining the node connectivity information and the distance between nodes based on the trajectory sequence and the trajectory data; wherein the node connectivity information includes: the connectivity number between any two nodes and the connectivity rate between any two nodes; and establishing a node connectivity dictionary based on the different nodes, the node connectivity information, and the distance between nodes.
2. The method according to claim 1, characterized in that, Before determining the target cluster archive from the cluster archive based on the node connectivity dictionary, the method further includes: Sort the trajectory points in the clustered archives according to time; Determine the shooting speed between the first trajectory point and the second trajectory point, wherein the first trajectory point and the second trajectory point are two trajectory points that are temporally adjacent in the cluster archive, the first trajectory point is the trajectory point captured at the first moment, and the second trajectory point is the trajectory point captured at the second moment, and the first moment is earlier than the second moment; If the shooting speed is greater than or equal to a preset outlier, the clustering file is determined to be an incorrectly clustered clustering file, wherein the target clustering file includes: incorrectly clustered clustering files.
3. The method according to claim 2, characterized in that, Determine the shooting speed between the first trajectory point and the second trajectory point, including: Determine the first recording time and first dimension corresponding to the first trajectory point, and the second recording time and second dimension corresponding to the second trajectory point; Determine the time difference between the first recording time and the second recording time, and use a preset conversion function to process the first dimension and the second dimension to obtain the dimensional distance between the first trajectory point and the second trajectory point; The shooting speed between the first trajectory point and the second trajectory point is obtained by dividing the dimensional distance by the time difference.
4. The method according to claim 1, characterized in that, The target cluster archive is determined from the cluster archive based on the node connectivity dictionary, including: Obtain the first connection rate between the first node and the second node in the clustered archive; Find the second preset threshold corresponding to the connection rate between the first node and the second node from the node connectivity dictionary; If the first connection rate is less than the second preset threshold, the current clustering file is determined to be the target clustering file.
5. The method according to claim 1, characterized in that, Determining the node connectivity information and inter-node distances between the different nodes based on the trajectory sequence and the trajectory data includes: The number of times the nodes corresponding to the same target object image are changed is determined by traversing the trajectory sequence, and the number of connections between different nodes in the trajectory sequence is determined based on the number of changes. The node connectivity between the different nodes is determined using the following formula: Connect_rate(A,B) = Here, count(A,B) is the connectivity between the third and fourth nodes, count(A) is the first number of images corresponding to the target object captured by the third node, and count(B) is the second number of images corresponding to the target object captured by the fourth node. The maximum number of images corresponding to the third node and the fourth node, where the third node and the fourth node are any two nodes among the different nodes.
6. The method according to claim 1, characterized in that, A node connectivity dictionary is established based on the different nodes, the node connectivity information, and the distance between nodes, including: The different nodes are decomposed into multiple node pairs, wherein each node pair includes any two nodes; Determine the tag value corresponding to each of the plurality of node pairs, and fill the target tuple in the data content corresponding to the tag value, wherein the target tuple includes: the node connectivity number corresponding to any two nodes, the node connectivity rate corresponding to any two nodes, and the distance between any two nodes; The node connectivity dictionary is constructed based on the tag value and the target tuple.
7. The method according to claim 1, characterized in that, After determining the target cluster archive from the cluster archive based on the node connectivity dictionary, the method further includes: Acquire a first image taken by the fifth node and a second image taken by the sixth node in the target clustering file, wherein the fifth node is the first node existing before the sixth node; Determine the first similarity between the first image and the second image; If the first similarity is less than a third preset threshold, the target cluster file is determined to be an abnormal trajectory file.
8. A trajectory recognition device, characterized in that, include: The acquisition module is used to acquire cluster profiles of different target objects, wherein the cluster profiles include trajectory data of the target objects collected at different nodes; A module is established to establish a node connectivity dictionary between the different nodes, wherein the node connectivity dictionary is used to indicate at least the number of connections and the connection rate between the different nodes, as well as the distance between the different nodes; The determination module is used to determine a target cluster file from the cluster files based on the node connectivity dictionary, wherein the probability that the target cluster file is an abnormal file is greater than a first preset threshold. The aforementioned module is further configured to: acquire file identifiers corresponding to all clustered files; group the clustered files of different target objects according to the file identifiers to obtain multiple file groups; sort the clustered files included in each of the multiple file groups according to the shooting time to obtain the trajectory sequence corresponding to each group; when the trajectory data corresponding to the target objects collected at different nodes in the trajectory sequence is obtained, determine the node connectivity information and the distance between nodes based on the trajectory sequence and the trajectory data; wherein, the node connectivity information includes: the number of connections between any two nodes and the connectivity rate between any two nodes; and establish a node connectivity dictionary based on the different nodes, the node connectivity information, and the distance between nodes.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.