User itinerary identification method and device based on neural network
By combining weak supervision and learning and clustering models, screening high -confidence samples and optimizing the loss function, the problem of short -term science and medium -sized itinerary identification and standard unity of standards is solved, and more efficient and reliable user schedule recognition has been achieved.
Patent Information
- Application Number
- CN202310380244.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2043-04-11
AI Technical Summary
The prior art is difficult to accurately identify short stroke points and form unified marking standards, resulting in hidden dangers in the data quality of user stroke identification.
Using a neural network -based user schedule recognition method, through the combination of weak supervision and learning and cluster models, the positive and negative samples of high -setting trust are screened, and the identification accuracy of the model is improved through subtraction threshold and FOCAL LOSS loss functions.
A more scientific and efficient user travel recognition has been achieved, the limitations of manual labeling are avoided, and the overall reliability and accuracy of the model is improved.
Smart Images

Figure CN117851850B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of machine learning and mobile communication technology, and in particular relates to a method and device for identifying a user's itinerary based on a neural network. Background Art
[0002] There is a problem of large amount of data in user itineraries. It is time-consuming and labor-intensive to manually identify user itineraries. In the prior art, LSTM neural networks are used to identify user itineraries based on big data, for example, identifying tourists based on user itineraries, and then realizing the statistics of the number of tourists. However, there are two aspects in the prior art: short itinerary point identification and manual labeling standards. A short itinerary is an itinerary with fewer itinerary points (less than 2 itinerary points) in the user itinerary captured by the base station. Since it is impossible to accurately obtain the travel purpose of users of this type of itinerary and this type of itinerary has a large randomness, the existing LSTM (Long Short-Term Memory) neural network cannot solve the randomness problem of short itinerary identification well, and cannot give full play to its advantages in extracting features from time series models; and the manual labeling standard is based on business definition. Since the scope of user itineraries is wide, it does not only refer to user itineraries to the destination, and it is difficult to form a unified labeling standard, resulting in hidden dangers in the quality of manually labeled data. Summary of the invention
[0003] In order to solve the shortcomings of the prior art and achieve the purpose of scientifically and efficiently identifying user itineraries, the present invention adopts the following technical solutions:
[0004] The user itinerary recognition method based on neural network includes the following steps:
[0005] Step S1: Obtain user travel data;
[0006] Step S2: Weakly supervised training: Based on the manually labeled user travel data, the first long short-term memory network (shallow LSTM network) is trained to screen out high-confidence positive and negative samples; based on the unlabeled user travel data, the clustering model K-means is trained; the confidence screening rules are constructed, and the levels are divided based on the different travel points of the users. Different levels use different confidence thresholds, and at the same time, combined with the clustering results, the positive and negative samples of the user travel category (i.e., tourists and non-tourists) are screened;
[0007] Step S3: User itinerary prediction: Based on the positive and negative samples obtained by the confidence rule, the second long short-term memory network (deep LSTM network) is trained, and the prediction results are extracted for manual verification. The user itinerary data corresponding to the corrected positive samples are used as manually labeled user itinerary data for training the first long short-term memory network (shallow LSTM network); finally, the user itinerary category is identified through the trained second long short-term memory network (deep LSTM network).
[0008] Furthermore, in step S1, the user's travel sequence data within a period of time is constructed, and feature screening is performed on it to obtain travel trajectory features and features of factors affecting the travel; the travel trajectory features and features of factors affecting the travel are used to train the first long short-term memory network, and the travel trajectory features are used to train the clustering model.
[0009] Furthermore, in step S1, the feature data contained in the user travel data is preprocessed, including the following steps:
[0010] Step S1.1: Encode the weather features into natural numbers, keep the other features as they are, and fill in missing values;
[0011] Step S1.2: Calculate the number of travel points for each travel data, which is used for weak supervision training and sample screening;
[0012] Step S1.3: To address the problem of inconsistent eigenvalue dimensions, standardize the data and unify the data dimensions.
[0013] Furthermore, in step S2, the training of the first long short-term memory network (shallow LSTM network) includes the following steps:
[0014] Step S2.1.1: Serialize the manually labeled user trip data and change the data dimension. The processed data dimension includes [total trip data volume, number of points, number of features];
[0015] Step S2.1.2: Build the first long short-term memory network (shallow LSTM network), obtain serialized manually annotated user itinerary data, and obtain the user itinerary category; the LSTM model is a neural network that has the ability to memorize long-term and short-term information, and is usually used in scenarios based on time series data for prediction. Since there is a close correlation between itinerary points in user itinerary planning, the use of LSTM can better extract the correlation features between itinerary points;
[0016] Step S2.1.3: Define a loss function, compare the predicted user trip category with the labeled user trip category, and train the first long short-term memory network (shallow LSTM network).
[0017] Furthermore, in step S2, the training of the clustering model includes the following steps:
[0018] Step S2.2.1: Obtain unlabeled user travel data;
[0019] Step S2.2.2: Define cluster center clusters based on user trip categories and generate cluster centers;
[0020] Step S2.2.3: Perform category aggregation based on the distance from the feature points corresponding to the data to the cluster center.
[0021] Furthermore, in step S2, the confidence screening rule comprises the following steps:
[0022] Step S2.3.1: positive sample screening: based on the user travel data corresponding to different travel points, using the corresponding different confidence levels as screening conditions, positive samples are screened;
[0023] Step S2.3.2: Negative sample screening; based on the negative samples predicted by the first long short-term memory network (shallow LSTM network) and the clustering model K-means, negative samples are screened.
[0024] Since there are partial deviations in the positive and negative samples identified based on the weak supervision model method, the errors of the misidentified samples will accumulate in the application model. In order to reduce the negative impact of the error accumulation, the present invention proposes a screening logic based on confidence. For positive samples, the positive samples predicted by LSTM are used for stratified screening based on the number of travel points, and different confidence thresholds are used for different travel point intervals. For negative samples, a method combining LSTM with K-means prediction results is used for screening, and mixed samples are sampled based on a specific ratio.
[0025] Further, in step S2.3.1, the user travel data whose user travel points are greater than the first travel point threshold and whose predicted probability by the first long short-term memory network (shallow LSTM network) is greater than or equal to the first positive sample threshold is used as a positive sample; the user travel data whose user travel points are less than or equal to the first travel point threshold, greater than or equal to the second travel point threshold, and whose predicted probability by the first long short-term memory network (shallow LSTM network) is greater than or equal to the second positive sample threshold is used as a positive sample; the user travel data whose user travel points are within the third travel point threshold and whose predicted probability by the first long short-term memory network (shallow LSTM network) is greater than or equal to the third positive sample threshold is used as a positive sample;
[0026] In step S2.3.2, the user travel data whose prediction probability by the first long short-term memory network (shallow LSTM network) is less than the first positive sample threshold and whose clustering model K-means predicts as a negative sample is taken as a negative sample.
[0027] Furthermore, in step S3, in order to improve the overall accuracy of the model, for the result data predicted by the second long short-term memory network (deep LSTM network), random sampling is performed on positive samples and negative samples respectively, and the sample labels are corrected by manual verification and correction. In order to reduce the negative impact of inconsistent manual labeling standards on data quality, manual labeling is performed by secondary cross-labeling, that is, the user travel data is assigned to another person for labeling. If the secondary labeled label is of the same type as the primary labeled label, the user travel data is input into the second long short-term memory network (deep LSTM network) for training, thereby completing the iterative tuning of the model.
[0028] Furthermore, the long short-term memory network includes long short-term memory LSTM units, a fully connected layer and a normalization layer connected in sequence. Since the amount of screened samples is larger, in order to better extract features, the number of long short-term memory LSTM units in the second long short-term memory network is greater than the number of long short-term memory LSTM units in the first long short-term memory network.
[0029] A user itinerary identification device based on a neural network includes a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the user itinerary identification method based on a neural network.
[0030] The advantages and beneficial effects of the present invention are:
[0031] The user itinerary identification method and device based on neural network of the present invention introduce weak supervision learning into user itinerary identification modeling, get rid of the limitation of user itinerary identification trained based on a small amount of manually labeled samples, and allow the recognition network to learn a wider range of user itinerary characteristics; compared with the prior art, in the weak supervision model prediction process, the present invention uses a method combining neural network with clustering algorithm, uses hierarchical confidence threshold screening, provides a large number of high-confidence positive and negative samples for recognition network training, and makes the input data of the recognition network more reliable; in the LSTM network training process, FocalLoss is used as the loss function, and the model accuracy is improved by adjusting the shared weights of positive and negative samples and controlling the weights of difficult and easy samples at the same time; based on the manual verification method of secondary cross-labeling, the present invention regularly performs random sampling correction on the predicted result data, ensures the randomness of the data, optimizes the data quality of the weak supervision process model, and improves the overall reliability of the application network. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a flow chart of a method in an embodiment of the present invention.
[0033] Figure 2 is a flow chart of a method in an embodiment of the present invention.
[0034] Figure 3 A schematic diagram of the structure of a shallow LSTM network in an embodiment of the present invention.
[0035] Figure 4 Schematic diagram of LSTM network in an embodiment of the present invention.
[0036] Figure 5 A schematic diagram of the structure of the K-means clustering model in an embodiment of the present invention.
[0037] Figure 6 A schematic diagram of the structure of a deep LSTM network in an embodiment of the present invention.
[0038] Figure 7 Schematic diagram of a device in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.
[0040] The user itinerary recognition method based on neural network adopts the modeling method of weakly supervised learning, such as Figure 1 As shown in the figure, it consists of a weak supervision model and a user itinerary prediction model. In the weak supervision model, a shallow LSTM model is first trained based on a small number of manually labeled samples, and a K-means (K-means clustering algorithm) model is trained using a large number of unlabeled samples. These two models are used to label a large number of unlabeled samples, and high-confidence itinerary sequence data (high-confidence positive and negative samples) are screened out through confidence screening rules as the input of the user itinerary prediction model. The user itinerary prediction model predicts user itinerary data based on a deep LSTM model. In order to improve the recognition accuracy of the model, the itinerary optimization model is used to randomly sample and manually verify the user itinerary data predicted by the weak supervision model. Then, the manually corrected user itinerary data is added to the weak supervision model as a manually labeled training data set to achieve iterative model tuning. Among them, the confidence screening rule is a confidence screening rule based on the stratification of itinerary points. The levels are divided according to the number of itinerary points, and different levels use different confidence thresholds to screen positive and negative samples.
[0041] The weakly supervised model training consists of two sub-models, namely the shallow LSTM model and the K-means model. The main goal of the shallow LSTM model is to screen high-confidence positive and negative samples. This model is essentially a binary classification model, and the data used is manually labeled travel data. The main goal of the K-means model is to assist in screening high-confidence negative samples. It uses unlabeled travel for training and defines the positive and negative sample label types in combination with the labels predicted by the model in the manually labeled test set.
[0042] The weak supervision model training task is defined as follows: define a labeled sample dataset X1 and an unlabeled sample dataset X2. The goal of the weak supervision model task is to use X1 as input for the shallow LSTM algorithm to train the model M1; use X2 as input for the K-means algorithm to train the model M2; and i =(r i 1 ,r i 2 ,...,r i j ), when the models M1 and M2 are used for joint prediction and labeling, and the confidence screening rules are met, r i Add the tourist itinerary prediction model as input sample data set Remember i is the trip sequence r i The labeling result (y i ∈{0,1}).
[0043] like Figure 2 As shown, the user itinerary identification method specifically includes the following steps:
[0044] Step S1: Obtain user travel data; construct the user's travel sequence data within a period of time, and perform feature screening on it to obtain travel trajectory features and travel factor features;
[0045] In the embodiment of the present invention, the user's full itinerary is analyzed based on mobile phone signaling, and the user's residence and the travel points with a longer stay time are matched by mobile phone signaling. The residence is used as the starting and ending points to construct the user's itinerary sequence data within a period of time. Among them, in order to ensure the uniformity of the sequence length, after data statistical analysis, the features of 10 travel points of the user are intercepted / filled as data input, the number of features of each travel point is 23, and the total number of features is 230, which are arranged in ascending order in time sequence. Feature screening, the trajectory features such as the POI type (Point Of Information, information point, refers to the geographical entity of interest to people), longitude and latitude, distance from the residence and workplace, and length of stay are selected as the main features, and the features of factors affecting tourism such as weather, temperature, and wind are screened. When training the LSTM model and the K-means model, different types of features are selected respectively. Considering that the LSTM model has strong feature extraction capabilities and can extract more nonlinear features, according to business experience, the model inputs more features that affect the user's itinerary direction; the K-means model cannot extract deep feature associations, so it mainly uses features such as the user's location and time. The specific feature usage is shown in the following table (taking a single trip point feature as an example):
[0046]
[0047] Feature data preprocessing includes the following steps:
[0048] Step S1.1: Encode the weather features into natural numbers, keep the rest of the features as they are, and fill in the missing values.
[0049] Step S1.2: Calculate the number of travel points for each travel data (for data with less than 10 travel points, the missing parts are filled with 0 values) for sample screening in the weak supervision model training stage.
[0050] Step S1.3: To address the problem of inconsistent eigenvalue dimensions, standardize the data and unify the data dimensions.
[0051] Step S2: Weakly supervised training: Based on the manually labeled user travel data, the first long short-term memory network (shallow LSTM network) is trained to screen out high-confidence positive and negative samples; based on the unlabeled user travel data, the clustering model K-means is trained; the confidence screening rules are constructed, and the levels are divided based on the different travel points of the users. Different levels use different confidence thresholds, and at the same time, combined with the clustering results, the positive and negative samples of the user travel category (i.e., tourists and non-tourists) are screened;
[0052] Due to the complexity, high cost and difficulty in obtaining the annotation method, the model trained with a small number of samples has greater randomness, low user feature coverage and large errors in model prediction results. The present invention adopts a weakly supervised model training method, inputs the manually annotated itinerary data into the LSTM algorithm for training, combines the K-means algorithm, uses the trained model to make predictions on a large amount of unlabeled data, and based on the confidence screening logic, screens positive and negative samples with higher confidence for training and finally uses them in the tourist itinerary recognition application model.
[0053] The first long short-term memory network (shallow LSTM network) training, such as Figure 3 As shown, the following steps are included:
[0054] Step S2.1.1: Serialize the manually labeled user trip data and change the data dimension. The processed data dimension includes [total trip data volume, number of points, number of features];
[0055] Step S2.1.2: Construct the first long short-term memory network (shallow LSTM network), including sequentially connected long short-term memory LSTM units, fully connected layers and normalization layers, obtain serialized manually labeled user travel data, and obtain user travel categories; the LSTM model is a neural network with the ability to memorize long-term and short-term information, and is usually used in scenarios based on time series data for prediction. Since there is a close correlation between travel points in user travel planning, the use of LSTM can better extract the correlation features between travel points; the LSTM network adopts a chain structure, consisting of a series of LSTM units (LSTM Unit), and each time slice uses the same parameters.
[0056] The LSTM model transmits two pieces of information backward in the time dimension, namely C t and h t (the subscript t represents time), which respectively represent the LSTM unit state and the hidden state. The former is transmitted along the time axis in a channel with less attenuation and stores long-term memory information; the hidden state is obtained by the LSTM unit after passing through a neuron and the output gate, so it stores short-term memory information. Represents the updated value of the LSTM cell state, which is used to select the cell state C added to the current moment t information.
[0057] In order to realize the memory and screening of long-term and short-term information by LSTM, LSTM is implemented through three gate structures: input gate (i t ), forget gate (f t ), output gate (o t ), the input gate determines the new input information x t and h t-1 Which information in C will be retained; the forget gate determines t-1 Which information will be discarded? The output gate filters the updated value of LSTM Add to the current cell state C t middle.
[0058] like Figure 4 As shown, the calculation method of the chain structure forward propagation process is as follows:
[0059]
[0060] Input Gate:
[0061] i t =σ(W i ·[h t ,x t ]+b i )
[0062] LSTM cell update value:
[0063]
[0064] Forget Gate:
[0065] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0066] To calculate the predicted value To generate the complete input for the next time slice, we need to calculate the output h of the hidden node t :
[0067] h t =o t *tanh(C t )
[0068] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0069] Among them, parameters W and b are LSTM calculation parameters and bias values, a total of 4 groups, parameter W i and b i Represents the input gate parameters and bias values; parameter W f and b f Represents the forget gate parameters and bias values; parameter W c and b c Represents LSTM cell state parameters and bias values; parameter W o and b o Represents the output gate parameters and bias values; the parameters in each structure are relatively independent and not shared. The back propagation algorithm BPTT is used to update the parameters. σ represents the fully connected layer with an activation function.
[0070] Step S2.1.3: Define the loss function, compare the predicted user trip category with the labeled user trip category, and train the first long short-term memory network (shallow LSTM network). In this embodiment of the present invention, Focal Loss is used as the loss function, combined with historical trip sequence data modeling. The Focal Loss function is a loss function that is effective in solving the problem of imbalance between positive and negative samples. This function introduces the parameter α tAnd the modulation coefficient γ adjusts the shared weights of positive and negative samples, while controlling the weights of difficult and easy samples to improve model accuracy. The Focal loss function calculation method is as follows:
[0071] FL(p t )=-α t (1-p t ) γ log(p t )
[0072]
[0073]
[0074] Among them, α is used to control the importance of positive sample loss relative to negative sample loss. The larger α is, the more important the positive sample loss is and the less important the negative sample loss is. t It represents the distance between the probability p of predicting a positive sample and the label y of the sample (i.e., the learning difficulty. The larger the distance, the more difficult it is to learn the sample. Therefore, the importance of the loss of the sample is increased. The modulation coefficient γ scales the distance. Different importance is given to the loss of different samples based on the learning difficulty. The larger the γ, the more important the loss of difficult samples is, and the less important the loss of easy samples is. y represents the sample label, 1 represents a positive sample, and 0 represents a negative sample.
[0075] Since the data type of user behavior trajectory obtained through the base station is huge, the number of user trips accounts for a low proportion, and there is an imbalance in the ratio of positive and negative samples in the data, the trained model recognizes a high number of user trip samples and a low accuracy rate, which affects the number of tourists. The present invention proposes an LSTM model based on Focal Loss, introduces Focal Loss, adjusts the shared weights of positive and negative samples, and controls the weights of difficult and easy samples to improve the model accuracy.
[0076] Training of the clustering algorithm K-means, such as Figure 5 As shown, the following steps are included:
[0077] Step S2.2.1: Obtain unlabeled user travel data;
[0078] Step S2.2.2: defining cluster center clusters based on user itinerary categories and generating cluster centers; in the embodiment of the present invention, the defined cluster center clusters k=6;
[0079] Step S2.2.3: Perform category aggregation based on the distance from the feature points corresponding to the data to the cluster center; in the embodiment of the present invention, the feature points corresponding to the data are divided into the class corresponding to the cluster center with the smallest distance until the model converges.
[0080] In order to better control the sample quality and ensure the randomness of the samples, the present invention adopts K-means clustering as an auxiliary screening of negative samples, and generates negative samples for application model training by randomly sampling the screened negative samples.
[0081] K-means clustering calculates similarity based on Euclidean distance, so the input data needs to be flattened to obtain flattened feature data, and then category aggregation is performed based on the distance from the feature point corresponding to the flattened feature data to the cluster center.
[0082] Specifically, K-means clustering initializes k center clusters, calculates the distance between the sample point and each center cluster, and divides it into the class corresponding to the cluster center with the smallest distance. That is, the random center point input to the K-means clustering initialization data is a=(a1,a2,...,a k ), for each sample x in the data set i Calculate its distance to the k cluster centers and assign it to the class corresponding to the cluster center with the smallest distance. j , j≤k, recalculate its cluster center, and iterate until the model converges. The algorithm for calculating the cluster center is:
[0083]
[0084] Among them, |c j | represents the number of samples contained in the jth cluster, x i Represents the sample set c of clustering j The i-th sample in .
[0085] The confidence screening rule includes the following steps:
[0086] Step S2.3.1: positive sample screening: based on the user travel data corresponding to different travel points, using the corresponding different confidence levels as screening conditions, positive samples are screened;
[0087] The user trip data whose user trip points are greater than the first trip point threshold and whose predicted probability by the shallow long short-term memory (LSTM) network is greater than or equal to the first positive sample threshold is regarded as a positive sample;
[0088] The user trip data whose user trip points are less than or equal to the first trip point threshold, greater than or equal to the second trip point threshold, and whose shallow long short-term memory LSTM network prediction probability is greater than or equal to the second positive sample threshold, are regarded as positive samples;
[0089] The user travel data whose user travel points are within the third travel point threshold and whose shallow long short-term memory (LSTM) network predicted probability is greater than or equal to the third positive sample threshold is taken as a positive sample.
[0090] In the embodiment of the present invention, the positive sample screening process is as follows: different confidence levels are used as screening conditions for data corresponding to different travel points. For data with travel points greater than 3, data with a positive sample prediction probability greater than or equal to 0.5 are screened; for data with travel points between 2 and 3, data with a positive sample prediction probability greater than or equal to 0.95 are screened; for data with travel points equal to 1, data with a positive sample prediction probability greater than or equal to 0.99 are screened as positive samples.
[0091] Step S2.3.2: Negative sample screening: based on the prediction of the shallow long short-term memory (LSTM) network and the negative samples predicted by the clustering algorithm K-means, negative samples are screened;
[0092] The user travel data whose prediction probability of the shallow long short-term memory (LSTM) network is less than the first positive sample threshold and whose clustering algorithm K-means predicts as a negative sample is taken as a negative sample.
[0093] Since there are partial deviations in the positive and negative samples identified based on the weak supervision model method, the errors of the misidentified samples will accumulate in the application model. In order to reduce the negative impact of the error accumulation, the present invention proposes a screening logic based on confidence. For positive samples, the positive samples predicted by LSTM are used for stratified screening based on the number of travel points, and different confidence thresholds are used for different travel point intervals. For negative samples, a method combining LSTM with K-means prediction results is used for screening, and mixed samples are sampled based on a specific ratio.
[0094] In the embodiment of the present invention, the negative sample screening process: using the K-means clustering algorithm, combined with the LSTM prediction results, the negative samples after random sampling are screened at a ratio of 1:6 between positive and negative samples, to further improve the reliability of the model for annotation. The confidence screening rule calculation method is as follows:
[0095]
[0096] where prob(M1(r i )) represents the model M1 predicting sequence sample r i is the probability value of the positive sample; M2(r i ) represents the model M2 predicting sequence sample r i The result label, y i Represents the sample label, 1 represents a positive sample and 0 represents a negative sample.
[0097] Step S3: User itinerary prediction: Based on the positive and negative samples obtained based on the confidence rule, the second long short-term memory network (deep LSTM network) is trained, and the prediction results are extracted for manual verification. The user itinerary data corresponding to the corrected positive samples are used as manually labeled user itinerary data for training the shallow long short-term memory LSTM network; finally, the user itinerary category is identified through the trained deep long short-term memory LSTM network.
[0098] The present invention manually corrects the results predicted by the weakly supervised training model, and adds the manually corrected data to the weakly supervised model training process, thereby steadily improving the model accuracy and achieving iterative model tuning.
[0099] In the embodiment of the present invention, in order to improve the overall accuracy of the model, for the predicted result data, random sampling is performed on positive samples and negative samples respectively, and the sample labels are corrected by manual verification and correction. In order to reduce the negative impact of inconsistent manual labeling standards on data quality, manual labeling is performed by secondary cross-labeling, that is, the user travel data is assigned to another person for labeling. If the secondary labeled label is of the same type as the primary labeled label, the user travel data is input into the deep long short-term memory LSTM network for training, thereby completing the iterative tuning of the model.
[0100] like Figure 6 As shown, in an embodiment of the present invention, the samples screened out by weakly supervised learning are used to train the application model. The application model is still trained using the LSTM model, including sequentially connected LSTM units, fully connected layers, and Softmax normalization layers. Since the amount of screened samples is larger, in order to extract better features, the LSTM model trained in the application model part uses a 2-layer LSTM unit.
[0101] Result verification: Since user trips account for a relatively low proportion of total trips, during the model evaluation process, the main focus is on the model confusion matrix evaluation indicators, namely precision, recall, and F1 value. The confusion matrix is shown below:
[0102]
[0103] 1 represents a positive sample, 0 represents a negative sample, TP (11) represents the prediction result is P, which is correct; FP (01) represents the prediction result is P, which is wrong; FN (00) represents the prediction result is N, which is wrong; TN (10) represents the prediction result is N, which is correct.
[0104] Corresponding to the above-mentioned embodiment of the method for identifying user itinerary based on a neural network, the present invention also provides an embodiment of a device for identifying user itinerary based on a neural network.
[0105] See also Figure 7The user itinerary identification device based on a neural network provided in an embodiment of the present invention includes a memory and one or more processors. The memory stores executable codes. When the one or more processors execute the executable codes, they are used to implement the user itinerary identification method based on a neural network in the above embodiment.
[0106] The embodiments of the user itinerary identification device based on neural network of the present invention can be applied to any device with data processing capability, and the device with data processing capability can be a device or apparatus such as a computer. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capability in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 7 As shown, it is a hardware structure diagram of any device with data processing capability where the user trip identification device based on neural network of the present invention is located. Figure 7 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.
[0107] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0108] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0109] An embodiment of the present invention further provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the user itinerary identification method based on a neural network in the above embodiment is implemented.
[0110] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capability. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.
[0111] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A user trip identification method based on a neural network, characterized in that The steps include: Step S1: Obtain user travel data; perform full travel analysis based on mobile phone signaling, use mobile phone signaling to match the user's place of residence and travel points with a long duration, construct the user's travel sequence data within a period of time with the place of residence as the starting and ending points, and perform feature screening on it to obtain travel trajectory features and features of factors affecting the travel; Step S2: Weakly supervised training, based on the manually labeled user itinerary data, train the first long short-term memory network, screen out positive and negative samples, and train the first long short-term memory network. The input features include the distance from home, distance from work, stay time, type of the point on the map, number of times the itinerary point is reached, number of people at the itinerary point, repetition rate of the people at the itinerary point, longitude of the itinerary point, latitude of the itinerary point, time of arrival at the itinerary point, whether the time of arrival at the itinerary point is working time, whether the travel application is visited recently, number of travel applications visited recently, number of times the travel application is visited recently, data account period working day or weekend, data account period corresponding to the quarter, whether it is a statutory holiday, type of tourist attraction nearest to the current itinerary point, distance to the nearest tourist attraction The data includes the following: distance from home, distance from work, stay time, type of the point on the map, longitude of the point, latitude of the point, time of arrival at the point, whether the time of arrival at the point is working time, whether the data account period is a working day or a weekend, the quarter corresponding to the data account period, and whether it is a statutory holiday; a confidence screening rule is constructed, and levels are divided based on the different travel points of the user, and different confidence thresholds are used for different levels. At the same time, the positive and negative samples of the user's travel category are screened in combination with the clustering results. The positive samples of the user's travel category are tourists, and the negative samples are non-tourists; the confidence screening rule includes the following steps: Step S2.3.1: positive sample screening: based on the user travel data corresponding to different travel points, using the corresponding different confidence levels as screening conditions, positive samples are screened; For user travel points greater than the first travel points threshold, and the user travel data predicted by the first long short-term memory network is greater than or equal to the first positive sample threshold, it is used as a positive sample; for user travel points less than or equal to the first travel points threshold, greater than or equal to the second travel points threshold, and the user travel data predicted by the first long short-term memory network is greater than or equal to the second positive sample threshold, it is used as a positive sample; for user travel points within the third travel points threshold, and the user travel data predicted by the first long short-term memory network is greater than or equal to the third positive sample threshold, it is used as a positive sample; Step S2.3.2: negative sample screening: based on the negative samples predicted by the first long short-term memory network and the clustering model, screening negative samples; The user travel data whose predicted probability by the first LSTM network is less than the first positive sample threshold and whose prediction by the clustering model is a negative sample is regarded as a negative sample; Step S3: User itinerary prediction; based on the positive and negative samples obtained based on the confidence rule, the second LSTM network is trained, the prediction results are extracted for manual verification, and the user itinerary data corresponding to the corrected positive samples are used as manually labeled user itinerary data for training the first LSTM network; finally, the user itinerary category is identified through the trained second LSTM network.
2. The method for identifying user itinerary based on a neural network according to claim 1, characterized in that: In the step S1, the user's itinerary sequence data within a period of time is constructed, and feature screening is performed on the itinerary to obtain itinerary trajectory features and itinerary factor features; The travel trajectory features and the features of factors affecting the travel are used to train the first long short-term memory network, and the travel trajectory features are used to train the clustering model.
3. The method for identifying user itinerary based on a neural network according to claim 1, characterized in that: In step S1, the feature data included in the user travel data is preprocessed, including the following steps: Step S1.1: Encode the weather features into natural numbers, keep the other features as they are, and fill in missing values; Step S1.2: Calculate the number of travel points for each travel data, which is used for weak supervision training and sample screening; Step S1.3: To address the problem of inconsistent eigenvalue dimensions, standardize the data and unify the data dimensions.
4. The method for identifying user itinerary based on neural network according to claim 1, characterized in that: In step S2, the training of the first long short-term memory network includes the following steps: Step S2.1.1: Serialize the manually labeled user travel data; Step S2.1.2: construct a first long short-term memory network, obtain serialized manually labeled user trip data, and obtain user trip categories; Step S2.1.3: Define a loss function, compare the predicted user trip category with the labeled user trip category, and train the first long short-term memory network.
5. The method for identifying user itinerary based on neural network according to claim 1, characterized in that: In step S2, the training of the clustering model includes the following steps: Step S2.2.1: Obtain unlabeled user travel data; Step S2.2.2: Define cluster center clusters based on user trip categories and generate cluster centers; Step S2.2.3: Perform category aggregation based on the distance from the feature points corresponding to the data to the cluster center.
6. The method for identifying user itinerary based on neural network according to claim 1, characterized in that: In step S3, for the result data predicted by the second long short-term memory network, positive samples and negative samples are randomly sampled respectively, and the sample labels are corrected by manual verification and correction. The manual labeling is performed by a secondary cross-labeling method, that is, the user travel data is assigned to another person for labeling. If the secondary labeled label is of the same type as the primary labeled label, the user travel data is input into the second long short-term memory network for training, thereby completing the iterative tuning of the model.
7. The method for identifying user itinerary based on a neural network according to claim 1, characterized in that: The long short-term memory network includes long short-term memory units, a fully connected layer and a normalization layer connected in sequence, and the number of long short-term memory units of the second long short-term memory network is greater than the number of long short-term memory units of the first long short-term memory network.
8. A user trip identification device based on a neural network, characterized in that: It comprises a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement the user itinerary identification method based on neural network as described in any one of claims 1-7.
Citation Information
Patent Citations
Target recognition model training method and device, equipment and storage medium
CN111523596A
Weak supervision time sequence behavior positioning method based on hierarchical category model
CN113221633A