Group entrance and exit detection method based on binary imbalance method

Through the cluster entrance and exit detection method based on binary imbalance method, using machine learning technology and feature extraction, the accuracy and stability of cluster entrance and exit detection in the existing technology are solved, the path planning and navigation experience is improved, and the community management is provided. Strong support.

CN119312216APending Publication Date: 2025-01-14CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411376992.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The prior art has problems with accuracy and stability when detecting group entrances and exits. Especially in outdoor environments, the sensor signal is disturbed by weather, light and other factors, resulting in poor detection results. The mainstream map suppliers lack group entrance and exit information. , affecting the community's micro-scale path planning and pedestrian navigation experience.

Method used

The cluster entrance and exit detection method based on binary imbalance method is adopted. Sample construction, feature extraction and machine learning classifier (LightGBM) combined with Smote and Tomek links algorithms are used to perform oversampling and undersampling, using the structural characteristics and spatial context characteristics of the cluster. , accurately locate the cluster entrances and exits, and embed them into the community road network.

Benefits of technology

It improves the accuracy and stability of group entrance and exit detection, optimizes community micro-scale path planning and pedestrian navigation experience, provides strong technical support for community management and security monitoring, and makes up for the shortcomings of traditional methods in information acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312216A_ABST
    Figure CN119312216A_ABST
Patent Text Reader

Abstract

The invention relates to a binary imbalance method-based group entrance and exit detection method, which comprises the following steps of: 1, constructing a sample, cutting a group boundary footprint into equidistant line segments, taking a midpoint as a sample point, and marking positive and negative samples; 2, extracting internal feature data reflecting the shape, size and spatial layout attributes of the cluster; step 3, extracting external feature data of each sample point according to an association relationship between the sample point and the context of the space where the sample point is located and interaction with the pedestrian; 4, normalizing the data set of the internal features and the data set of the external features and dividing the data set into a training set and a test set; 5, oversampling the positive sample, and undersampling the negative sample; step 6, predicting a group entrance and exit; and step 7, embedding the entrance and exit of the group into the community road network. According to the method, the position information of the entrance and the exit of the group is accurately deduced and positioned by utilizing the structural characteristics and the spatial context characteristics of the group, the accuracy of micro-scale path planning of the community is improved, and the navigation experience of pedestrians is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of group entrance and exit detection, and in particular to a group entrance and exit detection method based on a binary imbalance method. Background Art

[0002] In a cluster-type closed community, residential areas are further subdivided into multiple residential clusters. These clusters are enclosed by tangible barriers as a whole, forming relatively independent parts, and are equipped with independent entrances and exits, internal roads, green space and other facilities. This design mode ensures that only authorized personnel can enter the cluster, which can effectively reduce safety hazards in the community and ensure the safety of residents. Therefore, the community's fine road network includes roads. In addition, due to the unique cluster structure of the community, the cluster entrances and exits as special nodes of the road network are crucial to the connectivity of the roads. Determining the location of the cluster entrances and exits and the roads in the community is crucial for many location-based services. However, mainstream map providers, such as Baidu and Amap, lack information on cluster entrances and exits, and the fine navigation maps of urban communities are incomplete, which seriously affects the accuracy of community micro-scale path planning and the navigation experience of pedestrians.

[0003] The cluster entrances and exits are usually presented in the form of doors. Door detection methods are mainly divided into two categories: 2D image-based methods and 3D object-based methods. 2D image-based methods mainly use the attributes of the door in the image (such as the color, size, shape, orientation, texture, etc. of the door) and the differences with the surrounding environment (such as the gap between the door and the floor and the vanishing point) to construct a feature space, and then apply a classification algorithm to determine the location of the door. However, they rely on street-level images. These methods are limited in dealing with cluster entrances and exits within the community because cluster entrances and exits are usually not as easy to observe and identify as doors on the street. 3D object-based methods are mainly inspired by the important value of 3D data in understanding the structure of indoor environments. This type of method mainly uses sensors such as lidar to obtain 3D data of indoor environments and detects doors by analyzing the data. However, for the detection of cluster entrances and exits in outdoor environments, the situation becomes much more complicated. The shapes of cluster entrances and exits are more diverse, and many structural assumptions of indoor environment doors are not suitable for the detection of cluster entrances and exits in outdoor environments. Secondly, door detection in outdoor environments also needs to consider more factors, such as weather, light, wind speed, etc. These factors will interfere with the sensor signal and affect the accuracy and stability of detection.

