Pre-decomposition mixed multi-neural network library flow prediction method and system
Through Symlet wavelet decomposition and hybrid multi-neural network processing, the problems of randomness and volatility in library traffic prediction are solved, high-precision traffic prediction is achieved, and the accuracy and availability of the prediction model are improved.
Patent Information
- Application Number
- CN202411299597.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-24
AI Technical Summary
The existing library traffic prediction methods fail to effectively handle the randomness and volatility of traffic, resulting in low prediction accuracy, insufficient historical data processing, relatively single prediction model settings, and poor accuracy and availability of prediction results.
Symlet wavelet is used to decompose the original traffic signal into approximate components and detailed components, and predict it through different components using mixed multi-neural networks with different network parameters, reducing time dependence and randomness, and extracting local and global features.
High-precision prediction of library traffic is achieved, the accuracy of the prediction model and the precision of historical data processing are improved, the accuracy and availability of prediction results are improved, and the average relative percentage error is 6.945%.
Smart Images

Figure CN119180309A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of using big data to predict future data, and in particular to a pre-decomposition hybrid multi-neural network library traffic prediction method and system. Background Art
[0002] Modern libraries are important hubs for knowledge dissemination, cultural exchange and community development. Accurate and effective library traffic forecasting can not only optimize resource allocation and improve service quality, but also provide managers with a scientific basis for decision-making.
[0003] In the information and intelligent era, the role and function of libraries are constantly evolving. Libraries are not only a place to store traditional books, but also a center for information acquisition and learning, and an important hub for knowledge dissemination, cultural exchange and community development. Traffic forecasting is an important part of modern public library management, and its role is mainly reflected in the following aspects:
[0004] (1) Optimizing resource allocation: Effective traffic forecasting can help managers arrange human resources and materials more effectively, ensuring that there are sufficient staff and resources to support user needs during peak hours, thereby improving service quality.
[0005] (2) Improve space management: Traffic forecasting can help libraries allocate space rationally, optimize the layout of the library, and ensure that users have a good spatial experience when using the library, avoiding crowding and discomfort.
[0006] (3) Coordinated activity planning: By analyzing traffic data, the library can coordinate the planning and arrangement of various activities and lectures to ensure that more participants are attracted and the effectiveness of the activities is improved.
[0007] (4) User behavior research: Traffic data can provide an important basis for studying user behavior and preferences, helping libraries better understand user needs and formulate effective service strategies.
[0008] (5) Responding to emergencies: When faced with emergencies, traffic forecasting can help libraries develop emergency plans to ensure that they can still provide users with necessary services under special circumstances.
[0009] (6) Improve decision support: Traffic forecasting can provide data support for library management and provide effective decision support for modern library management.
[0010] With the rapid development of artificial intelligence and big data technology, more and more researchers have carried out library-related prediction research based on advanced technologies such as neural networks and deep learning. For example, existing studies have drawn up borrowing volume distribution maps based on time series such as years, months, weeks, and time periods, analyzed the distribution patterns of borrowing traffic, and put forward suggestions for the reasonable allocation of collection resource types in university libraries, improving the utilization rate of paper documents, and realizing dynamic management of library human resources, providing a basis for improving library management and decision-making levels, and improving work efficiency and quality; there is also borrowing data based on a decade of library management system of a double-first-class university in a certain region of China, and classified by book category and borrower's college, using a hybrid prediction model based on time series to predict future borrowing trends; by analyzing the influence of indoor personnel number, opening strategy and temperature on energy consumption, fuzzy clustering method is used to divide similar days, and data is analyzed based on similar days. After screening, a university library energy consumption prediction model based on similar day LM (Levenberg-Marquardt) neural network was proposed, which provided a reference for the research on energy consumption of university libraries; the ant colony algorithm was used to optimize the relevant parameters of the digital library traffic prediction model, and the big data technology was used to achieve a prediction accuracy of 95%; taking the historical data of borrowing traffic as the research object, a particle swarm optimization RBF neural network model for book borrowing traffic prediction was constructed, which provided a reference for libraries to improve work efficiency and service quality; based on the small data decision-making method, a reader interest discovery and prediction model was constructed, and by mining implicit knowledge, the mining and discovery of readers' reading interests was realized, which provided a decision-making reference for meeting readers' personalized service needs.
[0011] Although the above studies have achieved relevant predictive analysis of traffic flow, energy consumption, and discipline development trajectory in the library field, the above research methods directly process the corresponding data and use relevant algorithms or models to predict future traffic flow. However, they do not recognize the randomness and volatility of traffic prediction, and thus it is difficult to accurately reconstruct the temporal dependence characteristics of the time series, which limits its prediction accuracy, resulting in the low accuracy of the established prediction model, the insufficient processing of historical data, the relatively simple setting of the prediction model, the large fluctuation in the accuracy of the prediction results, and the poor usability. Summary of the invention
[0012] The present invention focuses on the problems existing in the above-mentioned prior art and provides a pre-decomposition hybrid multi-neural network library traffic prediction method and system, wherein pre-decomposition refers to using Symlet wavelet to decompose the original traffic signal into an approximate component and several detail components to reduce the time dependence and randomness in the original traffic signal; hybrid multi-neural network refers to different components, using hybrid multi-neural networks with different network parameters (number of convolution kernels, number of LSTM hidden layers) for prediction.
[0013] Aiming at the traffic prediction problem of public libraries, the present invention firstly realizes the extraction of local and global features of complex time series of library traffic through Symlet multi-layer wavelet transform; then, a hybrid multi-neural network traffic prediction model based on Symlet pre-decomposition is constructed, which realizes the analysis and prediction of the time series dependence characteristics of different wavelet components; finally, the test results show that the constructed hybrid multi-neural network traffic prediction system based on Symlet pre-decomposition can realize the accurate prediction of library traffic and provide effective decision-making support for modern library management.
[0014] In order to achieve the above-mentioned invention object, the present invention provides the following technical solutions:
[0015] A pre-decomposition hybrid multi-neural network library traffic prediction method includes the following specific steps:
[0016] S1: Obtain the data to be predicted in the target library area, which is the time series of passenger flow data, and use Symlet multi-level wavelet decomposition to decompose the input time series data into an approximate component and several detail components;
[0017] In step S1, for the data to be predicted, Symlet multi-level wavelet decomposition is used to decompose the input time series data into an approximate component and several detail components;
[0018] Firstly, a specific decomposition layer number N-1 is adopted to decompose the training traffic data into an approximate component and N-1 detail components using Symlet wavelet decomposition. Specifically, Symlet multi-level wavelet decomposition decomposes the library traffic time series dataset into several components, realizes the correlation of Symlet wavelet basis functions of different component data, and provides feature reference for the learning and training of CNN-LSTM.
[0019] Symlet wavelet is an orthogonal wavelet, which has the advantages of symmetry, compact support, and multi-resolution analysis capability, and is suitable for feature extraction in the field of deep learning.
[0020] According to the basic theory of wavelet analysis, through multi-resolution decomposition, any It can be represented as follows: For any function x(t), the continuous wavelet transform is expressed as formula (1):
[0021]
[0022] Where k is an arbitrary integer, representing the translation of the signal; j is an arbitrary non-negative integer, representing different wavelet scales. 2(R) represents the square integrable real number space, that is, the energy-limited signal space. ψ(t) is a basic wavelet or mother wavelet. After scaling and translating it, we can get a wavelet sequence ψ α,τ (t), where α is the scale factor and τ is the translation factor, where α, τ∈R; α≠0, ψ * (t) represents the Fourier transform of ψ(t).
[0023] In practical systems, the number of wavelet decomposition layers should be selected to meet the frequency constraints while taking into account the simplicity of calculation. Therefore, the Symlet wavelet decomposition layer is determined in the following way: for a specific continuous signal T(t) in the time domain, 0≤t≤t max , let T(t) be the space L 2 If the signal in f sample is greater than the Nyquist frequency and Then the discrete signal T(n) contains l samples. According to the Symlets wavelet transform mechanism, if each component signal adjusts the frequency f adj If it is less than ρ, then the Symlet wavelet decomposition order θ should satisfy the following formula:
[0024] ι / 2 θ ≤(ρ×t max ) (3)
[0025]
[0026] Among them, if the specific selected sample contains 350 samples ι=350, ρ=0.03125, t max =700 times, so by substituting the above value into formula (4), we can get that the Symlet wavelet decomposition order should satisfy:
[0027]
[0028] Regarding the selection of N, N is determined according to the order θ of the Symlet wavelet decomposition, and N=5 is selected, which is the detail components D1, D2, D3, D4 and approximate component A4 obtained after the training data set is decomposed by 4 layers of wavelets. Among them, the detail components D1-D4 represent the details and short-term fluctuations in the traffic data, reflecting the rapid changes and random components of the access volume; the approximate component A4 represents the overall trend or large-scale characteristics of the data, which retains the main information of the data, reflects the long-term behavior of the data, and is used to describe the baseline changes and long-term trends of the access volume.
[0029] S2: Count the flow of people during the opening hours of several libraries at intervals of 0.5 hours, mark them, and form a sample set database. Use Symlet multi-level wavelet decomposition to decompose the data in the sample set database into approximate components and several detail components. For each component after the sample data is decomposed, use the adaptive moment algorithm to train the hybrid multi-neural network. Add the training results to get the overall training result. When a specific number of training times is reached or the training error is less than a specific value, N hybrid multi-neural networks are obtained.
[0030] Among them, different components are trained using hybrid multi-neural networks with different network parameters. The different network parameters specifically refer to the different numbers of convolution kernels and LSTM hidden layers in the convolution layer. The number of convolution kernels and LSTM hidden layers corresponding to each component are obtained by enumeration. When the root mean square error between the training value and the actual value is less than the error threshold or the training reaches a specific number of steps, the number of convolution kernels and LSTM hidden layers corresponding to the corresponding component are selected;
[0031] Symlet wavelet pre-decomposition is used to decompose the original traffic signal into an approximate component and several detail components. For the approximate components and low-frequency detail components, a smaller number of convolution kernels and LSTM hidden layers can be used to achieve high-precision prediction, reducing the complexity of the network; for high-frequency detail components, a larger number of convolution kernels and a larger number of LSTM hidden layers can be used to achieve high-precision reconstruction of the complex temporal dependencies in the detail components, thereby improving the prediction accuracy.
[0032] In step S2, the specific steps for determining whether the training is finished are as follows:
[0033] Step, S21, for any sample data extracted, decompose the sample data into N components using Symlet multi-level wavelet decomposition, input the N components into N constructed CNN-LSTM networks respectively, obtain N prediction results, and add the N prediction results to obtain the final predicted future predicted flow of people in the sample library;
[0034] Step S22, comparing the predicted value of the future predicted flow of people with the true value of the sample marked in the sample data to obtain a deviation value;
[0035] Step S23, if the deviation value is greater than the preset threshold, execute step S24; if the deviation value is less than the preset threshold, the training ends;
[0036] Step S24, correct the parameter values of each layer of the CNN-LSTM model according to the deviation value, update the parameter value, add one to the counter, and determine whether the value of the counter is greater than M. If it is greater than M, the training ends; if it is less than or equal to M, replace the sample and execute steps S21 to S23, wherein M is set based on experience to avoid unnecessary repeated training when the preset threshold is set unreasonably.
[0037] S3: Inputting the approximate component of the data to be predicted and σ historical data of several detailed components into the trained hybrid multi-neural network respectively, and performing flow prediction at a future time point to obtain N different prediction components, and adding the N prediction components to obtain the final prediction result, and outputting the future passenger flow prediction value of each library in each time period;
[0038] The hybrid multi-neural network model also needs to use training samples to train the model to update the parameters of each layer in the hybrid multi-neural network model, thereby improving the prediction accuracy of the hybrid multi-neural network model; the training process specifically includes:
[0039] The traffic data of several libraries during their opening hours, which were counted at intervals of 0.5 hours, were used to construct a network training data set and prepare the data. The data preparation process involved denoising and normalizing the data to improve the generalization ability of the hybrid multi-neural network.
[0040] The training parameter setting process requires configuration of parameters such as training optimization algorithm, maximum number of training times, gradient threshold, initial learning rate, learning rate adjustment strategy, learning rate reduction factor, and learning rate reduction cycle;
[0041] During the training process monitoring, key parameters such as loss function value and root mean square error (RMSE) can be monitored and visualized to effectively evaluate the model performance and adjust the training strategy in time to ensure the best performance of the model.
[0042] The model evaluation process uses training data sets and test data sets to test and evaluate the trained CNN-LSTM model from aspects such as mean squared error (MSE), RMSE, mean absolute error (MAE), and mean absolute percentage error (Mean Absolute Percentage Error).
[0043] The hybrid multi-neural prediction network is essentially a multi-neural network hybrid prediction system. Among them, CNN is responsible for extracting local features from the input data, and LSTM is responsible for processing the feature sequence extracted by CNN to capture the temporal dependency. Multiple hybrid multi-neural networks together constitute the prediction of different Symlet wavelet components.
[0044] Each CNN-LSTM network consists of a convolutional layer, a pooling layer, a flattening layer, an LSTM layer, and a fully connected layer. In the prediction method, each decomposed component is processed by each layer to obtain the prediction result of each component. The functions of each layer are as follows:
[0045] (1) The convolution layer performs convolution operations on the input data through convolution kernels (filters) to extract local features of the data. The convolution layer is used for feature extraction. The larger the size and number of convolution kernels, the more features can be extracted, and the amount of calculation will also increase significantly.
[0046] (2) The pooling layer is used to reduce the feature dimension of the data and the computational complexity, and also has the functions of enhancing robustness and preventing overfitting;
[0047] (3) The flattening layer is used to flatten the multi-dimensional feature map of the data into a one-dimensional vector, which facilitates the subsequent LSTM layer to predict the data;
[0048] (4) The LSTM layer is used to capture temporal dependencies and is the key layer for realizing network prediction functions;
[0049] (5) The fully connected layer mainly performs classification or regression tasks, connecting the output of the previous layer to each neuron to provide the final prediction result.
[0050] The Symlet wavelet multi-level decomposition is performed into an approximate component and several detail components, where different components are trained using a hybrid multi-neural network with different network parameters. The different network parameters specifically refer to the number of convolution kernels and the number of LSTM hidden layers in the convolution layer. For approximate components and low-frequency detail components, a smaller number of convolution kernels and LSTM hidden layers can be used to achieve high-precision prediction, reducing the complexity of the network; for high-frequency detail components, a larger number of convolution kernels and a larger number of LSTM hidden layers can be used to achieve high-precision reconstruction of complex temporal dependencies in the detail components and improve prediction accuracy.
[0051] For different components, the number of convolution kernels and LSTM hidden layers corresponding to different components are determined by enumeration method. First, an initial value is set, and the convolution layer is set to have R convolution kernels and the LSTM layer to have T hidden layers, where R and T are the minimum numbers that can realize network functions;
[0052] T1. When training a component, compare the true value with the training prediction value to obtain the root mean square error RSME, and compare RSME with the error threshold r. If RSME≤r, the network is available, the training is ended, and the network parameters are obtained; if RSME>r, jump to T2;
[0053] T2, using enumeration method, R+1, and T+1, at the same time the counter is increased by one to determine whether the value of the counter is greater than the specific learning step number K. If yes, the training is terminated and the network parameters are obtained. If not, jump to T1.
[0054] LSTM is a special type of recurrent neural network (RNN) that aims to solve the gradient vanishing and gradient exploding problems of traditional RNN when processing long sequence data. LSTM can effectively capture the long-term dependencies in sequence data and is the core of time series prediction.
[0055] LSTM neurons are composed of a cell state, an input gate, a forget gate, and an output gate. The cell is the core of LSTM and is responsible for storing long-term information. It updates and maintains state information through a gating mechanism. The input gate determines the impact of the current input information on the cell state. It first uses the sigmoid activation function to determine which information needs to be updated, and then uses the tanh activation function to generate new candidate values. The forget gate determines how much of the cell state from the previous time step to retain. The output gate determines the impact of the current cell state on the output. It uses the sigmoid activation function to determine which parts of the output need to be retained, and processes the current cell state through the tanh activation function to generate the final output.
[0056] When designing a CNN-LSTM network, there are multiple parameters that need to be configured. In the convolution layer, you need to set the convolution kernel size, the number of convolution kernels, the filter sliding stride in the convolution operation, etc. This article sets the convolution kernel size to [3,1]; the number of convolution kernels to 16; and the filter sliding stride to [1,1]. In the pooling layer, you need to configure parameters such as the pooling window size, the window sliding stride, and the input data edge padding method. This article sets the pooling window size to [2,1]; the window sliding stride to 2; and the edge padding method that makes the output size the same as the input size. The LSTM layer needs to configure parameters such as the number of hidden layers and the output mode. This article sets the number of LSTM hidden layers to 25; and the output mode to last.
[0057] The training process of the hybrid multi-neural prediction network is the optimization process of various parameters and weights in the network. Through network training, the network can fully explore the time-dependent characteristics of different components of the training data set, thereby improving its performance in library traffic prediction.
[0058] The training process of the hybrid multi-neural network prediction network includes steps such as data preparation, training parameter setting, training process monitoring, and model evaluation. Among them, the data preparation process improves the generalization ability of the hybrid multi-neural network by denoising and normalizing the data; the training parameter setting process needs to configure parameters such as training optimization algorithm, maximum number of training times, gradient threshold, initial learning rate, learning rate adjustment strategy, learning rate reduction factor, and learning rate reduction cycle; in the training process monitoring, key parameters such as loss function value and root mean square error (RMSE) can be monitored and visualized to effectively evaluate the model performance, adjust the training strategy in time, and ensure the best performance of the model; the model evaluation process uses training data sets and test data sets to test and evaluate the trained CNN-LSTM model from the aspects of mean squared error (MSE), RMSE, mean absolute error (MAE), and mean relative percentage error (MAE).
[0059] The present application also has a pre-decomposition hybrid multi-neural network library traffic prediction system, which includes a data acquisition module, a data processing module, a Symlet module, a model training module, and a model module, wherein the data acquisition module is used to acquire time series traffic data, and the time series traffic data includes the target library area to be predicted data and traffic data of several library opening periods; the data processing module is used to extract data from the data acquisition module and pre-process the extracted data; the Symlet module is used to perform Symlet multi-level wavelet decomposition on the time series traffic data; the model training module is used to train the hybrid multi-neural network model using sample data in the sample set database and update the model parameters; the model module is used to predict the future traffic of the library using the hybrid multi-neural network model.
[0060] The CNN unit in the hybrid multi-neural network model is responsible for extracting local features from the input data, and the LSTM unit is responsible for processing the feature sequence extracted by the CNN. Each CNN-LSTM network consists of a convolutional layer, a pooling layer, a flattening layer, an LSTM layer, and a fully connected layer. The LSTM unit is a recursive neural network. The LSTM neuron consists of a memory unit, an input gate, a forget gate, and an output gate. The memory unit is the core part of the LSTM and is responsible for storing long-term information. The memory unit updates and maintains state information through a gating mechanism; the input gate determines the impact of the current input information on the state of the memory unit. It first uses the sigmoid activation function to determine which information needs to be updated, and then uses the tanh activation function to generate new candidate values; the forget gate determines how much of the memory unit state from the previous time step is retained; the output gate determines the impact of the current memory unit state on the output. The output gate uses the sigmoid activation function to determine which parts of the output need to be retained, and processes the current memory unit state through the tanh activation function to generate the final output.
[0061] Compared with the prior art, the present invention improves the library traffic prediction method and system. The Symlet wavelet multi-level decomposition of the original data is into multiple components, and different components respectively reflect approximation and details. Then, multiple hybrid multi-neural networks are used for training respectively, and the training results are added to obtain the overall training result. When the trained network is used, the test data is also first Symlet decomposed, and then predicted respectively, and the multiple components obtained by prediction are added to obtain the final prediction result. The prediction method and system in the present application overcome the randomness of traffic prediction, and the original sample data and the data to be predicted are decomposed into multiple components by using the Symlet wavelet multi-level, and are trained separately by multiple hybrid multi-neural networks, thereby improving the accuracy of the established prediction model, improving the precision of the historical sample data processing, and the prediction result is highly accurate and highly available. Based on multiple experiments, it is shown that:
[0062] 1) Symlet pre-decomposition realizes the extraction of local and global features in complex time series of random fluctuating traffic, laying the foundation for high-precision learning and prediction of hybrid multi-neural networks;
[0063] 2) Symlet wavelet pre-decomposition is used to decompose the original traffic signal into an approximate component and several detail components. For the approximate components and low-frequency detail components, a smaller number of convolution kernels and LSTM hidden layers can be used to achieve high-precision prediction, reducing the complexity of the network; for high-frequency detail components, a larger number of convolution kernels and a larger number of LSTM hidden layers can be used to achieve high-precision reconstruction of the complex temporal dependencies in the detail components, thereby improving the prediction accuracy.
[0064] 3) Hybrid multi-neural networks can effectively capture long-term dependencies in sequence data and achieve high-precision prediction of different components in library traffic data;
[0065] 4) Symlet-CNN-LSTM can achieve future 1-hour traffic forecast with an average relative percentage error of 6.945%. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 The present invention pre-decomposes the structure of the hybrid multi-neural network library traffic prediction system;
[0067] Figure 2 It is the Symlet pre-decomposition result of the present invention;
[0068] Figure 3 This is the LSTM neuron structure of the present invention.
[0069] Figure 4 The training data and hybrid multi-neural network output data of the present invention;
[0070] Figure 5 The hybrid multi-neural network training error of the present invention;
[0071] Figure 6 is the loss during the training process of the hybrid multi-neural network of the present invention;
[0072] Figure 7 is the RMSE during the training process of the hybrid multi-neural network of the present invention;
[0073] Figure 8 Test data and prediction data for the present invention;
[0074] Fig. 9 The present invention pre-decomposes the prediction error of the hybrid multi-neural network library traffic prediction model. DETAILED DESCRIPTION
[0075] The technology described below can be transformed in many ways and can have many embodiments, which are described in detail with reference to the accompanying drawings in specific embodiments. However, this does not mean that the technology described below is limited to specific embodiments. It should be understood that the present invention includes all similar modifications, equivalents and substitutions without departing from the spirit and technical scope of the technology described below.
[0076] like Figure 1-3As shown, the present invention provides a pre-decomposition hybrid multi-neural network library traffic prediction method and system, wherein pre-decomposition refers to using Symlet wavelet to decompose the original traffic signal into an approximate component and several detail components to reduce the time dependence and randomness in the original traffic signal; hybrid multi-neural network refers to different components, using CNN-LSTM networks with different network parameters (number of convolution kernels, number of LSTM hidden layers) to make predictions. Specifically, as Figure 1 As shown, the specific steps of the prediction method include:
[0077] S1: Obtain the data to be predicted in the target library area, which is the time series of passenger flow data, and use Symlet multi-level wavelet decomposition to decompose the input time series data into an approximate component and several detail components;
[0078] In step S1, for the data to be predicted, Symlet multi-level wavelet decomposition is used to decompose the input time series data into an approximate component and several detail components;
[0079] Firstly, a specific decomposition layer number N-1 is adopted to decompose the training traffic data into an approximate component and N-1 detail components using Symlet wavelet decomposition. Specifically, Symlet multi-level wavelet decomposition decomposes the library traffic time series dataset into several components, realizes the correlation of Symlet wavelet basis functions of different component data, and provides feature reference for the learning and training of CNN-LSTM.
[0080] Symlet wavelet is an orthogonal wavelet, which has the advantages of symmetry, compact support, and multi-resolution analysis capability, and is suitable for feature extraction in the field of deep learning.
[0081] According to the basic theory of wavelet analysis, through multi-resolution decomposition, any It can be represented as follows: For any function x(t), the continuous wavelet transform is expressed as formula (1):
[0082]
[0083] Where k is an arbitrary integer, representing the translation of the signal; j is an arbitrary non-negative integer, representing different wavelet scales. 2 (R) represents the square integrable real number space, that is, the energy-limited signal space. ψ(t) is a basic wavelet or mother wavelet. After scaling and translating it, we can get a wavelet sequence ψ α,τ (t), where α is the scale factor and τ is the translation factor, where α, τ∈R; α≠0, ψ * (t) represents the Fourier transform of ψ(t).
[0084] In practical systems, the number of wavelet decomposition layers should be selected to meet the frequency constraints while taking into account the simplicity of calculation. Therefore, the Symlet wavelet decomposition layer is determined in the following way: for a specific continuous signal T(t) in the time domain, 0≤t≤t max , let T(t) be the space L 2 If the signal in f sample is greater than the Nyquist frequency and Then the discrete signal T(n) contains l samples. According to the Symlets wavelet transform mechanism, if each component signal adjusts the frequency f adj If it is less than ρ, then the Symlet wavelet decomposition order θ should satisfy the following formula:
[0085] ι / 2 θ ≤(ρ×t max ) (3)
[0086]
[0087] The specific selected samples include 350 samples ι=350,ρ=0.03125,t max =700 times, so by substituting the above value into formula (4), we can get that the Symlet wavelet decomposition order should satisfy:
[0088]
[0089] The value of N is determined according to the order θ of the Symlet wavelet decomposition, for example, N = 5. Figure 2 As shown in the figure, the detail components D1, D2, D3, D4 and the approximate component A4 are obtained after the training data set is decomposed by 4 layers of wavelet. Among them, the detail components D1-D4 represent the details and short-term fluctuations in the traffic data, reflecting the rapid changes and random components of the visits; the approximate component A4 represents the overall trend or large-scale characteristics of the data, which retains the main information of the data, reflects the long-term behavior of the data, and is used to describe the baseline changes and long-term trends of the visits.
[0090] S2: Count the flow of people during the opening hours of several libraries at intervals of 0.5 hours, mark them, and form a sample set database. Use Symlet multi-level wavelet decomposition to decompose the data in the sample set database into approximate components and several detail components. For each component after the sample data is decomposed, use the adaptive moment algorithm to train the CNN-LSTM network. Add the training results to get the overall training result. When a specific number of training times is reached or the training error is less than a specific value, N CNN-LSTM networks are obtained.
[0091] Among them, different components are trained using a CNN-LSTM network with different network parameters. The different network parameters specifically refer to the different numbers of convolution kernels and LSTM hidden layers in the convolution layer. The number of convolution kernels and LSTM hidden layers corresponding to each component are obtained by enumeration. When the root mean square error between the training value and the actual value is less than the error threshold or the training reaches a specific number of steps, the number of convolution kernels and LSTM hidden layers corresponding to the corresponding component are selected;
[0092] Symlet wavelet pre-decomposition is used to decompose the original traffic signal into an approximate component and several detail components. For the approximate components and low-frequency detail components, fewer convolution kernels and LSTM hidden layers can be used to achieve high-precision prediction, reducing the complexity of the network; for high-frequency detail components, more convolution kernels and more LSTM hidden layers can be used to achieve high-precision reconstruction of the complex temporal dependencies in the detail components, thereby improving prediction accuracy.
[0093] In step S2, the specific steps for determining whether the training is finished are as follows:
[0094] Step, S21, for any sample data extracted, decompose the sample data into N components using Symlet multi-level wavelet decomposition, input the N components into N constructed CNN-LSTM networks respectively, obtain N prediction results, and add the N prediction results to obtain the final predicted future predicted flow of people in the sample library;
[0095] Step S22, comparing the predicted value of the future predicted flow of people with the true value of the sample marked in the sample data to obtain a deviation value;
[0096] Step S23, if the deviation value is greater than the preset threshold, execute step S24; if the deviation value is less than the preset threshold, the training ends;
[0097] Step S24, correct the parameter values of each layer of the CNN-LSTM model according to the deviation value, update the parameter value, add one to the counter, and determine whether the value of the counter is greater than M. If it is greater than M, the training ends; if it is less than or equal to M, replace the sample and execute steps S21 to S23, wherein M is set based on experience to avoid unnecessary repeated training when the preset threshold is set unreasonably.
[0098] S3: Inputting the approximate component of the data to be predicted and σ historical data of several detailed components into the trained CNN-LSTM network respectively, and performing traffic prediction at a future time point to obtain N different prediction components, and adding the N prediction components to obtain the final prediction result, and outputting the future passenger flow prediction value of each library in each time period;
[0099] The CNN-LSTM model used also needs to use training samples to train the model to update the parameters of each layer in the CNN-LSTM model, thereby improving the prediction accuracy of the CNN-LSTM model; the training process specifically includes:
[0100] The traffic data of several libraries during their opening hours, which were counted at intervals of 0.5 hours, were used to construct a network training data set and prepare the data. In the data preparation process, the data was denoised and normalized to improve the generalization ability of the CNN-LSTM network.
[0101] The training parameter setting process requires configuration of parameters such as training optimization algorithm, maximum number of training times, gradient threshold, initial learning rate, learning rate adjustment strategy, learning rate reduction factor, and learning rate reduction cycle;
[0102] During the training process monitoring, key parameters such as loss function value and root mean square error (RMSE) can be monitored and visualized to effectively evaluate the model performance and adjust the training strategy in time to ensure the best performance of the model.
[0103] The model evaluation process uses training data sets and test data sets to test and evaluate the trained CNN-LSTM model from aspects such as mean squared error (MSE), RMSE, mean absolute error (MAE), and mean absolute percentage error (Mean Absolute Percentage Error).
[0104] The CNN-LSTM prediction network is essentially a multi-neural network hybrid prediction system. Among them, CNN is responsible for extracting local features from the input data, and LSTM is responsible for processing the feature sequence extracted by CNN and capturing the temporal dependencies. Multiple CNN-LSTMs together constitute the prediction of different Symlet wavelet components.
[0105] like Figure 1 As shown in the figure, each CNN-LSTM network consists of a convolutional layer, a pooling layer, a flattening layer, an LSTM layer, and a fully connected layer. The functions of each layer are as follows:
[0106] (1) The convolution layer performs convolution operations on the input data through convolution kernels (filters) to extract local features of the data. The convolution layer is used for feature extraction. The larger the size and number of convolution kernels, the more features can be extracted, and the amount of calculation will also increase significantly.
[0107] (2) The pooling layer is used to reduce the feature dimension of the data and the computational complexity, and also has the functions of enhancing robustness and preventing overfitting;
[0108] (3) The flattening layer is used to flatten the multi-dimensional feature map of the data into a one-dimensional vector, which facilitates the subsequent LSTM layer to predict the data;
[0109] (4) The LSTM layer is used to capture temporal dependencies and is the key layer for realizing network prediction functions;
[0110] (5) The fully connected layer mainly performs classification or regression tasks, connecting the output of the previous layer to each neuron to provide the final prediction result.
[0111] For different components, the number of convolution kernels and LSTM hidden layers corresponding to different components are determined by enumeration method. First, an initial value is set, and the convolution layer is set to have R convolution kernels and the LSTM layer to have T hidden layers, where R and T are the minimum numbers that can realize network functions;
[0112] T1. When training a component, compare the true value with the training prediction value to obtain the root mean square error RSME, and compare RSME with the error threshold r. If RSME≤r, the network is available, the training is ended, and the network parameters are obtained; if RSME>r, jump to T2;
[0113] T2, using enumeration method, R+1, and T+1, at the same time the counter is increased by one to determine whether the value of the counter is greater than the specific learning step number K. If yes, the training is terminated and the network parameters are obtained. If not, jump to T1.
[0114] LSTM is a special type of recurrent neural network (RNN) that aims to solve the gradient vanishing and gradient exploding problems of traditional RNN when processing long sequence data. LSTM can effectively capture the long-term dependencies in sequence data and is the core of time series prediction.
[0115] like Figure 3As shown in the figure, LSTM neurons are composed of a memory cell (Cell State), an input gate (Input Gate), a forget gate (Forget Gate), and an output gate (Output Gate). Among them, the memory cell is the core part of LSTM, responsible for storing long-term information. It updates and maintains state information through a gating mechanism; the input gate determines the impact of the current input information on the memory cell state. It first uses the sigmoid activation function to determine which information needs to be updated, and then uses the tanh activation function to generate new candidate values; the forget gate determines how much of the memory cell state from the previous time step is retained; the output gate determines the impact of the current memory cell state on the output. It uses the sigmoid activation function to determine which parts of the output need to be retained, and processes the current memory cell state through the tanh activation function to generate the final output.
[0116] When designing a CNN-LSTM network, there are multiple parameters that need to be configured. In the convolution layer, you need to set the convolution kernel size, the number of convolution kernels, the filter sliding stride in the convolution operation, etc. Preferably, the convolution kernel size can be set to [3,1]; the number of convolution kernels is 16; and the filter sliding stride is [1,1]. In the pooling layer, you need to configure parameters such as the pooling window size, the window sliding stride, and the input data edge padding method. In this paper, the pooling window size is set to [2,1]; the window sliding stride is 2; and the edge padding method is used to make the output size the same as the input size. The LSTM layer needs to configure parameters such as the number of hidden layers and the output mode. In this paper, the number of LSTM hidden layers is set to 25; the output mode is last.
[0117] The CNN-LSTM prediction network training process is an optimization process of various parameters and weights in the network. Through network training, the network can fully explore the time-dependent characteristics of different components of the training data set, thereby improving its performance in library traffic prediction.
[0118] The CNN-LSTM prediction network training process includes data preparation, training parameter setting, training process monitoring, and model evaluation. In the data preparation process, the generalization ability of the CNN-LSTM network is improved by denoising and normalizing the data; the training parameter setting process requires configuration of parameters such as the training optimization algorithm, the maximum number of training times, the gradient threshold, the initial learning rate, the learning rate adjustment strategy, the learning rate reduction factor, and the learning rate reduction cycle; in the training process monitoring, the model performance can be effectively evaluated by monitoring and visualizing key parameters such as the loss function value and the root mean square error (RMSE) to adjust the training strategy in time to ensure the best performance of the model; the model evaluation process uses the training data set and the test data set to test and evaluate the trained CNN-LSTM model from the aspects of mean squared error (MSE), RMSE, mean absolute error (MAE), and mean relative percentage error (MAE).
[0119] Specifically, the pre-decomposed hybrid multi-neural network library traffic prediction model was constructed, and the traffic data of several library opening hours counted at intervals of 0.5 hours were used to construct a network training data set, and CNN-LSTM network training and prediction experiments were carried out in sequence.
[0120] The present application also has a pre-decomposition hybrid multi-neural network library traffic prediction system, which includes a data acquisition module, a data processing module, a Symlet module, a model training module, and a model module, wherein the data acquisition module is used to obtain time series traffic data, and the time series traffic data includes the target library area to be predicted data and the traffic data of several library opening hours; the data processing module is used to extract data from the data acquisition module and pre-process the extracted data; the Symlet module is used to perform Symlet multi-level wavelet decomposition on the traffic data of the time series; the model training module is used to train the CNN-LSTM model using the sample data in the sample set database and update the model parameters; the model module is used to predict the future traffic of the library using the CNN-LSTM model. The CNN unit in the CNN-LSTM model is responsible for extracting local features from the input data, and the LSTM unit is responsible for processing the feature sequence extracted by the CNN, wherein each CNN-LSTM network is composed of a convolutional layer, a pooling layer, a flattening layer, an LSTM layer, and a fully connected layer. The LSTM unit is a recursive neural network, and the LSTM neuron is composed of a memory unit, an input gate, a forget gate, and an output gate. The memory cell is the core part of LSTM and is responsible for storing long-term information. The memory cell updates and maintains state information through a gating mechanism. The input gate determines the impact of the current input information on the state of the memory cell. It first uses the sigmoid activation function to determine which information needs to be updated, and then uses the tanh activation function to generate new candidate values. The forget gate determines how much of the memory cell state from the previous time step is retained. The output gate determines the impact of the current memory cell state on the output. The output gate uses the sigmoid activation function to determine which parts of the output need to be retained, and processes the current memory cell state through the tanh activation function to generate the final output.
[0121] In one embodiment, the CNN-LSTM network training parameter settings shown in Table 1 are used, and the training data and network output data obtained after 50 iterations of training are as follows: Figure 4 shown.
[0122] Table 1 CNN-LSTM network training parameter settings
[0123]
[0124] Depend on Figure 4 It can be seen that the waveform of the CNN-LSTM network output data is highly consistent with the training data, with only slight differences at the peaks of the waveform. The specific training error waveform is as follows Figure 5 As shown, the loss value and RMSE value during the training process are as follows Figure 6 , Figure 7shown.
[0125] Depend on Figure 6 It can be seen that during the training process, the loss value decreases rapidly and becomes stable after about 30 iterations. Figure 7 It can be seen that the RMSE in the training process is basically stable at 40 iterations. At the same time, for the loss value and RMSE in the training process, the detail component D4 is larger. The reason is that D4 contains the high-frequency detail components in the library traffic training data, which reflects the most detail components and is difficult for CNN-LSTM to accurately reproduce.
[0126] The CNN-LSTM model is evaluated from five aspects: MSE, RMSE, MAE, MAPE, and R2. The specific results are shown in Table 2.
[0127] Table 2 CNN-LSTM network training results
[0128]
[0129] Based on the trained Symlet-CNN-LSTM library traffic prediction model, 10 historical data points were used as input to conduct a prediction experiment for the next hour (i.e., 2 data points). The prediction results are as follows: Figure 8 shown.
[0130] Depend on Figure 8 It can be seen that the Symlet-CNN-LSTM prediction model accurately predicts the library traffic data in the next hour, but when there are detailed fluctuations in the test data, the prediction results still have certain errors. Fig. 9 Shown are the specific prediction errors.
[0131] Table 3 shows the analysis indicators of the Symlet-CNN-LSTM prediction results. It can be seen that the constructed Symlet-CNN-LSTM library traffic prediction model achieves high-precision traffic prediction with an average relative percentage error of 6.945%.
[0132] Table 3 Symlet-CNN-LSTM prediction results
[0133]
[0134] Although the present invention has been described in detail above with general description and specific embodiments, some modifications or improvements can be made on the basis of the present invention. The above description is only a preferred embodiment of the present invention and is not limited to the scope of the present invention. Other changes and modifications made by those skilled in the art without departing from the spirit and scope of protection of the present invention are still included in the scope of protection of the present invention.
Claims
1. A pre-decomposition hybrid multi-neural network library traffic prediction method, characterized by: The specific steps include: S1: Obtain the data to be predicted of the target library area to be predicted, wherein the data to be predicted is the flow of people data of the time series, and use Symlet multi-level wavelet decomposition to decompose the input time series data into an approximate component and several detail components; S2: Count the flow of people during the opening hours of several libraries at intervals of 0.5 hours, mark them, and form a sample set database. Use Symlet multi-level wavelet decomposition to decompose the data in the sample set database into approximate components and several detail components. For each component after the sample data is decomposed, use the adaptive moment algorithm to train the CNN-LSTM network. Add the training results to get the overall training result. When a specific number of training times is reached or the training error is less than a specific value, N CNN-LSTM networks are obtained. Among them, different components are trained using a CNN-LSTM network with different network parameters. The different network parameters specifically refer to the different numbers of convolution kernels and LSTM hidden layers in the convolution layer. The number of convolution kernels and LSTM hidden layers corresponding to each component are obtained by enumeration. When the root mean square error between the training value and the actual value is less than the error threshold or the training reaches a specific number of steps, the number of convolution kernels and LSTM hidden layers corresponding to the corresponding component are selected; S3: Input the approximate components of the data to be predicted and σ historical data of several detailed components into the trained CNN-LSTM network respectively, and make traffic predictions at a future time points to obtain N different prediction components. Add the N different prediction components to obtain the final prediction result, and output the future passenger flow prediction value of each library in each time period.
2. The prediction method according to claim 1, characterized in that: In step S1, the Symlet multi-level wavelet decomposition is specifically as follows: Through multi-resolution decomposition, any It can be represented as follows: For any function x(t), the continuous wavelet transform is expressed as formula (1): Where k is an arbitrary integer, representing the translation of the signal; j is an arbitrary non-negative integer, representing different wavelet scales. 2 (R) represents the square integrable real space, that is, the energy-limited signal space, ψ(t) is a basic wavelet or mother wavelet, after scaling and translating it, we can get a wavelet sequence ψ α,τ (t), where α is the scale factor and τ is the translation factor, where α, τ∈R; α≠0, ψ * (t) represents the Fourier transform of ψ(t).
3. The prediction method according to claim 1, characterized in that: In S1, the use of Symlet multi-level wavelet decomposition to decompose the input time series data into an approximate component and several detail components specifically includes: using a specific decomposition level N-1, decomposing the training library traffic data into an approximate component and N-1 detail components using Symlet wavelet, wherein the selection of N is determined according to the order θ of the Symlet wavelet decomposition, and θ is specifically determined by the following formula: For a specific continuous signal T(t) in the time domain, 0≤t≤t max , let T(t) be the space L 2 If the signal in f sample is greater than the Nyquist frequency and Then the discrete signal T(n) contains 1 sample. According to the Symlet wavelet transform mechanism, if each component signal adjusts the frequency f adj If it is less than ρ, then the Symlet wavelet decomposition order θ should satisfy the following formula: i / 2 θ ≤(ρ×t max ) (3) 4. The prediction method according to claim 1, characterized in that: In step S2, the specific steps for determining whether the training is finished are as follows: Step S21, for any sample data extracted, decompose the sample data into N components using Symlet multi-level wavelet decomposition, input the N components into N constructed CNN-LSTM networks respectively, obtain N prediction results, and add the N prediction results to obtain the final predicted future predicted flow of people in the sample library; Step S22, comparing the predicted value of the future predicted flow of people with the true value of the sample marked in the sample data to obtain a deviation value; Step S23, if the deviation value is greater than the preset threshold, execute step S24; If the deviation value is less than the preset threshold, the training ends; Step S24, correct the parameter values of each layer of the CNN-LSTM model according to the deviation value, update the parameter value, add one to the counter, and determine whether the value of the counter is greater than M. If it is greater than M, the training ends; if it is less than or equal to M, replace the sample and execute steps S21 to S23, wherein M is set based on experience to avoid unnecessary repeated training when the preset threshold is set unreasonably.
5. The prediction method according to claim 1, characterized in that: Each of the CNN-LSTM networks includes a convolutional layer, a pooling layer, a flattening layer, an LSTM layer and a fully connected layer. In the prediction method, each decomposed component is processed by each layer to obtain a prediction result of each component.
6. The prediction method according to claim 3, characterized in that: The specific selected samples include 350 samples ι=350,ρ=0.03125,t max =700 times, so by substituting the above value into formula (4), we can get that the Symlet wavelet decomposition order should satisfy: Based on the calculation result in formula (5), when N is selected as 5, the Symlet multi-level wavelet decomposition is used to obtain 4 detail components and 1 approximate component.
7. The prediction method according to claim 1, characterized in that: In the step S1 and the step S2, after the data is acquired, the flow data is subjected to denoising and normalization processing.
8. A system for executing the pre-decomposition hybrid multi-neural network library traffic prediction method as claimed in claim 1, characterized in that: The system includes a data acquisition module, a data processing module, a Symlet module, a model training module, and a model module, wherein the data acquisition module is used to acquire time series passenger flow data, and the time series passenger flow data includes the target library area to be predicted data and the passenger flow data of several library opening periods; the data processing module is used to extract data from the data acquisition module and pre-process the extracted data; the Symlet module is used to perform Symlet multi-level wavelet decomposition on the time series passenger flow data; the model training module is used to train the CNN-LSTM model using the sample data in the sample set database and update the model parameters; the model module is used to predict the future passenger flow of the library using the CNN-LSTM model.
9. The system according to claim 8, characterized in that The CNN unit in the CNN-LSTM model is responsible for extracting local features from the input data, and the LSTM unit is responsible for processing the feature sequence extracted by CNN, wherein each CNN-LSTM network is composed of a convolutional layer, a pooling layer, a flattening layer, an LSTM layer and a fully connected layer.
10. The system according to claim 8, characterized in that The Symlet module is used to decompose the data output by the data processing module into 1 approximate component and N-1 detail components, where N=5.
