Location feature generation method, training method, detection method, and device
By calculating the transfer time and correlation between specified locations, and adjusting the transformation model and location feature matrix, the problem that location features cannot effectively represent correlation is solved, thus improving the accuracy of behavior detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2024-08-30
- Publication Date
- 2026-07-03
AI Technical Summary
In existing technologies, location features determined based on location coordinates cannot effectively characterize the correlation between locations, resulting in low accuracy in detecting human behavior.
By acquiring spatiotemporal information records of sample personnel, calculating the transfer duration and correlation between specified locations, adjusting the transformation model and location feature matrix until convergence is achieved, and generating a new location feature matrix to improve the correlation representation capability of location features.
It improves the accuracy of location-based detection of human behavior, can more effectively characterize the correlation between locations, and enhances the precision of behavior detection.
Smart Images

Figure CN121637018B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method for generating location features, a training method, a detection method, and an apparatus. Background Technology
[0002] With the advent of the big data era, data generated from people's daily activities can be collected. Based on this data, the characteristics of individuals can be analyzed to create profiles, providing support for maintaining public safety. For example, when people are active in a certain area (such as a city or a closed park), spatiotemporal information records of when and where they arrive can be obtained through cameras, GPS (Global Positioning System) positioning, portable signal transmitting devices, etc., revealing their movement routes. Analyzing these routes can determine the type or intent of an individual's actions, allowing for behavioral monitoring and enriching their profile. For instance, if an individual leaves their residential area in the morning, goes to the subway station to take the subway to their workplace, and then leaves their workplace in the evening to return to the same residential area by subway, their activity type can be identified as going to work; if an individual leaves their hotel and visits several scenic spots, their activity type can be identified as tourism.
[0003] However, in analyzing pedestrian movement routes, although the coordinates of spatial nodes (i.e., locations) are usually known, the positional relationships (e.g., distance) between locations cannot effectively characterize their correlation due to limitations such as roads and terrain. For example, two subway stations may be far apart, but people are likely to move between them; while locations on and under elevated roads may be close, but people rarely move instantaneously between them. Therefore, location features determined solely by coordinates cannot effectively characterize the correlation between locations, leading to low accuracy in detecting pedestrian behavior based on these location features. Summary of the Invention
[0004] The purpose of this application is to provide a location feature generation method, training method, detection method, and device to improve the accuracy of detecting human behavior based on determined location features. The specific technical solution is as follows:
[0005] A first aspect of this application provides a method for generating location features, the method comprising:
[0006] Acquire the first spatiotemporal information records of each sample person for each designated location; wherein, the first spatiotemporal information record of a sample person includes the designated locations visited by the sample person, and the time the sample person was at each designated location visited;
[0007] For each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, the first transfer duration between the two designated locations is determined based on the time each sample person is at those two designated locations;
[0008] Based on the first transfer time of each sample person between the two designated locations, the correlation between the two designated locations is calculated as the baseline correlation; wherein, the baseline correlation between the two designated locations is negatively correlated with the average level of the first transfer time of each sample person between the two designated locations.
[0009] The current first location feature matrix is transformed according to the current transformation model to obtain the correlation between each two specified locations, which is used as the first predicted correlation; wherein, the first location feature matrix contains the location feature vector of each specified location;
[0010] Based on the difference between the obtained baseline correlation and the corresponding first predicted correlation, the current transformation model and the current first location feature matrix are adjusted, and the process returns to the step of transforming the current first location feature matrix according to the current transformation model to obtain the correlation between each two specified locations as the first predicted correlation, until the first convergence condition is met, resulting in a new first location feature matrix; wherein, the new first location feature matrix contains the location feature vectors of each specified location, which are used to detect the transfer behavior of the person to be detected between the specified locations.
[0011] Optionally, before calculating the correlation between the two designated locations based on the first transfer time between each sample person and the designated location, as a baseline correlation, the method further includes:
[0012] For each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, determine the first number of transfers of each sample person between the two designated locations;
[0013] The calculation of the correlation between the two designated locations, based on the first transfer time of each sample person between the two designated locations, as the baseline correlation, includes:
[0014] The correlation between the two designated locations is calculated based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample person, and is used as the baseline correlation. The baseline correlation between the two designated locations is positively correlated with the first number of transfers and the distance between the two designated locations.
[0015] Optionally, the step of calculating the correlation between the two designated locations based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample person, as a baseline correlation, includes:
[0016] Based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample member, the correlation between the two designated locations is calculated according to the first formula, which serves as the baseline correlation. The first formula is as follows:
[0017]
[0018] This indicates the baseline correlation between the two specified locations. This represents the natural exponential function. This indicates taking the minimum value. This represents the hyperparameter of the transfer frequency. This indicates the first transfer number between the two specified locations. This indicates the distance between the two specified locations. This represents the average duration of the first transfer between the two designated locations for each sample member. This represents the time normalization parameter.
[0019] Optionally, the transformation model includes: a transformation matrix and an activation function;
[0020] The step of transforming the current first location feature matrix according to the current transformation model to obtain the correlation between every two specified locations, as the first predicted correlation, includes: transforming the current first location feature matrix according to the current transformation model and a second formula to obtain the correlation between every two specified locations, as the first predicted correlation; wherein, the second formula is as follows:
[0021]
[0022] This indicates the first predictive relevance obtained. This represents the feature matrix of the current first location. This represents the current transformation matrix. This represents the transpose of the feature matrix of the current first location. This represents the activation function.
[0023] Optionally, the location feature vectors of each specified location contained in the first location feature matrix during the first transformation are randomly generated.
[0024] Optionally, the location feature vectors of each specified location contained in the current first location feature matrix are obtained by encoding the attribute information of each specified location using the current location feature encoder;
[0025] The step of adjusting the current transformation model and the current first location feature matrix according to the difference between the obtained baseline correlation and the corresponding first predicted correlation includes: adjusting the current transformation model and the current location feature encoder according to the difference between the obtained baseline correlation and the corresponding first predicted correlation.
[0026] A second aspect of this application also provides a method for training a spatiotemporal representation model, the method comprising:
[0027] For each sample person, based on the first spatiotemporal information record of the sample person for each designated location, the feature vector of the time when the sample person is at each designated location is obtained as the first time feature vector; wherein, the first spatiotemporal information record of a sample person includes the designated locations that the sample person has passed through, and the time when the sample person is at each designated location.
[0028] For each designated location visited by the sample person, the location feature vector of the designated location contained in the current second location feature matrix and the first time feature vector of the time when the sample person was at the designated location are fused to obtain the spatiotemporal feature vector of the sample person for the designated location; wherein, the second location feature matrix when the first fusion is performed is the new first location feature matrix obtained when the first convergence condition is met according to any of the methods described in the first aspect above.
[0029] The spatiotemporal feature vectors of the sample person for each specified location they have passed through are input into the spatiotemporal representation model of the initial structure to obtain the predicted time of the sample person at each specified location they have passed through, and the location prediction result representing the specified location passed by the sample person at each predicted time.
[0030] The loss value is calculated based on the difference between the predicted time and the time when the sample person is located at each specified location they have passed through, and the difference between the location prediction result and the location tag of the sample person; wherein, the location tag of the sample person represents the specified locations passed through by the sample person as included in the first spatiotemporal information record of the sample person.
[0031] Based on the obtained loss value, the parameters of the spatiotemporal representation model of the initial structure are adjusted until the second convergence condition is met, and the trained spatiotemporal representation model is obtained.
[0032] Optionally, for each sample person, based on the first spatiotemporal information record of that sample person, the step of obtaining the feature vector of the time when that sample person is located at each specified location visited, as the first time feature vector, includes:
[0033] For each sample person, based on the first spatiotemporal information record of that sample person, the feature vector of the time when that sample person is at each specified location they have passed through is determined according to the third formula, and is used as the first time feature vector; wherein, the third formula is as follows:
[0034]
[0035] The j-th dimension of the first time feature vector represents the time that sample person I was at each specified location they passed through. This indicates the time that sample person I was at each specified location they visited. and The same, both represent the square root of the dimension of the first time feature vector; the feature values of each dimension calculated from the time that the sample person I is at each specified location it passes through constitute the first time feature vector of the time that the sample person I is at each specified location it passes through.
[0036] Optionally, the spatiotemporal representation model of the initial structure includes: a spatiotemporal sequence encoder, a linear network, and a classification network;
[0037] The step of inputting the spatiotemporal feature vectors of the sample person for each specified location visited into the spatiotemporal representation model of the initial structure to obtain the predicted time of the sample person at each specified location visited, and the location prediction result representing the specified location visited by the sample person at each predicted time, includes:
[0038] The spatiotemporal feature vectors of the sample personnel for each designated location they have visited are input into the spatiotemporal sequence encoder to obtain the encoding results;
[0039] The obtained encoding results are input into the linear network to obtain the predicted time of the sample person at each specified location they have passed through;
[0040] The obtained encoding results are input into the classification network to obtain location prediction results representing the specified locations visited by the sample person at each prediction time.
[0041] Optionally, before calculating the loss value based on the difference between the predicted time and the time the sample person was at each specified location they visited, and the difference between the location prediction result and the location label of the sample person, the method further includes:
[0042] Based on the predicted time of the sample personnel at each designated location they passed through, and the location prediction results representing the designated locations the sample personnel passed through at each predicted time, a second spatiotemporal information record of the sample personnel for each designated location is obtained.
[0043] For each pair of designated locations where personnel transfer behavior exists in the second spatiotemporal information records of each sample person, the second transfer duration between the two designated locations is determined based on the predicted time when each sample person is located at the two designated locations;
[0044] Based on the second transfer time of each sample person between the two designated locations, the correlation between the two designated locations is calculated to obtain the second predicted correlation; wherein, the second predicted correlation between the two designated locations is negatively correlated with the average level of the second transfer time of each sample person between the two designated locations.
[0045] Based on the difference between the predicted time and the time the sample person was at each specified location they visited, and the difference between the location prediction result and the sample person's location label, a loss value is calculated, including:
[0046] The loss value is calculated based on the difference between the predicted time and the time when the sample person is located at each specified location, the difference between the location prediction result and the location label of the sample person, and the difference between the second prediction correlation and the first prediction correlation obtained when the first convergence condition is met according to any of the methods described in the first aspect above; wherein the determined loss value is also used to adjust the current second location feature matrix.
[0047] A third aspect of this application also provides a behavior detection method, the method comprising:
[0048] Acquire third spatiotemporal information records of the person to be tested for each designated location; wherein, the third spatiotemporal information records include the designated locations visited by the person to be tested, and the time the person to be tested was at each designated location visited;
[0049] Based on the third spatiotemporal information record, the feature vector of the time when the person to be detected is located at each designated location passed by is obtained as the second time feature vector;
[0050] For each designated location visited by the person to be detected, the location feature vector of the designated location contained in the third location feature matrix and the second time feature vector of the time when the person to be detected was located at the designated location are fused to obtain the spatiotemporal feature vector of the person to be detected for the designated location; wherein, the third location feature matrix is the second location feature matrix obtained when the second convergence condition is met according to any of the methods described in the second aspect above.
[0051] The spatiotemporal feature vectors of the person to be detected for each designated location they have passed through are input into a trained spatiotemporal sequence encoder to obtain the behavioral features of the person to be detected; wherein, the spatiotemporal sequence encoder is trained based on the spatiotemporal representation model training method that includes the spatiotemporal sequence encoder in the second aspect above;
[0052] Based on the behavioral characteristics of the person to be tested, the movement behavior of the person to be tested between designated locations is detected.
[0053] Optionally, based on the behavioral characteristics of the person to be detected, the transfer behavior of the person to be detected between various designated locations is detected, including: performing a pooling operation on the behavioral characteristics of the person to be detected to obtain a behavioral pattern representation of the transfer behavior of the person to be detected between various designated locations;
[0054] Based on the similarity between the behavioral pattern representation of the person to be detected and the typical behavioral pattern representation, the detection result of the transfer behavior of the person to be detected between designated locations is determined; wherein, the typical behavioral pattern representation is: the cluster centers obtained by clustering the sample behavioral pattern representations obtained by pooling the behavioral features of each sample person; the behavioral features of each sample person are the encoding results obtained when the second convergence condition is met according to the spatiotemporal representation model training method including the spatiotemporal sequence encoder in the second aspect above.
[0055] Optionally, based on the similarity between the behavioral pattern representation of the person under test and the typical behavioral pattern representation, the detection result of the person under test's transfer behavior between designated locations is determined, including: calculating the similarity between the behavioral pattern representation of the person under test and each typical behavioral pattern representation; if there is a typical behavioral pattern representation with a similarity greater than a similarity threshold, the behavioral pattern of the person under test's transfer behavior is determined to be the behavioral pattern represented by the typical behavioral pattern representation with the highest similarity; if there is no typical behavioral pattern representation with a similarity greater than a similarity threshold, the transfer behavior of the person under test is determined to be abnormal.
[0056] A fourth aspect of this application also provides a location feature generation apparatus, the apparatus comprising:
[0057] The first spatiotemporal information recording acquisition module is used to acquire the first spatiotemporal information records of each sample person for each designated location; wherein, the first spatiotemporal information record of a sample person includes the designated locations that the sample person has passed through, and the time that the sample person was at each designated location passed through;
[0058] The first transfer duration determination module is used to determine the first transfer duration between two designated locations for each sample person based on the time each sample person is at the two designated locations in each of the acquired first spatiotemporal information records where there is a transfer behavior between the two designated locations.
[0059] The baseline correlation calculation module is used to calculate the correlation between two designated locations based on the first transfer time of each sample person between the two designated locations, and use this as the baseline correlation. The baseline correlation between the two designated locations is negatively correlated with the average level of the first transfer time of each sample person between the two designated locations.
[0060] The first prediction correlation determination module is used to transform the current first location feature matrix according to the current transformation model to obtain the correlation between each two specified locations, which is used as the first prediction correlation; wherein, the first location feature matrix contains the location feature vector of each specified location;
[0061] The matrix adjustment module is used to adjust the current transformation model and the current first location feature matrix according to the difference between the obtained baseline correlation and the corresponding first predicted correlation, and to trigger the first predicted correlation determination module until the first convergence condition is met, so as to obtain a new first location feature matrix; wherein, the new first location feature matrix contains the location feature vectors of each specified location, which are used to detect the transfer behavior of the person to be detected between the specified locations.
[0062] Optionally, the device further includes: a first transfer count determination module, used to determine the first transfer count of each sample person between two designated locations for each pair of designated locations in the acquired first spatiotemporal information records before calculating the correlation between the two designated locations based on the first transfer duration of each sample person between the two designated locations as the benchmark correlation; the benchmark correlation calculation module includes: a benchmark correlation calculation submodule, used to calculate the correlation between the two designated locations based on the first transfer duration, the first transfer count, and the distance between the two designated locations of each sample person, as the benchmark correlation; wherein the benchmark correlation between the two designated locations is positively correlated with the first transfer count between the two designated locations and the distance between the two designated locations.
[0063] Optionally, the benchmark correlation calculation submodule is specifically used to calculate the correlation between the two designated locations based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample person, according to a first formula, as the benchmark correlation; wherein, the first formula is as follows:
[0064]
[0065] This indicates the baseline correlation between the two specified locations. This represents the natural exponential function. This indicates taking the minimum value. This represents the hyperparameter of the transfer frequency. This indicates the first transfer number between the two specified locations. This indicates the distance between the two specified locations. This represents the average duration of the first transfer between the two designated locations for each sample member. This represents the time normalization parameter.
[0066] Optionally, the transformation model includes: a transformation matrix and an activation function;
[0067] The first prediction relevance determination module is specifically used to transform the current first location feature matrix according to the second formula based on the current transformation model, to obtain the relevance between every two specified locations, which is used as the first prediction relevance; wherein, the second formula is as follows:
[0068]
[0069] This indicates the first predictive relevance obtained. This represents the feature matrix of the current first location. This represents the current transformation matrix. This represents the transpose of the feature matrix of the current first location. This represents the activation function.
[0070] Optionally, the location feature vectors of each specified location contained in the first location feature matrix during the first transformation are randomly generated.
[0071] Optionally, the location feature vectors of each specified location contained in the current first location feature matrix are obtained by encoding the attribute information of each specified location using the current location feature encoder; the matrix adjustment module is specifically used to adjust the current transformation model and the current location feature encoder according to the difference between the obtained baseline correlation and the corresponding first prediction correlation.
[0072] A fifth aspect of the embodiments of this application also provides a spatiotemporal representation model training device, the device comprising:
[0073] The first-time feature vector acquisition module is used to acquire, for each sample person, the feature vector of the time when the sample person is located at each specified location based on the first spatiotemporal information record of the sample person for each specified location, as the first-time feature vector; wherein, the first spatiotemporal information record of a sample person includes the specified locations that the sample person has passed through, and the time when the sample person is located at each specified location.
[0074] The feature vector fusion module is used to fuse the location feature vector of the specified location contained in the current second location feature matrix and the first time feature vector of the time when the sample person is at the specified location for each specified location visited by the sample person, to obtain the spatiotemporal feature vector of the sample person for the specified location; wherein, the second location feature matrix when the fusion is performed for the first time is a new first location feature matrix obtained when the first convergence condition is met according to any of the methods described in the first aspect above.
[0075] The spatiotemporal prediction module is used to input the spatiotemporal feature vectors of the sample person for each specified location they have passed through into the spatiotemporal representation model of the initial structure, and to obtain the predicted time of the sample person at each specified location they have passed through, as well as the location prediction result of the specified location that the sample person has passed through at each predicted time.
[0076] The loss value calculation module is used to calculate the loss value based on the difference between the predicted time and the time when the sample person is located at each specified location passed through, and the difference between the location prediction result and the location tag of the sample person; wherein, the location tag of the sample person represents the specified locations passed through by the sample person as included in the first spatiotemporal information record of the sample person.
[0077] The model parameter adjustment module is used to adjust the parameters of the spatiotemporal representation model of the initial structure based on the obtained loss value until the second convergence condition is met, thus obtaining the trained spatiotemporal representation model.
[0078] Optionally, the first time feature vector acquisition module is specifically used to, for each sample person, determine the time feature vector of the sample person at each specified location they have passed through, based on the first spatiotemporal information record of that sample person, according to the third formula, as the first time feature vector; wherein, the third formula is as follows:
[0079]
[0080] The j-th dimension of the first time feature vector represents the time that sample person I was at each specified location they passed through. This indicates the time that sample person I was at each specified location they visited. and The same, both represent the square root of the dimension of the first time feature vector; the feature values of each dimension calculated from the time that the sample person I is at each specified location it passes through constitute the first time feature vector of the time that the sample person I is at each specified location it passes through.
[0081] Optionally, the spatiotemporal representation model of the initial structure includes: a spatiotemporal sequence encoder, a linear network, and a classification network;
[0082] The spatiotemporal prediction module is specifically used to input the spatiotemporal feature vectors of the sample person for each specified location they have passed through into the spatiotemporal sequence encoder to obtain the encoding result; input the obtained encoding result into the linear network to obtain the predicted time of the sample person at each specified location they have passed through; and input the obtained encoding result into the classification network to obtain the location prediction result representing the specified location passed by the sample person at each predicted time.
[0083] Optionally, the apparatus further includes: a second spatiotemporal information recording and acquisition module, used to obtain a second spatiotemporal information record of the sample person for each specified location based on the predicted time of the sample person at each specified location visited, and the location prediction result representing the specified location visited by the sample person at each predicted time, before calculating the loss value based on the difference between the predicted time and the time of the sample person at each specified location visited, and the location prediction result representing the specified location visited by the sample person at each predicted time;
[0084] The second transfer duration determination module is used to determine the second transfer duration between two designated locations for each sample person based on the predicted time of each sample person being located at the two designated locations, for each pair of designated locations where there is a transfer behavior in the second spatiotemporal information record of each sample person.
[0085] The second predictive correlation calculation module is used to calculate the correlation between the two designated locations based on the second transfer time of each sample person between the two designated locations, and obtain the second predictive correlation; wherein, the second predictive correlation between the two designated locations is negatively correlated with the average level of the second transfer time of each sample person between the two designated locations.
[0086] The loss value calculation module is specifically used to calculate the loss value based on the difference between the prediction time and the time when the sample person is located at each specified location, the difference between the location prediction result and the location label of the sample person, and the difference between the second prediction correlation and the first prediction correlation obtained when the first convergence condition is met according to any of the methods described in the first aspect above; wherein the determined loss value is also used to adjust the current second location feature matrix.
[0087] In another aspect of the embodiments of this application, a behavior detection device is also provided, the device comprising:
[0088] The third spatiotemporal information recording and acquisition module is used to acquire the third spatiotemporal information records of the person to be tested for each designated location; wherein, the third spatiotemporal information records include the designated locations visited by the person to be tested, and the time the person to be tested was at each designated location visited;
[0089] The second time feature vector acquisition module is used to acquire the feature vector of the time when the person to be detected is located at each specified location he / she passes through, based on the third spatiotemporal information record, as the second time feature vector.
[0090] The spatiotemporal fusion module is used to fuse, for each designated location visited by the person to be detected, the location feature vector of the designated location contained in the third location feature matrix and the second time feature vector of the time when the person to be detected was located at the designated location, to obtain the spatiotemporal feature vector of the person to be detected for the designated location; wherein, the third location feature matrix is the second location feature matrix obtained when the second convergence condition is met according to any of the methods described in the second aspect above.
[0091] The behavior feature determination module is used to input the spatiotemporal feature vectors of the person to be detected for each designated location they have passed through into a trained spatiotemporal sequence encoder to obtain the behavior features of the person to be detected; wherein, the spatiotemporal sequence encoder is trained based on the spatiotemporal representation model training method that includes the spatiotemporal sequence encoder in the second aspect above.
[0092] The behavior detection module is used to detect the movement behavior of the person to be detected between designated locations based on the behavioral characteristics of the person to be detected.
[0093] Optionally, the behavior detection module includes: a behavior pattern representation determination submodule, used to perform pooling operations on the behavior features of the person to be detected to obtain behavior pattern representations representing the transfer behavior of the person to be detected between designated locations; and a detection result determination submodule, used to determine the detection result of the transfer behavior of the person to be detected between designated locations based on the similarity between the behavior pattern representation of the person to be detected and the typical behavior pattern representation; wherein, the typical behavior pattern representation is: the cluster centers obtained by clustering the sample behavior pattern representations obtained by pooling the behavior features of each sample person; the behavior features of each sample person are the encoding results obtained by training the spatiotemporal representation model including the spatiotemporal sequence encoder according to the second aspect mentioned above when the second convergence condition is met.
[0094] Optionally, the detection result determination submodule is specifically used to calculate the similarity between the behavioral pattern representation of the person to be detected and each typical behavioral pattern representation; if there is a typical behavioral pattern representation with a similarity greater than the similarity threshold, the behavioral pattern of the person to be detected's transfer behavior is determined to be the behavioral pattern represented by the typical behavioral pattern representation with the highest similarity; if there is no typical behavioral pattern representation with a similarity greater than the similarity threshold, the transfer behavior of the person to be detected is determined to be abnormal.
[0095] This application also provides an electronic device, including:
[0096] Memory, used to store computer programs;
[0097] When a processor executes a program stored in memory, it implements any of the methods described in the first, second, or third aspect above.
[0098] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods described in the first, second, or third aspects above.
[0099] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described in the first, second, or third aspects above.
[0100] Beneficial effects of the embodiments in this application:
[0101] The location feature generation method provided in this application can acquire first spatiotemporal information records of each sample person for each designated location. Each first spatiotemporal information record of a sample person includes the designated locations visited by that sample person and the time spent at each of those locations. For each pair of designated locations in the acquired first spatiotemporal information records where personnel transfer occurs, a first transfer duration between the two designated locations is determined based on the time each sample person spent at those locations. Based on the first transfer duration between the two designated locations, a correlation between the two locations is calculated as a baseline correlation. The baseline correlation between the two designated locations is related to the average level of the first transfer duration between the two locations. The correlation is negative; the current first location feature matrix is transformed according to the current transformation model to obtain the correlation between each two specified locations, which is used as the first predicted correlation; wherein, the first location feature matrix contains the location feature vectors of each specified location; according to the difference between the obtained baseline correlation and the corresponding first predicted correlation, the current transformation model and the current first location feature matrix are adjusted, and the step of transforming the current first location feature matrix according to the current transformation model to obtain the correlation between each two specified locations is returned to be executed until the first convergence condition is met, and a new first location feature matrix is obtained; wherein, the location feature vectors of each specified location contained in the new first location feature matrix are used to detect the transfer behavior of the person to be detected between the specified locations.
[0102] Based on the above processing, the designated locations visited by each sample member and the time each sample member spent at each designated location can be obtained, resulting in a spatiotemporal information record indicating when each sample member visited which location (i.e., the first spatiotemporal information record). Based on a sample member's first spatiotemporal information record, their transfer behavior between the designated locations can be determined. For each pair of designated locations where transfer behavior exists in each sample member's first spatiotemporal information record, the duration of the transfer between those two locations can be determined (i.e., the first transfer duration). The average first transfer duration between two designated locations represents the correlation between those two locations (i.e., the baseline correlation); the shorter the average first transfer duration between two designated locations, the higher the correlation between those two locations.
[0103] The transformation model and the first location feature matrix are adjusted so that the correlation between each pair of specified locations (i.e., the first predicted correlation) obtained by transforming the first location feature matrix according to the transformation model is closer to the baseline correlation. Accordingly, the location feature vectors of each specified location contained in the new first location feature matrix obtained when the first convergence condition is met can effectively represent the correlation between the specified locations. Furthermore, the accuracy of detecting personnel migration behavior based on the obtained location feature vectors can be improved.
[0104] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0105] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0106] Figure 1 A schematic diagram of the first process of the location feature generation method provided in the embodiments of this application;
[0107] Figure 2 A second flowchart illustrating the location feature generation method provided in this application embodiment;
[0108] Figure 3 A schematic diagram of the first process of the spatiotemporal representation model training method provided in the embodiments of this application;
[0109] Figure 4 This is a schematic diagram of a second process for training a spatiotemporal representation model provided in an embodiment of this application;
[0110] Figure 5 A schematic diagram of the third process of the spatiotemporal representation model training method provided in the embodiments of this application;
[0111] Figure 6 This is a schematic diagram of a first flowchart of the behavior detection method provided in the embodiments of this application;
[0112] Figure 7 This is a second flowchart illustrating the behavior detection method provided in the embodiments of this application;
[0113] Figure 8 This is a schematic diagram of the structure of a location feature generation device provided in an embodiment of this application;
[0114] Figure 9 A schematic diagram of the structure of a spatiotemporal representation model training device provided in an embodiment of this application;
[0115] Figure 10 This is a schematic diagram of the structure of a behavior detection device provided in an embodiment of this application;
[0116] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0117] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0118] With the advent of the big data era, data generated from people's daily activities can be collected. Based on this data, the characteristics of individuals can be analyzed to create profiles, providing support for maintaining public safety. For example, when people are active in a certain area (such as a city or a closed park), spatiotemporal information records of when and where they arrive can be obtained through cameras, GPS positioning, portable signal transmitting devices, etc., revealing their movement routes. Analyzing these routes can determine the type or intent of an individual's actions, allowing for behavioral monitoring and enriching their profile. For instance, if an individual leaves their residential area in the morning, goes to the subway station to take the subway to their workplace, and then leaves their workplace in the evening to return to the same residential area by subway, their activity type can be identified as going to work; if an individual leaves their hotel and visits several scenic spots, their activity type can be identified as tourism.
[0119] However, in analyzing pedestrian movement routes, although the coordinates of spatial nodes (i.e., locations) are usually known, the positional relationships (e.g., distance) between locations cannot effectively characterize their correlation due to limitations such as roads and terrain. For example, two subway stations may be far apart, but people are likely to move between them; while locations on and under elevated roads may be close, but people rarely move instantaneously between them. Therefore, location features determined solely by coordinates cannot effectively characterize the correlation between locations, leading to low accuracy in detecting pedestrian behavior based on these location features.
[0120] To improve the accuracy of detecting human behavior based on determined location features, embodiments of this application provide a location feature generation method. See also... Figure 1 , Figure 1A first flowchart illustrating a location feature generation method provided in this application embodiment, the method comprising:
[0121] Step S101: Obtain the first spatiotemporal information records of each sample person for each designated location.
[0122] The first spatiotemporal information record of a sample person includes the designated locations that the sample person has visited, and the time that the sample person was at each of the designated locations visited.
[0123] Step S102: For each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, determine the first transfer duration between the two designated locations for each sample person based on the time each sample person is at the two designated locations.
[0124] Step S103: Based on the first transfer time of each sample person between the two designated locations, calculate the correlation between the two designated locations as the baseline correlation.
[0125] The baseline correlation between the two designated locations was negatively correlated with the average first transfer time between the two designated locations for each sample member.
[0126] Step S104: Transform the current first location feature matrix according to the current transformation model to obtain the correlation between every two specified locations, which is used as the first predicted correlation.
[0127] The first location feature matrix contains the location feature vectors of each specified location.
[0128] Step S105: Adjust the current transformation model and the current first location feature matrix according to the difference between the obtained baseline correlation and the corresponding first prediction correlation, and return to execute step S104 until the first convergence condition is met to obtain a new first location feature matrix.
[0129] The new first location feature matrix contains location feature vectors for each designated location, which are used to detect the movement behavior of the person to be detected between the designated locations.
[0130] Based on the above processing, the designated locations visited by each sample member and the time each sample member spent at each designated location can be obtained, resulting in a spatiotemporal information record indicating when each sample member visited which location (i.e., the first spatiotemporal information record). Based on a sample member's first spatiotemporal information record, their transfer behavior between the designated locations can be determined. For each pair of designated locations where transfer behavior exists in each sample member's first spatiotemporal information record, the duration of the transfer between those two locations can be determined (i.e., the first transfer duration). The average first transfer duration between two designated locations represents the correlation between those two locations (i.e., the baseline correlation); the shorter the average first transfer duration between two designated locations, the higher the correlation between those two locations.
[0131] The transformation model and the first location feature matrix are adjusted so that the correlation between each pair of specified locations (i.e., the first predicted correlation) obtained by transforming the first location feature matrix according to the transformation model is closer to the baseline correlation. Accordingly, the location feature vectors of each specified location contained in the new first location feature matrix obtained when the first convergence condition is met can effectively represent the correlation between the specified locations. Furthermore, the accuracy of detecting personnel migration behavior based on the obtained location feature vectors can be improved.
[0132] Regarding step S101, the designated locations can be locations within the area currently requiring monitoring (referred to as the designated area). A preset number of designated locations can be selected within the designated area. For example, if the designated area is a closed industrial park, the designated locations could be warehouses, workshops, and offices within that industrial park; or, if the designated area is a city, the designated locations could be subway stations, hospitals, tourist attractions, and hotels within that city. The preset number can be determined based on actual needs and is not specifically limited.
[0133] The sample personnel can be any individuals active within the designated area, and the number of sample personnel can be determined based on actual needs without specific limitations. For each sample personnel, their movement routes within the designated area over a preset time period can be obtained using methods such as cameras, GPS positioning, or portable signal transmitting devices. For example, the preset time period can be 12 hours or 24 hours. Accordingly, based on the sample personnel's movement routes, the designated locations traversed by the sample personnel and the time the sample personnel were at each designated location can be determined, resulting in the first spatiotemporal information record of the sample personnel for each designated location. It is understood that when a sample personnel is active within the designated area, they may only pass through some of the designated locations, not necessarily all of them, and a sample personnel may pass through the same designated location at different times.
[0134] For example, a set P of locations where the activities of personnel need to be recorded can be predetermined, containing M designated locations; that is, the preset number can be M, and each designated location can be recorded in the form of a location number. Each time-space pair in the first spatiotemporal information record of sample personnel i can be represented as: , This represents the k-th time-space pair in the first spatiotemporal information record of sample person i. This indicates the time that sample person i was at a specified location, and the time can be recorded in the form of a timestamp. This indicates the designated location. In the first spatiotemporal information record of sample person i, the time and space pairs can be sorted in chronological order. Accordingly, the first spatiotemporal information record of sample person i for each designated location (also known as the spatiotemporal route sequence) can be represented as follows: K is the length of the spatiotemporal route sequence, that is, the number of time and space pairs.
[0135] Regarding step S102, based on the first spatiotemporal information record of a sample person, the transfer behavior of that sample person between the designated locations they have passed through can be determined. In the first spatiotemporal information record of the sample person, if the sample person leaves one designated location and arrives at another designated location, that is, the sample person has a transfer behavior between the two designated locations, which also indicates that there is a transfer behavior between the two designated locations. In one implementation, for the two designated locations where there is a transfer behavior in the first spatiotemporal information record of the sample person, the sample person may pass through other designated locations during the transfer behavior between the two designated locations. In another implementation, the sample person does not pass through other designated locations during the transfer behavior between the two designated locations, that is, the two designated locations are adjacent in the first spatiotemporal information record of the sample person. It is understood that a sample person can transfer between the two designated locations multiple times, and different sample persons can transfer between the two designated locations, that is, there can be multiple transfer behaviors between the two designated locations. Accordingly, multiple transfer durations can be determined for the two designated locations subsequently.
[0136] For each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, at least one sample person has a transfer behavior between the two designated locations. Based on the time a sample person is at one of the designated locations they have passed through, the arrival time and departure time of the sample person at that location can be determined. When a sample person has a transfer behavior between two designated locations, based on the time the sample person is at those two locations, the difference between the departure time from one designated location and the arrival time at the other can be determined, yielding the transfer duration (i.e., the first transfer duration) between the two locations. Correspondingly, for each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, based on the time each sample person is at those two designated locations, the first transfer duration between each sample person and the two designated locations can be determined.
[0137] Regarding step S103, the average first transfer time between two designated locations can represent the correlation between those two locations. The shorter the average first transfer time between two designated locations, the higher the correlation between them. Accordingly, based on the first transfer time of each sample person between the two designated locations, the correlation between them (i.e., the baseline correlation) can be calculated. For example, the baseline correlation can be obtained by calculating the reciprocal of the average first transfer time of each sample person between the two designated locations; or, the baseline correlation can be obtained by calculating a function with the negative value of the average first transfer time of each sample person between the two designated locations as the exponent and the natural constant as the base.
[0138] The average first transfer time for each sample member between the two specified locations can be represented as either the mean or the expected value of the first transfer time for each sample member between the two specified locations. For example, the first transfer time for each sample member between the two specified locations can be fitted to a Gamma distribution, the expression for which is as follows:
[0139]
[0140] in, The duration of the first transfer between the two designated locations is expressed as follows: The probability, This indicates the first transfer time between the two designated locations. Indicates shape parameters, Indicates the scale parameter. Indicates the offset coefficient. , ,and All are greater than 0. Based on the parameters obtained from the fitting (i.e.... , ,and Using the value of , and applying the expectation formula of the gamma distribution, calculate the expected value of the first transfer time between the two specified locations. The formula for calculating the expectation value of the gamma distribution is as follows:
[0141]
[0142] in, This represents the expected value of the first transfer time between the two specified locations. , ,and These represent the shape parameters, scale parameters, and offset coefficients obtained from the fitting, respectively.
[0143] For steps S104 and S105, initial location feature vectors for each specified location can be obtained in advance to obtain the first location feature matrix (which can be called the initial first location feature matrix) for the first transformation. For example, the initial location feature vectors for each specified location can be randomly generated, or the initial location feature vectors for each specified location can be obtained by encoding the attribute information of each specified location. An initial transformation model can also be preset to obtain the transformation model (which can be called the initial transformation model) for the first transformation.
[0144] Transforming the initial first location feature matrix according to the initial transformation model yields the correlation between every two specified locations, which serves as the first predicted correlation. For example, transforming the initial first location feature matrix according to the initial transformation model results in a matrix containing the correlation between every two specified locations, which can be called the first predicted correlation matrix (which can be represented as...). For example, if there are M specified locations, the dimension of the first prediction relevance matrix can be M×M. Each element in the first prediction relevance matrix corresponds to the first predicted relevance between every two specified locations. For example, the element in the i-th row and j-th column of the first prediction relevance matrix... Indicates a specified location and The first predicted correlation between them. The specific method for obtaining the first predicted correlation can be found in the description of calculating the first predicted correlation according to the second formula in subsequent embodiments.
[0145] For two designated locations exhibiting population migration behavior, the baseline correlation between these two locations corresponds to the first predicted correlation. The initial transformation model and the initial first location feature matrix are adjusted to reduce the difference between the obtained baseline correlation and the corresponding first predicted correlation, resulting in a new transformation model and a new first location feature matrix. For example, the baseline correlation matrix (which can be represented as...) can be determined. The difference between the baseline correlation matrix and the first predicted correlation matrix is used to adjust the initial transformation model and the initial first location feature matrix to reduce the difference between them. For example, the gradient descent algorithm can be used to adjust the initial transformation model and the initial first location feature matrix to reduce the difference between them.
[0146] The baseline correlation matrix has the same dimension as the first predicted correlation matrix. The element in the i-th row and j-th column of the baseline correlation matrix... Indicates a specified location and The baseline correlation between them. If each sample member is at a designated location. and If there is a transfer behavior, then For the designated location obtained through step S103 and The baseline correlation between them. If each sample member is at a designated location. and If there is no transfer behavior between them, then If the value is 0, then the difference between the baseline correlation matrix and the first predicted correlation matrix can be disregarded. and The difference between them. That is, the transformation model and the first location feature matrix are adjusted only based on the difference between the obtained baseline correlation and the corresponding first predicted correlation.
[0147] A new transformation model can be obtained based on the new transformation model. Transforming the new first location feature matrix using this new transformation model yields a new first predicted correlation. The difference between the baseline correlation and the corresponding new first predicted correlation allows for updating the latest transformation model and the first location feature matrix. The updated transformation model can then be used to transform the new first location feature matrix, yielding the latest first predicted correlation. This latest first predicted correlation is then used to adjust the latest transformation model and the first location feature matrix. This process continues until a first convergence condition is met. The first location feature matrix obtained when the first convergence condition is met is the new first location feature matrix. For example, the first convergence condition could be that the difference between the obtained baseline correlation and the corresponding first predicted correlation is less than a first threshold. The objective function for adjusting the transformation model and the first location feature matrix based on the difference between the obtained baseline correlation and the corresponding first predicted correlation can be expressed as:
[0148]
[0149] in, Indicates to make Minimum; Represents the mask matrix. Represents the benchmark correlation matrix. This represents the first prediction relevance matrix. The L1 norm represents the difference between the baseline correlation matrix and the first predicted correlation matrix; and The dimensions are the same, when each sample person is at a designated location. and When there is no transfer behavior or the number of transfer behaviors does not exceed the transfer count threshold, The element in the i-th row and j-th column is 0, indicating that it is not considered. and The difference between them.
[0150] Thus, upon reaching the first convergence condition, the location feature vectors of each specified location contained in the new first location feature matrix can effectively reflect the correlation between the specified locations. Subsequently, based on the location feature vectors of each specified location contained in the new first location feature matrix, the movement behavior of the person to be detected between the specified locations can be detected, thereby improving the accuracy of the detection.
[0151] In one implementation, for every two designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, a baseline correlation between the two designated locations can be calculated based on the first transfer duration between the sample personnel and those two designated locations. For example, the baseline correlation can be calculated using the following formula:
[0152]
[0153] in, This refers to the two designated locations (which can be represented as...). and The baseline correlation between them This represents the natural exponential function. This represents the average duration of the first transfer between the two designated locations for each sample member. This represents the time normalization parameter. The time normalization parameter can be determined based on... The unit of measurement settings, for example... If the unit is hours, then the time normalization parameter can be 1; If the unit is minutes, then the time normalization parameter can be 60. For example, If set to 1, then if If the baseline correlation between the two designated locations is 0.368, then the correlation coefficient between them is 0.368. The baseline correlation between the two designated locations is 0.607.
[0154] In another implementation, for each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, a baseline correlation between the two designated locations can be calculated based on the first transfer duration of each sample person between the two designated locations, combined with the number of first transfers of each sample person between the two designated locations and the distance between the two designated locations. Before step S103, the method further includes: for each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, determining the number of first transfers of each sample person between the two designated locations.
[0155] Step S103 includes: Step 1: Calculate the correlation between the two designated locations based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample person, and use this as the baseline correlation. The baseline correlation between the two designated locations is positively correlated with the first number of transfers and the distance between the two designated locations.
[0156] In this embodiment, for each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, the number of times each sample person transfers between those two designated locations (i.e., the first transfer count) can be determined, and the distance between the two designated locations can be obtained. Furthermore, based on the first transfer duration, the first transfer count, and the distance between the two designated locations, the correlation between the two designated locations can be calculated as a baseline correlation. For details, please refer to the description of calculating the baseline correlation based on the first formula in subsequent embodiments.
[0157] If the correlation between two designated locations is high, then when the locations are close together, the sample members are more likely to move between them; that is, the number of initial moves between the two locations is usually high. If the locations are close together but the number of initial moves is low, then the correlation between the two locations is low. If the correlation between the two locations is determined solely by the average duration of the initial moves, then when the locations are close together but the number of initial moves is low, the calculated correlation is high, but the accuracy of the baseline correlation between the two locations obtained in this case is not high.
[0158] To avoid this situation, a baseline correlation between the two designated locations can be determined by combining the first transfer duration between them with the number of first transfers and the distance between them. Since the baseline correlation is positively correlated with the number of first transfers and the distance between the two locations, it can reduce the correlation between two nearby locations with fewer transfers to some extent. This avoids overestimating the correlation between nearby locations with fewer transfers, thus improving the accuracy of the obtained baseline correlation. Consequently, it ensures that the subsequently obtained location feature vectors accurately reflect the correlation between the designated locations, further improving the accuracy of detecting personnel movement behavior based on the obtained location feature vectors.
[0159] In one implementation, step one includes: calculating the correlation between the two designated locations based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample person, according to a first formula, and using this as the baseline correlation. The first formula is as follows:
[0160]
[0161] This indicates the baseline correlation between the two specified locations. This represents the natural exponential function. This indicates taking the minimum value. This represents the hyperparameter of the transfer frequency. This indicates the first transfer number between the two specified locations. This indicates the distance between the two specified locations. This represents the average duration of the first transfer between the two designated locations for each sample member. This represents the time normalization parameter.
[0162] In this embodiment, the correlation between two designated locations can be calculated according to a first formula, using the first transfer duration, the first number of transfers, and the distance between the two designated locations. A correlation penalty coefficient (which can be expressed as...) can be calculated based on the first number of transfers and the distance between the two designated locations. A correlation penalty coefficient can be used to penalize the correlation calculated solely based on the average first transfer time between the two specified locations for each sample member, thus obtaining a baseline correlation between the two specified locations. The correlation penalty coefficient can be obtained using the following formula:
[0163]
[0164] in, This represents the relevance penalty coefficient. ; This represents the natural exponential function. This indicates taking the minimum value; This represents the hyperparameter of the transfer frequency. This indicates the first transfer number between the two specified locations. This represents the distance between the two specified locations. (Transfer frequency hyperparameter) Pre-set empirical values can be determined based on factors such as the length of a preset time period, the number of sample participants, and the size of a specified area. For example, the transition frequency hyperparameter... It can be positively correlated with the length of the preset time period, the number of sample participants, and the size of the specified area. Correspondingly, the first formula can also be expressed as:
[0165]
[0166] in, This refers to the two designated locations (which can be represented as...). and The baseline correlation between them This represents the natural exponential function. This represents the average duration of the first transfer between the two designated locations for each sample member. This represents the time normalization parameter.
[0167] Based on the above processing, a baseline correlation between two designated locations can be determined by combining the first transfer duration between them with the number of transfers and the distance between them. This can reduce the correlation between two designated locations that are close to each other but have few transfers. This avoids overestimating the correlation between designated locations that are close to each other but have few transfers, thus improving the accuracy of the obtained baseline correlation. Furthermore, this ensures that the subsequently obtained location feature vectors accurately reflect the correlation between the designated locations, thereby further improving the accuracy of detecting personnel transfer behavior based on the obtained location feature vectors.
[0168] In one embodiment, the transformation model includes a transformation matrix and an activation function. Step S104 includes: based on the current transformation model, transforming the current first location feature matrix according to a second formula to obtain the correlation between every two specified locations, which is used as the first predicted correlation; wherein, the second formula is as follows:
[0169]
[0170] This indicates the first predictive relevance obtained. This represents the feature matrix of the current first location. This represents the current transformation matrix. This represents the transpose of the feature matrix of the current first location. This represents the activation function.
[0171] In this embodiment, the dimension of the transformation matrix can be set according to the dimension of the first location feature vector matrix. For example, if there are M specified locations, and the location feature vector of each specified location is D-dimensional, then the dimension of the first location feature matrix can be M×D, and the dimension of the transformation matrix can be D×D. The latest first location feature matrix can be transformed using the transformation matrix in the latest transformation model according to the second formula, thus obtaining the transformation result. The obtained transformation result can then be mapped using an activation function to obtain the first predicted correlation between every two specified locations. For example, It can be (An activation function) can normalize the transformation result; correspondingly, the second formula can also be expressed as:
[0172]
[0173] Based on the above processing, the first predicted correlation between every two specified locations can be obtained by transforming the first location feature matrix according to the transformation model. This allows for adjustments to the transformation model and the first location feature matrix based on the difference between the baseline correlation and the corresponding first predicted correlation, making the correlation between every two specified locations (i.e., the first predicted correlation) more closely approximate the baseline correlation. It can be understood that adjusting the transformation model involves adjusting the transformation matrix within the transformation model. Consequently, the location feature vectors of each specified location contained in the new first location feature matrix obtained when the first convergence condition is met can effectively represent the correlation between the specified locations. Furthermore, this improves the accuracy of detecting personnel migration behavior based on the obtained location feature vectors.
[0174] In this embodiment of the application, the initial location feature vectors of each specified location can be obtained through either method one or method two to obtain the first location feature matrix (i.e., the initial first location feature matrix) for the first transformation:
[0175] In Method 1, attribute information for each specified location can be obtained. For example, the attribute information of a specified location may include: its latitude and longitude coordinates, its POI (Point of Interest) type, and its name description text. The name description text can describe the attributes of the specified location; for example, a bus stop located next to a city hospital could have the name description text "City Hospital Station"; a supermarket operated by Zhang San could have the name description text "Zhang San Supermarket". Correspondingly, the attribute information of each specified location can be input into a pre-set location feature encoder to perform structured encoding, obtaining the initial location feature vector for each specified location, i.e., obtaining the initial first location feature matrix. For example, the location feature encoder can be a Transformer model (a deep learning model). In other words, the current first location feature matrix contains location feature vectors for each specified location obtained by encoding the attribute information of each specified location using the current location feature encoder.
[0176] exist Figure 1 Based on this, see Figure 2 , Figure 2This is a second flowchart illustrating the location feature generation method provided in this application embodiment. Step S104 may include: Step S1041: Transform the current first location feature matrix according to the current transformation model to obtain the correlation between each two specified locations, which is used as the first predicted correlation; wherein, the location feature vector of each specified location contained in the current first location feature matrix is obtained by encoding the attribute information of each specified location using the current location feature encoder.
[0177] Step S105 may include: Step S1051: Adjust the current transformation model and the current location feature encoder according to the difference between the obtained baseline correlation and the corresponding first prediction correlation.
[0178] In this embodiment, a pre-set location feature encoder can be used to encode the attribute information of each specified location to obtain an initial first location feature matrix, i.e., the first location feature matrix that undergoes the first transformation. Subsequently, the transformation model and the location feature encoder can be adjusted according to the difference between the obtained baseline correlation and the corresponding first predicted correlation. Furthermore, the attribute information of each specified location can be re-encoded using the adjusted latest location feature encoder to obtain the latest first location feature matrix, i.e., the adjustment of the first location feature matrix is achieved. Thus, while ensuring that location feature vectors that effectively represent the correlation between each specified location are obtained, the obtained location feature vectors can effectively represent the attribute information of the specified locations, further ensuring improved accuracy in detecting personnel migration behavior based on the obtained location feature vectors.
[0179] In Method Two, the location feature vectors of each specified location contained in the initial first location feature matrix can be randomly generated. Thus, even without obtaining the attribute information of each specified location, a first location feature matrix after initial transformation can be obtained. This first location feature matrix can then be adjusted to obtain location feature vectors that effectively represent the correlation between the specified locations. This further ensures improved accuracy in detecting personnel movement behavior based on the obtained location feature vectors. Furthermore, since the initial location feature vectors of each specified location are randomly generated, the robustness of the adjusted location feature vectors is also improved.
[0180] Based on the same inventive concept, this application also provides a method for training a spatiotemporal representation model, see [link to relevant documentation]. Figure 3 , Figure 3 This is a schematic diagram of a first flowchart of a spatiotemporal representation model training method provided in an embodiment of this application. The method includes:
[0181] Step S301: For each sample person, based on the first spatiotemporal information record of the sample person for each designated location, obtain the feature vector of the time when the sample person is at each designated location passed by, as the first time feature vector.
[0182] The first spatiotemporal information record of a sample person includes the designated locations that the sample person has visited, and the time that the sample person was at each of the designated locations visited.
[0183] Step S302: For each designated location visited by the sample person, fuse the location feature vector of the designated location contained in the current second location feature matrix with the first time feature vector of the time when the sample person was at the designated location to obtain the spatiotemporal feature vector of the sample person for the designated location.
[0184] The second location feature matrix during the first fusion is the new first location feature matrix obtained when the first convergence condition is met, according to any location feature generation method in the above embodiments.
[0185] Step S303: Input the spatiotemporal feature vectors of the sample person for each specified location they have passed through into the spatiotemporal representation model of the initial structure to obtain the predicted time of the sample person at each specified location they have passed through, and the location prediction result representing the specified location passed by the sample person at each predicted time.
[0186] Step S304: Calculate the loss value based on the difference between the predicted time and the time when the sample person is located at each specified location they pass through, and the difference between the location prediction result and the location label of the sample person.
[0187] The location tag of the sample person indicates the designated locations visited by the sample person as included in the first spatiotemporal information record of the sample person.
[0188] Step S305: Based on the obtained loss value, adjust the parameters of the spatiotemporal representation model of the initial structure until the second convergence condition is met, and obtain the trained spatiotemporal representation model.
[0189] In this embodiment, the first spatiotemporal information records of each sample person for each designated location can be referred to the relevant description of step S101 in the above embodiments. For each sample person, based on the first spatiotemporal information records of that sample person, the feature vector of the time when the sample person is located at each designated location visited can be obtained as the first time feature vector. For example, the time when the sample person is located at each designated location visited can be encoded by a preset time encoding function to obtain the first time feature vector.
[0190] In one implementation, the preset time encoding function can be represented by a third formula. Step S301 may include: for each sample person, based on the first spatiotemporal information record of the sample person, determining the feature vector of the time of the sample person at each specified location visited by the sample person according to the third formula, as the first time feature vector.
[0191] The third formula is as follows:
[0192]
[0193] The j-th dimension of the first time feature vector represents the time that sample person I was at each specified location they passed through. This indicates the time that sample person I was at each specified location they visited. and The same, both representing the square root of the dimension of the first-time feature vector.
[0194] In this implementation, the dimension of the first-time feature vector is the same as the dimension of the location feature vector at the specified location. This sample person can be referred to as sample person I. Sample person I is present at each specified location multiple times, arranged in order of the duration of each time. This can also represent the feature value of the j-th dimension of the time that sample person I is at each specified location they have passed through, in chronological order. This represents the time that sample person I was at each specified location they visited, in chronological order. In this way, the time at each specified location visited by the sample person can be encoded to obtain the first time feature vector.
[0195] After obtaining a new first location feature matrix by any of the location feature generation methods in the above embodiments when the first convergence condition is met, the obtained first location feature matrix can be used as the initial second location feature matrix. The initial second location feature matrix is also the second location feature matrix at the time of the first fusion. Accordingly, for each specified location visited by the sample person, the location feature vector of the specified location contained in the initial second location feature matrix can be fused with the first time feature vector of the time when the sample person was at the specified location to obtain the spatiotemporal feature vector of the sample person for the specified location.
[0196] For example, a weighted sum of the location feature vector of a specified location and the first time feature vector of the time the sample person is at that specified location can be calculated. Alternatively, the location feature vector of the specified location can be concatenated with the first time feature vector of the time the sample person is at that specified location to obtain the spatiotemporal feature vector of the sample person for that specified location. For example, the first spatiotemporal information record (also called the spatiotemporal route sequence) of sample person i for each specified location is as follows: Each time-space pair contained herein can be represented as: Based on the order in which the sample personnel were located at each designated location they visited, the temporal characteristic sequence of the time spent at each designated location can be represented as follows: , This indicates the time during which the sample person was located at each of the designated locations they visited. The first time-time feature vector of each time point. Correspondingly, the location feature vector sequence for each specified location visited by the sample personnel can be represented as: , This indicates that the sample personnel were in The specified locations traversed by the represented time. Adding the time feature sequence and the location feature sequence yields a spatiotemporal feature sequence containing spatiotemporal feature vectors. Spatiotemporal feature sequences Each element in .
[0197] By inputting the spatiotemporal feature vectors of the sample person for each specified location they have passed through into the spatiotemporal representation model of the initial structure, we can obtain the predicted time when the sample person is located at each specified location they have passed through, as well as the location prediction result representing the specified location the sample person has passed through at each predicted time. For example, the location prediction result can be the probability of each specified location predicted based on the spatiotemporal feature vectors, and the specified location with the highest probability in the location prediction result is the predicted location obtained based on the spatiotemporal feature vectors.
[0198] The loss value can be calculated based on the difference between the predicted time and the time when the sample person is located at each specified location visited, as well as the difference between the location prediction result and the sample person's location label. The sample person's location label represents the specified locations visited by the sample person as contained in the sample person's first spatiotemporal information record, that is, the specified locations actually visited by the sample person.
[0199] Based on the obtained loss value, the parameters of the initial spatiotemporal representation model are adjusted to reduce the loss value until the second convergence condition is met, resulting in a trained spatiotemporal representation model. For example, the second convergence condition could be that the difference between the predicted time and the time when the sample person is located at each specified location visited, and the difference between the location prediction result and the location label of the sample person, are both less than a spatiotemporal loss threshold. For example, a pre-set model tuning algorithm, such as the backpropagation algorithm, can be used to adjust the parameters of the initial spatiotemporal representation model.
[0200] Since the initial second location feature matrix is the new first location feature matrix obtained by any location feature generation method in the above embodiments when the first convergence condition is met, and the location feature vectors of each specified location contained in the new first location feature matrix when the first convergence condition is met can effectively represent the correlation between the specified locations, a spatiotemporal feature vector can be obtained based on the location feature vector that can effectively represent the correlation between the specified locations. Correspondingly, the obtained spatiotemporal feature vector can also effectively represent the correlation between the specified locations. Furthermore, by using this spatiotemporal feature vector to train the spatiotemporal representation model, the spatiotemporal representation model can learn the ability to process this spatiotemporal feature vector. Subsequently, the trained spatiotemporal representation model can be used to process the spatiotemporal feature vector of the person to be detected in order to detect the transfer behavior of the person to be detected. This can improve the accuracy of detecting the transfer behavior of personnel based on the trained spatiotemporal representation model.
[0201] In one embodiment, in Figure 3 Based on this, see Figure 4 , Figure 4 This is a schematic diagram of a second process for training a spatiotemporal representation model provided in an embodiment of this application. The initial spatiotemporal representation model includes: a spatiotemporal sequence encoder, a linear network, and a classification network.
[0202] Step S303 includes:
[0203] Step S3031: Input the spatiotemporal feature vectors of the sample personnel for each specified location they have passed through into the spatiotemporal sequence encoder to obtain the encoding results.
[0204] Step S3032: Input the obtained encoding result into the linear network to obtain the predicted time of the sample person at each specified location they have passed through.
[0205] Step S3033: Input the obtained encoding results into the classification network to obtain the location prediction results representing the specified locations visited by the sample person at each prediction time.
[0206] In this embodiment, the spatiotemporal representation model may include a spatiotemporal sequence encoder, a linear network, and a classification network. For example, the spatiotemporal sequence encoder may be a Transformer encoder architecture or a CNN (Convolutional Neural Network). The linear network, also known as a fitting network, may be a fully connected layer. The classification network, also known as a classification head, includes a small number of fully connected layers and activation functions. The spatiotemporal feature vectors of the sample person at each specified location they have visited can be input into the spatiotemporal sequence encoder to obtain the encoding result. Then, based on the encoding result, the linear network is used to predict the time the sample person is at each specified location they have visited, obtaining the predicted time. Based on the encoding result, the classification network is used to predict the specified locations the sample person has visited at each predicted time, obtaining the location prediction result.
[0207] For example, self-supervised learning can be used to train the spatiotemporal representation model. During training, the input spatiotemporal feature sequence can be randomly masked, for example, 20% or 30% of the elements in the input spatiotemporal feature sequence can be set to zero. The spatiotemporal feature sequence is then encoded using a spatiotemporal sequence encoder, and the encoded result, also known as the route feature sequence, can be represented as... For each element in the route feature sequence The corresponding time records can be predicted using linear networks and classification networks, respectively. and spatial records This yields the predicted time and location. Subsequently, the parameters of the spatiotemporal sequence encoder can be adjusted using the backpropagation algorithm.
[0208] Based on the above processing, the spatiotemporal sequence encoder in the spatiotemporal representation model can encode the input spatiotemporal feature vector. Then, using both linear and classification networks, the time and location represented by the encoded result can be predicted. This allows the spatiotemporal sequence encoder within the spatiotemporal representation model to encode the input spatiotemporal feature vector, and the resulting encoding effectively represents the time and location features corresponding to the input spatiotemporal feature vector. Furthermore, the trained spatiotemporal sequence encoder within the spatiotemporal representation model can be used to process the spatiotemporal feature vector of the person to be detected, obtaining an encoding result that effectively represents the time and location features corresponding to the input spatiotemporal feature vector.
[0209] Furthermore, since spatiotemporal feature vectors can effectively represent the correlation between specified locations, the resulting encoding can also effectively represent the correlation between specified locations. Subsequently, by detecting the movement behavior of the personnel to be detected based on the obtained encoding results, the accuracy of detecting personnel movement behavior using the obtained encoding results can be improved.
[0210] In one embodiment, in Figure 3 Based on this, see Figure 5 , Figure 5 This is a schematic diagram of a third process for training a spatiotemporal representation model provided in an embodiment of this application. Before step S304, the method further includes:
[0211] Step S306: Based on the predicted time of the sample person at each designated location they have passed through, and the location prediction result representing the designated location the sample person has passed through at each predicted time, obtain the second spatiotemporal information record of the sample person for each designated location.
[0212] Step S307: For each pair of designated locations where personnel transfer behavior exists in the second spatiotemporal information record of each sample person, determine the second transfer duration between the two designated locations based on the predicted time of each sample person being at the two designated locations.
[0213] Step S308: Based on the second transfer time of each sample person between the two designated locations, calculate the correlation between the two designated locations to obtain the second predicted correlation.
[0214] The second predictive correlation between the two designated locations was negatively correlated with the average second transfer duration between the two designated locations for each sample person.
[0215] Step S304 includes: Step S3041: Calculate the loss value based on the difference between the prediction time and the time when the sample person is located at each specified location, the difference between the location prediction result and the location label of the sample person, and the difference between the second prediction correlation and the first prediction correlation obtained when the first convergence condition is met according to any location feature generation method in the above embodiments; wherein the determined loss value is also used to adjust the current second location feature matrix.
[0216] In this embodiment, based on the predicted times of the sample person's location at each designated location, and the location prediction results representing the designated locations the sample person passed through at each predicted time, a second spatiotemporal information record for the sample person at each designated location can be obtained. It is understood that the second spatiotemporal information record for the sample person at each designated location includes: the predicted designated locations the sample person passed through at each predicted time, and each predicted time. Step S307 can be referred to the relevant description of step S102 in the above embodiments. Step S308 can be referred to the relevant description of step S103 in the above embodiments.
[0217] Based on the differences between the predicted time and the time when the sample person is located at each specified location visited, and the differences between the location prediction result and the sample person's location label, a loss value can also be calculated by combining the second prediction relevance with the first prediction relevance obtained when the first convergence condition is met according to any of the location feature generation methods in the above embodiments. The difference between the predicted time and the time when the sample person is located at each specified location visited can be used to measure the accuracy of the encoding result output by the spatiotemporal sequence encoder for time prediction. The difference between the location prediction result and the sample person's location label can be used to measure the accuracy of the encoding result output by the spatiotemporal sequence encoder for location prediction.
[0218] The determined loss value can be used to further adjust the current second location feature matrix, i.e., update the second location feature matrix. When a location feature encoder exists, the parameters of the location feature encoder can also be adjusted based on the determined loss value to adjust the location feature vector obtained by the location feature encoder, i.e., adjust the second location feature matrix.
[0219] Since the first predicted relevance obtained by any of the location feature generation methods in the above embodiments when the first convergence condition is met can accurately reflect the relevance between the specified locations, and the difference between the second predicted relevance and the first predicted relevance obtained by any of the location feature generation methods in the above embodiments when the first convergence condition is met is used as a constraint when adjusting the current second location feature matrix, it can be ensured that the location features obtained after adjusting the second location feature matrix based on the determined loss value can still effectively reflect the relevance between the specified locations, and the accuracy of detecting personnel transfer behavior based on the obtained location feature vector can be improved.
[0220] Furthermore, the first predicted correlation obtained by any of the location feature generation methods in the above embodiments when the first convergence condition is met can effectively reflect the correlation between each specified location while avoiding interference from noise information in the acquired first spatiotemporal information records in determining the correlation between the specified locations. For example, the baseline correlation between two specified locations with few transfer behaviors in each of the first spatiotemporal information records is not accurate, i.e., there is noise information. In other words, adjusting the parameters of the location feature encoder based on the first predicted correlation obtained by any of the location feature generation methods in the above embodiments when the first convergence condition is met can also play a role in normalization and noise reduction.
[0221] Based on the same inventive concept, this application also provides a behavior detection method, see [link to relevant documentation]. Figure 6 , Figure 6 This is a schematic flowchart of a first embodiment of the behavior detection method provided in this application. The method includes:
[0222] Step S601: Obtain the third spatiotemporal information records of the person to be tested for each designated location.
[0223] The third spatiotemporal information record includes the designated locations visited by the person being tested, as well as the time the person being tested was at each of the designated locations visited.
[0224] Step S602: Based on the third spatiotemporal information record, obtain the feature vector of the time when the person to be detected is located at each specified location passed through, as the second time feature vector.
[0225] Step S603: For each designated location visited by the person to be detected, the location feature vector of the designated location contained in the third location feature matrix and the second time feature vector of the time when the person to be detected was located at the designated location are fused to obtain the spatiotemporal feature vector of the person to be detected for the designated location.
[0226] The third location feature matrix is the second location feature matrix obtained when the second convergence condition is met, according to any of the spatiotemporal representation model training methods in the above embodiments.
[0227] Step S604: Input the spatiotemporal feature vector of the person to be detected into the trained spatiotemporal sequence encoder to obtain the behavioral features of the person to be detected.
[0228] The spatiotemporal sequence encoder is obtained by training the spatiotemporal representation model (including the spatiotemporal sequence encoder) in any of the above embodiments until the second convergence condition is met.
[0229] Step S605: Based on the behavioral characteristics of the person to be tested, detect the person's movement between designated locations.
[0230] In this embodiment, third spatiotemporal information records of the person to be detected for each designated location can be obtained. Refer to the description of step S101 in the above embodiments. Refer to the description of step S301 in the above embodiments for step S602. Refer to the description of step S302 in the above embodiments for step S603. The spatiotemporal sequence encoder is obtained by training the spatiotemporal representation model (including the spatiotemporal sequence encoder) in any of the above embodiments until the second convergence condition is met. The spatiotemporal feature vector of the person to be detected is input into the trained spatiotemporal sequence encoder to obtain the behavioral features of the person to be detected.
[0231] Based on the above processing, the obtained behavioral features can effectively represent the correlation between the designated locations visited by the person being tested, the location characteristics of the designated locations visited by the person being tested, and the temporal characteristics of the time the person being tested was at the designated locations visited. Accordingly, based on the obtained behavioral features, the accuracy of detecting the person being tested's movement between designated locations can be improved.
[0232] In one embodiment, step S605 includes: Step 1: performing a pooling operation on the behavioral characteristics of the person to be tested to obtain a behavioral pattern representation of the person to be tested’s transfer behavior between designated locations.
[0233] Step 2: Based on the similarity between the behavioral pattern representation of the person to be tested and the typical behavioral pattern representation, determine the detection results of the person to be tested's transfer behavior between designated locations.
[0234] Among them, the typical behavior pattern is represented as: the cluster centers obtained by clustering the sample behavior pattern representations obtained by pooling the behavior features of each sample person; the behavior features of each sample person are the encoding results when the spatiotemporal representation model (including the spatiotemporal sequence encoder) is trained according to any of the above embodiments and the second convergence condition is reached.
[0235] In this embodiment, the behavioral features of the person to be detected can be further pooled to vectorize these features, resulting in a behavioral pattern representation of the person's movement between designated locations. For example, the pooling operation can be average pooling, max pooling, global pooling, or spatial pyramid pooling. The encoding result of training the spatiotemporal representation model (including the spatiotemporal sequence encoder) according to any of the above embodiments until the second convergence condition is met is used as the behavioral features of each sample person. Pooling the behavioral features of each sample person yields a sample behavioral pattern representation.
[0236] Clustering is performed on the behavioral pattern representations of each sample to obtain cluster centers. Based on the pre-determined type of behavioral pattern for each sample, the behavioral pattern represented by each cluster center can be determined. Since individuals with similar behavioral patterns are based on the same activity intention, their activity routes will follow similar logic and conform to certain fixed patterns; that is, the behavioral pattern representations of individuals are relatively similar. Therefore, the similarity between the behavioral pattern representation of the person to be detected and the typical behavioral pattern representation can be calculated. Based on the calculated similarity, the detection result of the person to be detected's transfer behavior between designated locations is determined. The specific method for determining the detection result can be referred to the relevant descriptions in steps 21-23 of the subsequent embodiments.
[0237] In this way, the obtained behavioral characteristics can effectively represent the correlation between the designated locations visited by the person being tested, the location characteristics of the designated locations visited by the person being tested, and the temporal characteristics of the time the person being tested was at the designated locations visited. Accordingly, the accuracy of the detection results of the person being tested's transfer behavior between designated locations based on the obtained behavioral characteristics can be improved, which can also improve the accuracy of detecting the person being tested's transfer behavior between designated locations.
[0238] In one embodiment, step 2 includes:
[0239] Step 21: Calculate the similarity between the behavioral pattern representation of the person to be tested and the representation of each typical behavioral pattern.
[0240] Step 22: In the case that there is a typical behavior pattern representation with a similarity greater than the similarity threshold, determine the behavior pattern of the transfer behavior of the person to be detected as the behavior pattern represented by the typical behavior pattern representation with the highest similarity.
[0241] Step 23: In the absence of a typical behavioral pattern representation with a similarity greater than the similarity threshold, determine that the transfer behavior of the person to be detected is abnormal.
[0242] In this embodiment, for each typical behavioral pattern representation, the similarity between the behavioral pattern representation of the person to be detected and the typical behavioral pattern representation can be calculated to obtain the similarity corresponding to the typical behavioral pattern representation. If the similarity corresponding to a typical behavioral pattern representation is greater than a similarity threshold, it means that the behavioral pattern represented by the behavioral pattern representation of the person to be detected is relatively consistent with the behavioral pattern represented by the typical behavioral pattern representation. If there is only one corresponding typical behavioral pattern representation with a similarity greater than the similarity threshold, the behavioral pattern represented by that typical behavioral pattern representation can be identified as the behavioral pattern of the person to be detected. If there are multiple corresponding typical behavioral pattern representations with a similarity greater than the similarity threshold, the behavioral pattern represented by the typical behavioral pattern representation with the highest similarity can be identified as the behavioral pattern of the person to be detected. If there is no corresponding typical behavioral pattern representation with a similarity greater than the similarity threshold, it means that the behavioral pattern of the person to be detected does not match the behavioral pattern represented by the typical behavioral pattern representation, and it is determined that the transfer behavior of the person to be detected is abnormal, and the activity of the person to be detected can be regarded as suspicious activity.
[0243] Based on the above processing, the behavioral patterns of the individuals to be tested can be determined, creating a behavioral profile. Consequently, it becomes possible to analyze the overall activity habits and trends of these individuals. Furthermore, it is possible to detect whether the behavior of the individuals to be tested is abnormal, thus enabling timely detection and early warning of abnormal or even illegal behaviors.
[0244] In one embodiment, see Figure 7 , Figure 7 This is a second flowchart illustrating the behavior detection method provided in the embodiments of this application.
[0245] Step S701: Obtain personnel movement records. That is, step S101 or step S601 in the above embodiments.
[0246] Step S702: Pre-train location feature vectors. That is, steps S102-S105 in the above embodiment.
[0247] Step S703: Perform spatiotemporal encoding to obtain a spatiotemporal feature sequence. That is, steps S301-S302 in the above embodiment.
[0248] Step S704: Self-supervised training of the spatiotemporal representation model. That is, steps S303-S304 in the above embodiments.
[0249] Step S705: Fine-tuning of the location feature vector. That is, in the above embodiment, the current second location feature matrix is adjusted based on the determined loss value.
[0250] Step S706: Obtain the behavioral pattern representation from the spatiotemporal feature sequence. That is, steps S601-S604 and step 1 in the above embodiment.
[0251] Step S707: Behavioral pattern clustering. That is, step 21 in the above embodiment.
[0252] Step S708: Behavioral profiling and abnormal behavior detection. That is, steps 22-23 in the above embodiments.
[0253] Based on the above processing, behavioral pattern profiling and suspicious behavior identification can be achieved by encoding spatiotemporal movement routes. Furthermore, the encoding results obtained by this application effectively represent the correlation (i.e., relevance) between locations and the implicit features related to location attributes. Analyzing personnel behavior patterns by constructing algorithmic models can not only quickly identify the categories of personnel behavior patterns but also promptly detect abnormal or even illegal behaviors and issue early warnings, assisting in urban or regional safety management and enabling rapid response and handling of violations. Moreover, by analyzing personnel behavior patterns, the overall activity habits and changing trends of personnel can be analyzed, thereby optimizing facility planning or public service layout, which is of great significance for urban or park management.
[0254] In the technical solution of this application, the acquisition, storage, use, processing, transmission, provision and disclosure of personnel route information are all carried out with the authorization of the personnel.
[0255] Based on the same inventive concept, this application also provides a location feature generation device, see [link to relevant documentation]. Figure 8 , Figure 8 This is a schematic diagram of a location feature generation device provided in an embodiment of this application. The device includes:
[0256] The first spatiotemporal information recording acquisition module 801 is used to acquire the first spatiotemporal information records of each sample person for each designated location; wherein, the first spatiotemporal information record of a sample person includes the designated locations that the sample person has passed through, and the time that the sample person was at each designated location passed through.
[0257] The first transfer duration determination module 802 is used to determine the first transfer duration between two designated locations for each sample person based on the time each sample person is at the two designated locations in each of the acquired first spatiotemporal information records where there is a transfer behavior between the two designated locations.
[0258] The baseline correlation calculation module 803 is used to calculate the correlation between the two designated locations based on the first transfer time of each sample person between the two designated locations, and use it as the baseline correlation; wherein, the baseline correlation between the two designated locations is negatively correlated with the average level of the first transfer time of each sample person between the two designated locations.
[0259] The first prediction correlation determination module 804 is used to transform the current first location feature matrix according to the current transformation model to obtain the correlation between each two specified locations, which is used as the first prediction correlation; wherein, the first location feature matrix contains the location feature vector of each specified location;
[0260] The matrix adjustment module 805 is used to adjust the current transformation model and the current first location feature matrix according to the difference between the obtained baseline correlation and the corresponding first predicted correlation, and trigger the first predicted correlation determination module 804 until the first convergence condition is reached to obtain a new first location feature matrix; wherein, the new first location feature matrix contains the location feature vectors of each specified location, which are used to detect the transfer behavior of the person to be detected between the specified locations.
[0261] Based on the location feature generation apparatus provided in this application embodiment, the transformation model and the first location feature matrix are adjusted so that the correlation (i.e., the first predicted correlation) between each pair of specified locations obtained by transforming the first location feature matrix according to the transformation model is closer to the baseline correlation. Accordingly, the location feature vectors of each specified location contained in the new first location feature matrix obtained when the first convergence condition is met can effectively represent the correlation between the specified locations. Furthermore, the accuracy of detecting personnel migration behavior based on the obtained location feature vectors can be improved.
[0262] In one embodiment, the apparatus further includes:
[0263] The first transfer count determination module is used to determine the first transfer count of each sample person between two designated locations for each pair of designated locations where there is personnel transfer behavior in each of the first spatiotemporal information records before calculating the correlation between the two designated locations based on the first transfer duration of each sample person between the two designated locations as the benchmark correlation.
[0264] The benchmark correlation calculation module 803 includes a benchmark correlation calculation submodule, which is used to calculate the correlation between the two designated locations based on the first transfer time, the first number of transfers, and the distance between the two designated locations for each sample person, as the benchmark correlation; wherein the benchmark correlation between the two designated locations is positively correlated with the first number of transfers and the distance between the two designated locations.
[0265] In one embodiment, the benchmark correlation calculation submodule is specifically used to calculate the correlation between the two designated locations based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample person, according to a first formula, as the benchmark correlation; wherein, the first formula is as follows:
[0266]
[0267] This indicates the baseline correlation between the two specified locations. This represents the natural exponential function. This indicates taking the minimum value. This represents the hyperparameter of the transfer frequency. This indicates the first transfer number between the two specified locations. This indicates the distance between the two specified locations. This represents the average duration of the first transfer between the two designated locations for each sample member. This represents the time normalization parameter.
[0268] In one embodiment, the transformation model includes a transformation matrix and an activation function; the first prediction relevance determination module 804 is specifically used to transform the current first location feature matrix according to a second formula based on the current transformation model, to obtain the relevance between every two specified locations, as the first prediction relevance; wherein, the second formula is as follows:
[0269]
[0270] This indicates the first predictive relevance obtained. This represents the feature matrix of the current first location. This represents the current transformation matrix. This represents the transpose of the feature matrix of the current first location. This represents the activation function.
[0271] In one embodiment, the location feature vectors of each specified location contained in the first location feature matrix during the first transformation are randomly generated.
[0272] In one embodiment, the location feature vectors of each specified location contained in the current first location feature matrix are obtained by encoding the attribute information of each specified location using the current location feature encoder;
[0273] The matrix adjustment module 805 is specifically used to adjust the current transformation model and the current location feature encoder according to the difference between the obtained baseline correlation and the corresponding first prediction correlation.
[0274] Based on the same inventive concept, this application also provides a spatiotemporal representation model training device, see [link to relevant documentation]. Figure 9 , Figure 9 This is a schematic diagram of a spatiotemporal representation model training device provided in an embodiment of this application. The device includes: a first time feature vector acquisition module 901, used to acquire, for each sample person, a feature vector of the time the sample person is at each specified location visited, based on the first spatiotemporal information record of the sample person for each specified location, as the first time feature vector; wherein, the first spatiotemporal information record of a sample person includes the specified locations visited by the sample person, and the time the sample person is at each specified location visited;
[0275] The feature vector fusion module 902 is used to fuse the location feature vector of the specified location contained in the current second location feature matrix and the first time feature vector of the time when the sample person is at the specified location for each specified location visited by the sample person, to obtain the spatiotemporal feature vector of the sample person for the specified location; wherein, the second location feature matrix when the fusion is performed for the first time is a new first location feature matrix obtained by the location feature generation method according to any of the above embodiments when the first convergence condition is met;
[0276] The spatiotemporal prediction module 903 is used to input the spatiotemporal feature vectors of the sample person for each specified location passed through into the spatiotemporal representation model of the initial structure, and obtain the predicted time of the sample person at each specified location passed through, as well as the location prediction result of the specified location passed through by the sample person at each predicted time.
[0277] The loss value calculation module 904 is used to calculate the loss value based on the difference between the predicted time and the time when the sample person is located at each specified location passed through, and the difference between the location prediction result and the location tag of the sample person; wherein, the location tag of the sample person represents the specified locations passed through by the sample person as included in the first spatiotemporal information record of the sample person.
[0278] The model parameter adjustment module 905 is used to adjust the parameters of the spatiotemporal representation model of the initial structure based on the obtained loss value until the second convergence condition is met, so as to obtain the trained spatiotemporal representation model.
[0279] Based on the spatiotemporal representation model training device provided in this application, a spatiotemporal feature vector can be obtained from a location feature vector that can effectively represent the correlation between specified locations. Correspondingly, the obtained spatiotemporal feature vector can effectively represent the correlation between specified locations. Furthermore, by training the spatiotemporal representation model using this spatiotemporal feature vector, the model can learn to process this type of spatiotemporal feature vector. Subsequently, the trained spatiotemporal representation model can be used to process the spatiotemporal feature vector of the person to be detected in order to detect the person's movement behavior. This can improve the accuracy of detecting the movement behavior of personnel based on the trained spatiotemporal representation model.
[0280] In one embodiment, the first time feature vector acquisition module is specifically used to, for each sample person, determine the time feature vector of the sample person at each specified location visited, based on the first spatiotemporal information record of the sample person, according to a third formula, as the first time feature vector; wherein, the third formula is as follows:
[0281]
[0282] The j-th dimension of the first time feature vector represents the time that sample person I was at each specified location they passed through. This indicates the time that sample person I was at each specified location they visited. and The same, both represent the square root of the dimension of the first time feature vector; the feature values of each dimension calculated from the time that the sample person I is at each specified location it passes through constitute the first time feature vector of the time that the sample person I is at each specified location it passes through.
[0283] In one embodiment, the spatiotemporal representation model of the initial structure includes: a spatiotemporal sequence encoder, a linear network, and a classification network;
[0284] The spatiotemporal prediction module 903 is specifically used to input the spatiotemporal feature vectors of the sample person for each specified location passed through into the spatiotemporal sequence encoder to obtain the encoding result; input the obtained encoding result into the linear network to obtain the predicted time of the sample person at each specified location passed through; and input the obtained encoding result into the classification network to obtain the location prediction result representing the specified location passed through by the sample person at each predicted time.
[0285] In one embodiment, the apparatus further includes:
[0286] The second spatiotemporal information recording and acquisition module is used to obtain the second spatiotemporal information record of the sample person for each specified location before calculating the loss value based on the difference between the predicted time and the time when the sample person is located at each specified location passed by, and the location prediction result representing the specified location passed by the sample person at each predicted time.
[0287] The second transfer duration determination module is used to determine the second transfer duration between two designated locations for each sample person based on the predicted time of each sample person being located at the two designated locations, for each pair of designated locations where there is a transfer behavior in the second spatiotemporal information record of each sample person.
[0288] The second predictive correlation calculation module is used to calculate the correlation between the two designated locations based on the second transfer time of each sample person between the two designated locations, and obtain the second predictive correlation; wherein, the second predictive correlation between the two designated locations is negatively correlated with the average level of the second transfer time of each sample person between the two designated locations.
[0289] The loss value calculation module 904 is specifically used to calculate the loss value based on the difference between the predicted time and the time when the sample person is located at each specified location they have passed, the difference between the location prediction result and the location label of the sample person, and the difference between the second prediction correlation and the first prediction correlation obtained by any of the location feature generation methods described in the above embodiments when the first convergence condition is met; wherein, the determined loss value is also used to adjust the current second location feature matrix.
[0290] Based on the same inventive concept, this application also provides a behavior detection device, see [link to relevant documentation]. Figure 10 , Figure 10 This is a schematic diagram of the structure of a behavior detection device provided in an embodiment of this application. The device includes: a third spatiotemporal information recording and acquisition module 1001, used to acquire third spatiotemporal information records of the person to be detected for each designated location; wherein, the third spatiotemporal information records include the designated locations visited by the person to be detected, and the time the person to be detected was at each designated location visited;
[0291] The second time feature vector acquisition module 1002 is used to acquire the feature vector of the time when the person to be detected is located at each specified location he / she passes through, based on the third spatiotemporal information record, as the second time feature vector.
[0292] The spatiotemporal fusion module 1003 is used to fuse, for each designated location visited by the person to be detected, the location feature vector of the designated location contained in the third location feature matrix and the second time feature vector of the time the person to be detected was located at the designated location, to obtain the spatiotemporal feature vector of the person to be detected for the designated location; wherein, the third location feature matrix is the second location feature matrix obtained when the spatiotemporal representation model training method described in any of the above embodiments reaches the second convergence condition;
[0293] The behavior feature determination module 1004 is used to input the spatiotemporal feature vectors of the person to be detected for each designated location they have passed through into a trained spatiotemporal sequence encoder to obtain the behavior features of the person to be detected; wherein, the spatiotemporal sequence encoder is trained based on any spatiotemporal representation model training method that includes a spatiotemporal sequence encoder in the above embodiments.
[0294] The behavior detection module 1005 is used to detect the movement behavior of the person to be detected between designated locations based on the behavioral characteristics of the person to be detected.
[0295] Based on the behavior detection device provided in this application embodiment, the obtained behavior features can effectively represent the correlation between the designated locations visited by the person to be detected, the location features of the designated locations visited by the person to be detected, and the time features of the time the person to be detected was at the designated locations visited. Accordingly, based on the obtained behavior features, the accuracy of detecting the movement behavior of the person to be detected between the designated locations can be improved.
[0296] In one embodiment, the behavior detection module 1005 includes: a behavior pattern representation determination submodule, used to perform a pooling operation on the behavior features of the person to be detected to obtain a behavior pattern representation representing the transfer behavior of the person to be detected between designated locations;
[0297] The detection result determination submodule is used to determine the detection result of the transfer behavior of the person to be detected between designated locations based on the similarity between the behavioral pattern representation and the typical behavioral pattern representation of the person to be detected; wherein, the typical behavioral pattern representation is: the cluster centers obtained by clustering the sample behavioral pattern representations obtained by pooling the behavioral features of each sample person; the behavioral features of each sample person are the encoding results obtained by training any of the spatiotemporal representation models containing spatiotemporal sequence encoders in the above embodiments when the second convergence condition is reached.
[0298] In one embodiment, the detection result determination submodule is specifically used to calculate the similarity between the behavioral pattern representation of the person to be detected and each typical behavioral pattern representation; if there is a typical behavioral pattern representation with a similarity greater than a similarity threshold, the behavioral pattern of the person to be detected's transfer behavior is determined to be the behavioral pattern represented by the typical behavioral pattern representation with the highest similarity; if there is no typical behavioral pattern representation with a similarity greater than a similarity threshold, the transfer behavior of the person to be detected is determined to be abnormal.
[0299] This application also provides an electronic device, such as... Figure 11 As shown, it includes:
[0300] Memory 1101 is used to store computer programs;
[0301] When the processor 1102 executes the program stored in the memory 1101, it implements any of the location feature generation methods, spatiotemporal representation model training methods, or behavior detection methods described in the above embodiments.
[0302] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 1102, the communication interface, and the memory 1101 communicating with each other via the communication bus.
[0303] The communication bus mentioned in the aforementioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not indicate that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned electronic device and other devices. The memory can include Random Access Memory (RAM), or Non-Volatile Memory (NVM), such as at least one disk storage device. Optionally, the memory can also be at least one storage device located remotely from the aforementioned processor.
[0304] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0305] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the location feature generation methods, spatiotemporal representation model training methods, or behavior detection methods in the above embodiments.
[0306] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the location feature generation methods, spatiotemporal representation model training methods, or behavior detection methods in the above embodiments.
[0307] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.
[0308] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0309] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, storage media, and program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0310] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method of generating a site feature, the method comprising: The method includes: Acquire the first spatiotemporal information records of each sample person for each designated location; wherein, the first spatiotemporal information record of a sample person includes the designated locations visited by the sample person, and the time the sample person was at each designated location visited; For each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, the first transfer duration between the two designated locations is determined based on the time each sample person is at those two designated locations; Based on the first transfer time of each sample person between the two designated locations, the correlation between the two designated locations is calculated as the baseline correlation; wherein, the baseline correlation between the two designated locations is negatively correlated with the average level of the first transfer time of each sample person between the two designated locations. The current first location feature matrix is transformed according to the current transformation model to obtain the correlation between each two specified locations, which is used as the first predicted correlation; wherein, the first location feature matrix contains the location feature vector of each specified location; Based on the difference between the obtained baseline correlation and the corresponding first predicted correlation, the current transformation model and the current first location feature matrix are adjusted, and the process returns to the step of transforming the current first location feature matrix according to the current transformation model to obtain the correlation between each two specified locations as the first predicted correlation, until the first convergence condition is met, resulting in a new first location feature matrix; wherein, the new first location feature matrix contains the location feature vectors of each specified location, which are used to detect the transfer behavior of the person to be detected between the specified locations.
2. The method of claim 1, wherein, Before calculating the correlation between the two designated locations based on the first transfer time of each sample person between the two designated locations, and using this as a baseline correlation, the method further includes: For each pair of designated locations where personnel transfer behavior exists in the acquired first spatiotemporal information records, determine the first number of transfers of each sample person between the two designated locations; The calculation of the correlation between the two designated locations, based on the first transfer time of each sample person between the two designated locations, as the baseline correlation, includes: The correlation between the two designated locations is calculated based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample person, and is used as the baseline correlation. The baseline correlation between the two designated locations is positively correlated with the first number of transfers and the distance between the two designated locations.
3. The method of claim 2, wherein, The step of calculating the correlation between two designated locations based on the first transfer duration, the first transfer number, and the distance between the two designated locations for each sample person, and using this as the baseline correlation, includes: Based on the first transfer duration, the first number of transfers, and the distance between the two designated locations for each sample member, the correlation between the two designated locations is calculated according to the first formula, which serves as the baseline correlation. The first formula is as follows: ; represents the benchmark correlation between the two specified locations, represents the natural exponential function, represents taking the minimum value, represents the transition frequency hyperparameter, represents the first transition number between the two specified locations, represents the distance between the two specified locations, represents the average level of the first transition duration between the two specified locations for each sample person, represents the time normalization parameter.
4. The method according to claim 1, characterized in that, The transformation model includes: transformation matrix and activation function; The step of transforming the current first location feature matrix according to the current transformation model to obtain the correlation between every two specified locations, which is used as the first predicted correlation, includes: Based on the current transformation model, the feature matrix of the first location is transformed according to the second formula to obtain the correlation between every two specified locations, which is used as the first predicted correlation; wherein, the second formula is as follows: ; This indicates the first predictive relevance obtained. This represents the feature matrix of the current first location. This represents the current transformation matrix. This represents the transpose of the feature matrix of the current first location. This represents the activation function.
5. The method according to claim 1, characterized in that, The location feature vectors of each specified location contained in the first location feature matrix during the first transformation are randomly generated.
6. The method according to claim 1, characterized in that, The current first location feature matrix contains location feature vectors for each specified location, which are obtained by encoding the attribute information of each specified location using the current location feature encoder. The step of adjusting the current transformation model and the current first location feature matrix according to the difference between the obtained baseline correlation and the corresponding first predicted correlation includes: Based on the difference between the obtained baseline correlation and the corresponding first predicted correlation, the current transformation model and the current location feature encoder are adjusted.
7. A method for training a spatiotemporal representation model, characterized in that, The method includes: For each sample person, based on the first spatiotemporal information record of the sample person for each designated location, the feature vector of the time when the sample person is at each designated location is obtained as the first time feature vector; wherein, the first spatiotemporal information record of a sample person includes the designated locations that the sample person has passed through, and the time when the sample person is at each designated location. For each designated location visited by the sample person, the location feature vector of the designated location contained in the current second location feature matrix and the first time feature vector of the time when the sample person was at the designated location are fused to obtain the spatiotemporal feature vector of the sample person for the designated location; wherein, the second location feature matrix when the first fusion is performed is the new first location feature matrix obtained when the first convergence condition is met according to the method of any one of claims 1-6. The spatiotemporal feature vectors of the sample person for each specified location they have passed through are input into the spatiotemporal representation model of the initial structure to obtain the predicted time of the sample person at each specified location they have passed through, and the location prediction result representing the specified location passed by the sample person at each predicted time. The loss value is calculated based on the difference between the predicted time and the time when the sample person is located at each specified location they have passed through, and the difference between the location prediction result and the location tag of the sample person; wherein, the location tag of the sample person represents the specified locations passed through by the sample person as included in the first spatiotemporal information record of the sample person. Based on the obtained loss value, the parameters of the spatiotemporal representation model of the initial structure are adjusted until the second convergence condition is met, and the trained spatiotemporal representation model is obtained.
8. The method according to claim 7, characterized in that, For each sample person, based on the first spatiotemporal information record of that sample person, the feature vector of the time when that sample person is located at each specified location they have passed through is obtained as the first time feature vector, including: For each sample person, based on the first spatiotemporal information record of that sample person, the feature vector of the time when that sample person is at each specified location they have passed through is determined according to the third formula, and is used as the first time feature vector; wherein, the third formula is as follows: ; The j-th dimension of the first time feature vector represents the time that sample person I was at each specified location they passed through. This indicates the time that sample person I was at each specified location they visited. and The same, both represent the square root of the dimension of the first time feature vector; the feature values of each dimension calculated from the time that the sample person I is at each specified location it passes through constitute the first time feature vector of the time that the sample person I is at each specified location it passes through.
9. The method according to claim 7 or 8, characterized in that, The spatiotemporal representation model of the initial structure includes: a spatiotemporal sequence encoder, a linear network, and a classification network; The step of inputting the spatiotemporal feature vectors of the sample person for each specified location visited into the spatiotemporal representation model of the initial structure to obtain the predicted time of the sample person at each specified location visited, and the location prediction result representing the specified location visited by the sample person at each predicted time, includes: The spatiotemporal feature vectors of the sample personnel for each designated location they have visited are input into the spatiotemporal sequence encoder to obtain the encoding results; The obtained encoding results are input into the linear network to obtain the predicted time of the sample person at each specified location they have passed through; The obtained encoding results are input into the classification network to obtain location prediction results representing the specified locations visited by the sample person at each prediction time.
10. The method according to claim 7, characterized in that, Before calculating the loss value based on the difference between the predicted time and the time the sample person was at each specified location they visited, and the difference between the location prediction result and the location label of the sample person, the method further includes: Based on the predicted time of the sample personnel at each designated location they passed through, and the location prediction results representing the designated locations the sample personnel passed through at each predicted time, a second spatiotemporal information record of the sample personnel for each designated location is obtained. For each pair of designated locations where personnel transfer behavior exists in the second spatiotemporal information records of each sample person, the second transfer duration between the two designated locations is determined based on the predicted time when each sample person is located at the two designated locations; Based on the second transfer time of each sample person between the two designated locations, the correlation between the two designated locations is calculated to obtain the second predicted correlation; wherein, the second predicted correlation between the two designated locations is negatively correlated with the average level of the second transfer time of each sample person between the two designated locations. Based on the difference between the predicted time and the time the sample person was at each specified location they visited, and the difference between the location prediction result and the sample person's location label, a loss value is calculated, including: The loss value is calculated based on the difference between the predicted time and the time when the sample person is located at each specified location, the difference between the location prediction result and the location label of the sample person, and the difference between the second prediction correlation and the first prediction correlation obtained when the first convergence condition is met according to any one of claims 1-6; wherein the determined loss value is also used to adjust the current second location feature matrix.
11. A behavior detection method, characterized in that, The method includes: Acquire third spatiotemporal information records of the person to be tested for each designated location; wherein, the third spatiotemporal information records include the designated locations visited by the person to be tested, and the time the person to be tested was at each designated location visited; Based on the third spatiotemporal information record, the feature vector of the time when the person to be detected is located at each designated location passed by is obtained as the second time feature vector; For each designated location visited by the person to be detected, the location feature vector of the designated location contained in the third location feature matrix and the second time feature vector of the time when the person to be detected was located at the designated location are fused to obtain the spatiotemporal feature vector of the person to be detected for the designated location; wherein, the third location feature matrix is the second location feature matrix obtained when the second convergence condition is met according to the method of any one of claims 7-10. The spatiotemporal feature vectors of the person to be detected for each designated location they have passed through are input into a trained spatiotemporal sequence encoder to obtain the behavioral features of the person to be detected; wherein, the spatiotemporal sequence encoder is trained based on the method described in claim 9; Based on the behavioral characteristics of the person to be tested, the movement behavior of the person to be tested between designated locations is detected.
12. The method according to claim 11, characterized in that, Based on the behavioral characteristics of the person to be detected, the movement behavior of the person to be detected between designated locations is detected, including: The behavioral characteristics of the person to be tested are pooled to obtain a behavioral pattern representation of the person to be tested’s transfer behavior between designated locations. Based on the similarity between the behavioral pattern representation of the person to be detected and the typical behavioral pattern representation, the detection result of the transfer behavior of the person to be detected between designated locations is determined; wherein, the typical behavioral pattern representation is: the cluster centers obtained by clustering the sample behavioral pattern representations obtained by pooling the behavioral features of each sample person; the behavioral features of each sample person are the encoding results obtained when the second convergence condition is met according to the method of claim 9.
13. The method according to claim 12, characterized in that, Based on the similarity between the behavioral pattern representation of the person under test and the typical behavioral pattern representation, the detection results of the person under test's transfer behavior between designated locations are determined, including: Calculate the similarity between the behavioral pattern representation of the person to be tested and the typical behavioral pattern representation; In the case where there is a typical behavior pattern representation with a similarity greater than the similarity threshold, the behavior pattern of the transfer behavior of the person to be detected is determined to be the behavior pattern represented by the typical behavior pattern representation with the highest similarity. In the absence of a typical behavioral pattern representation with a similarity greater than the similarity threshold, it is determined that the transfer behavior of the person to be detected is abnormal.
14. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-6, 7-10, or 11-13.