[0004] Therefore, it is necessary to design a group entrance and exit detection method based on the binary imbalance method to overcome the above problems. Summary of the invention

[0005] In order to avoid the above problems, a cluster entrance and exit detection method based on the binary imbalance method is provided. The structural characteristics of the cluster and the spatial context features are used to accurately derive and locate the location information of the cluster entrance and exit, improve the accuracy of community micro-scale path planning, and optimize the pedestrian navigation experience.

[0006] The present invention provides a group entrance and exit detection method based on a binary imbalance method, comprising the following steps:

[0007] Step 1: Sample construction: cut the cluster boundary footprint into equidistant line segments, take the midpoint of the line segment as the sample point, and mark the positive and negative samples;

[0008] Step 2, extracting intrinsic characteristic data of the reaction group shape, size and spatial layout attributes;

[0009] Step 3: extract the external feature data of each sample point based on the association between the sample point and its spatial context and the interaction with pedestrians;

[0010] Step 4, normalize the data sets of intrinsic features and extrinsic features and divide them into training sets and test sets;

[0011] Step 5: Use the Smote algorithm to oversample the positive samples and use the Tomek links algorithm to undersample the negative samples;

[0012] Step 6: Predict the entrance and exit of the group based on the LightGBM classifier;

[0013] Step 7: Embed the group entrances and exits into the community road network.

[0014] Preferably, the sample points corresponding to the line segments containing the actual entrances and exits in step 1 are marked as positive samples, and the remaining sample points are marked as negative samples.

[0015] Preferably, in step 2, the intrinsic features are defined for each sample point from the structural characteristics of the cluster itself, including: area, perimeter, concavity, distance to the centroid, proportion, main side length, symmetry axis, and length to the symmetry axis.

[0016] Preferably, in step 3, the external features include the number of residences, the shortest distance to the road, the average distance to the residential buildings, the shortest distance to the residential buildings, the turning angle, whether there is a road passing through, the trajectory density, the ratio of the trajectory density inside and outside the group, the magnetic flux, and the magnetic flux in each direction.

[0017] Preferably, in step 5, first, the Smote algorithm is used to oversample the positive samples to increase the number of positive samples, and the negative samples that are close to the positive samples in space in physical distance are eliminated, and the physical distance between the two samples is the shortest linear distance along the cluster footprint; then, the Tomek links algorithm is used to undersample the negative samples, and the negative samples that are close to the positive samples in feature distance are eliminated to obtain a balanced data set;

[0018] In the problem solved by this method, positive samples are minority samples and negative samples are majority samples. The specific process of generating new samples is as follows: for each minority sample x i Find the K nearest neighbors and randomly select samples x from these neighbors k , use interpolation theory to generate a new sample, the formula is: x new =x i +rand(0,1)*(x i -x k );

[0019] The Tomek links algorithm defines a pair of neighbor samples with the minimum Euclidean distance (x i , x j ), where x i Belongs to the minority class sample, x j Belong to the majority class sample, i is 1 to I, I is the number of positive samples, j is 1 to J, J is the number of negative samples; let d(x i , x j ) represents x i and x j The Euclidean distance between them; if there is a sample x k The following conditions are met: d(x i , x k ) <d(x i , x j ) or d(x j , x k ) <d(x i , x j ), then (x i , x j ) is a pair of Tomek links.

[0020] Preferably, the LightGBM classifier prediction results are evaluated using accuracy, precision, recall and f1 score.

[0021] Preferably, step 7 includes two steps: road network correction based on control points and road network shape adjustment:

[0022] 7.1 Use the entrance and exit positions of the group as control points to calibrate the road network: First, calculate the correction parameters by comparing the coordinates of the control points with the coordinates of the corresponding positions in the road network data; then, apply the calculated correction parameters to the road network data to perform coordinate transformation and adjustment on each element in the road network;

[0023] 7.2 Road network shape adjustment: First, the expansion method is used to widen the road, that is, the buffer analysis is used to convert the vector road line into the road surface, and then the skeleton grid method is used to extract the center line of the road surface; then the Douglas-Peucker simplification algorithm is used to smooth the curve.

