Locomotive energy consumption prediction model training method and device
By using a bidirectional long short-term memory network model optimized through correlation analysis and the whale optimization algorithm, the problem of low accuracy in locomotive energy consumption prediction was solved, achieving more efficient and accurate energy consumption prediction.
Patent Information
- Application Number
- CN202511444702.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-01-09
AI Technical Summary
Existing locomotive energy consumption prediction methods rely on empirical models and rule formulation, and LSTM-based models have difficulty encoding information from back to front, resulting in low prediction accuracy and precision.
Correlation analysis was conducted between multiple locomotive energy consumption influencing indicators and sample data. A sequence of collected sample data was constructed. A bidirectional long short-term memory network model combined with an attention mechanism was optimized through data preprocessing and whale optimization algorithm. The locomotive energy consumption prediction model was then trained and validated.
It improves the accuracy and effectiveness of locomotive energy consumption prediction, and can better capture bidirectional semantic dependencies, thereby improving prediction accuracy and stability.
Smart Images

Figure CN121301925A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of locomotive energy consumption prediction, and in particular to a locomotive energy consumption prediction model training method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] In a railway transportation system, accurate prediction of locomotive energy consumption is of great significance for energy management, dispatching optimization and cost control. Currently, locomotive energy consumption prediction mainly relies on empirical models and rules, or machine learning-based locomotive energy consumption prediction methods. However, locomotive energy consumption prediction still faces some challenges.
[0003] In related technologies, locomotive energy consumption prediction modeling usually uses an LSTM (Long Short-Term Memory) model, which is suitable for modeling time series data and can capture long-distance data dependencies. In the training process, it can learn the information that needs to be remembered and the information that needs to be forgotten. However, the above prediction modeling method has the problem of being unable to encode information from back to front, which affects the accuracy of locomotive energy consumption prediction and has low accuracy. SUMMARY
[0004] Therefore, it is necessary to provide a locomotive energy consumption prediction model training method, device, computer equipment, computer readable storage medium and computer program product to solve the above technical problems.
[0005] In a first aspect, the present application provides a locomotive energy consumption prediction model training method, which comprises:
[0006] Correlation analysis is performed on a plurality of locomotive energy consumption influence indicators and sample locomotive energy consumption data, and a sample data sequence is constructed based on the correlation analysis results. The correlation analysis results include the degree of association between each locomotive energy consumption influence indicator and locomotive energy consumption.
[0007] Through data preprocessing of the sample data sequence, a model training data set and a model test data set are obtained. The data preprocessing at least includes data cleaning and normalization operations.
[0008] An initial model for locomotive energy consumption prediction is optimized using a whale optimization algorithm to obtain an optimized model. The optimized model is trained according to the model training data set to obtain a locomotive energy consumption prediction model. The initial model is constructed by combining a bidirectional long short-term memory network with an attention mechanism.
[0009] Based on the model test data set and the locomotive energy consumption prediction model, an output prediction result is obtained, and the output prediction result is subjected to inverse normalization processing to obtain a test prediction result; the test prediction result is used to verify the effectiveness of the locomotive energy consumption prediction model.
[0010] In one of the embodiments, the construction of the collection sample data sequence based on the correlation analysis result comprises:
[0011] Based on the correlation analysis result, an absolute value matrix is generated, and the correlation degree score corresponding to each of the locomotive energy consumption influence indicators is determined according to the absolute value matrix;
[0012] A target influence indicator is determined from the plurality of locomotive energy consumption influence indicators; the correlation degree score corresponding to the target influence indicator meets a preset selection condition;
[0013] The collection sample data sequence is constructed based on the target influence indicator.
[0014] In one of the embodiments, the data preprocessing of the collection sample data sequence comprises:
[0015] In the data cleaning process, noise data in the collection sample data sequence is identified, the noise data is corrected, and a processed collection sample data sequence is obtained;
[0016] The processed collection sample data sequence is mapped to a specified numerical interval, and the normalization operation is performed.
[0017] In one of the embodiments, the initial model for locomotive energy consumption prediction is optimized by using a whale optimization algorithm to obtain an optimized model, which comprises:
[0018] Model training information of the initial model is configured; the model training information comprises training times, training batch information, the number of hidden layer nodes of the bidirectional long short-term memory network, and model optimization upper and lower bound information;
[0019] The parameter factor adjustment result of the whale optimization algorithm and the model training information are used to find a global optimal solution of hyperparameters of the initial model through iteration to determine optimal model parameters;
[0020] The initial model established based on the optimal model parameters is used as the optimized model.
[0021] In one of the embodiments, the finding of the global optimal solution of hyperparameters of the initial model through iteration to determine the optimal model parameters comprises:
[0022] In the local optimization process, the position of the local optimal solution is adjusted by using an adaptive weight method, and in the global search process, the random number generated by the whale optimization algorithm is adjusted based on the gamma function;
[0023] The optimal solution found in each iteration is updated based on the local optimization process and the global search process until the optimal solution of the iteration process is output as the optimal model parameter.
[0024] In one of the embodiments, the method further comprises:
[0025] In combination with the model error calculation information and the multiple comparative models for verification, the effectiveness of the locomotive energy consumption prediction model is evaluated based on the test prediction result; the model error calculation information includes at least one of the mean absolute error, the mean absolute percentage error, the root mean square error, and the linear regression determination coefficient.
[0026] In a second aspect, the application further provides a locomotive energy consumption prediction model training device, the device comprising:
[0027] A correlation analysis module is configured to perform correlation analysis on a plurality of locomotive energy consumption influencing indicators and sample locomotive energy consumption data, and to construct a sample data sequence based on the correlation analysis results; the correlation analysis results include the correlation degree between each of the locomotive energy consumption influencing indicators and the locomotive energy consumption;
[0028] A data preprocessing module is configured to obtain a model training data set and a model test data set by performing data preprocessing on the sample data sequence; the data preprocessing at least includes data cleaning and normalization operation;
[0029] A model training module is configured to optimize an initial model for locomotive energy consumption prediction by using a whale optimization algorithm to obtain an optimized model, and to train the optimized model based on the model training data set to obtain a locomotive energy consumption prediction model; the initial model is constructed by using a bidirectional long short-term memory network combined with an attention mechanism;
[0030] A model prediction result obtaining module is configured to obtain an output prediction result based on the model test data set and the locomotive energy consumption prediction model, and to obtain a test prediction result by performing inverse normalization processing on the output prediction result; the test prediction result is used to verify the effectiveness of the locomotive energy consumption prediction model.
[0031] In a third aspect, the application further provides a computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the above-mentioned method when executing the computer program.
[0032] In a fourth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the steps of the method described above.
[0033] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described above.
[0034] The locomotive energy consumption prediction model training method, device, computer device, computer readable storage medium and computer program product described above, by using a plurality of locomotive energy consumption influencing indicators and sample locomotive energy consumption data for correlation analysis, constructing a sample data sequence based on the correlation analysis result, the correlation analysis result includes the correlation degree between each locomotive energy consumption influencing indicator and locomotive energy consumption, by data preprocessing on the sample data sequence, obtaining a model training data set and a model test data set, the data preprocessing at least includes data cleaning and normalization operation, then using whale optimization algorithm to optimize the initial model for locomotive energy consumption prediction, obtaining the optimized model, training the optimized model according to the model training data set, obtaining the locomotive energy consumption prediction model, the initial model is constructed by combining the attention mechanism and the bidirectional long short-term memory network, and then based on the model test data set and the locomotive energy consumption prediction model, obtaining the output prediction result, and performing reverse normalization processing on the output prediction result to obtain the test prediction result, which is used to verify the effectiveness of the locomotive energy consumption prediction model. In this way, by combining the correlation analysis to screen the key locomotive energy consumption influencing indicators, the model input quality can be effectively improved to provide data support for accurate model prediction, the whale optimization algorithm is used to optimize the bidirectional long short-term memory network combined with the attention mechanism, and the output prediction result is processed by reverse normalization and verified, which can enhance the accuracy and effectiveness of the locomotive energy consumption prediction model. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor.
[0036] Figure 1 A flowchart of a locomotive energy consumption prediction model training method in one embodiment;
[0037] Figure 2 A schematic diagram of WOA optimizing AT-BILSTM in one embodiment;
[0038] Figure 3A flowchart of a method for training a locomotive energy consumption prediction model in another embodiment;
[0039] Figure 4 A structural block diagram of a device for training a locomotive energy consumption prediction model in an embodiment;
[0040] Figure 5 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0041] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.
[0042] For a railway transportation system, the accuracy of locomotive energy consumption prediction directly affects the efficiency and sustainability of the transportation system. Traditional locomotive energy consumption prediction mainly relies on empirical models and rules, but it is limited by the nature of experience-based, lacks accuracy and scalability, and traditional methods are difficult to capture complex nonlinear relationships and dynamic changes in locomotive operation data.
[0043] With the development of machine learning and data analysis technology, more and more researches are committed to using machine learning technology to improve the accuracy and reliability of locomotive energy consumption prediction. Machine learning methods can better predict locomotive energy consumption under different working conditions by learning energy consumption patterns and trends from a large amount of actual operation data. Some studies show that locomotive energy consumption prediction methods based on machine learning can use large-scale historical operation data to discover potential patterns and correlations in the data, and make real-time energy consumption predictions based on real-time operation data. It can consider multiple factors such as train speed, traction power, traction force, train load, road slope and curve radius, etc. to improve the accuracy and precision of prediction. However, traditional machine learning-based locomotive energy consumption prediction modeling usually uses LSTM models, which are difficult to encode information from back to front, affecting the precision and accuracy of locomotive energy consumption prediction.
[0044] To solve the above problems, the present application provides a BILSTM (Bi-directional Long Short-Term Memory) method, which establishes a bidirectional LSTM model and uses a multi-strategy improved WOA (Whale Optimization Algorithm) algorithm to find the global optimal solution of the model hyperparameters, which can better capture bidirectional semantic dependencies and effectively improve the precision and accuracy of locomotive energy consumption prediction.
[0045] In an exemplary embodiment, as Figure 1As shown, a locomotive energy consumption prediction model training method is provided, and in this embodiment, the method is applied to a terminal for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is realized through the interaction of the terminal and the server. In this embodiment, the method includes the following steps 101 to 104. Among them:
[0046] Step 101, correlation analysis is performed on a plurality of locomotive energy consumption influence indicators and sample locomotive energy consumption data, and a sample data sequence is constructed based on the correlation analysis result.
[0047] Among them, the correlation analysis result can include the correlation degree between each locomotive energy consumption influence indicator and the locomotive energy consumption.
[0048] As an example, the plurality of locomotive energy consumption influence indicators can include vehicle attributes, line attributes, train organization, and meteorological factors.
[0049] In actual application, as Figure 2 shown, by collecting and sorting sample data, correlation analysis of locomotive energy consumption influencing factors can be performed; as an example, the influence indicators (i.e. the plurality of locomotive energy consumption influence indicators) for locomotive energy consumption prediction can be determined, such as vehicle attributes, line attributes, train organization, and meteorological factors, and then the gray correlation degree between the vehicle attributes, line attributes, train organization, and meteorological factors and the sample locomotive energy consumption data can be studied using gray correlation analysis, and then the sample locomotive energy consumption data column can be used as a reference vector to generate a data matrix (i.e. the correlation analysis result) to construct the sample data sequence.
[0050] Optionally, the vehicle attributes can include but are not limited to vehicle model, external design, auxiliary equipment power, and locomotive traction and braking characteristics; the line attributes can include but are not limited to station-to-station distance, line curve, and line slope; the train plan can include but is not limited to station stop plan, interval running time, and full load rate; and the meteorological factors can include but are not limited to rainfall, weather temperature, and extreme weather conditions.
[0051] Step 102, data preprocessing is performed on the sample data sequence to obtain a model training data set and a model test data set; the data preprocessing at least includes data cleaning and normalization operation.
[0052] Specifically, data preprocessing can be performed on the locomotive energy consumption and its related influencing factor data (i.e. the sample data sequence), such as including data cleaning and normalization processing, and then the model training data set and the model test data set can be divided, such as the training set and the test set in Figure 2 .
[0053] In step 103, an initial model for locomotive energy consumption prediction is optimized by using a whale optimization algorithm to obtain an optimized model, and the optimized model is trained according to a model training data set to obtain a locomotive energy consumption prediction model.
[0054] The initial model can be a bidirectional long short-term memory network combined with an attention mechanism.
[0055] In a specific implementation, an AT-BILSTM model (i.e., an initial model) can be established, and a multi-strategy improved WOA algorithm (i.e., a whale optimization algorithm) can be used to find a global optimal solution of the model hyperparameters, and then the normalized data (i.e., a model training data set) can be used to train the optimized AT-BILSTM model to obtain a locomotive energy consumption prediction model.
[0056] In step 104, based on the model test data set and the locomotive energy consumption prediction model, an output prediction result is obtained, and the output prediction result is subjected to inverse normalization processing to obtain a test prediction result; the test prediction result is used to verify the effectiveness of the locomotive energy consumption prediction model.
[0057] In an example, based on the model test data set, the trained model (i.e., the locomotive energy consumption prediction model) can be used to predict the locomotive energy consumption data, and by performing inverse normalization processing on the prediction result, a final prediction result (i.e., a test prediction result) can be obtained, and then the final prediction result can be compared with other prediction models to verify the effectiveness of the locomotive energy consumption prediction model. Thus, the locomotive energy consumption prediction model can have good prediction accuracy and stability while maintaining high efficiency, flexibility, and database scalability.
[0058] In an optional embodiment, the prediction time period can be set to 1 day, 3 days, and 7 days, and the trained locomotive energy consumption prediction model can be used to predict the locomotive energy consumption data to obtain prediction data (i.e., output prediction results) corresponding to 1 day, 3 days, and 7 days, respectively, and then by performing inverse normalization operation on the predicted data, locomotive energy consumption prediction data in a test scenario (i.e., test prediction results) can be obtained.
[0059] In the locomotive energy consumption prediction model training method, the correlation between multiple locomotive energy consumption influencing indicators and sample locomotive energy consumption data is analyzed, the sample data sequence is constructed based on the correlation analysis result, the model training data set and the model test data set are obtained by data preprocessing of the sample data sequence, the initial model for locomotive energy consumption prediction is optimized by using the whale optimization algorithm to obtain the optimized model, the optimized model is trained based on the model training data set to obtain the locomotive energy consumption prediction model, and then the output prediction result is obtained based on the model test data set and the locomotive energy consumption prediction model. The output prediction result is normalized to obtain the test prediction result. In this way, by combining the correlation analysis to select the key locomotive energy consumption influencing indicators, the model input quality can be effectively improved to provide data support for accurate prediction of the model. The bidirectional long short-term memory network combined with the attention mechanism is optimized by using the whale optimization algorithm, and the output prediction result is normalized and verified, which can enhance the accuracy and effectiveness of the locomotive energy consumption prediction model.
[0060] In one exemplary embodiment, the sample data sequence can be constructed based on the correlation analysis result, which can include the following steps:
[0061] Based on the correlation analysis result, an absolute value matrix is generated, the correlation degree score corresponding to each locomotive energy consumption influencing indicator is determined according to the absolute value matrix, a target influencing indicator is determined from the multiple locomotive energy consumption influencing indicators, the correlation degree score corresponding to the target influencing indicator meets a preset selection condition, and the sample data sequence is constructed based on the target influencing indicator.
[0062] After generating the data matrix (i.e. the correlation analysis result), an absolute value matrix can be generated based on the data matrix, and the maximum and minimum values of the absolute value matrix can be set. Then, the gray correlation matrix can be calculated, and the gray correlation degree can be calculated. The correlation degree value can be used to represent the correlation between the influencing factors and the locomotive energy consumption value. A higher correlation degree score can indicate a stronger correlation between the two. Then, the influencing factors with higher correlation degrees (i.e. target influencing indicators) can be selected according to the preset selection condition to construct the sample data sequence.
[0063] Alternatively, the preset selection condition can include selecting based on the correlation degree score threshold, or selecting a preset number of locomotive energy consumption influencing indicators according to the correlation degree score size. Other selection conditions can also be set, which are not limited in this embodiment.
[0064] In this embodiment, the correlation degree score is calculated by the absolute value matrix and the target indicator is selected, which can improve the objectivity and accuracy of indicator selection and avoid irrelevant indicators interference. Then, the sample sequence is constructed based on the target indicator, which can provide accurate data basis for subsequent locomotive energy consumption related analysis and modeling.
[0065] In an exemplary embodiment, the data preprocessing of the collected sample data sequence can include the following steps:
[0066] In the data cleaning process, by identifying the noise data in the collected sample data sequence, the noise data is corrected to obtain a processed collected sample data sequence; the processed collected sample data sequence is mapped to a specified numerical interval, and the normalization operation is performed.
[0067] In an example, as shown in Figure 2 For data preprocessing, DBSCAN (Density-Based Spatial Clustering of Applications with Noise) can be used to identify noise data, find outliers, and then a weighted Lagrange interpolation method can be used to correct the noise data, and then the cleaned data can be normalized, such as using the MinMaxScaler method, which is a data normalization method that can scale data features to a specified range. By determining the minimum and maximum values of each data column in the collected sample data sequence, the proportion of each element in the data column to the total distance between the maximum and minimum values of the data column is calculated to map the standardized data to the given [0, 1] interval (i.e. specified numerical interval).
[0068] In this embodiment, by identifying and correcting the noise data in the collected sample data sequence, data interference can be effectively reduced, and data quality can be improved. Furthermore, by mapping the processed data to a specified numerical interval to complete normalization, the data dimension difference can be eliminated, providing a standardized data basis for subsequent model training.
[0069] In an exemplary embodiment, the initial model for locomotive energy consumption prediction is optimized using a whale optimization algorithm to obtain an optimized model, which can include the following steps:
[0070] Configure the model training information of the initial model; the model training information includes the number of training times, training batch information, the number of hidden layer nodes of the bidirectional long short-term memory network, and model optimization upper and lower bound information; using the parameter factor adjustment result of the whale optimization algorithm and the model training information, the global optimal solution of the hyperparameters of the initial model is found by iteration to determine the optimal model parameters; the initial model established based on the optimal model parameters is used as the optimized model.
[0071] In practical applications, for the initial model, a bidirectional LSTM can be used, and the time step dimension, variable dimension, bidirectional LSTM unit node number, and full connection layer and output layer can be set. By adding an attention mechanism, the weight of each time step can be calculated using the full connection layer. The influence of selective attention to the input on the prediction result can be selected based on the probability distribution method, thereby improving the accuracy of the model.
[0072] In an example, for the hyperparameter selection of the model, the whale optimization algorithm can be used for optimization, such as setting the maximum number of iterations to 10, the number of whales to 5, and setting the learning rate, the number of training times, the BatchSize (the number of samples selected in each training), the node number of the two BiLstm hidden layers, and the upper and lower bounds of the node number of the full connection layer. The parameter factor in the whale optimization algorithm can be adjusted (i.e., the parameter factor adjustment result).
[0073] Specifically, as shown in Figure 2 The learning rate, the number of iterations, the number of hidden layer nodes, and other model parameters determined by the whale optimization algorithm (i.e., the optimal model parameters) can be used to establish an initial model as a prediction model for further training (i.e., an optimized model).
[0074] In this embodiment, by configuring model training key information and adjusting parameters based on the whale optimization algorithm, global optimization of the hyperparameters of the initial model is achieved, which can improve the optimization efficiency of the model parameters. The optimized model constructed based on the optimal parameters can better adapt to the training task and effectively improve the overall performance and prediction accuracy of the model.
[0075] In an exemplary embodiment, the determination of the optimal model parameters by iteratively finding the global optimal solution of the hyperparameters of the initial model can include the following steps:
[0076] In the local optimization process, the position of the local optimal solution is adjusted using an adaptive weight method, and in the global search process, the random numbers generated by the whale optimization algorithm are adjusted based on the gamma function. The optimal solution found in each iteration is updated based on the local optimization process and the global search process until the optimal solution of the iteration process is output as the optimal model parameters.
[0077] In a specific implementation, as shown in Figure 2 For the parameter optimization process based on the whale optimization algorithm, the fitness of each whale can be calculated by initializing the population, the position of the current optimal whale is determined and retained, and then the position is iteratively updated to prevent the particle from jumping out of the range. Boundary judgment is added, and the latest optimal solution is used to replace the retained optimal position if it is better than the retained optimal position.
[0078] For example, the population can be initialized by using a piecewise logistics chaotic mapping, which has a nonlinear property and can ensure that no perturbation operation is needed when generating a sequence, thereby improving the efficiency of the algorithm.
[0079] In an example, in the traditional whale optimization algorithm, the parameter A is an important factor for adjusting the algorithm during the stages of surrounding prey and bubble net attack predation, and the parameter A is affected by the adjustment factor a. However, in the traditional whale optimization algorithm, a is linearly decreasing and ranges from 0 to 2, which can cause poor random optimization ability in the early stage and difficulty in searching in the global range, and can cause the algorithm to fall into a local optimum in the later stage. Therefore, a needs to be improved from linear to nonlinear.
[0080] For local optimization of whales, during the local search process, the whale can only approach the local optimal solution when approaching the local optimal solution, but cannot better perform local optimization. To address the above problem, the technical solution of the embodiment can use a new adaptive weight method, so that when the whale approaches the food, a smaller adaptive weight can be used to change the position of the optimal whale at this time, thereby improving the local optimization ability of the whale.
[0081] In yet another example, the technical solution of the embodiment can make the random numbers generated by the whale optimization algorithm more consistent with the characteristics of the gamma distribution by using the inverse cumulative distribution function of the gamma distribution, thereby better adapting to the characteristics of the target function. The application of the above method in the whale optimization algorithm can enhance the global search ability and convergence speed of the algorithm, thereby improving the optimization effect.
[0082] Furthermore, the WOA algorithm improved by multiple strategies can be used to find the global optimal solution of the hyperparameters of the model, which can further train the prediction model.
[0083] In the embodiment, the adaptive weight is used to adjust the position of the local optimal solution, and the global search random number is optimized based on the gamma function, which can improve the accuracy and global search ability of the optimization process. Furthermore, the local and global optimization are combined to update and iterate the optimal solution, which can effectively avoid the optimization from falling into a local optimum, thereby improving the reliability of the optimal model parameters.
[0084] In an exemplary embodiment, the following steps can also be included:
[0085] The effectiveness of the locomotive energy consumption prediction model is evaluated based on the test prediction results in combination with model error calculation information and multiple comparison models for verification. The model error calculation information includes at least one of the mean absolute error, the mean absolute percentage error, the root mean square error, and the linear regression determination coefficient.
[0086] In practical applications, the mean absolute error, mean absolute percentage error, root mean square error and linear regression determination coefficient R2 (i.e. model error calculation information) can be used for model evaluation, and the BP neural network, LSTM neural network, CS-LSTM, WOA-BILSTM-AT and other models can be used as comparative models to verify the advantages of the MSIWOA-At-BILSTM model (i.e. locomotive energy consumption prediction model) in terms of locomotive energy consumption prediction accuracy.
[0087] Compared with the traditional method, the technical scheme of the embodiment establishes an AT-BILSTM model, uses the multi-strategy improved WOA algorithm to optimize the model to find the global optimal solution of the prediction model hyperparameters, then predicts the sample data, and compares the predicted results with other models to verify the superiority of the MSIWOA-optimized AT-BILSTM prediction model performance, which can better cope with complex and variable locomotive energy consumption prediction scenarios.
[0088] In the embodiment, the multi-dimensional error index and multi-model comparison verification can comprehensively and accurately evaluate the effectiveness of the locomotive energy consumption prediction model, objectively reflect the model prediction performance, and provide a reliable basis for the optimization and improvement of the model.
[0089] In one exemplary embodiment, as shown in Figure 3 Fig. 2 shows another flowchart of a locomotive energy consumption prediction model training method. The method includes the following steps:
[0090] In step 301, the correlation between a plurality of locomotive energy consumption influencing indicators and sample locomotive energy consumption data is analyzed, an absolute value matrix is generated based on the correlation analysis results, and the correlation scores of the corresponding locomotive energy consumption influencing indicators are determined according to the absolute value matrix. In step 302, the target influencing indicator is determined from the plurality of locomotive energy consumption influencing indicators, and the sample data sequence is constructed based on the target influencing indicator. In step 303, the model training data set and the model test data set are obtained by data preprocessing of the collected sample data sequence. In step 304, the model training information of the initial model is configured, the parameter factor adjustment results of the whale optimization algorithm and the model training information are used, the hyperparameter global optimal solution of the initial model is found through iteration, and the optimal model parameters are determined. In step 305, the initial model established based on the optimal model parameters is used as the optimized model, the optimized model is trained according to the model training data set, and the locomotive energy consumption prediction model is obtained. In step 306, based on the model test data set and the locomotive energy consumption prediction model, the output prediction result is obtained, the output prediction result is de-normalized to obtain the test prediction result. In step 307, the effectiveness of the locomotive energy consumption prediction model is evaluated based on the test prediction result, the model error calculation information and the plurality of comparative models used for verification.
[0091] It should be noted that the specific definitions of the above steps can refer to the specific definitions of the locomotive energy consumption prediction model training method described above, which will not be repeated here.
[0092] It should be understood that, although the steps in the flowchart involved in each of the above embodiments are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps.
[0093] Based on the same inventive concept, the present application also provides a locomotive energy consumption prediction model training device for implementing the above-mentioned locomotive energy consumption prediction model training method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific definitions in one or more locomotive energy consumption prediction model training device embodiments provided below can refer to the definitions of the locomotive energy consumption prediction model training method described above, which will not be repeated here.
[0094] In one exemplary embodiment, as shown in Figure 4 a locomotive energy consumption prediction model training device is provided, comprising:
[0095] The correlation analysis module 401 is configured to perform correlation analysis on the plurality of locomotive energy consumption influence indicators and the sample locomotive energy consumption data, and construct a sample data sequence based on the correlation analysis result. The correlation analysis result includes the correlation degree between each of the locomotive energy consumption influence indicators and the locomotive energy consumption.
[0096] The data preprocessing module 402 is configured to obtain a model training data set and a model test data set by performing data preprocessing on the sample data sequence. The data preprocessing at least includes data cleaning and normalization operations.
[0097] The model training module 403 is configured to optimize an initial model for locomotive energy consumption prediction using a whale optimization algorithm to obtain an optimized model, and train the optimized model according to the model training data set to obtain a locomotive energy consumption prediction model. The initial model is constructed by combining an attention mechanism and a bidirectional long short-term memory network.
[0098] The model prediction result obtaining module 404 is configured to obtain an output prediction result based on the model test data set and the locomotive energy consumption prediction model, perform inverse normalization processing on the output prediction result, and obtain a test prediction result; the test prediction result is used to verify the effectiveness of the locomotive energy consumption prediction model.
[0099] In one of the embodiments, the correlation analysis module 401 is specifically configured to generate an absolute value matrix based on the correlation analysis result, determine a correlation degree score corresponding to each of the locomotive energy consumption influence indicators according to the absolute value matrix, determine a target influence indicator from the plurality of locomotive energy consumption influence indicators, and determine that the correlation degree score corresponding to the target influence indicator meets a preset selection condition; and construct the collected sample data sequence based on the target influence indicator.
[0100] In one of the embodiments, the data preprocessing module 402 is specifically configured to, in a data cleaning process, identify noise data in the collected sample data sequence, correct the noise data, and obtain a processed collected sample data sequence; and map the processed collected sample data sequence to a specified numerical interval and perform the normalization operation.
[0101] In one of the embodiments, the model training module 403 is specifically configured to configure model training information of the initial model; the model training information includes a training number, training batch information, a number of hidden layer nodes of the bidirectional long short-term memory network, and model optimization upper and lower bound information; adjust a parameter factor of the whale optimization algorithm based on the model training information, iteratively find a global optimal solution of a hyperparameter of the initial model, determine an optimal model parameter, and use an initial model established based on the optimal model parameter as the optimized model.
[0102] In one of the embodiments, the model training module 403 is specifically configured to, in a local optimization process, adjust a position of a local optimal solution by using an adaptive weight manner, and in a global search process, adjust a random number generated by the whale optimization algorithm based on a gamma function; update the optimal solution found in each iteration based on the local optimization process and the global search process until an optimal solution of an iteration process is output as the optimal model parameter.
[0103] In one of the embodiments, the device further includes:
[0104] The model evaluation module is configured to evaluate the effectiveness of the locomotive energy consumption prediction model based on the test prediction result, model error calculation information, and a plurality of comparison models used for verification; the model error calculation information includes at least one of a mean absolute error, a mean absolute percentage error, a root mean square error, and a linear regression determination coefficient.
[0105] Each of the modules in the locomotive energy consumption prediction model training apparatus can be implemented wholly or partially by software, hardware, and combinations thereof. Each of the modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform operations corresponding to each of the modules.
[0106] In an exemplary embodiment, a computer device, which can be a terminal, is provided, and an internal structure diagram of the computer device can be as shown in Figure 5 The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, mobile cellular network, near field communication (NFC), or other technologies. The computer program is executed by the processor to implement a locomotive energy consumption prediction model training method.
[0107] Those skilled in the art can understand that Figure 5 The structure shown in the above
[0108] In an exemplary embodiment, a computer device is provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the following steps:
[0109] The plurality of locomotive energy consumption influence indicators are subjected to correlation analysis with the sample locomotive energy consumption data, and a sample data sequence is constructed based on the correlation analysis result. The correlation analysis result includes a correlation degree between each of the locomotive energy consumption influence indicators and the locomotive energy consumption.
[0110] The model training data set and the model test data set are obtained by data preprocessing on the collected sample data sequence; the data preprocessing at least includes data cleaning and normalization operation;
[0111] An initial model for locomotive energy consumption prediction is optimized by using a whale optimization algorithm to obtain an optimized model, and the optimized model is trained according to the model training data set to obtain a locomotive energy consumption prediction model; the initial model is obtained by constructing a bidirectional long short-term memory network combined with an attention mechanism;
[0112] Based on the model test data set and the locomotive energy consumption prediction model, an output prediction result is obtained, and the output prediction result is subjected to inverse normalization processing to obtain a test prediction result; the test prediction result is used to verify the effectiveness of the locomotive energy consumption prediction model.
[0113] In one embodiment, the processor also implements the steps of the locomotive energy consumption prediction model training method in the other embodiments above when executing the computer program.
[0114] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0115] A plurality of locomotive energy consumption influence indicators are subjected to correlation analysis with sample locomotive energy consumption data, and a collected sample data sequence is constructed based on the correlation analysis result; the correlation analysis result includes the correlation degree between each locomotive energy consumption influence indicator and locomotive energy consumption;
[0116] The model training data set and the model test data set are obtained by data preprocessing on the collected sample data sequence; the data preprocessing at least includes data cleaning and normalization operation;
[0117] An initial model for locomotive energy consumption prediction is optimized by using a whale optimization algorithm to obtain an optimized model, and the optimized model is trained according to the model training data set to obtain a locomotive energy consumption prediction model; the initial model is obtained by constructing a bidirectional long short-term memory network combined with an attention mechanism;
[0118] Based on the model test data set and the locomotive energy consumption prediction model, an output prediction result is obtained, and the output prediction result is subjected to inverse normalization processing to obtain a test prediction result; the test prediction result is used to verify the effectiveness of the locomotive energy consumption prediction model.
[0119] In one embodiment, the computer program is executed by the processor to also implement the steps of the locomotive energy consumption prediction model training method in the other embodiments above.
[0120] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps:
[0121] Correlation analysis is performed on the plurality of locomotive energy consumption impact indicators and the sample locomotive energy consumption data, and a sample data sequence is constructed based on the correlation analysis result; the correlation analysis result includes the correlation degree between each of the locomotive energy consumption impact indicators and the locomotive energy consumption;
[0122] Through data preprocessing on the sample data sequence, a model training data set and a model test data set are obtained; the data preprocessing at least includes data cleaning and normalization operation;
[0123] An initial model for locomotive energy consumption prediction is optimized using a whale optimization algorithm to obtain an optimized model, and the optimized model is trained according to the model training data set to obtain a locomotive energy consumption prediction model; the initial model is constructed by combining a bidirectional long short-term memory network with an attention mechanism;
[0124] Based on the model test data set and the locomotive energy consumption prediction model, an output prediction result is obtained, and the output prediction result is subjected to inverse normalization processing to obtain a test prediction result; the test prediction result is used to verify the effectiveness of the locomotive energy consumption prediction model.
[0125] In one embodiment, the computer program, when executed by a processor, also implements the steps of the locomotive energy consumption prediction model training method in the other embodiments described above.
[0126] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0127] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0128] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A method for training a locomotive energy consumption prediction model, characterized in that, The method comprises: Correlation analysis is performed on a plurality of locomotive energy consumption influence indexes and sample locomotive energy consumption data, and a sample data sequence is constructed based on the correlation analysis results; the correlation analysis results include the correlation degree between each of the locomotive energy consumption influence indexes and locomotive energy consumption; Data preprocessing is performed on the sample data sequence to obtain a model training data set and a model test data set; the data preprocessing at least includes data cleaning and normalization operations; An initial model for locomotive energy consumption prediction is optimized using a whale optimization algorithm to obtain an optimized model, and the optimized model is trained based on the model training data set to obtain a locomotive energy consumption prediction model; the initial model is constructed based on a bidirectional long short-term memory network combined with an attention mechanism; Based on the model test data set and the locomotive energy consumption prediction model, an output prediction result is obtained, and the output prediction result is subjected to reverse normalization processing to obtain a test prediction result; the test prediction result is used to verify the effectiveness of the locomotive energy consumption prediction model.
2. The method of claim 1, wherein, The sample data sequence is constructed based on the correlation analysis results, which comprises: An absolute value matrix is generated based on the correlation analysis results, and the correlation degree score corresponding to each of the locomotive energy consumption influence indexes is determined based on the absolute value matrix; A target influence index is determined from the plurality of locomotive energy consumption influence indexes; the correlation degree score corresponding to the target influence index meets a preset selection condition; The sample data sequence is constructed based on the target influence index.
3. The method of claim 1, wherein, The data preprocessing of the sample data sequence comprises: In the data cleaning process, noise data in the sample data sequence is identified and corrected to obtain a processed sample data sequence; The processed sample data sequence is mapped to a specified numerical interval, and the normalization operation is performed.
4. The method of claim 1, wherein, The initial model for locomotive energy consumption prediction is optimized using a whale optimization algorithm to obtain an optimized model, which comprises: Model training information of the initial model is configured; the model training information includes the number of training times, training batch information, the number of hidden layer nodes of the bidirectional long short-term memory network, and model optimization upper and lower bound information; The parameter factor adjustment result of the whale optimization algorithm and the model training information are used to find the global optimal solution of the hyperparameters of the initial model through iteration to determine the optimal model parameters; The initial model established based on the optimal model parameters is used as the optimized model.
5. The method of claim 4, wherein, The global optimal solution of the hyperparameters of the initial model is found through iteration to determine the optimal model parameters, which comprises: In the local optimization process, the position of the local optimal solution is adjusted using an adaptive weight method, and in the global search process, the random numbers generated by the whale optimization algorithm are adjusted based on a gamma function; The optimal solution found in each iteration is updated based on the local optimization process and the global search process until the optimal solution of the iteration process is output as the optimal model parameters.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: The validity of the locomotive energy consumption prediction model is evaluated based on the test prediction result in combination with model error calculation information and a plurality of comparative models for verification; the model error calculation information includes at least one of mean absolute error, mean absolute percentage error, root mean square error, and linear regression determination coefficient.
7. A locomotive energy consumption prediction model training apparatus, characterized by, The device comprises: A correlation analysis module is configured to perform correlation analysis on a plurality of locomotive energy consumption influence indexes and sample locomotive energy consumption data, and construct a sample data sequence based on a correlation analysis result; the correlation analysis result includes a correlation degree between each of the locomotive energy consumption influence indexes and locomotive energy consumption; A data preprocessing module is configured to obtain a model training data set and a model test data set by performing data preprocessing on the sample data sequence; the data preprocessing at least includes data cleaning and normalization operation; A model training module is configured to optimize an initial model for locomotive energy consumption prediction by using a whale optimization algorithm to obtain an optimized model, and train the optimized model according to the model training data set to obtain a locomotive energy consumption prediction model; the initial model is constructed by using a bidirectional long short-term memory network combined with an attention mechanism; A model prediction result obtaining module is configured to obtain an output prediction result based on the model test data set and the locomotive energy consumption prediction model, and obtain a test prediction result by performing inverse normalization processing on the output prediction result; the test prediction result is used to verify the validity of the locomotive energy consumption prediction model.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to realize the steps of the method of any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method of any one of claims 1 to 6.
Citation Information
Cited By
High-concentration pulper flow field response rapid prediction model optimization method and related device
CN122088396A
Optimization Method and Related Device for Rapid Prediction Model of Flow Field Response of High Consistency Pulper
CN122088396B