A method for pedestrian trajectory classification based on semi-supervised stochastic neural network
By combining the quantized minimum error entropy criterion and semi-supervised random neural networks, the problem of pedestrian trajectory classification being sensitive to noise in existing technologies is solved, achieving higher classification accuracy and noise resistance, and making it suitable for applications such as intelligent monitoring and crowd behavior analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU DIANZI UNIV
- Filing Date
- 2023-06-03
- Publication Date
- 2026-07-07
AI Technical Summary
Existing semi-supervised random neural networks are sensitive to non-Gaussian noise and large outliers in pedestrian trajectory classification, and have difficulty effectively handling complex pedestrian movement behaviors, resulting in insufficient classification accuracy.
A pedestrian trajectory classification model is constructed by combining the quantized minimum error entropy criterion with a semi-supervised random neural network and an effective online vector quantization method. By preprocessing pedestrian trajectory data and simulating noise, four trajectory patterns are established, and the quantized minimum error entropy criterion is used to replace the traditional mean square error criterion to improve classification ability.
It improves the accuracy and noise resistance of pedestrian trajectory classification, enhances the ability to handle complex pedestrian movement behaviors, and improves classification accuracy.
Smart Images

Figure CN116758629B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision, and more particularly to a method for classifying pedestrian trajectories based on a semi-supervised random neural network. Background Technology
[0002] Pedestrian trajectory classification is an important problem in the field of computer vision, aiming to classify the movement behavior of pedestrians in different scenarios. Such classification tasks have wide applications in many scenarios, such as intelligent surveillance, crowd behavior analysis, and traffic management.
[0003] The main challenge in pedestrian trajectory classification lies in the significant variability and complexity of pedestrian movement behavior across different scenarios. Pedestrians may exhibit varying speeds, directions, postures, and intentions, all of which influence the shape and characteristics of their trajectories. Furthermore, pedestrian trajectory datasets are prone to noise, which can affect classification results. Therefore, accurately classifying such complex trajectory data is a crucial research problem in this field.
[0004] Semi-supervised learning algorithms can extract knowledge from both labeled and unlabeled data, avoiding the time-consuming process of data labeling and making it more attractive. In recent years, Extreme Learning Machines (ELM) based on stochastic neural networks have been developed for semi-supervised learning. The resulting semi-supervised stochastic neural network (SSELM) incorporates Laplacian regularization into the cost function, offering advantages such as fast learning speed and good generalization performance. Then, the semi-supervised stochastic neural network is extended to the semi-supervised kernel extremum learning method. Although semi-supervised stochastic neural networks exhibit good performance, they have limitations, including sensitivity to non-Gaussian noise and large outliers under the mean squared error criterion. Summary of the Invention
[0005] Objective: To overcome the shortcomings of existing pedestrian trajectory classification techniques, this invention proposes a semi-supervised random neural network-based pedestrian trajectory classification method based on the quantized minimum error entropy criterion. This method can further improve the ability to classify pedestrian trajectories.
[0006] Technical solution: To achieve the above objectives, the present invention adopts the following technical solution:
[0007] Step 1: Construct a pedestrian trajectory dataset. Each sample in the dataset includes a unique pedestrian identifier (pedestrian ID), the pedestrian's latitude and longitude coordinates, and the corresponding timestamp.
[0008] Step 2: Preprocess the constructed pedestrian trajectory dataset. Previously, the obtained pedestrian trajectory dataset was quite disorganized, with many pedestrians not having trajectory data for 20 consecutive timestamps. Therefore, a series of preprocessing operations are needed. First, name each timestamp a frame ID. Select trajectory data from frames ID1 to ID20. Under each frame ID, there are different pedestrian IDs. Since this dataset was acquired by a camera, some pedestrians may have moved out of the camera's field of view, resulting in missing trajectory data for these pedestrians. Therefore, the trajectory data of pedestrians appearing in frame ID1 may be missing in frame ID15. These pedestrian IDs need to be removed, leaving pedestrian IDs that satisfy the condition that pedestrian trajectory data exists in frames ID1 to ID20. Arrange the remaining trajectory data according to pedestrian ID, segmenting different pedestrian IDs. The pedestrian trajectory data of the 20 frame IDs contained in each pedestrian ID is considered a mini-batch. The number of mini-batches generated depends on the number of pedestrian IDs remaining in these 20 frame IDs. Subsequently, pedestrian trajectory data from frames ID2-ID21 are selected and processed in the same way to generate new mini-batches. This process is repeated until all mini-batches are generated. These mini-batches constitute all the required pedestrian trajectory data. Twenty percent of all pedestrian trajectory data is randomly selected as the trajectories that need to be labeled, and the remaining eighty percent is used as unlabeled trajectory data.
[0009] To add noise to unlabeled trajectories: 1. Randomly select a portion of pedestrian trajectory data and add random perturbations to each pedestrian's space, such as adding a small displacement change at each time step. 2. Randomly select a portion of pedestrian trajectory data and add Gaussian noise to the pedestrian's position to simulate sensor measurement errors or modeling biases. 3. Randomly select a portion of pedestrian trajectory data, and from 20 timestamps in this portion of pedestrians, randomly select 5 timestamps and set the latitude and longitude coordinates of the pedestrians corresponding to these 5 timestamps to zero.
[0010] Step 3: Establish four pedestrian trajectory patterns: simple trajectory, cyclic trajectory, back-and-forth trajectory, and complex trajectory. In the simple trajectory pattern, the pedestrian trajectory tends to be a straight line, indicating the pedestrian is walking in a straight line. In the cyclic trajectory pattern, the pedestrian trajectory tends to be an ellipse, indicating the pedestrian changes direction midway and eventually returns to the initial position. In the back-and-forth trajectory pattern, the pedestrian trajectory tends to be two parallel straight lines, indicating the pedestrian turns around midway and walks back. In the complex trajectory pattern, the pedestrian trajectory is relatively chaotic, and the direction of the pedestrian is unclear, indicating the pedestrian is wandering aimlessly. Select the data that needs to be labeled from all pedestrian trajectories after preprocessing the dataset, and label the trajectories similar to the trajectory patterns.
[0011] Step 4: Based on the pedestrian trajectory dataset and pedestrian trajectory patterns, a classification model is constructed by combining the quantizable minimum error entropy criterion with a semi-supervised random neural network learning algorithm. At the same time, an effective online vector quantization method is used to suppress network growth and classify pedestrian trajectories.
[0012] This invention replaces the traditional mean square error (MSE) criterion with the minimum error entropy (MEE) criterion and combines it with a semi-supervised stochastic neural network algorithm. Simultaneously, it employs an effective online vector quantization method to suppress network growth, further enhancing the ability of existing semi-supervised learning models to classify pedestrian trajectories. The classification model is a classifier QMEE, in which the quantization operator D[·] has a codebook Q={q1,q2,…,q k The number of real-valued codewords K in the codebook is less than the number of labeled samples.
[0013] The cost function of QMEE is:
[0014]
[0015]
[0016] in, Let H represent the squared Frobenius norm, H be the matrix form of the hidden layer output, C and λ be the trade-off parameters, I and u be the number of labeled and unlabeled samples, and e be the number of samples. i Let I be the prediction error, Tr(·) be the trace of a matrix, and L be the Laplacian graph obtained by pairwise similarity calculation of samples based on the nearest neighbor method. Let Λ represent a Gaussian kernel with bandwidth σ, and Λ be a (l+u)×(l+u) diagonal matrix, where the first l diagonal elements are... T k =[t1-q k ,…,t l -q k ,t l+1 -q k ,…,t l+u -q k ], t l For the target output, K k Quantized into code words q k The number of bit errors, and
[0017] The beneficial effects of this invention are as follows: This invention replaces the traditional mean square error (MSE) criterion with a quantifiable minimum error entropy criterion, and combines it with a semi-supervised stochastic neural network algorithm. Simultaneously, it employs an effective online vector quantization method to suppress network growth. Compared to the traditional MSE, the minimum error entropy considers all higher-order moments, making it more effective for processing nonlinear and non-Gaussian signals. Preprocessing of the original pedestrian trajectory data avoids the impact of data drift on the classification results. The combination of the quantifiable minimum error entropy criterion and the semi-supervised stochastic neural network learning algorithm for pedestrian trajectory classification provides good noise resistance while balancing classification effectiveness and efficiency. This invention can further improve the classification ability of existing semi-supervised learning models and also improve the accuracy of pedestrian trajectory classification. Attached Figure Description
[0018] Figure 1 This is a flowchart of a pedestrian trajectory classification method. Detailed Implementation
[0019] The embodiments of the present invention will now be described in further detail with reference to the accompanying drawings.
[0020] like Figure 1 As shown, the pedestrian trajectory classification method based on semi-supervised random neural networks includes the following steps:
[0021] Step 1: Construct a pedestrian trajectory dataset. This invention uses the ETH pedestrian trajectory dataset. Each sample in the dataset includes a unique pedestrian identifier (pedestrian ID), the pedestrian's latitude and longitude coordinates, and the corresponding timestamp.
[0022] Step 2: Dataset Preprocessing. Previously obtained pedestrian trajectory datasets were quite disorganized, with many pedestrians not having trajectory data with 20 consecutive timestamps. Therefore, a series of preprocessing operations are required for the dataset.
[0023] First, assign a frame ID to each timestamp. For example, if the starting timestamp of this pedestrian trajectory dataset is 10, its frame ID is 1; if the next timestamp is 20, its frame ID is 2, and so on. Select pedestrian trajectory data from frames ID1 to ID20. Under each frame ID, there are different pedestrian IDs. For example, the pedestrian IDs under frame ID1 are 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10, while the pedestrian IDs under frame ID2 are 3, 4, 5, 6, 7, and 8. Since this dataset was acquired by a camera, some pedestrians may have moved out of the camera's field of view. Therefore, the pedestrian trajectory data for these pedestrians will be missing. Thus, pedestrian trajectory data appearing in frame ID1 may be missing in frame ID2. These missing pedestrian IDs need to be removed. The final remaining pedestrian IDs must contain pedestrian trajectory data in frames ID1-ID20. The remaining trajectory data is then sorted by pedestrian ID, and the different pedestrian IDs are segmented. The pedestrian trajectory data of the 20 frame IDs contained in each pedestrian ID is considered a mini-batch. The number of pedestrian IDs remaining in these 20 frame IDs determines the number of mini-batches generated. Subsequently, the pedestrian trajectory data of frames ID2-ID21 is selected, and the same process is performed to generate new mini-batches, and so on, until all mini-batches are generated. These mini-batches contain all the required pedestrian trajectory data.
[0024] Twenty percent of all pedestrian trajectories are randomly selected as those requiring labeling, while the remaining eighty percent are left unlabeled. Noise is added to the unlabeled trajectories as follows: 1. Randomly select a portion of the pedestrian trajectory data and add random perturbations to each pedestrian's space, such as adding a small displacement change at each time step. 2. Randomly select a portion of the pedestrian trajectory data and add Gaussian noise to the pedestrian's position to simulate sensor measurement errors or modeling biases. 3. Randomly select a portion of the pedestrian trajectory data, and from 20 timestamps in this portion, randomly select 5 timestamps and set the latitude and longitude coordinates of the pedestrians corresponding to these 5 timestamps to zero.
[0025] Step 3: Establish different trajectory patterns. After obtaining all pedestrian trajectories, four different pedestrian trajectory patterns will be established: simple trajectory pattern, cyclic trajectory pattern, back-and-forth trajectory pattern, and complex trajectory pattern. In the simple trajectory pattern, the pedestrian trajectory tends to be a straight line, indicating that the pedestrian is walking in a straight line; in the cyclic trajectory pattern, the pedestrian trajectory tends to be an ellipse, indicating that the pedestrian changes direction midway and eventually returns to the initial position; in the back-and-forth trajectory pattern, the pedestrian trajectory tends to be two parallel straight lines, indicating that the pedestrian turns around midway and walks back; in the complex trajectory pattern, the pedestrian trajectory is relatively chaotic, and the direction of the pedestrian is unclear, indicating that the pedestrian is wandering aimlessly.
[0026] After establishing the trajectory patterns, labels are added to some of the obtained pedestrian trajectories. Data requiring labeling is selected from all pedestrian trajectories after dataset preprocessing, and trajectories similar to the trajectory patterns are labeled accordingly. Specifically, pedestrian trajectories similar to simple trajectory patterns are labeled 0, those similar to cyclic trajectory patterns are labeled 1, those similar to traveling trajectory patterns are labeled 2, and those similar to complex trajectory patterns are labeled 3.
[0027] Step 4: Pedestrian Trajectory Classification. Based on all pedestrian trajectories and their different trajectory patterns, a semi-supervised random neural network-based pedestrian trajectory classification method using the quantized minimum error entropy criterion is employed to construct a classification model for classification. All pedestrian trajectories will be divided into training and test sets. The training set is used to train and optimize the model, and the test set is used to verify the model's superiority. An output of 0 indicates a simple trajectory pattern; an output of 1 indicates a cyclic trajectory pattern; an output of 2 indicates a traveling trajectory pattern; and an output of 3 indicates a complex trajectory pattern.
[0028] This invention replaces the traditional mean squared error (MSE) criterion with the minimum error entropy (MEE) criterion and combines it with a semi-supervised stochastic neural network algorithm. Simultaneously, it employs an effective online vector quantization method to suppress network growth, further enhancing the ability of existing semi-supervised learning models to classify pedestrian trajectories. This model consists of only one classifier, named QMEE. In QMEE, the quantization operator (quantizer) D[·] has a codebook Q = {q1,q2,…,q}. k The number of real-valued codewords K in the codebook is usually less than the number of labeled samples. Here, D[·] represents the function that maps the error to the codebook.
[0029] SSELM is developed based on the smoothness assumptions: (i) labeled and unlabeled samples have the same marginal distribution, and (ii) if the distance between two samples is small enough, their conditional probabilities are considered to be similar.
[0030] The cost function of SSELM can be written as:
[0031]
[0032] The dataset contains labeled and unlabeled samples l and u, and h(x) i ) is the sample x i The corresponding network output, e i For the prediction error, t i The target output is Y, where C and λ are trade-off parameters, and Y is the network output matrix. i ) is the sample x iThe output is β, where β is the output weight, and Tr(·) represents the trace of a matrix. It is a graph Laplacian obtained by pairwise similarity calculation of samples based on the nearest neighbor method. The output weight β can be analytically derived as:
[0033]
[0034] Among them I l+u It is an identity matrix. H and These are the matrix forms of the hidden layer output and the target output, respectively.
[0035] Here, U(e) is called the information potential (IP), which is a common MEE cost in information theory learning. An empirical version of the quadratic IP can be expressed as:
[0036]
[0037] Minimum Error Entropy (MEE) can be viewed as an estimate of the unknown original signal by minimizing the entropy of the random variable error, which is unknown about the error distribution. However, mean square error is very sensitive to non-Gaussian noise, relying on the Gaussianity assumption of the error distribution and only considering the second moment of the error probability density function.
[0038] The Quantization Minimum Entropy (QMEE) criterion can achieve almost the same or even better performance using fewer samples. In QMEE, the quantization operator (quantizer) D[·] has a codebook Q = {q1,q2,…,q}. k The number of real-valued codewords K in the codebook is usually less than the number of labeled samples. Here, D[·] represents the function that maps the error to the codebook. Therefore, given that each erroneous sample is quantized to the closest codeword, equation (3) can be written as:
[0039]
[0040] Where K k Quantized into code words q k The number of bit errors, l is the number of labeled data items, and
[0041] With QMEE, the cost function in equation (1) can be transformed into:
[0042]
[0043] in, Let FB denote the squared Frobenius norm, H be the matrix form of the hidden layer output, and C and λ be trade-off parameters. Tr(·) denotes the trace of a matrix, and L be the graph Laplacian obtained by pairwise similarity calculation of samples based on the nearest neighbor method. This represents a Gaussian kernel with bandwidth σ, e i It is the prediction error.
[0044] Quantization is only applied to labeled samples. The gradient of equation (5) can be used to derive β as:
[0045]
[0046] In addition, there are:
[0047]
[0048] Write equation (7) in matrix form:
[0049]
[0050] In the formula, Λ is a (l+u)×(l+u) diagonal matrix, and the first l diagonal elements T k =[t1-q k ,…,t l -q k ,t l+1 -q k ,…,t l+u -q k Rearranging equation (8), the solution for β is:
[0051]
[0052] Compared with traditional algorithms, the present invention has a significant improvement in classification accuracy. The fundamental reason is that the algorithm of the present invention has a strong ability to resist noise interference, while traditional algorithms are easily affected by noise, thus limiting their classification accuracy.
[0053] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several improvements and modifications without departing from the concept of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A pedestrian trajectory classification method based on a semi-supervised random neural network, characterized in that, Includes the following steps: Step 1: Construct a pedestrian trajectory dataset. Each sample in the dataset includes a unique pedestrian identifier (pedestrian ID), the pedestrian's latitude and longitude coordinates, and the corresponding timestamp. Step 2: Perform preprocessing operations on the constructed pedestrian trajectory dataset. The specific process is as follows: 2-1. Name each timestamp with a frame ID, select the trajectory data of frames ID1-ID20, under each frame ID there are different pedestrian IDs, and remove the pedestrian IDs with missing pedestrian trajectory data, so that the remaining pedestrian IDs satisfy that there is pedestrian trajectory data in frames ID1-ID20. 2-2. Arrange the remaining trajectory data according to pedestrian ID, divide the different pedestrian IDs, and take the pedestrian trajectory data of the twenty frame IDs contained in each pedestrian ID as a minimum batch; generate as many mini-batches as there are pedestrian IDs in these twenty frame IDs. 2-3. Select pedestrian trajectory data from frames ID2-ID21, perform the same processing as above, generate a new mini-batch, and so on, until all mini-batches are generated; these mini-batches are all pedestrian trajectory data; randomly select 20% of all pedestrian trajectory data as labeled trajectory data, and the remaining 80% as unlabeled trajectory data. 2-4. Add noise to unlabeled trajectories; The specific process of adding noise to the unlabeled trajectory is as follows: 2-4-1. Randomly select a portion of pedestrian trajectory data and add random perturbations to each pedestrian in space; 2-4-2. Randomly select a portion of pedestrian trajectory data and add Gaussian noise to the pedestrian positions to simulate the sensor's measurement error or modeling deviation; 2-4-3. Randomly select a portion of pedestrian trajectory data, randomly select five timestamps from the twenty timestamps of this portion of pedestrians, and set the latitude and longitude coordinates of the pedestrians corresponding to these five timestamps to zero; Step 3: Establish four pedestrian trajectory patterns, including simple trajectory pattern, loop trajectory pattern, outbound trajectory pattern, and complex trajectory pattern; Step 4: Based on the pedestrian trajectory dataset and pedestrian trajectory patterns, a classification model is constructed by combining the quantizable minimum error entropy criterion with a semi-supervised random neural network learning algorithm. At the same time, an online vector quantization method is used to suppress network growth and classify pedestrian trajectories.
2. The pedestrian trajectory classification method based on a semi-supervised random neural network according to claim 1, characterized in that, The four pedestrian trajectory patterns described in step three are as follows: The simple trajectory pattern indicates that the pedestrian's trajectory tends to be a straight line, suggesting that the pedestrian is moving in a straight line. The cyclic trajectory pattern indicates that the pedestrian's trajectory tends to be elliptical, suggesting that the pedestrian changes direction midway and eventually returns to the initial position; The outbound trajectory pattern is that the pedestrian trajectory tends to be two parallel straight lines, indicating that the pedestrian turned around and walked back midway. Complex trajectory patterns indicate that pedestrian trajectories are chaotic and the direction of pedestrians is unclear, suggesting that pedestrians are wandering aimlessly.
3. A pedestrian trajectory classification method based on a semi-supervised random neural network according to claim 1 or 2, characterized in that, The classification model described in step four is a classifier QMEE, in which the quantization operator... With codebook The number of real-valued codewords contained in the codebook Less than the number of labeled samples; The cost function of QMEE is: ; The output weights are : ; in, Denotes the square of the Frobenius norm. It is the matrix form of the hidden layer output. To balance the parameters, These represent the number of labeled and unlabeled samples, respectively. For prediction error, As a unit array, Represents the trace of a matrix. It is a Laplacian graph obtained by pairwise similarity calculation of samples based on the nearest neighbor method. = Indicates bandwidth is Gaussian kernel, for Diagonal matrix, front diagonal elements = , , Output as the target. Quantification into code words The number of bit errors, ,and .