[0024] Compared with the prior art, the present invention has the following beneficial effects: The present invention makes full use of the close relationship between community group entrances and exits and the spatial context, and provides an effective solution to the problem of incomplete or missing geographical location information of closed or semi-closed community entrances and exits. By deeply analyzing the spatial layout and entrance and exit characteristics of the community, the present invention transforms the group entrance and exit detection task into a binary classification task, and explores the morphological characteristics of the group entrances and exits and the interaction characteristics with the surrounding elements, and uses machine learning methods to identify the potential locations of the entrances and exits, providing a new idea for capturing accessible points in the community. This method not only makes up for the shortcomings of traditional methods in information acquisition, but also provides strong technical support for community management and security monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a flow chart of a group entrance and exit detection method based on a binary imbalance method according to a preferred embodiment of the present invention;

[0026] Figure 2 A study area diagram of a preferred embodiment of the present invention;

[0027] Figure 3 The top ten important features output by the LightGBM model of a preferred embodiment of the present invention;

[0028] Figure 4 This is a graph showing the entrance and exit extraction results of the C1 group in the study area according to a preferred embodiment of the present invention;

[0029] Figure 5 This is a graph showing the entrance and exit extraction results of the C2 group in the study area according to a preferred embodiment of the present invention;

[0030] Figure 6 This is a graph showing the entrance and exit extraction results of the C3 group in the study area according to a preferred embodiment of the present invention;

[0031] Figure 7 This is a graph showing the entrance and exit extraction results of the C4 group in the study area according to a preferred embodiment of the present invention;

[0032] Figure 8 is an evaluation index of different base classifiers in a preferred embodiment of the present invention;

[0033] Fig. 9 are evaluation indicators of different synthetic samples in a preferred embodiment of the present invention;

[0034] Fig.10 It is a model evaluation index for eliminating different physical distance thresholds in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0035] like Figure 1 As shown, this embodiment provides a group entrance and exit detection method based on a binary imbalance method, comprising the following steps:

[0036] Step 1: Sample construction: Cut the cluster boundary footprint into equidistant line segments, take the midpoint of the line segment as the sample point, and mark the positive and negative samples. Among them, the sample points corresponding to the line segment containing the real entrance and exit are marked as positive samples, and the remaining sample points are marked as negative samples.

[0037] In this embodiment, the edge of the cluster footprint is divided into small segments with a distance of α. The small segments can approximately represent the location of the cluster entrance and exit. The last segment with a length less than α is also regarded as a complete segment; the midpoint of each segment is selected as a sample point, and these sample points constitute the candidate location set of the main entrance. Finally, the sample points corresponding to the segment containing the real entrance and exit are marked as positive samples, and the remaining sample points are marked as negative samples.

[0038] Step 2: Extract the intrinsic features of the reaction cluster shape, size and spatial layout attributes; the intrinsic features are defined for each sample point from the cluster's own structural characteristics, including: area, perimeter, concavity, distance to the centroid, proportion, main side length, symmetry axis, and length to the symmetry axis. See Table 1 for details.

[0039] Table 1 Indicators, descriptions and schematics of intrinsic characteristics

[0040]

[0041]

[0042] Step 3: Extract the external features of each sample point based on the relationship between the sample point and its spatial context and the interaction with pedestrians; the external features include the number of residences, the shortest distance to the road, the average distance to the residential building, the shortest distance to the residential building, the turning angle, whether there is a road passing through, the trajectory density, the ratio of the trajectory density inside and outside the group, the magnetic flux, and the magnetic flux in each direction. The details are shown in Table 2.

[0043] Table 2 Indicators, descriptions and schematics of external features

[0044]

[0045]

[0046]

[0047] Step 4: In the data set, each sample is represented by a feature vector, which includes the above internal and external features. The Min-Max normalization method is used to normalize each variable in the feature vector, and the values ​​of all features are limited to the range of 0 to 1. Then the processed group data is divided into a training set and a test set according to the ratio of 5:1 of the number of groups, which are used for training and testing of the LightGBM classifier respectively. The normalization formula is as follows:

[0048]

[0049] Step 5: A hybrid sampling method is used to oversample positive samples using the Smote algorithm and undersample negative samples using the Tomeklinks algorithm.

[0050] First, the Smote algorithm is used to oversample the positive samples to increase the number of positive samples, and the negative samples that are close to the positive samples in space in physical distance are removed. The physical distance between two samples is the shortest linear distance along the cluster footprint; then, the Tomek links algorithm is used to undersample the negative samples, and the negative samples that are close to the positive samples in feature distance are removed to obtain a balanced data set;

