Tracking sequence anomaly detection method and device, electronic equipment and storage medium
By using multi-scale sliding windows to divide molecular sequences in the target tracking technology and calculating the degree of deviation of position data, the problem that outliers in the tracking sequence affect the analysis accuracy is solved, and higher accuracy of analysis results is achieved.
Patent Information
- Application Number
- CN202510364701.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-06-27
AI Technical Summary
In the target tracking technology, due to background interference, lighting changes and target occlusion, outliers exist in the tracking sequence, which in turn affects the accuracy of subsequent analysis.
By obtaining the target tracking sequence of the target object, it is traversed with preset multiple sliding windows of different sizes to obtain multiple sub-sequences. Then, for the position data in each subsequence, its deviation degree is calculated, and if the deviation degree in at least a preset number of subsequences is greater than the threshold, the position data is determined to be an outlier.
Effectively detect and exclude outliers in the tracking sequence, avoid using the exception tracking sequence for subsequent analysis, thereby improving the accuracy of the analysis results.
Smart Images

Figure CN120217248A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular, to a method, apparatus, electronic device, and storage medium for detecting anomalies in a tracking sequence. Background Art
[0002] Target tracking technology refers to, based on target detection, performing real-time and continuous tracking of the position of a target object in a continuous video sequence to obtain a tracking sequence, where each value in the tracking sequence represents the position of the target object at different times. Target tracking technology has broad application prospects in scenarios such as monitoring systems, autonomous driving, unmanned aerial vehicle navigation, and sports event analysis.
[0003] Currently, under ideal circumstances, the tracking sequences determined by most target tracking technologies are relatively accurate. However, in practical applications, due to factors such as background interference, light changes, and target occlusion, there may be outliers in the determined tracking sequence, that is, the position represented by this value does not belong to the target to which the tracking sequence belongs. Therefore, if the subsequent analysis is performed using the tracking sequence with outliers (hereinafter simply referred to as an abnormal tracking sequence), the accuracy of the results obtained from the subsequent analysis may be relatively low. Therefore, how to effectively detect the outliers in the tracking sequence to avoid the low accuracy of the results obtained when using the abnormal tracking sequence for subsequent analysis is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a method, apparatus, electronic device, and storage medium for detecting anomalies in a tracking sequence to avoid the problem of low accuracy of the results obtained when using an abnormal tracking sequence for subsequent analysis. The specific technical solutions are as follows:
[0005] In the first aspect implemented in the present application, first, a method for detecting anomalies in a tracking sequence is provided, and the method includes:
[0006] Obtain a target tracking sequence of a target object, where the target tracking sequence includes position data of the target object at multiple times, and the position data are arranged in chronological order;
[0007] Use a plurality of preset sliding windows with different scales to traverse the target tracking sequence respectively to obtain a plurality of subsequences;
[0008] For each position data in each subsequence, determine the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence;
[0009] For each of the position data, if the deviation degree of the position data in at least a preset number of subsequences is greater than a preset threshold, then the position data is determined as an outlier.
[0010] In some embodiments, determining the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence includes:
[0011] Determine the statistical value of the subsequence, where the statistical value is used to represent the central tendency of each position data in the subsequence; and, determine the fluctuation value of the subsequence, where the fluctuation value is used to represent the degree of dispersion of each position data in the subsequence;
[0012] Respectively determine the degree of difference between each position data in the subsequence and the statistical value as the initial difference value of the position data;
[0013] Respectively determine the ratio of the initial difference value of each position data to the fluctuation value of the subsequence as the deviation degree of the position data in the subsequence.
[0014] In some embodiments, using sliding windows of a plurality of different preset scales to traverse the target tracking sequence respectively to obtain a plurality of subsequences; and, for each position data in each of the subsequences, determining the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence; and, for each of the position data, if the deviation degree of the position data in at least a preset number of subsequences is greater than a preset threshold, then determining the position data as an outlier includes,
[0015] Use the current sliding window to traverse the target tracking sequence to obtain a plurality of subsequences; for each position data in the subsequence, determine the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence; take the position data with a deviation degree greater than the preset threshold as a candidate value; where, when determining the candidate value for the first time, the current sliding window is the first sliding window among the preset plurality of sliding windows of different scales;
[0016] Determine whether all the preset sliding windows of different scales have completed traversing the target tracking sequence. If there is a sliding window that has not traversed the target tracking sequence, then use the sliding window that has not traversed the target tracking sequence as the current sliding window, and return to execute the above step of determining the candidate value; if all the preset sliding windows of different scales have completed traversing the target tracking sequence, then,
[0017] Determine the position data that is a candidate value in at least a preset number of subsequences as the outlier.
[0018] In some embodiments, the target tracking sequence includes a first tracking sequence and a second tracking sequence, and the first tracking sequence and the second tracking sequence are determined as follows:
[0019] Obtain multiple target images including the target object, and different target images are taken at different times;
[0020] For each of the target images, determine the position coordinates of the target object in the target image;
[0021] Arrange the abscissas in each of the position coordinates in the order of the shooting times of the corresponding target images from early to late as the first tracking sequence; and arrange the ordinates in each of the position coordinates in the order of the shooting times of the corresponding target images from early to late as the second tracking sequence;
[0022] The traversing the target tracking sequence respectively by using a plurality of sliding windows with preset different scales includes:
[0023] Traverse the first tracking sequence respectively by using a plurality of sliding windows with preset different scales; and traverse the second tracking sequence respectively by using a plurality of sliding windows with preset different scales.
[0024] In some embodiments, the statistical value is the mean of the subsequence, and the fluctuation value is the standard deviation of the subsequence;
[0025] Determine the degree of deviation of the position data in the subsequence through the following formula:
[0026]
[0027] where z-score i is the degree of deviation of the i-th position data in the subsequence, x i is the i-th position data, σ is the standard deviation of the subsequence, μ is the mean of the subsequence, and x i -μ is the initial difference value of the i-th position data.
[0028] In the second aspect of the implementation of the present application, there is also provided a tracking sequence anomaly detection device, and the device includes:
[0029] A tracking sequence acquisition module, configured to acquire a target tracking sequence of a target object, where the target tracking sequence includes position data of the target object at multiple times, and each of the position data is arranged in chronological order;
[0030] A subsequence acquisition module, configured to traverse the target tracking sequence respectively by using a plurality of sliding windows with preset different scales, so as to obtain a plurality of subsequences;
[0031] A deviation degree determination module, configured to determine, for each position data in each of the subsequences, the degree to which the position data deviates from other data in the subsequence, as the deviation degree of the position data in the subsequence;
[0032] An outlier determination module, configured to determine, for each of the position data, that if the deviation degree of the position data in at least a preset number of subsequences is greater than a preset threshold, then determine the position data as an outlier.
[0033] In some embodiments, the deviation degree determination module is specifically configured to:
[0034] Determine the statistical value of the subsequence, where the statistical value is used to represent the central tendency of each position data in the subsequence; and determine the fluctuation value of the subsequence, where the fluctuation value is used to represent the dispersion degree of each position data in the subsequence;
[0035] Respectively determine the difference degree between each position data in the subsequence and the statistical value, as the initial difference value of the position data;
[0036] Respectively determine the ratio of the initial difference value of each position data to the fluctuation value of the subsequence, as the deviation degree of the position data in the subsequence.
[0037] In some embodiments, the subsequence acquisition module; and the deviation degree determination module; and the outlier determination module are specifically configured to,
[0038] Traverse the target tracking sequence by using the current sliding window to obtain a plurality of subsequences; for each position data in the subsequence, determine the degree to which the position data deviates from other data in the subsequence, as the deviation degree of the position data in the subsequence; use the position data with the deviation degree greater than the preset threshold as candidate values; where, when determining the candidate values for the first time, the current sliding window is the first sliding window among the preset plurality of sliding windows with different scales;
[0039] Determine whether all of the preset plurality of sliding windows with different scales have completed traversing the target tracking sequence. If there is a sliding window that has not traversed the target tracking sequence, then use the sliding window that has not traversed the target tracking sequence as the current sliding window, and return to execute the above step of determining candidate values; if all of the preset plurality of sliding windows with different scales have completed traversing the target tracking sequence, then,
[0040] Determine the position data that is a candidate value in at least a preset number of subsequences as the outlier.
[0041] In some embodiments, the target tracking sequence includes a first tracking sequence and a second tracking sequence, and the first tracking sequence and the second tracking sequence are determined as follows:
[0042] Obtain multiple target images including the target object, and different target images are taken at different times;
[0043] For each of the target images, determine the position coordinates of the target object in the target image;
[0044] Arrange the abscissas in each of the position coordinates in ascending order of the shooting times of the corresponding target images as the first tracking sequence; and arrange the ordinates in each of the position coordinates in ascending order of the shooting times of the corresponding target images as the second tracking sequence;
[0045] The step of traversing the target tracking sequence respectively by using a plurality of sliding windows with preset different scales includes:
[0046] Traverse the first tracking sequence respectively by using a plurality of sliding windows with preset different scales; and traverse the second tracking sequence respectively by using a plurality of sliding windows with preset different scales.
[0047] In some embodiments, the statistical value is the mean of the subsequence, and the fluctuation value is the standard deviation of the subsequence;
[0048] Determine the degree of deviation of the position data in the subsequence through the following formula:
[0049]
[0050] where z-score i is the degree of deviation of the i-th position data in the subsequence, x i is the i-th position data, σ is the standard deviation of the subsequence, μ is the mean of the subsequence, and x i -μ is the initial difference value of the i-th position data.
[0051] In yet another aspect of the implementation of the present application, an electronic device is further provided, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0052] The memory is used to store a computer program;
[0053] A processor, when executing a program stored in a memory, implements the tracking sequence anomaly detection method described in any one of the above.
[0054] In yet another aspect of the implementation of the present application, a computer-readable storage medium is further provided. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the tracking sequence anomaly detection method described in any one of the above is implemented.
[0055] In yet another aspect of the implementation of the present application, a computer program product containing instructions is further provided. When it runs on a computer, it causes the computer to execute the tracking sequence anomaly detection method described in any one of the above.
[0056] In the technical solution provided by the embodiments of the present invention, it can be understood that the movement of the target object is continuous in the time domain. Therefore, if a set of position data all belongs to the same target object, these position data should be continuous, that is, there is no data that significantly deviates from other position data among these position data. On the contrary, if in a set of position data, a certain position data significantly deviates from other position data, it indicates that this position data may not belong to the same target object as other position data, that is, this position data may be abnormal.
[0057] Moreover, the trends presented by the position data in sequences of different lengths are different. For example, for an object moving along an arc with a large radius of curvature, the position data of this object shows a trend of moving in a straight line in a shorter subsequence, and only shows a trend of moving along a curve in a longer subsequence. Therefore, the same position data may have the same trend as other position data in a subsequence of a certain length, that is, it does not significantly deviate from other position data, while in a subsequence of other lengths, it has a different trend from other position data, that is, it significantly deviates from other position data. In other words, for the same position data, it may be abnormal in a subsequence of a certain length, but may be normal in a subsequence of other lengths. Thus, the present application divides the target tracking sequence into multiple subsequences through a preset number of sliding windows of different scales, so as to ensure that each position data is located in subsequences of different scales. Furthermore, for each position data, the anomaly situation of the same position data at different scales can be determined. In this way, if the deviation degree of a certain position data in at least a preset number of subsequences is greater than a preset threshold, it can be determined that this position data is an outlier.
[0058] It can be understood that based on the technical solution provided by the embodiments of the present application, it is possible to determine whether there are outliers in the tracking sequence, that is, to determine whether the tracking sequence is an abnormal sequence. Thus, it is possible to avoid using an abnormal tracking sequence to analyze other results, which may lead to a lower accuracy of the obtained results. Description of the Drawings
[0059] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art.
[0060] Figure 1 It is the first process schematic diagram of the tracking sequence anomaly detection method provided by the embodiment of the present application;
[0061] Figure 2 It is a refined schematic diagram of the above step S13 provided by the embodiment of the present application;
[0062] Figure 3 It is a process schematic diagram of determining the first tracking sequence and the second tracking sequence provided by the embodiment of the present application;
[0063] Figure 4 It is the second process schematic diagram of the tracking sequence anomaly detection method provided by the embodiment of the present application;
[0064] Figure 5 It is the third process schematic diagram of the tracking sequence anomaly detection method provided by the embodiment of the present application;
[0065] Figure 6 It is the fourth process schematic diagram of the tracking sequence anomaly detection method provided by the embodiment of the present application;
[0066] Figure 7 It is a structural schematic diagram of the tracking sequence anomaly detection device provided by the embodiment of the present application;
[0067] Figure 8 It is a structural schematic diagram of the electronic device provided by the embodiment of the present application. Detailed implementation manners
[0068] The following will describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention.
[0069] To avoid the problem of low accuracy of the results obtained by subsequent analysis using the tracking sequence, the embodiment of the present application provides a tracking sequence anomaly detection method. It can be understood that the tracking sequence anomaly detection method provided by the embodiment of the present application is applied to an electronic device, and the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, etc.
[0070] The following will specifically illustrate the tracking sequence anomaly detection method provided by the embodiment of the present application through specific examples:
[0071] See Figure 1 , Figure 1 It is the first process schematic diagram of the tracking sequence anomaly detection method provided by the embodiment of the present application, including the following steps:
[0072] Step S11: Obtain a target tracking sequence of a target object. The target tracking sequence includes position data of the target object at multiple moments, and the position data are arranged in chronological order.
[0073] Step S12: Use a plurality of preset sliding windows with different scales to traverse the target tracking sequence respectively to obtain a plurality of subsequences.
[0074] Step S13: For each position data in each subsequence, determine the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence.
[0075] Step S14: For each position data, if the deviation degree of the position data in at least a preset number of subsequences is greater than a preset threshold, then determine the position data as an outlier.
[0076] In the technical solution provided by the embodiments of the present application, it can be understood that the movement of the target object is continuous in the time domain. Therefore, if a segment of position data all belongs to the same target object, then these position data should be continuous, that is, there is no data that significantly deviates from other position data among these position data. On the contrary, if in a segment of position data, a certain position data significantly deviates from other position data, it indicates that the position data may not belong to the same target object as other position data, that is, the position data may be abnormal.
[0077] Moreover, the trends presented by each position data in sequences of different lengths are different. For example, for an object moving along an arc with a large radius of curvature, the position data of the object presents a trend of moving along a straight line in a shorter subsequence, and only presents a trend of moving along a curve in a longer subsequence. Therefore, the same position data may have the same trend as other position data in a subsequence of a certain length, that is, it does not significantly deviate from other position data, while in a subsequence of other lengths, it has a different trend from other position data, that is, it significantly deviates from other position data. In other words, for the same position data, it may be abnormal in a subsequence of a certain length, but may be normal in a subsequence of other lengths. Thus, in the present application, the target tracking sequence is divided into a plurality of subsequences by a plurality of preset sliding windows with different scales, so as to enable each position data to be located in subsequences of different scales. Furthermore, for each position data, the abnormal situation of the same position data at different scales can be determined. In this way, if the deviation degree of a certain position data in at least a preset number of subsequences is greater than the preset threshold, then it can be determined that the position data is an outlier.
[0078] It is understandable that the technical solution provided by the embodiments of the present application can determine whether there are outliers in the tracking sequence, that is, determine whether the tracking sequence is an abnormal sequence. Thus, outliers can be avoided from participating in the subsequent analysis process. Therefore, the problem of low accuracy of the obtained results caused by analyzing other results using an abnormal tracking sequence can be avoided.
[0079] In the above step S11, the target object is the object for which it is necessary to determine whether there are outliers in its tracking sequence. For example, in the case of an autonomous driving scenario, the target object can be a vehicle with autonomous driving function. Another example is that in the case of an unmanned aerial vehicle (UAV) navigation scenario, the target object can be the UAV, or it can be the object served by the UAV navigation, such as a person or a vehicle. Still another example is that in the case of a sports event analysis scenario, the target object can be an athlete participating in the sports event.
[0080] The target tracking sequence includes the position data of the target object at multiple moments, and in the target tracking sequence, the position data are arranged in chronological order. Among them, the position data can be one-dimensional position data or two-dimensional position data.
[0081] Moreover, the position data in the target tracking sequence can be the position data in coordinate systems such as an image coordinate system, a laser coordinate system, a radar coordinate system, and a satellite navigation coordinate system. Which coordinate system the position data is specifically in depends on which device is used to obtain the position data. For example, by continuously capturing multiple image frames including the target object through an image acquisition device, and then determining the position data of the target object in each image frame, and forming a target tracking sequence with these position data, then the position data in the target tracking sequence is the position data in the image coordinate system. Another example is that by continuously positioning the target object through a satellite navigation system, obtaining the position data of the target object at multiple moments, and then forming a target tracking sequence with these position data, then the position data in the target tracking sequence is the position data in the satellite navigation coordinate system.
[0082] It can be understood that in the embodiments of the present application, the electronic device only needs to obtain the target tracking sequence of the target object, and does not care about when the target tracking sequence is formed.
[0083] Specifically, in some embodiments, the tracking sequences of multiple objects can be obtained in advance and stored corresponding to their respective objects. Subsequently, if it is necessary to determine the outliers in the tracking sequence of a certain object, the object can be used as the target object, and the electronic device can obtain the tracking sequence stored corresponding to the object as the target tracking sequence. Alternatively, in some other embodiments, the target object can be determined first, and then the position data of the target object at multiple subsequent moments starting from the current moment can be collected in real time. Furthermore, based on these position data, a target tracking sequence can be formed to obtain the target tracking sequence. Among them, the device for forming the target tracking sequence can be the same as the execution subject of this application or different from the execution subject of this application.
[0084] In step S12 above, the number and scale of the sliding windows can be set by the user according to the actual situation (such as the length of the target tracking sequence, the false negative rate of outliers, etc.). For example, if the length of the target tracking sequence is long, the length of the sliding window can be set larger; or, if it is necessary to reduce the false negative rate of outliers, several sliding windows with different scales can be set. Therefore, the number and scale of the sliding windows are not limited here.
[0085] In the embodiments of this application, the electronic device can use a plurality of preset sliding windows with different scales to traverse the target tracking sequence respectively to obtain a plurality of subsequences; that is, for the target tracking sequence, the electronic device can use each sliding window to traverse the target tracking sequence to obtain a plurality of subsequences.
[0086] Illustrated with an example. For instance, the target tracking sequence is position 1, position 2, position 3, …, position 20, and the pre-set sliding windows are window 1 and window 2. Among them, the scale of window 1 is 4 and the step size is 2; the scale of window 2 is 6 and the step size is 3. Then the electronic device uses window 1 to traverse the target tracking sequence, and the obtained subsequences are: {position 1, position 2, position 3, position 4}, {position 3, position 4, position 5, position 6}, {position 5, position 6, position 7, position 8}, {position 7, position 8, position 9, position 10}, {position 9, position 10, position 11, position 12}, {position 11, position 12, position 13, position 14}, {position 13, position 14, position 15, position 16}, {position 15, position 16, position 17, position 18}, {position 17, position 18, position 19, position 20}; the electronic device uses window 2 to traverse the target tracking sequence, and the obtained subsequences are {position 1, position 2, …, position 6}, {position 4, position 5, …, position 9}, {position 7, position 8, …, position 12}, {position 10, position 11, …, position 15}, {position 13, position 14, …, position 18}, {position 15, position 16, …, position 20}. Based on this, the subsequences obtained after traversing the target tracking sequence using window 1 and window 2 above are the multiple subsequences obtained by the electronic device traversing the target tracking sequence respectively using a plurality of pre-set sliding windows with different scales.
[0087] In the above step S13, after the electronic device determines each subsequence, for each subsequence, it determines the degree to which each position data in the subsequence deviates from other position data as the deviation degree of the position data in the subsequence. For example, the subsequences determined by the electronic device are subsequence 1 {position 1, position 2, position 3} and subsequence 2 {position 3, position 4, position 5}. Then for subsequence 1, it determines the deviation degree of position 1 in subsequence 1 relative to position 3 and position 4 as the deviation degree of position 1 in subsequence 1; determines the deviation degree of position 2 in subsequence 1 relative to position 1 and position 3 as the deviation degree of position 2 in subsequence 1; determines the deviation degree of position 3 in subsequence 1 relative to position 1 and position 2 as the deviation degree of position 3 in subsequence 1; at the same time, for subsequence 2, it determines the deviation degree of position 3 in subsequence 2 relative to position 4 and position 5 as the deviation degree of position 3 in subsequence 2; determines the deviation degree of position 4 in subsequence 2 relative to position 3 and position 5 as the deviation degree of position 4 in subsequence 2; determines the deviation degree of position 5 in subsequence 2 relative to position 3 and position 4 as the deviation degree of position 5 in subsequence 2.
[0088] Among them, the electronic device can determine the degree to which each position data deviates from other position data through clustering, motion trajectory fitting, central tendency, etc. Specifically, taking clustering as an example, for each subsequence, if the electronic device needs to calculate the degree to which a certain position data in a certain subsequence deviates from other position data, the electronic device can cluster the other position data in the subsequence except this position data to obtain a clustering center. Then, calculate the distance between this position data and the clustering center as the degree to which this position data deviates from other position data in this subsequence; or, taking motion trajectory fitting as an example, for each subsequence, if the electronic device needs to calculate the degree to which a certain position data in a certain subsequence deviates from other position data, the electronic device can perform motion trajectory fitting on the other position data in the subsequence except this position data to obtain a trajectory curve. Then, calculate the distance between this position data and the trajectory curve as the degree to which this position data deviates from other position data in this subsequence. Among them, the method for determining the deviation degree according to the central tendency can be referred to the description in the following Figure 2 and will not be elaborated here.
[0089] In the above step S14, for each position data, if the deviation degree of a certain position data in at least a preset number of subsequences is greater than a preset threshold, then this position data is determined as an outlier. Among them, the preset number can be set according to user requirements, such as it can be set to 1, 2, 3, etc.; the preset threshold can also be set according to user requirements.
[0090] Taking the preset number as 2 as an example, if the deviation degree of a certain position data in at least 2 subsequences is greater than the preset threshold, then this position data is determined as an outlier; taking the preset number as 1 as an example, for the position data, as long as its deviation degree in any one subsequence is greater than the preset threshold, then this position data is determined as an outlier.
[0091] In some embodiments, after the electronic device determines the outliers in the target tracking sequence, it can mark the outliers in the target tracking sequence to obtain the marked target tracking sequence. Thus, it is convenient for the user to perform subsequent processing on the marked tracking sequence, such as removing the marked position data in the tracking sequence, using the remaining position data for analysis, or using multiple consecutive position data without outliers for analysis, etc.
[0092] See Figure 2 , Figure 2 which is a refined schematic diagram of the above step S13 provided by the embodiment of the present application and can include the following steps:
[0093] Step S21: Determine the statistical value of the subsequence and the fluctuation value of the subsequence; wherein, the statistical value is used to represent the central tendency of the data at each position in the subsequence; the fluctuation value is used to represent the degree of dispersion of the data at each position in the subsequence.
[0094] Step S22: Respectively determine the degree of difference between the data at each position in the subsequence and the statistical value as the initial difference value of the position data.
[0095] Step S23: Respectively determine the ratio of the initial difference value of each position data to the fluctuation value of the subsequence as the degree of deviation of the position data in the subsequence.
[0096] In the technical solution provided by the embodiment of the present application, the statistical value for representing the central tendency of the data at each position in the subsequence and the fluctuation value for representing the degree of dispersion of the data at each position in the subsequence are determined; and, the degree of difference between the data at each position in the subsequence and the statistical value is respectively determined as the initial difference value of the position data; furthermore, the ratio of the initial difference value of the position data to the fluctuation value of the subsequence is determined as the degree of deviation of the position data in the subsequence, thereby realizing the calculation of the degree of deviation of the position data in the subsequence.
[0097] In the above step S21, the electronic device determines the statistical value and the fluctuation value of each subsequence. Among them, the statistical value is a value used to represent the central tendency of the data at each position in the subsequence. Specifically, the statistical value can be values such as mean, mode, median, etc.; the fluctuation value is a value used to represent the degree of dispersion of the data at each position in the subsequence. Specifically, the fluctuation value can be values such as standard deviation, variance, average difference, etc.
[0098] In the above step S22, the electronic device respectively determines the degree of difference between the data at each position in the subsequence and the statistical value as the initial difference value of the position data; that is, for each subsequence, after determining the statistical value of the subsequence, the degree of difference between the data at each position in the subsequence and the statistical value of the subsequence is determined as the initial difference value of the position data in the subsequence.
[0099] For example, the determined subsequences are subsequence 1 {position 1, position 2, position 3} and subsequence 2 {position 3, position 4, position 5}. Based on step S21 above, the electronic device determines that the statistical value of subsequence 1 is value 1 and the statistical value of subsequence 2 is value 2. Thus, the degree of difference between position 1 and value 1 is determined as the initial difference value of position 1 in subsequence 1; the degree of difference between position 2 and value 1 is determined as the initial difference value of position 2 in subsequence 1; the degree of difference between position 3 and value 1 is determined as the initial difference value of position 3 in subsequence 1; and, the degree of difference between position 3 and value 2 is determined as the initial difference value of position 3 in subsequence 2; the degree of difference between position 4 and value 2 is determined as the initial difference value of position 4 in subsequence 2; the degree of difference between position 5 and value 2 is determined as the initial difference value of position 5 in subsequence 2.
[0100] In step S23 above, the degree of deviation of the position data in the subsequence is the ratio of the initial difference value of the position data to the fluctuation value of the subsequence where the position data is located. The electronic device calculates the degree of deviation of each position data in each subsequence as the degree of deviation of the position data in the subsequence.
[0101] For example, the determined subsequences are subsequence 1 {position 1, position 2, position 3} and subsequence 2 {position 3, position 4, position 5}. Based on step S21 above, the electronic device determines that the fluctuation value of subsequence 1 is value 3 and the fluctuation value of subsequence 2 is value 4; based on step S22 above, the electronic device determines that the initial difference value of position 1 in subsequence 1 is value 5, then the degree of deviation of position 1 in subsequence 1 is the ratio of value 5 to value 3; the initial difference value of position 2 in subsequence 1 is value 6, then the degree of deviation of position 2 in subsequence 1 is the ratio of value 6 to value 3; the initial difference value of position 3 in subsequence 1 is value 7, then the degree of deviation of position 3 in subsequence 1 is the ratio of value 7 to value 3; the initial difference value of position 3 in subsequence 2 is value 8, then the degree of deviation of position 3 in subsequence 2 is the ratio of value 8 to value 4; the initial difference value of position 4 in the subsequence is value 9, then the degree of deviation of position 4 in subsequence 2 is the ratio of value 9 to value 4; the initial difference value of position 5 in subsequence 2 is value 10, then the degree of deviation of position 5 in subsequence 2 is the ratio of value 10 to value 4.
[0102] It can be understood that in some specific examples, when the statistical value is the mean of the subsequence and the fluctuation value is the standard deviation of the subsequence, the degree of deviation of the position data in the subsequence can be determined by the following formula:
[0103]
[0104] where, z-score i is the degree of deviation of the i-th position data in the subsequence, xi is the data at the i-th position, σ is the standard deviation of the subsequence, μ is the mean of the subsequence, and x i - μ is the initial difference value of the data at the i-th position.
[0105] In addition, in some embodiments, the target tracking sequence includes a first tracking sequence and a second tracking sequence, where the first tracking sequence and the second tracking sequence can be determined by the following Figure 3 shown method, specifically, it may include the following steps:
[0106] Step S31: Obtain multiple target images including the target object, and different target images are taken at different times;
[0107] Step S32: For each target image, determine the position coordinates of the target object in the target image;
[0108] Step S33: Arrange the abscissas in each position coordinate in ascending order of the shooting time of the corresponding target image as the first tracking sequence; and arrange the ordinates in each position coordinate in ascending order of the shooting time of the corresponding target image as the second tracking sequence.
[0109] In the technical solution provided by the embodiments of the present application, multiple target images including the target object are obtained, and different target images are taken at different times; thus, for each target image, the position coordinates of the target object in the target image are determined, and the abscissas in each position coordinate are arranged in ascending order of the shooting time of the corresponding target image as the first tracking sequence; and the ordinates in each position coordinate are arranged in ascending order of the shooting time sequence of the corresponding target image as the second tracking sequence.
[0110] It can be understood that generally, the position data is two-dimensional position data. For two-dimensional position data, if the statistical values and fluctuation values of the subsequence composed of two-dimensional position data need to be calculated, the required calculation amount is extremely large. Therefore, based on the tracking sequence anomaly detection method provided in this embodiment, the two-dimensional position data can be divided into two one-dimensional data. Furthermore, the subsequence becomes a sequence composed of one-dimensional data, and the calculation amount for calculating the statistical values and fluctuation values of the subsequence will be reduced, and the calculation efficiency will be improved.
[0111] In the above step S31, the target image is an image including the target object. The electronic device obtains multiple target images including the target object, and different target images are taken at different times.
[0112] In some embodiments, the shooting time of the target image can also be obtained while obtaining the target image.
[0113] In the above step S32, for each target image, the electronic device determines the position coordinates of the target object in the target image. Specifically, the electronic device can directly obtain the position coordinates of the target object in each target image by recognizing the image. Alternatively, the electronic device can use a target recognition algorithm to detect each target image to obtain the target boxes where the target object is located in each target image. Then, for each target box, the coordinates at the same position on each target box are taken as the position coordinates of the target object in the target image. For example, after determining the target boxes occupied by the target object in each target image, the coordinates of the center points of each target box can be used as the position coordinates of the target object in the target image.
[0114] In the above step S33, after the electronic device determines the position coordinates of the target object in each target image, it arranges the abscissas in each position coordinate in ascending order of the shooting time of the corresponding target image to form a first tracking sequence; and arranges the ordinates in each position coordinate in ascending order of the shooting time of the corresponding target image to form a second tracking sequence.
[0115] Taking a specific example for illustration, for example, there are a total of 3 target images, denoted as target image 1, target image 2, and target image 3 respectively. Among them, the shooting time of target image 1 is t1, the shooting time of target image 2 is t2, and the shooting time of target image 3 is t3, and t1 < t2 < t3 is satisfied. And it is assumed that the position coordinates of the target object determined from target image 1 are (x1, y1), the position coordinates of the target object determined from target image 2 are (x2, y2), and the position coordinates of the target object determined from target image 3 are (x3, y3). Then in this example, the first tracking sequence is (x1, x2, x3), and the second tracking sequence is (y1, y2, y3).
[0116] Based on the above Figure 3 illustrated example, when the target tracking sequence includes the first tracking sequence and the second tracking sequence, the embodiment of the present application also provides another processing flow of the tracking sequence anomaly detection method. Refer to Figure 4 , Figure 4 which is the second process schematic diagram of the tracking sequence anomaly detection method provided by the embodiment of the present application, and may include the following steps:
[0117] Step S41: Obtain the first tracking sequence and the second tracking sequence of the target object;
[0118] Step S42: Use a plurality of preset sliding windows with different scales to traverse the first tracking sequence respectively, and use a plurality of preset sliding windows to traverse the second tracking sequence respectively to obtain a plurality of subsequences;
[0119] Step S43: For each position data in each subsequence, determine the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence.
[0120] Step S44: For each position data, if the deviation degree of the position data in at least a preset number of subsequences is greater than a preset threshold, then determine the position data as an outlier.
[0121] In the technical solution provided by the embodiments of the present application, when the target tracking sequence includes a first tracking sequence and a second tracking sequence, use a preset plurality of sliding windows with different scales to traverse the first tracking sequence respectively, and use a preset plurality of sliding windows to traverse the second tracking sequence respectively. In this way, a plurality of subsequences are obtained. Furthermore, determine the outliers according to the deviation degree of each position data in the subsequence. In this way, when the target object includes a first tracking sequence and a second tracking sequence, the method for determining the outliers based on the first tracking sequence and the second tracking sequence is clarified.
[0122] It can be understood that the above step S43 is the same as Figure 1 step S13 in Figure 1 and step S44 is the same as
[0123] step S14 in Figure 3 Therefore, steps S43 and S44 will not be elaborated here, and only steps S41 and S42 will be described.
[0124] In the above step S41, the electronic device obtains the first tracking sequence and the second tracking sequence of the target object. Here, the generation methods of the first tracking sequence and the second tracking sequence can refer to the examples shown above Figure 3 And it can be understood that the generation times of the first tracking sequence and the second tracking sequence may be the same or different from the times of obtaining the first tracking sequence and the second tracking sequence. The first tracking sequence and the second tracking sequence can be generated by the execution entity of the present application or by other devices other than the execution entity of the present application, as long as the execution entity of the present application can obtain the first tracking sequence and the second tracking sequence.
[0124] In the above step S42, the principle that the electronic device uses a preset plurality of sliding windows with different scales to traverse the first tracking sequence respectively is the same as the principle that the electronic device uses a preset plurality of sliding windows with different scales to traverse the target tracking sequence in the above step S12, and only needs to replace the target tracking sequence in the above step S12 with the first tracking sequence. And the principle that the electronic device uses a preset plurality of sliding windows to traverse the second tracking sequence respectively is also the same as the principle that the electronic device uses a preset plurality of sliding windows with different scales to traverse the target tracking sequence in the above step S12, and only needs to replace the target tracking sequence in the above step S12 with the second tracking sequence.
[0125] It can be understood that in the above step S12, the determined subsequences are all the subsequences obtained by traversing the target tracking sequence using a plurality of preset sliding windows with different scales; while in step S42, the determined subsequences are all the subsequences obtained by traversing the first tracking sequence using a plurality of preset sliding windows with different scales, and all the subsequences obtained by traversing the second tracking sequence using a plurality of preset sliding windows with different scales.
[0126] A specific example is used to illustrate the subsequences obtained in the above step S42. For example, the first tracking sequence is (x1, x2,..., x6), the second tracking sequence is (y1, y2,..., y6), the preset sliding windows are window 3 and window 4, and the scale of window 3 is 2 and the step size is 1; the scale of window 4 is 3 and the step size is 1. Thus, the subsequences obtained by traversing the first tracking sequence using window 3 are {x1, x2}, {x2, x3}, {x3, x4}, {x4, x5}, {x5, x6}; the subsequences obtained by traversing the first tracking sequence using window 4 are {x1, x2, x3}, {x2, x3, x4}, {x3, x4, x5}, {x4, x5, x6}. The subsequences obtained by traversing the second tracking sequence using window 3 are {y1, y2}, {y2, y3}, {y3, y4}, {y4, y5}, {y5, y6}; the subsequences obtained by traversing the second tracking sequence using window 4 are {y1, y2, y3}, {y2, y3, y4}, {y3, y4, y5}, {y4, y5, y6}. Thus, the above-obtained subsequences are the multiple subsequences obtained in step S42.
[0127] It can be understood that in some embodiments, for the above steps S12 - S14, in step S12, the electronic device can also first use a sliding window to traverse the target tracking sequence, and then, execute step S13, that is, for each of the traversed subsequences, determine the deviation degree of each position data in the subsequence. After that, determine whether all the preset sliding windows with different scales have completed traversing the target tracking sequence. If there is a sliding window that has not traversed the target tracking sequence, return to execute step S12 and use the sliding window that has not traversed the target tracking sequence to traverse the target tracking sequence; if all the preset sliding windows with different scales have completed traversing the target tracking sequence, then execute step S14 to determine the outliers. For specific details, please refer to the following Figure 5 description.
[0128] See Figure 5 , Figure 5This is the third process schematic diagram of the tracking sequence anomaly detection method provided by the embodiments of the present application, which may include the following steps:
[0129] Step S51: Obtain the target tracking sequence of the target object. The target tracking sequence includes the position data of the target object at multiple moments, and each position data is arranged in chronological order.
[0130] Step S52: Traverse the target tracking sequence using the current sliding window to obtain multiple subsequences; for each position data in the subsequence, determine the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence; use the position data with a deviation degree greater than the preset threshold as the candidate value; among them, when determining the candidate value for the first time, the current sliding window is the first sliding window among the preset multiple sliding windows with different scales.
[0131] Step S53: Determine whether all the preset multiple sliding windows with different scales have completed traversing the target tracking sequence. If so, execute step S55; if not, execute step S54.
[0132] Step S54: Use the sliding window that has not traversed the target tracking sequence as the current sliding window, and return to execute the above step of determining the candidate value.
[0133] Step S55: Determine the position data that is a candidate value in at least the preset number of subsequences as the outlier.
[0134] In the technical solution provided by the embodiments of the present application, for the preset multiple different sliding windows, a single sliding window is used to traverse the target tracking sequence in turn, and based on the obtained subsequences, determine the position data with a deviation degree greater than the preset threshold in the subsequence corresponding to the single sliding window, that is, the candidate value; in this way, until all sliding windows complete traversing the target tracking sequence, that is, determine the candidate values corresponding to all sliding windows, and then determine the outlier from all candidate values. Thus, based on the embodiments of the present application, a complete processing flow for traversing the target tracking sequence based on the sliding window to determine the outlier can be clarified when there are multiple different sliding windows.
[0135] The above step S51 is the same as Figure 1 step S11 in [reference], and will not be elaborated here.
[0136] In the above step S52, the current sliding window is the sliding window that traverses the target tracking sequence currently. It can be understood that when determining the candidate value for the first time, the current sliding window is the first sliding window among a plurality of preset sliding windows with different scales. That is, when using the sliding window to traverse the target tracking sequence for the first time, the sliding window used is the first sliding window among a plurality of preset sliding windows with different scales. In the subsequent process, after the first sliding window finishes traversing the target tracking sequence, the electronic device will use the sliding window that has not traversed the target tracking sequence as the current sliding window and return to execute step S52. For specific details, please refer to the description in the subsequent step S54.
[0137] Among them, in some embodiments, when the user sets the sliding window, the arrangement order of the sliding window can also be set. In this way, the electronic device can determine which sliding window is the first sliding window based on the arrangement order set by the user. Or, in some other embodiments, the electronic device can sort the sliding windows set by the user according to a preset rule. Then, based on this sorting, the electronic device can determine which sliding window is used as the first sliding window. Among them, the preset rule can be set by the user according to requirements. For example, the preset rule can be set to sort by window scale from large to small, or sort by window step size from large to small, etc.
[0138] After the electronic device traverses the target tracking sequence using the current sliding window, a plurality of subsequences can be obtained (for specific details, please refer to the content in the above step S12); furthermore, for each position data in the subsequence, the electronic device can determine the degree to which the position data deviates from other data as the deviation degree of the position data in the subsequence (for specific details, please refer to the content in the above step S13); then, the electronic device can use the position data with a deviation degree greater than the preset threshold as the candidate value. That is, for a position data, as long as its deviation degree in any subsequence is greater than the preset threshold, then this position data is determined as the candidate value.
[0139] Illustrated with a specific example. For example, the current sliding window is window 5. After using window 5 to traverse the target tracking sequence, the obtained subsequences are {position 1, position 2, position 3, position 4} and {position 3, position 4, position 5, position 6}. After the electronic device calculates the deviation degree of each position data in the subsequence, it is determined that the deviation degrees of position 2 and position 3 in the subsequence {position 1, position 2, position 3, position 4} are greater than the preset threshold, and the deviation degree of position 6 in the subsequence {position 3, position 4, position 5, position 6} is greater than the preset threshold. Then, position 2, position 3, and position 6 are all candidate values.
[0140] In the above step S53, the electronic device determines whether the preset sliding windows of multiple different scales have completed the traversal of the target tracking sequence. That is, the electronic device determines whether each preset sliding window has completed the traversal of the target tracking sequence. In this step, if yes, it indicates that each preset sliding window has completed the traversal of the target tracking sequence, and the subsequent step S55 needs to be executed; if no, it indicates that there are still sliding windows that have not traversed the target tracking sequence, and the subsequent step S54 needs to be executed.
[0141] In some embodiments, before executing step S53, the electronic device may also determine whether the current sliding window has completed the traversal of the target tracking sequence. If the current sliding window has completed the traversal of the target tracking sequence, the subsequent step S53 is executed; if the current sliding window has not completed the traversal of the target tracking sequence, the current sliding window continues to be used to traverse the target and sequence that have not been traversed, and determine the candidate value.
[0142] In the above step S54, the electronic device uses the sliding window that has not traversed the target tracking sequence as the current sliding window, and returns to execute the above step S52.
[0143] Specifically, in some embodiments, the user can also set the arrangement order of the sliding windows when setting the sliding windows, so that the electronic device can determine the first sliding window and the sliding window that should be used as the current sliding window in step S54 according to the order set by the user.
[0144] For example, the preset sliding windows are window 1, window 2, and window 3, and the user sets the order of use of the three sliding windows to be window 1, window 2, and window 3. Thus, when the above step S52 is executed for the first time, that is, when the candidate value is determined for the first time, the electronic device uses window 1 as the current sliding window; after window 1 completes the traversal of the target tracking sequence, the electronic device can determine that window 2 and window 3 have not traversed the target tracking sequence based on the preset window order and the sliding window used when executing the above step S52. Then, according to the preset window order, when executing step S54, the electronic device uses window 2 as the current sliding window and returns to execute the above step S52; when window 2 completes the traversal of the target tracking sequence, similarly, according to the preset window order, when executing step S54, the electronic device uses window 3 as the current sliding window and returns to execute the above step S52. At this point, all sliding windows have completed the traversal of the target tracking sequence.
[0145] Alternatively, in some other embodiments, the electronic device may sort the sliding windows set by the user according to a preset rule. Furthermore, the electronic device may determine the first sliding window and the sliding window that should be used as the current sliding window in step S54 according to the sorting. The preset rule may be set by the user according to requirements. For example, the preset rule may be set to sort by the window scale from large to small, or sort by the window step from large to small, etc.
[0146] In the above step S55, if a certain position data is a candidate value in at least a preset number of subsequences, then it is determined that the position data is an outlier. The preset number can be set according to user requirements. For example, if the user needs to avoid missing the detection of outliers, the preset number can be set to be relatively small.
[0147] Taking the preset number as 2 as an example, if a certain position data is an outlier in 2 or more subsequences, then the position data is determined to be an outlier; taking the preset number as 1 as an example, for the position data, as long as it is a candidate value in any one subsequence, then the position data is determined to be an outlier.
[0148] Next, for the convenience of understanding the tracking sequence anomaly detection method provided in this application, a specific example is used to illustrate the tracking sequence anomaly detection method provided in the embodiments of this application.
[0149] Specifically, taking the target tracking sequence including the first tracking sequence and the second tracking sequence, and if the deviation degree of the position data in at least 1 subsequence is greater than a preset threshold, then the position data is determined to be an outlier as an example, see Figure 6 , Figure 6 is the fourth process schematic diagram of the tracking sequence anomaly detection method provided in the embodiments of this application, and may include the following steps:
[0150] Step S61: Initialize.
[0151] Step S62: Input the time series sequence X = x_1, x_2,..., x_n of the abscissa of the center point of the target detection box; and the time series sequence Y = y_1, y_2,..., y_n of the ordinate of the center point of the target detection box.
[0152] In this example, the time series sequence of the abscissa of the center point of the target detection box can be understood as the above-mentioned first tracking sequence; the time series sequence of the ordinate of the center point of the target box can be understood as the above-mentioned second tracking sequence. The generation methods of the first tracking sequence and the second tracking sequence can be referred to the above Figure 3For the description in [it]; the process of obtaining the first tracking sequence and the second tracking sequence can be referred to the description in step S41 above. Among them, \(x_n\) represents the abscissa of the center point of the target box where the target object is located in the \(n\)th image frame; \(y_n\) represents the ordinate of the center point of the target box where the target object is located in the \(n\)th image frame.
[0153] Step S63: Input the sliding window length list \(L = L_1, L_2, \ldots, L_n\).
[0154] Among them, \(L_1, L_2, \ldots, L_n\) respectively represent the sliding windows with different scales set, and \(L_n\) represents the \(n\)th sliding window. Specifically, it can be referred to the description in step S12 above.
[0155] Step S64: For window \(L_i\), execute the following steps S641 - S646.
[0156] Among them, window \(L_i\) can be understood as the current sliding window in step S52 above.
[0157] Step S641: Determine each subsequence of sequence \(X\) and sequence \(Y\) under window \(L_i\).
[0158] In this example, use window \(L_i\) to traverse sequence \(X\) to obtain multiple subsequences, and use window \(L_i\) to traverse sequence \(Y\) to obtain multiple subsequences; specifically, it can be referred to the description in step S42 and step S52 above.
[0159] Step S642: For each subsequence, calculate the mean \(\mu\) and standard deviation \(\sigma\) of the subsequence; it can be referred to the Figure 2 description above.
[0160] Step S643: For each data point, calculate the z - score.
[0161] Among them, the z - score of the data point can be understood as the degree of deviation of the above - mentioned position data in the subsequence. Specifically, it can be referred to the description in step S13 above.
[0162] Step S644: Determine whether the z - score is greater than a predetermined threshold. If the z - score is greater than the predetermined threshold, execute step S645; if the z - score is not greater than the predetermined threshold, execute step S646; specifically, it can be referred to the description in step S14 above.
[0163] Step S645: Mark it as an outlier; specifically, it can be referred to the description in step S14 above.
[0164] Step S646: Determine whether the end of the sequence has been reached. If the end of the sequence has been reached, execute Step S65; if not, return to execute the above Step S641. For details, refer to the description in the above Step S53.
[0165] Step S65: Determine whether all sliding windows have been processed. If so, execute Step S66; if not, return to execute the above Step S64. For details, refer to the description in the above Step S53.
[0166] Step S66: Combine the outlier markers at different scales; for details, refer to the description in the above Step S14.
[0167] Step S67: Output the marked sequence. For details, refer to the description in the above Step S14.
[0168] Corresponding to the above method for detecting outliers in a tracking sequence, an embodiment of the present application further provides a device for detecting outliers in a tracking sequence, as Figure 7 shown, the device includes:
[0169] A tracking sequence acquisition module 71, configured to acquire a target tracking sequence of a target object, where the target tracking sequence includes position data of the target object at multiple moments, and each position data is arranged in chronological order;
[0170] A subsequence acquisition module 72, configured to traverse the target tracking sequence respectively by using a plurality of preset sliding windows with different scales to obtain a plurality of subsequences;
[0171] A deviation degree determination module 73, configured to determine, for each position data in each subsequence, the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence;
[0172] An outlier determination module 74, configured to determine, for each position data, that if the deviation degree of the position data in at least a preset number of subsequences is greater than a preset threshold, the position data is determined as an outlier.
[0173] In the technical solution provided by the embodiment of the present application, it can be understood that the movement of the target object is continuous in the time domain. Therefore, if a segment of position data all belongs to the same target object, these position data should be continuous, that is, there is no data in these position data that significantly deviates from other position data. On the contrary, if in a segment of position data, a certain position data significantly deviates from other position data, it indicates that the position data may not belong to the same target object as other position data, that is, the position data may be abnormal.
[0174] The trends presented by the data at each position in sequences of different lengths are different. For example, for an object moving along an arc with a large radius of curvature, the position data of the object shows a trend of moving in a straight line in a shorter subsequence, while it shows a trend of moving along a curve only in a longer subsequence. Therefore, the same position data may have the same trend as other position data in a subsequence of a certain length, that is, it does not deviate significantly from other position data, while in subsequences of other lengths, it may have a different trend from other position data, that is, it deviates significantly from other position data. In other words, for the same position data, it may be abnormal in a subsequence of a certain length, but normal in subsequences of other lengths. Thus, in this application, the target tracking sequence is divided into multiple subsequences through a plurality of sliding windows with preset different scales, so as to ensure that each position data is located in subsequences of different scales. Furthermore, for each position data, the abnormal situation of the same position data at different scales can be determined. In this way, if the deviation degree of a certain position data in at least a preset number of subsequences is greater than the preset threshold, it can be determined that the position data is an outlier.
[0175] It can be understood that based on the technical solution provided by the embodiments of this application, it is possible to determine whether there are outliers in the tracking sequence, that is, to determine whether the tracking sequence is an abnormal sequence. Then, it can be shown that the outliers participate in the subsequent analysis process. Thus, the problem of low accuracy of the obtained results caused by using an abnormal tracking sequence to analyze other results can be avoided.
[0176] In some embodiments, the deviation degree determination module 73 is specifically configured to:
[0177] Determine the statistical value of the subsequence, where the statistical value is used to represent the central tendency of the position data in the subsequence; and determine the fluctuation value of the subsequence, where the fluctuation value is used to represent the degree of dispersion of the position data in the subsequence;
[0178] Respectively determine the degree of difference between each position data in the subsequence and the statistical value as the initial difference value of the position data;
[0179] Respectively determine the ratio of the initial difference value of each position data to the fluctuation value of the subsequence as the deviation degree of the position data in the subsequence.
[0180] In some embodiments, the subsequence acquisition module 72; and the deviation degree determination module 73; and the outlier determination module 74 are specifically configured to,
[0181] Traverse the target tracking sequence using the current sliding window to obtain multiple subsequences; for each position data in the subsequence, determine the degree to which the position data deviates from other data in the subsequence as the deviation degree of the position data in the subsequence; use the position data with a deviation degree greater than the preset threshold as candidate values; among them, when determining the candidate values for the first time, the current sliding window is the first sliding window among the preset multiple sliding windows with different scales.
[0182] Determine whether all the preset multiple sliding windows with different scales have completed traversing the target tracking sequence. If there is a sliding window that has not traversed the target tracking sequence, use the sliding window that has not traversed the target tracking sequence as the current sliding window and return to execute the above step of determining candidate values; if all the preset multiple sliding windows with different scales have completed traversing the target tracking sequence, then,
[0183] Determine the position data that is a candidate value in at least the preset number of subsequences as outlier values.
[0184] In some embodiments, the target tracking sequence includes a first tracking sequence and a second tracking sequence, and the first tracking sequence and the second tracking sequence are determined in the following manner:
[0185] Obtain multiple target images including the target object, and different target images are taken at different times;
[0186] For each target image, determine the position coordinates of the target object in the target image;
[0187] Arrange the abscissas in each position coordinate in ascending order of the shooting time of the target image to which they belong as the first tracking sequence; and arrange the ordinates in each position coordinate in ascending order of the shooting time of the target image to which they belong as the second tracking sequence;
[0188] The traversing of the target tracking sequence using the preset multiple sliding windows with different scales respectively includes,
[0189] Traverse the first tracking sequence using the preset multiple sliding windows with different scales respectively; and traverse the second tracking sequence using the preset multiple sliding windows with different scales respectively.
[0190] In some embodiments, the statistical value is the mean of the subsequence, and the fluctuation value is the standard deviation of the subsequence;
[0191] Determine the deviation degree of the position data in the subsequence through the following formula:
[0192]
[0193] where, z-scorei is the degree of deviation of the data at the i-th position in the subsequence, x i is the data at the i-th position, σ is the standard deviation of the subsequence, μ is the mean of the subsequence, x i -μ is the initial difference value of the data at the i-th position.
[0194] An embodiment of the present invention also provides an electronic device, such as Figure 8 shown, including a processor 81, a communication interface 82, a memory 83, and a communication bus 84. Among them, the processor 81, the communication interface 82, and the memory 83 complete mutual communication through the communication bus 84,
[0195] The memory 83 is used to store a computer program;
[0196] When the processor 81 is used to execute the program stored on the memory 83, the following steps are implemented:
[0197] Obtain the position sequence of the detection frames at N moments of the target to be detected in the image to be detected, and the K length parameters of the sliding window, where N and K are both positive integers, and the position sequence of the detection frames at each moment includes K position parameters;
[0198] For any one of the length parameters, calculate the mean and standard deviation of the position sequence of the detection frames at N moments; according to the calculated mean and standard deviation, calculate the standard score corresponding to each position parameter;
[0199] When the standard score of any position parameter is greater than a preset threshold, it is determined that the position parameter is abnormal.
[0200] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0201] The communication interface is used for communication between the above terminal and other devices.
[0202] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0203] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU for short), a Network Processor (NP for short), etc.; it may also be a Digital Signal Processor (DSP for short), an Application Specific Integrated Circuit (ASIC for short), a Field-Programmable Gate Array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0204] In another embodiment provided by the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the tracking sequence anomaly detection method described in any one of the above embodiments is implemented.
[0205] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions, and when it runs on a computer, it causes the computer to execute the tracking sequence anomaly detection method described in any one of the above embodiments.
[0206] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)).
[0207] It should be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.
[0208] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the apparatus, electronic device, storage medium and computer program product, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the relevant parts of the method embodiments for the relevant content.
[0209] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.
Claims
1. A tracking sequence anomaly detection method, characterized in that: The method comprises: Acquire a target tracking sequence of a target object, wherein the target tracking sequence includes position data of the target object at multiple moments, and each of the position data is arranged in chronological order; Using a plurality of preset sliding windows of different scales to traverse the target tracking sequence respectively to obtain a plurality of subsequences; For each position data in each of the subsequences, determining a degree to which the position data deviates from other data in the subsequence as a degree of deviation of the position data in the subsequence; For each of the position data, if the degree of deviation of the position data in at least a preset number of subsequences is greater than a preset threshold, the position data is determined as an abnormal value.
2. The method according to claim 1, characterized in that The determining a degree to which the position data deviates from other data in the subsequence as a degree to which the position data deviates from the other data in the subsequence comprises: Determine a statistical value of the subsequence, the statistical value is used to represent the central tendency of the data at each position in the subsequence; and determine a fluctuation value of the subsequence, the fluctuation value is used to represent the dispersion degree of the data at each position in the subsequence; respectively determining the degree of difference between each position data in the subsequence and the statistical value as an initial difference value of the position data; The ratio of the initial difference value of each position data to the fluctuation value of the subsequence is determined respectively as the deviation degree of the position data in the subsequence.
3. The method according to claim 1, characterized in that The target tracking sequence is traversed respectively by using a plurality of preset sliding windows of different scales to obtain a plurality of subsequences; and, for each position data in each of the subsequences, a degree of deviation of the position data from other data in the subsequence is determined as a degree of deviation of the position data in the subsequence; and, for each of the position data, if the degree of deviation of the position data in at least a preset number of subsequences is greater than a preset threshold, the position data is determined as an abnormal value, including: Using the current sliding window to traverse the target tracking sequence to obtain multiple subsequences; For each position data in the subsequence, determining a degree to which the position data deviates from other data in the subsequence as a degree of deviation of the position data in the subsequence; The position data whose deviation degree is greater than a preset threshold is used as a candidate value; wherein, when the candidate value is determined for the first time, the current sliding window is the first sliding window among the preset multiple sliding windows of different scales; Determine whether the preset multiple sliding windows of different scales have completed the traversal of the target tracking sequence. If there is a sliding window that has not traversed the target tracking sequence, use the sliding window that has not traversed the target tracking sequence as the current sliding window, and return to execute the above step of determining the candidate value; if the preset multiple sliding windows of different scales have completed the traversal of the target tracking sequence, then, Position data that are candidate values in at least a preset number of subsequences are determined as the abnormal value.
4. The method according to claim 1, characterized in that: The target tracking sequence includes a first tracking sequence and a second tracking sequence, and the first tracking sequence and the second tracking sequence are determined in the following manner: Acquire a plurality of target images including the target object, wherein different target images are taken at different times; For each of the target images, determining the position coordinates of the target object in the target image; Arranging the horizontal coordinates of the position coordinates in order from early to late according to the shooting time of the target image to which they belong as the first tracking sequence; and arranging the vertical coordinates of the position coordinates in order from early to late according to the shooting time of the target image to which they belong as the second tracking sequence; The target tracking sequence is traversed respectively by using a plurality of preset sliding windows of different scales, including: The first tracking sequence is traversed respectively by using a plurality of preset sliding windows of different scales; and the second tracking sequence is traversed respectively by using a plurality of preset sliding windows of different scales.
5. The method according to claim 2, characterized in that: The statistical value is the mean of the subsequence, and the fluctuation value is the standard deviation of the subsequence; The degree of deviation of the position data in the subsequence is determined by the following formula: Among them, z-score i is the degree of deviation of the i-th position data in the subsequence, x i is the i-th position data, σ is the standard deviation of the subsequence, μ is the mean of the subsequence, x i -μ is the initial difference value of the i-th position data.
6. A tracking sequence anomaly detection device, characterized in that: The device comprises: A tracking sequence acquisition module, used to acquire a target tracking sequence of a target object, wherein the target tracking sequence includes position data of the target object at multiple moments, and each position data is arranged in chronological order; A subsequence acquisition module, used to traverse the target tracking sequence respectively using a plurality of preset sliding windows of different scales to obtain a plurality of subsequences; a deviation degree determination module, configured to determine, for each position data in each of the subsequences, a degree to which the position data deviates from other data in the subsequence, as the deviation degree of the position data in the subsequence; The outlier determination module is used to determine, for each of the position data, if the degree of deviation of the position data in at least a preset number of subsequences is greater than a preset threshold, the position data as an outlier.
7. The device according to claim 6, characterized in that The deviation degree determination module is specifically used for: Determine a statistical value of the subsequence, the statistical value is used to represent the central tendency of the data at each position in the subsequence; and determine a fluctuation value of the subsequence, the fluctuation value is used to represent the dispersion degree of the data at each position in the subsequence; respectively determining the degree of difference between each position data in the subsequence and the statistical value as an initial difference value of the position data; The ratio of the initial difference value of each position data to the fluctuation value of the subsequence is determined respectively as the deviation degree of the position data in the subsequence.
8. The device according to claim 6, characterized in that The subsequence acquisition module; and the deviation degree determination module; and the outlier determination module are specifically used to: The target tracking sequence is traversed using the current sliding window to obtain multiple subsequences; for each position data in the subsequence, a degree of deviation of the position data from other data in the subsequence is determined as the degree of deviation of the position data in the subsequence; The position data whose deviation degree is greater than a preset threshold is used as a candidate value; wherein, when the candidate value is determined for the first time, the current sliding window is the first sliding window among the preset multiple sliding windows of different scales; Determine whether the preset multiple sliding windows of different scales have completed the traversal of the target tracking sequence. If there is a sliding window that has not traversed the target tracking sequence, use the sliding window that has not traversed the target tracking sequence as the current sliding window, and return to execute the above step of determining the candidate value; if the preset multiple sliding windows of different scales have completed the traversal of the target tracking sequence, then, Position data that are candidate values in at least a preset number of subsequences are determined as the abnormal value.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.
Citation Information
Cited By
Target tracking detection method and device based on dynamic scoring and time window adjustment
CN121582297A