A method for predicting demand for building cement materials
By combining architectural progress pictures and time series data, feature information is extracted and mapped into frequency domain information, the LSTM model is improved to process frequency domain information, and the attention mechanism is used to pay attention to historical dependence information, the accuracy and reliability problems of cement material demand prediction in the existing technology are solved, and more efficient prediction results are achieved.
Patent Information
- Application Number
- CN202410952155.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-07-16
AI Technical Summary
The existing methods for forecasting the demand for building cement materials rely on experience and subjective judgment, and there are accuracy and reliability issues, making it difficult to effectively deal with large amounts of data and complex relationships.
Combining architectural progress pictures and time series data related to building cement materials, feature information is extracted through multimodal information combined with modules, the time series information is mapped into frequency domain information using Fourier transform, and the LSTM model is improved to simultaneously process the real and imaginary parts of frequency domain information, and finally, using the attention mechanism to pay attention to historical dependence information.
It improves the accuracy and reliability of building cement material demand forecasts, can better capture key patterns and dependencies in the time series, is suitable for building cement material demand forecasts, and can be generalized for other materials demand forecasts.
Smart Images

Figure CN118863160B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of machine learning, and in particular relates to a method for predicting demand for building cement materials. Background Art
[0002] Cement material is a powdered engineering composite material. After adding water and stirring, it forms a slurry. It can be cast into various shapes through formwork and eventually hardened into a solid concrete structure, providing the necessary strength and stability for the building. It is a key material in building structures. Therefore, accurate prediction of the demand for cement materials in construction projects will help to purchase and reserve the material in a timely manner, reasonably arrange manpower and equipment, and ensure the smooth progress of the project.
[0003] The forecast of demand for construction cement materials usually relies on past experience accumulation and subjective judgment. Although this method can provide valuable reference to a certain extent, it also has many limitations. First, the accuracy and reliability of the forecast are easily affected by personal experience and cognitive bias, resulting in a lack of objectivity and scientific basis for the forecast results. Second, as the scale and complexity of construction projects increase, this method is difficult to effectively handle large amounts of data and complex relationships, which may lead to inaccurate forecast results.
[0004] Building progress pictures can intuitively display the specific construction progress. Therefore, construction cement material data includes two types of data: pictures and numerical values. Comprehensive analysis of these two different types of data can capture the information of construction projects more comprehensively, thereby improving the accuracy of cement material demand forecasts. Summary of the invention
[0005] The present invention provides a method for predicting the demand for building cement materials, which aims to combine the information of two modes, namely, construction progress pictures and time series data related to building cement materials, to obtain richer features, and on this basis, map the information into frequency domain information to better utilize global and local information, and at the same time use the attention mechanism to focus on historical dependency information, so as to improve the performance of machine learning in the task of predicting the demand for building cement materials.
[0006] The technical method adopted by the present invention to achieve the above-mentioned purpose specifically comprises the following steps:
[0007] S1. Collect data related to construction cement materials, including image data and time series data. The image data includes regularly taken photos of the construction site, and the time series data includes actual consumption data of cement materials, weather conditions during construction, and construction schedules.
[0008] S2. Construct a multimodal information combination module, input the image data and time series data of building cement materials, use convolutional neural network and lookup table to obtain the feature information of each type of data, and then combine the feature information of the two modalities;
[0009] S3, using two multi-layer perceptrons to reduce and increase the dimension of feature information;
[0010] S4, constructing an information mapping module, using Fourier transform to map the time series information into frequency domain information, including two components, real part and imaginary part;
[0011] S5. Build a frequency domain LSTM module, improve the input gate, forget gate, output gate and candidate memory unit of the original LSTM, so that it can learn both the real and imaginary components of frequency domain information, and then capture the key patterns and dependencies of time series in the frequency domain;
[0012] S6. Use the attention mechanism to take the final output of the frequency domain LSTM module as the query and all outputs as the key and value. Generate attention weights by calculating the similarity between the query and the key. These attention weights are used to weight the values and further obtain the feature representation of the key time step information of the history.
[0013] S7. Construct a fully connected neural network and calculate the feature representation to obtain the final forecast value of the demand for construction cement materials.
[0014] Preferably, in step S1, the historical data related to construction cement materials include two types of data: picture data and time series data, wherein the picture data refers to photos of construction sites taken regularly; the time series data includes actual consumption data of cement materials, weather conditions during construction, and a construction schedule.
[0015] Preferably, in step S2, for the input building cement material picture data Where W and H are the width and height of the image respectively, and T is the number of timestamps. For the picture at timestamp t∈[1,T], use a convolutional neural network to process P:
[0016] P′=Conv(P);
[0017] Where Conv(·) is a convolutional neural network, It is the feature representation of the image after the convolution operation. After straightening, we get a new image feature representation For the input time series data of building cement materials Where N and T are the number of time series and the number of timestamps respectively. is a multivariate value representation at timestamp t∈[1,T], processed by a lookup table:
[0018] X′=Emb(X);
[0019] Where Emb(·) is the lookup table function, is the new embedding representation of the time series data X obtained by looking up the table, M is the new dimension obtained after the data is operated on the lookup table, and the same is true for After straightening, we get a new embedding representation Concatenate it with P″ to obtain a feature representation containing multimodal information
[0020] Preferably, convolutional neural networks are good at extracting detailed information in images, while lookup tables can automatically learn the feature representation of data and capture the intrinsic relationships and patterns in the data. Therefore, using convolutional neural networks to process image data of building cement materials and combining lookup tables to process time series data of building cement materials can make full use of the spatial features of images and the dynamic features of time series, learn features with higher discrimination, and help to more accurately predict the demand for building cement materials in the future.
[0021] Preferably, in step S3, a multi-layer perceptron is used to perform dimension reduction and dimension increase operations on the feature representation Y:
[0022] Y′=σ(MLP1(Y));
[0023] V = σ(MLP2(Y′));
[0024] Where MLP1(·) and MLP2(·) are multi-layer perceptrons for dimensionality reduction and dimensionality increase, respectively. is the feature representation of Y after dimensionality reduction, q<(W×H+N×M) is the dimension of Y′, is the feature representation of Y′ after dimension increase, is the feature representation at timestamp t∈[0,T], K>q is the dimension of V, and σ is the Sigmoid function.
[0025] Preferably, the feature information can effectively reduce the dimension of the data and remove noise and redundant information through a dimensionality reduction step, thereby improving computational efficiency and model stability. Subsequently, through a dimensionality increase step, more representative and discernible features can be reconstructed to enhance the expressive power of the method. Therefore, reducing the dimensionality of the feature information first and then increasing the dimensionality can simplify the data while retaining its key structural information and improve the overall prediction model effect.
[0026] Preferably, in step S4, the feature information V is converted into frequency domain information using Fourier transform, so as to perform more effective time series prediction using the global perspective and energy compression characteristics of the frequency domain. The specific calculation process is as follows:
[0027] V(l t )=Re(V(v t ))+Im(V(v t ));
[0028]
[0029] Where V(v t ) is the feature representation at timestamp t∈[1,T] in V, is the frequency domain information at timestamp t, indicating V(v t ) The result after Fourier transformation, l t is the frequency variable, which indicates the frequency of the signal in the frequency domain. is v(l t ), Im(V( v t)) is The imaginary part of , j is the imaginary unit.
[0030] Preferably, using Fourier transform to convert feature information into frequency domain information can remove noise, achieve feature compression, simplify complex operations, analyze the global perspective and energy compression characteristics of frequency domain information, and more efficiently process and understand hidden patterns in feature information, providing a basis for the calculation of frequency domain LSTM modules.
[0031] Preferably, in step S5, the characteristic representation Re(V(v t )) and Im(V(v t )) is straightened to obtain the feature representation of the new dimension Where d = k × T. The input gate, forget gate, output gate and candidate memory unit of the original LSTM are further improved to obtain the frequency domain LSTM, so that it can simultaneously learn the real and imaginary components of the frequency domain information. The calculation process of the improved frequency domain LSTM is as follows:
[0032]
[0033] h t =o t ⊙tanh(c t );
[0034] Where W i , U f , W o , U c is the learnable weight parameter, b i 、b f 、b o 、b c is the bias parameter, σ is the Sigmoid function, i t 、f t , They are the input gate, forget gate and output gate of LSTM at timestamp t, is the candidate memory unit at timestamp t, is the memory unit at timestamp t, is the hidden state at timestamp t, and ⊙ is the element-wise multiplication.
[0035] Preferably, the main advantage of LSTM is that it retains historical sequence information through its memory unit and gating mechanism, and effectively captures long-term dependencies. Therefore, LSTM performs well in processing complex periodic patterns and nonlinear relationships. The input gate, forget gate, output gate and candidate memory unit of the original LSTM are improved to obtain the frequency domain LSTM, so that it can simultaneously process both the real and imaginary components of the frequency domain information, further enhancing the model's ability to capture complex time series data, and improving the prediction accuracy and the modeling effect of long-term dependencies.
[0036] Preferably, in step S6, the output o of the frequency domain LSTM at the last moment T is T As the query, all the outputs of the frequency domain LSTM are used as keys and values. The attention weights are generated by calculating the similarity between the query and the key. These attention weights are used to weight the values and further obtain the feature representation of the key time step information of the history. The specific calculation process is as follows:
[0037] In the formula for o t The transpose of s t is the attention score, a t To t Normalized attention weights, is the final weighted sum.
[0038] Preferably, the last moment output of the frequency-domain LSTM is used as the query vector, which interacts with the hidden states of all historical moments through the attention mechanism to generate attention weights. These weights represent the importance of each historical moment to the current prediction. The hidden states of each historical moment are weighted and summed using the attention weights to obtain a comprehensive context vector. This context vector not only retains all historical information, but also highlights those moments that are critical to the current prediction, enabling the model to more accurately capture the key patterns and features in the time series, thereby improving the accuracy of the prediction.
[0039] Preferably, in step S7, the feature representation L is calculated by a fully connected neural network to obtain the final forecast value of the demand for building cement materials:
[0040] F = Linear(L);
[0041] Where Linear(·) is a fully connected neural network, It is the predicted value of final demand for construction cement materials.
[0042] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention proposes a multimodal information combination module to process and fuse the two modal data of building cement material image and time series data to obtain richer features, providing a basis for subsequent processing; secondly, the original LSTM is improved to obtain the frequency domain LSTM, so that it can simultaneously process the real and imaginary parts of the frequency domain information, while effectively utilizing the global perspective and energy compression characteristics of the frequency domain, capturing the key patterns and dependencies of the time series; finally, the attention mechanism is used to further enhance the historical key information, thereby improving the accuracy of the method prediction; the present invention is not only suitable for the demand forecast of building cement materials, but can also be extended to other materials that require demand forecasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a step-by-step diagram for a method for predicting demand for construction cement materials.
[0044] Figure 2 It is a module diagram for combining multimodal information.
[0045] Figure 3 This is the frequency domain LSTM module diagram.
[0046] Figure 4 To further enhance the historical information structure graph using the attention mechanism.
[0047] Figure 5 This is a fitting effect diagram for predicting the demand for construction cement materials. DETAILED DESCRIPTION
[0048] The present invention proposes a method for predicting the demand for building cement materials. By using information from two modalities, namely, construction progress pictures and time series data related to building cement materials, richer features are obtained. On this basis, the information is mapped into frequency domain information to better utilize global and local information. At the same time, the attention mechanism is used to focus on historical dependency information, thereby improving the performance of machine learning in the task of predicting the demand for building cement materials. The technical solution in the embodiment of the present invention is clearly and completely described below, which specifically includes the following steps: Figure 1 shown.
[0049] S1. Collect image data and time series data related to construction cement materials, where the image data includes regularly taken photos of the construction site, and the time series data includes the actual consumption data of cement materials, weather conditions during construction, and construction schedules. The 730-day historical data of construction cement materials obtained will be divided into training set and validation set according to the ratio of 8 to 2, and the first 5 days of data for each day will be used as historical data for method learning.
[0050] S2. Construct a multimodal information combination module, input the image data and time series data of building cement materials, use a convolutional neural network with a convolution kernel of 3×3 and a lookup table to obtain the feature information of each type of data, and then directly splice the feature information of the two modalities.
[0051] Furthermore, a multimodal information combination module is constructed, and its structure is as follows: Figure 2 As shown, for the input building cement material image data Where W=512, H=512 are the width and height of the image respectively, and T=5 is the number of timestamps. For the picture at timestamp t∈[1,5], use a convolutional neural network to process P:
[0052] P′=Conv(P);
[0053] Where Conv(·) is a convolutional neural network with a convolution kernel size of 3×3 and a padding size of 1. The image feature representation obtained after the convolution operation on P is The image features are represented as After straightening, we get a new image feature representation
[0054] For the input time series data of building cement materials Where N = 64 and T = 5 are the number of time series and the number of timestamps respectively. For the multivariate value representation at timestamp t∈[1,5], X is processed using a lookup table:
[0055] X′=Emb(X);
[0056] Where Emb(·) is the lookup table function, is the new embedding representation of the time series data X obtained by the lookup table, 128 is the new dimension value obtained after the data is operated on the lookup table, and similarly for X′ After straightening, we get a new embedding representation Right now Concatenate X″ and P″ to obtain a feature representation containing multimodal information
[0057] S3. Using two multi-layer perceptrons, the first multi-layer perceptron reduces the dimension of feature information, and the second one increases the dimension based on the first one.
[0058] Furthermore, we need to first use a multi-layer perceptron to reduce the dimension of the feature representation Y, and then use another multi-layer perceptron to increase the dimension:
[0059] Y′=σ(MLP1(Y));
[0060] V = σ(MLP2(Y′));
[0061] Where MLP1(·) is a multi-layer perceptron with dimensionality reduction operation, σ is the Sigmoid function, is the feature representation of Y after dimensionality reduction, 512 is the dimension of Y after dimensionality reduction, MLP2(·) is a multi-layer perceptron with dimensionality increase operation, is the feature representation of Y′ after dimension increase, is the feature representation at timestamp t∈[0,5], and 1024 is the dimension of Y′ after dimensionality increase.
[0062] S4. Construct an information mapping module and use Fourier transform to map the time series information into frequency domain information, which includes two components: real part and imaginary part.
[0063] Furthermore, the characteristic information V is converted into frequency domain information using Fourier transform. The frequency domain information includes two parts: the real part and the imaginary part. The specific calculation process is as follows:
[0064] v(l t )=Re(V(v t ))+Im(V(v t ));
[0065]
[0066] In the formula is the frequency domain information representation at timestamp t, which is V(v t ) is the result after Fourier transformation, V(v t) is the feature representation at timestamp t∈[1,5] in V, l t is the frequency variable, which indicates the frequency of the signal in the frequency domain. and Im(V(v t )) are v(l t ), j is an imaginary unit, satisfying j 2 =-1.
[0067] S5. Build a frequency domain LSTM module and improve the input gate, forget gate, output gate and candidate memory units of the original LSTM so that it can simultaneously learn the information mapping module to obtain real and imaginary information, and then capture the key patterns and dependencies of the time series in the frequency domain.
[0068] Furthermore, a frequency domain LSTM module is constructed, and the input gate, forget gate, output gate and candidate memory unit of the original LSTM are expanded so that it can simultaneously learn the real and imaginary components of the frequency domain information. Its structure is as follows: Figure 3 As shown, the characteristics Re(V(v t )) and Im(V(v t )) is straightened to obtain the feature representation of the new dimension Among them, 5120=1024×5, further constructing the frequency domain LSTM, the specific calculation process is as follows:
[0069]
[0070] h t =o t ⊙tanh(c t );
[0071] Where W i , U i , W f , U f , W o , U o , W c , U c is the learnable weight parameter, b i 、b f 、b o 、b c is the bias parameter, σ is the Sigmoid function, i t 、f t , They are the input gate, forget gate and output gate of LSTM at timestamp t, is the candidate memory unit at timestamp t, is the memory unit at timestamp t, is the hidden state at timestamp t, and ⊙ is the element-wise multiplication.
[0072] S6. Use the attention mechanism, take the final output of the frequency domain LSTM module as the query, and all outputs as keys and values. Generate attention weights by calculating the similarity between the query and the key. These attention weights are used to weight the values. The weighted values are directly added to obtain the feature representation of the key historical time step information.
[0073] Furthermore, the attention mechanism is used to further enhance the historical information, such as Figure 4 As shown, the output O of the frequency domain LSTM at the last moment T is T As the query, all the outputs of the frequency domain LSTM are used as keys and values. The similarity between the query and each key is calculated by the dot product attention calculation method to obtain the attention weight, and it is multiplied with the corresponding value to obtain a new weighted value. These weighted values are added element by element to further obtain the feature representation of the key time step information. The specific calculation process is as follows:
[0074] In the formula O t The transpose of s t is the attention score, a t To t Normalized attention weights, is the final weighted sum.
[0075] S7. Construct a fully connected neural network and calculate the final feature representation to obtain the final forecast value of the demand for construction cement materials.
[0076] Furthermore, through the fully connected neural network, the feature representation L is calculated to obtain the final forecast value of the demand for building cement materials:
[0077] F = Linear(L);
[0078] Where Linear(·) is a fully connected neural network, It is the predicted value of final demand for construction cement materials.
[0079] Furthermore, the method uses Python 3.8 language, uses the PyTorch framework in the CUDA 11 environment, and is trained on an NVIDIA RTX 3090 GPU. The batch size during training is 32 and the learning rate is 1×10 -3 ,AdamW optimizer is used.
[0080] Furthermore, the fitting effect of this method is as follows Figure 5As shown in the figure, the ordinate is the demand for cement materials (kg), the abscissa is time (days), the grey dotted line represents the demand data for cement materials, and the black straight line represents the predicted geological disaster data. It can be seen from the figure that the predicted value obtained by this method can fit the actual demand well, and when facing noise and outliers, the predicted value of this method is not affected by them and can still remain stable, which proves the effectiveness of this method.
[0081] The above are only preferred embodiments of the present invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. A method for predicting demand for building cement materials, characterized in that: The following steps are involved: S1. Collect data related to construction cement materials, including pictures and time series data, where the picture data includes regularly taken photos of the construction site, and the time series data includes actual consumption data of cement materials, weather conditions during construction, and construction schedules; S2. Construct a multimodal information combination module, use a convolutional neural network and a lookup table to process the image data and time series data of the building cement material, respectively, obtain the feature information of the two modal data, and then combine the feature information of the two modalities; S3, using two multi-layer perceptrons to reduce the dimension of feature information to remove redundant information, and then perform dimensionality increase again; S4, constructing an information mapping module, using Fourier transform to map the time series information into frequency domain information, including two components, real part and imaginary part; S5. Build a frequency domain LSTM module, improve the input gate, forget gate, output gate and candidate memory unit of the original LSTM, so that the frequency domain LSTM can simultaneously learn the real and imaginary components of the frequency domain information, and then capture the key patterns and dependencies of the time series in the frequency domain; S6. Use the attention mechanism to take the final output of the frequency domain LSTM module as the query and all outputs as the key and value. Generate attention weights by calculating the similarity between the query and the key. These attention weights are used to weight the values, thereby further obtaining feature representations containing historical key time step information. S7. Use a fully connected neural network to calculate the feature representation and obtain the final forecast value of the demand for construction cement materials.
2. A method for predicting demand for building cement materials according to claim 1, characterized in that: In step S2, for the multimodal information combining module, it is necessary to process the data of two different modes, the image of the building cement material and the time series data, obtain their feature information and combine them, so the input includes the image data of the building cement material Where W and H are the width and height of the image respectively, and T is the number of timestamps. is a picture at timestamp t∈[1, T], and time series data of building cement materials Where N and T are the number of time series and the number of timestamps respectively. For the multivariate value representation at timestamp t∈[1, T], the image data P of building cement materials is first processed using a convolutional neural network: P′=Conv(P); Where Conv(·) is a convolutional neural network, It is the feature representation of the image after the convolution operation. After straightening, we get a new image feature representation The input building cement material time series data X is then processed by looking up the table: X′=Emb(X); Where Emb(·) is the lookup table function, is the new embedding representation of the time series data X obtained by looking up the table, M is the new dimension obtained after the data is operated on the lookup table, and the same is true for After straightening, we get a new embedding representation After obtaining the feature information X″ and P″ of the two modal data, they are concatenated to obtain a feature representation containing multimodal information.
3. A method for predicting demand for building cement materials according to claim 2, characterized in that: In step S3, for information dimension reduction and dimension increase operations, a multi-layer perceptron is first used to perform a dimension reduction operation on the feature representation Y: Y′=σ(MLP1(Y)); Where MLP1(·) is a multi-layer perceptron for dimensionality reduction. is the feature representation of Y after dimensionality reduction, q<(W×H+N×M) is the dimension of Y′, σ is the Sigmoid function, and then the multi-layer perceptron is used to increase the dimension of the feature representation Y′: V = σ(MLP2(Y′)); Where MLP2(·) is a multi-layer perceptron with dimension-raising operation. is the feature representation of Y′ after dimension increase, is the feature representation at timestamp t∈[0,T], k>q is the dimension of V, and σ is the Sigmoid function.
4. A method for predicting demand for building cement materials according to claim 3, characterized in that: In step S4, for the information mapping module, the characteristic information V is converted into frequency domain information using Fourier transform, and the specific calculation process is as follows: Where V(v t ) is the feature representation at timestamp t∈[1,T] in V, is the frequency domain information at timestamp t, indicating V(v t ) The result after Fourier transformation, l t is a frequency variable, which indicates the frequency of the signal in the frequency domain. Im(V(v t ))for The imaginary part of for The real part of , j is the imaginary unit, and the global perspective and energy compression characteristics of frequency domain information can more effectively predict time series.
5. A method for predicting demand for building cement materials according to claim 4, characterized in that: In step S5, for the frequency domain LSTM module, the input gate, forget gate, output gate and candidate memory unit of the original LSTM are improved so that it can simultaneously learn the real and imaginary components of the frequency domain information. First, the feature representation Re(V(v t )) and Im(V(v t )) is straightened to obtain the feature representation of the new dimension Where d = k × T, which is then input into the frequency domain LSTM. The calculation process of the frequency domain LSTM is as follows: h t =o t ⊙tanh(c t ); Where W i U i , W f , U f , W o , U o , W c , U c is the learnable weight parameter, b i 、b f 、b o 、b c is the bias parameter, σ is the Sigmoid function, They are the input gate, forget gate and output gate of LSTM at timestamp t, is the candidate memory unit at timestamp t, is the memory unit at timestamp t, is the hidden state at timestamp t, and ⊙ is the element-wise multiplication.
6. A method for predicting demand for building cement materials according to claim 5, characterized in that: In step S6, the feature representation of the historical key time step information using the attention mechanism is to be focused on, and the output o of the last moment T of the frequency domain LSTM is T As the query in the attention mechanism, all the outputs of the frequency domain LSTM are used as keys and values. The similarity between the query and the key is calculated to generate the attention weight, and the corresponding value is weighted according to the weight. The weighted values are added to get the final feature representation. The specific calculation process is as follows: In the formula for o t The transpose of s t is the attention score, a t To t Normalized attention weights, The final weighted sum of all output value keys.
Citation Information
Patent Citations
Method for predicting material purchasing demand based on LSTM network
CN111401651A
Industrial internet prediction method and system based on frequency domain and long and short term feature fusion
CN115907154A