[0051] In the problem solved by this method, positive samples are minority samples and negative samples are majority samples. The specific process of generating new samples is as follows: for each minority sample x i Find the K nearest neighbors and randomly select samples x from these neighbors k , use interpolation theory to generate a new sample, the formula is: x new =x i +rand(0,1)*(x i -x k );

[0052] The Tomek links algorithm defines a pair of neighbor samples with the minimum Euclidean distance (x i , x j ), where x i Belongs to the minority class sample, x j Belong to the majority class sample, i is 1 to I, I is the number of positive samples, j is 1 to J, J is the number of negative samples; let d(x i , x j ) represents x i and xj The Euclidean distance between them; if there is a sample x k The following conditions are met: d(x i , x k ) <d(x i , x j ) or d(x j , x k ) <d(x i , x j ), then (x i , x j ) is a pair of Tomek links.

[0053] Step 6: Predict the entrance and exit of the group based on the LightGBM classifier; by using Smote to increase the minority class samples, the classifier can better learn the characteristics and patterns of the minority class, thereby improving the recognition rate of the minority class. At the same time, the use of TomekLinks makes the boundaries of the data clearer and reduces the impact of noise and outliers on the classification results. And use accuracy, precision, recall and f1 score to evaluate the prediction results of the LightGBM classifier to ensure efficiency and accuracy.

[0054] Step 7: embed the entrance and exit of the group into the community road network. This includes two steps: road network correction based on control points and road network shape adjustment:

[0055] 7.1 Use the entrance and exit positions of the group as control points to calibrate the road network: First, by comparing the coordinates of the control points with the coordinates of the corresponding positions in the road network data, calculate the correction parameters; including translation, rotation angle, etc., which are used to adjust the position and shape of the road network data. Then, apply the calculated correction parameters to the road network data, and perform coordinate conversion and adjustment on each element in the road network (such as roads, intersections, etc.);

[0056] 7.2 Road network morphology adjustment: First, the expansion method in morphology is used to widen the road, that is, the vector road line is converted into the road surface by buffer analysis, and then the center line of the road surface is extracted by the skeleton grid method; after processing by the expansion and contraction method, some unnecessary details can be eliminated. Then the DP (Douglas-Peucker) simplification algorithm is used to smooth the bends. This algorithm can effectively reduce the complexity of the road while retaining its main morphological features.

[0057] In order to verify the effectiveness of the group entrance and exit detection method, three communities with group structures were selected as the experimental areas of this experiment, namely Contemporary International Garden (N1), Vanke City Garden Area A (N7), and Vanke City Garden Area B (N8), with a total of 36 groups.

[0058] The cluster boundaries are cut at intervals of 5m, and sample points are extracted. Then the negative samples with close physical distance or feature distance to the positive samples are eliminated. The entrance and exit positions of each cluster are determined through field measurements, and the sample points with the smallest distance to the entrance and exit are marked as positive samples, and the rest are marked as negative samples. Figure 2 As shown, they are N1 community, N7 community and N8 community respectively; and the specific situation of the experimental area is shown in Table 3.

[0059] Table 3 Overview of the study area

[0060]

[0061] The identification of group entrances and exits belongs to the traditional binary classification. In the data set, the true label of 1 indicates that the sample point is the real entrance and exit, and the label of 0 indicates that the sample point is not the entrance and exit.

[0062] A confusion matrix is ​​constructed based on the predicted categories and true value categories, and various indicators are calculated using the confusion matrix. The real entrances and exits are positive examples, and the non-entrances and exits are negative examples. The test samples are divided into four categories: TN, FN, FP, and TP, as shown in Table 4.

[0063] Table 4 Confusion matrix

[0064]

[0065] Based on the confusion matrix, the following indicators are defined.

[0066] (1) Accuracy

[0067] Accuracy is the ratio of all samples that are correctly classified. The specific definition formula is:

[0068]

[0069] (2) Accuracy

[0070] Precision is the ratio of correctly classified positive samples to all predicted positive samples. The formula is as follows:

[0071]

[0072] (3) Recall rate

[0073] Recall is the ratio of correctly classified positive samples to all positive samples. The formula is as follows:

[0074]

[0075] (4) F1 score

[0076] Precision and recall are a pair of contradictory metrics. F1 is the harmonic mean of the two, which is a comprehensive consideration of the two. The larger the value, the more balanced and better the performance of the classifier. The formula is as follows:

[0077]

[0078] In order to verify the effectiveness of the method proposed in the present invention in identifying group entrances and exits, this embodiment selects four methods, namely oversampling, undersampling, hybrid sampling and cost-sensitive learning, as baseline methods. The oversampling methods include ROS (Random Over-sampling), SmoteBoost (Synthetic Minority Over-sampling TEchnique), and ADASYN (Adaptive Synthetic Sampling); the undersampling methods include RUS (Random Under-sampling), EasyEnsemble, and BalanceCascade, while the cost-sensitive learning method is represented by AdaCost, and the hybrid sampling method is represented by SmoteENN.

[0079] In order to achieve the best performance, several important parameters are set, namely the number of synthetic samples, the number of nearest neighbors, and the physical distance threshold. The parameters are tuned by the grid search method, and the final parameter settings of the method are shown in Table 5 below; the final parameter settings of the base classifier LightGBM are shown in Table 6 below.

[0080] Table 5 Parameter settings

[0081]

[0082] Table 6 Parameter settings of base classifier LightGBM

[0083]

[0084]

[0085] LightGBM can output the importance of each feature through the model parameter feature_importance. Figure 3As shown in the figure, the top ten features are the distance to the main road of the community, the number of GPS track points, magnetic flux, the distance to the centroid, the average distance to the building's centroid, the ratio of the density of the track inside and outside the cluster, the proportion of the edge, the area, the length of the main edge, and whether it intersects with the road. The top three are all external features that quantify the relationship between the entrance and exit of the cluster and the spatial context such as roads and tracks. The fourth is the distance to the centroid of the intrinsic feature, the fifth and sixth are the characteristics associated with buildings and track density, respectively, the seventh, eighth and ninth are the intrinsic characteristics of the cluster, and the tenth is the interactive feature with the road. These 10 important features are all important features that have a strong correlation with the location of the entrance and exit of the cluster.

[0086] The results of the method of the present invention and various baseline methods are as follows Figure 4-7 , which is the entrance and exit extraction result of the group.

[0087] All baseline methods correctly identified the entrances and exits of the C1 group, but only Smote-Tomek-LightGBM, ROS, SmoteBoost, and BalanceCascade had an accuracy of 100%. ADASYN and SmoteENN identified one false entrance and exit, and RUS, EasyEnsemble, and AdaCost identified two or more false entrances and exits. When processing the data of the C1 group, the methods based on oversampling and mixed sampling performed better, while the methods based on undersampling and cost-sensitive learning had more misjudgments.

[0088] For the C2 cluster, all oversampling and mixed sampling methods correctly identified all entrances and exits. All undersampling and cost-sensitive learning-based methods also misclassified negative samples as entrances and exits. This further verifies that when processing data from different clusters, oversampling and mixed sampling-based methods are more effective than undersampling and cost-sensitive learning-based methods.

[0089] For the C3 and C4 clusters, the situation is more complicated. Both clusters have two entrances and exits, and the cluster structures are more irregular and complex than those of the C1 and C2 clusters. The method of the present invention, SmoteBoost and SmoteENN only identified one correct entrance and exit. EasyEnsemble and BalanceCascade correctly identified all entrances and exits. ROS did not identify the entrances and exits in this cluster. RUS and AdaCost identified multiple incorrect entrances and exits. It is worth noting that only Smote-Tomek-LightGBM identified all the entrances and exits of the C4 cluster, and the accuracy rate was 100%. In the C4 cluster, false positives were also found based on oversampling and hybrid sampling, which performed well at the entrances and exits of the C1-C3 clusters. When processing cluster data with complex structures and a larger number of entrances and exits, methods based on oversampling and hybrid sampling also have limitations.

[0090] Methods based on negative sampling and cost-sensitive learning will also identify samples that are close in physical distance and feature distance to the real entrance and exit as entrances and exits. This is because two samples with close physical distances have similar internal and external features. The method of the present invention eliminates negative samples that are close in physical distance and feature distance to the real entrance and exit, thereby improving recognition accuracy. Negative sampling and cost-sensitive learning methods have certain limitations in processing data with unclear category boundaries. Eliminating negative samples that are close in physical distance to the entrance and exit can further clarify the classification boundaries. Methods based on oversampling can correctly identify the locations of entrances and exits when faced with simple structural groups, but the recognition accuracy is not high when faced with more complex structural groups. This may be because for more complex structural groups, the complexity of features increases, there is more noise and interference, and simple oversampling is difficult to learn and adapt to new features and patterns.

[0091] The evaluation indicators of various methods are shown in Table 7. The STL-based method is superior to the methods based on oversampling, undersampling, mixed sampling and cost-sensitive learning in terms of accuracy, precision, recall and F1 score. The STL-based method can detect 87.50% of the entrances and exits of community groups, and the accuracy of the entrances and exits of the groups remains 100%. This shows that the location of the entrances and exits of the groups can be well inferred by using the intrinsic information and spatial context information of the groups. Embedding the entrances and exits of the groups as key nodes in the community road network can enrich the community map information and improve the pedestrians' judgment on the accessibility of community roads and the accuracy of path planning during navigation.

[0092] The method of the present invention (STL) has the highest accuracy among all the methods, exceeding 0.99. SmoteENN ranks second, and AdaCost has the lowest accuracy of 0.7384. The accuracy of the oversampling method is above 0.5, which is generally higher than that of the undersampling and cost-sensitive learning methods. The recall rates of the undersampling and cost-sensitive learning methods are both 1.0, and all the entrances and exits of the group are successfully identified, and the recall rate is higher than that of the oversampling method. This shows that oversampling increases the number of entrances and exits, so that the model can better focus on the characteristics of the entrances and exits during training, which helps to improve the model's ability to recognize entrances and exits, thereby improving the accuracy of the model. Undersampling balances the category distribution by reducing the number of non-entrances and exits, which may cause the samples of non-entrances and exits to be ignored and the information of non-entrances and exits to be weakened, thereby affecting the ability to recognize non-entrances and exits, and then affecting the recall rate. The method of the present invention has the highest accuracy, reaching 1.0, which shows that the positive samples predicted by the present invention are all real entrances and exits. Among all the oversampling-based methods, the SmoteBoost method has the lowest precision and a recall rate of 1, while ROS has the highest precision and the second highest recall rate, which shows that simply copying the entrance and exit samples on the data set of the present invention can improve the recognition accuracy of minority class samples, but the recognition ability is still weak. When synthesizing samples, SmoteBoost considers the similarity between entrance and exit features, avoids generating too many duplicate samples, improves the recognition ability of minority class samples, but the precision rate decreases slightly. Among all the undersampling-based methods, RUS has the lowest precision, because some important non-entry and exit information is discarded by random undersampling, and the minority class samples are reused, which makes the model overfit to the minority class. The precision rate of mixed sampling ranks second, and the recall rate also ranks second. Mixed sampling combines the advantages of oversampling and undersampling methods, while reducing the risks of overfitting and underfitting, and better retains the original classification information. Compared with the method of the present invention, the mixed sampling method uses Adaboost as the base classifier, and the precision rate is lower than LightGBM. Balance Cascade focuses on the application of feature similarity. Only samples that are close to the features of the entrance and exit samples can be input into the subsequent classifier. This solves the problem of undersampling information loss to a certain extent. The accuracy is improved by 0.2623 compared to RUS, which is the highest accuracy among all undersampling methods. EasyEnsemble ranks second in accuracy among undersampling methods because it focuses on ensemble learning of the model, and its generalization ability and accuracy are improved to a certain extent. AdaCost has the lowest accuracy, less than 0.1, and identifies many non-entrances and exits as entrances and exits. This may be because the classification boundary of the model is not clear, resulting in a decrease in accuracy.

[0093] Table 7 Evaluation indicators of various methods

[0094]

[0095] The f1 value of the method of the present invention is the highest, which is 26.66, 26.66, 30.83, 55.83, 44.33, 26.66, 55.83, and 12.59 percentage points higher than the other eight baseline methods respectively. In order to balance the precision and recall rate, the present invention selects the Smote-Tomek-LightGBM method. Smote increases the number of entrances and exits by oversampling, so that the classifier can better learn the internal and external features of the entrances and exits. The present invention further eliminates the noise of non-entrances and exits by negatively sampling the data through Tomk links and distance thresholds. LightGBM has good robustness while ensuring the precision rate, and has the best effect in judging the task of group entrances and exits.

[0096] In order to compare the impact of base classifiers on the group entrance and exit detection results, the present invention selects six classic classifiers including KNN (K-NearestNeighbors), SVM (Support Vector Machine), AdaBoost, RF (Random Forest), LR (LogisticRegression) and GaussianNB (Gaussian Naive Bayes) for comparison.

[0097] As shown in Table 8 and Figure 8As shown, it can be seen that LightGBM has significant advantages in indicators such as accuracy, precision and f1 score. LightGBM ranks first in accuracy, exceeding 0.99, SVM, GaussianNB, RF and AdaBoost also exceed 0.9, and KNN and LR perform the worst. This is because LightGBM uses the gradient boosting decision tree algorithm to obtain the optimal model through iterative training. During the training process, it can automatically perform feature selection and pruning, which helps to avoid overfitting and achieve higher accuracy. LightGBM achieves 1 in accuracy. This means that all instances predicted as positive samples are true entrances and exits, and there are no false positives. LightGBM is 97.56, 25.00, 33.34, 50.00, 92.68 and 78.95 percentage points higher than KNN, SVM, GaussianNB, RF, LR, and AdaBoost in accuracy, respectively, with significant advantages. In terms of f1 score, lightGBM is 88.61, 18.33, 58.55, 20.60, and 74.51 percentage points higher than KNN, SVM, GaussianNB, RF, LR, and AdaBoost, respectively, which shows that lightGBM takes into account both accuracy and recall. In terms of recall, lightGBM ranks second. Although GaussianNB and AdaBoost successfully predicted all entrances and exits, the precision is too low. The goal of the present invention is to find as many entrances and exits as possible while ensuring that the predicted entrance and exit results are as accurate as possible, that is, to improve the recall rate of the model while ensuring the accuracy and precision of the model. Therefore, on the whole, choosing LightGBM as the base classifier for the detection of group entrances and exits is the best.

[0098] Table 8 Evaluation indicators of different base classifiers

[0099]

[0100] Synthetic samples are a key step in oversampling, which can improve unbalanced data sets and increase the recognition rate of minority class samples. The number of synthetic samples is a key parameter of oversampling. In order to explore the impact of the number of synthetic samples on the classifier effect, the present invention conducts experiments with 100-1000 synthetic samples, with an interval of 50. The experimental results are shown in Figure 2. Fig. 9 As shown in the figure, when the number of synthetic samples is 350 and 400, the four evaluation indicators all reach the highest values, showing the best classification effect.

[0101] As the number of synthetic samples increases, the accuracy remains stable. The recall rate is stable between 0.8-0.9. Relatively speaking, the change in precision is large. Before the number of synthetic samples is 300, the accuracy is less than 0.75. When the number of synthetic samples is 350 and 400, the accuracy reaches the highest value of 0.82. At the same time, the f1 score also reaches a peak of 0.86. In the sample number range of 450-500, the accuracy drops significantly. Then, as the number of samples increases to 800, the accuracy begins to rise. But when the number of samples is in the range of 800-1000, the accuracy begins to drop again.

[0102] This result shows that increasing the number of synthetic samples helps alleviate the data imbalance problem. However, as the number of synthetic samples increases, some erroneous positive samples are also introduced into the training set, resulting in a decrease in classification performance. In order to reduce the number of operations while ensuring the best classification performance, the present invention sets the number of synthetic samples parameter to 350. This choice is intended to balance the classification effect and computational efficiency to achieve the best classification performance.

[0103] Eliminating negative samples with a certain physical distance from the entrance and exit can reduce the number of negative samples to a certain extent, alleviate the imbalance of the data set, and clarify the classification boundaries and improve the classification accuracy. In order to study the impact of different distance thresholds on the performance of the classifier, the present invention conducts experiments under physical distance thresholds of 0-25 meters, with an interval of 5 meters. The experimental results are shown in Figure 2. Fig.10 As shown in the figure, when the physical distance threshold is set to 10 meters, the four evaluation indicators all reach the highest value, showing the best classification effect.

[0104] In general, as the physical distance threshold increases, the four indicators are improved. When the physical distance threshold is set to 10 meters, the four evaluation indicators all reach the highest value. After that, as the physical distance increases, the four indicators show a downward trend. When the physical distance threshold is set to 5 meters, the recall rate reaches a maximum of 0.8889. When the physical distance is set to 10 meters, the accuracy rate reaches 0.9982, the precision rate reaches 1.0, the recall rate remains at 0.8889, and the f1 score reaches 0.9412, and the four indicators reach the best. When the physical distance threshold is 15 meters and 20 meters, the accuracy rate remains at 1.0, but the recall rate is reduced to 0.5556. When the physical distance threshold is 25 meters, the four indicators are the lowest. This shows that the negative samples in the data set that are close to the real entrance and exit distance will cause the category boundaries to be blurred and overlapped, affecting the classification performance. However, setting the physical distance too large will lose important information of non-entrances and exits. In order to balance these two situations, the present invention eliminates negative samples within 10 meters of the physical distance from the entrance and exit.

[0105] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A group entrance and exit detection method based on a binary imbalance method, characterized in that: The steps include: Step 1: Sample construction: cut the cluster boundary footprint into equidistant line segments, take the midpoint of the line segment as the sample point, and mark the positive and negative samples; Step 2, extracting intrinsic characteristic data of the reaction group shape, size and spatial layout attributes; Step 3: extract the external feature data of each sample point based on the association between the sample point and its spatial context and the interaction with pedestrians; Step 4, normalize the data sets of intrinsic features and extrinsic features and divide them into training sets and test sets; Step 5: Use the Smote algorithm to oversample the positive samples and use the Tomek links algorithm to undersample the negative samples; Step 6: Predict the entrance and exit of the group based on the LightGBM classifier; Step 7: Embed the group entrances and exits into the community road network.

2. The group entrance and exit detection method based on the binary imbalance method as claimed in claim 1, characterized in that: The sample points corresponding to the line segments containing the true entrances and exits in step 1 are marked as positive samples, and the remaining sample points are marked as negative samples.

3. The group entrance and exit detection method based on the binary imbalance method as claimed in claim 1, characterized in that: In step 2, the intrinsic features are defined for each sample point based on the structural characteristics of the cluster, including: area, perimeter, concavity, distance to the centroid, proportion, main side length, symmetry axis, and length to the symmetry axis.

4. The group entrance and exit detection method based on the binary imbalance method as claimed in claim 1, characterized in that: In step 3, the external features include the number of residences, the shortest distance to the road, the average distance to the residential building, the shortest distance to the residential building, the turning angle, whether there is a road passing through, the trajectory density, the ratio of the trajectory density inside and outside the group, the magnetic flux, and the magnetic flux in each direction.

5. The group entrance and exit detection method based on the binary imbalance method as claimed in claim 1, characterized in that: In step 5, first, the Smote algorithm is used to oversample the positive samples to increase the number of positive samples, and the negative samples that are close to the positive samples in space in physical distance are removed. The physical distance between two samples is the shortest linear distance along the cluster footprint; then, the Tomek links algorithm is used to undersample the negative samples, and the negative samples that are close to the positive samples in feature distance are removed to obtain a balanced data set; Among them, positive samples are minority samples, and negative samples are majority samples. The specific process of Smote algorithm to generate new samples is as follows: for each minority sample x i Find the K nearest neighbors and randomly select samples x from these neighbors k , use interpolation theory to generate a new sample, the formula is: x new =x i +rand(0,1)*(x i -x k ); The Tomek links algorithm defines a pair of neighbor samples with the minimum Euclidean distance (x i ,x j ), where x i Belongs to the minority class sample, x j Belong to the majority class sample, i is 1 to I, I is the number of positive samples, j is 1 to J, J is the number of negative samples; let d(x i ,x j ) represents x i and x j The Euclidean distance between them; if there is a sample x k The following conditions are met: d(x i ,x k ) <d(x i ,x j ) or d(x j ,x k ) <d(x i ,x j ), then (x i ,x j ) is a pair of Tomek links.

6. The group entrance and exit detection method based on the binary imbalance method as claimed in claim 1, characterized in that: The prediction results of the LightGBM classifier are evaluated using accuracy, precision, recall and f1 score.

7. The group entrance and exit detection method based on the binary imbalance method as claimed in claim 1, characterized in that: Step 7 includes two steps: road network correction based on control points and road network shape adjustment: 7.1 Use the entrance and exit positions of the group as control points to calibrate the road network: First, calculate the correction parameters by comparing the coordinates of the control points with the coordinates of the corresponding positions in the road network data; then, apply the calculated correction parameters to the road network data to perform coordinate transformation and adjustment on each element in the road network; 7.2 Road network shape adjustment: First, the expansion method is used to widen the road, that is, the buffer analysis is used to convert the vector road line into the road surface, and then the skeleton grid method is used to extract the center line of the road surface; then the Douglas-Peucker simplification algorithm is used to smooth the curve.