AMSformer: A Transformer for Grain Storage Temperature Prediction Using Adaptive Multi-Scale Feature Fusion
Abstract
:1. Introduction
- (1)
- This paper delves into the existing variants of transformer-based temperature prediction and finds that these models bring redundant information when utilizing cross-dimensional dependencies, which, if not handled, can impact the accuracy of grain temperature prediction.
- (2)
- An adaptive channel attention mechanism and a multi-scale attention mechanism are designed. The former is able to adaptively adjust the weights of different channels according to the characteristics of the input data while suppressing those irrelevant or redundant channels. The latter is used to capture cross-time dependencies more accurately, and by computing attention at different time scales, the model is able to understand the features and structures in the data more comprehensively, thus improving the accuracy and generalization ability of the prediction.
- (3)
- We utilize a hierarchical encoder to feature-fuse the adaptive channel attention mechanism and the multi-scale attention mechanism, which realizes the effective use of adaptive multi-scale information. Experimental results show that our model achieves state-of-the-art performance on both real-world datasets and synthetic datasets.
2. Related Works
3. Methodology
3.1. Datasets
3.2. Adaptive Channel Attention
3.3. Multi-Scale Attention Mechanisms
3.4. Hierarchical Encoder–Decoder
4. Experiments
4.1. Spatial and Temporal Correlation Analysis
4.2. Experimental Setup and Results
4.3. Comparative Analysis of Experiments
4.4. Ablation Experiment
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
References
- Cao, B.; Tang, L.; Hu, B.; Zhao, X. Global Grain Crisis and China’s Grain Security. Int. Econ. Rev. 2021, 2, 9–21. [Google Scholar]
- Liu, Z.; Zhong, H.; Li, Y.; Wen, Q.; Liu, X.; Jian, Y. Change in grain production in China and its impacts on spatial supply and demand distributions in recent two decades. J. Nat. Resour. 2021, 36, 1413–1425. [Google Scholar] [CrossRef]
- Oliveira, L.F.P.; Moreira, A.P.; Silva, M.F. Advances in agriculture robotics: A state-of-the-art review and challenges ahead. Robotics 2021, 10, 52. [Google Scholar] [CrossRef]
- Heller, M.C.; Willits-Smith, A.; Mahon, T.; Keoleian, G.A.; Rose, D. Individual US diets show wide variation in water scarcity footprints. Nat. Food 2021, 2, 255–263. [Google Scholar] [CrossRef] [PubMed]
- Chen, X.; Wu, L.; Shan, L.; Zang, Q. Main factors affecting post-harvest grain loss during the sales process: A survey in nine provinces of China. Sustainability 2018, 10, 661. [Google Scholar] [CrossRef]
- Zhao, L.; Wang, J.; Li, Z.; Hou, M.; Dong, G.; Liu, T.; Sun, T.; Grattan, K.T. Quasi-distributed fiber optic temperature and humidity sensor system for monitoring of grain storage in granaries. IEEE Sens. Journal. 2020, 20, 9226–9233. [Google Scholar] [CrossRef]
- SS, V.C.; Hareendran, A.; Albaaji, G.F. Precision farming for sustainability: An agricultural intelligence model. Comput. Electron. Agric. 2024, 226, 109386. [Google Scholar] [CrossRef]
- Chen, W.; Wang, W.; Peng, B.; Wen, Q.; Zhou, T.; Sun, L. Learning to rotate: Quaternion transformer for complicated periodical time series forecasting. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Washington, DC, USA, 14–18 August 2022; pp. 146–156. [Google Scholar]
- Zhang, Z.; Wang, X.; Gu, Y. Sageformer: Series-aware graph-enhanced transformers for multivariate time series forecasting. arXiv 2023, arXiv:2307.01616. [Google Scholar]
- Zhang, Y.; Yan, J. Crossformer: Transformer utilizing cross-dimension dependency for multivariate time series forecasting. In Proceedings of the Eleventh International Conference on Learning Representations, Kigali, Rwanda, 1–5 May 2023. [Google Scholar]
- Duan, S.; Yang, W.; Wang, X.; Mao, S.; Zhang, Y. Grain pile temperature forecasting from weather factors: A support vector regression approach. In Proceedings of the 2019 IEEE/CIC International Conference on Communications in China (ICCC), Changchun, China, 1–13 August 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 255–260. [Google Scholar]
- Qi, Y.; Li, Q.; Karimian, H.; Liu, D. A hybrid model for spatiotemporal forecasting of PM 2.5 based on graph convolutional neural network and long short-term memory. Sci. Total Environ. 2019, 664, 1–10. [Google Scholar] [CrossRef] [PubMed]
- Ge, L.; Chen, C.; Li, Y.; Mo, T.; Li, W. A CNN-based temperature prediction approach for grain storage. Int. J. Internet Manuf. Serv. 2020, 7, 345–357. [Google Scholar] [CrossRef]
- Qu, Z.; Zhang, Y.; Hong, C.; Zhang, C.; Dai, Z.; Zhao, Y.; Gu, Z. Temperature forecasting of grain in storage: A multi-output and spatiotemporal approach based on deep learning. Comput. Electron. Agric. 2023, 208, 107785. [Google Scholar] [CrossRef]
- Mao, B.; Tao, S.; Li, B. Grain Temperature Prediction Based on GRU Deep Fusion Model. Int. J. Inf. Technol. Decis. Mak. 2024, 1–19. [Google Scholar] [CrossRef]
- Fan, J.; Zhang, K.; Huang, Y.; Zhu, Y.; Chen, B. Parallel spatio-temporal attention-based TCN for multivariate time series prediction. Neural Comput. Appl. 2023, 35, 13109–13118. [Google Scholar] [CrossRef]
- Jiang, Z.; Ning, Z.; Miao, H.; Wang, L. STDNet: A Spatio-Temporal Decomposition Neural Network for Multivariate Time Series Forecasting. Tsinghua Sci. Technol. 2024, 29, 1232–1247. [Google Scholar] [CrossRef]
- Li, X.; Luo, S.; Pan, L.; Wu, Z. Adapt to small-scale and long-term time series forecasting with enhanced multidimensional correlation. Expert Syst. Appl. 2024, 238, 122203. [Google Scholar] [CrossRef]
- Kim, J.; Lee, H.; Yu, S.; Hwang, U.; Jung, W.; Yoon, K. Hierarchical Joint Graph Learning and Multivariate Time Series Forecasting. IEEE Access 2023, 11, 118386–118394. [Google Scholar] [CrossRef]
- Lu, J.; Han, X.; Sun, Y.; Yang, S. CATS: Enhancing Multivariate Time Series Forecasting by Constructing Auxiliary Time Series as Exogenous Variables. arXiv 2024, arXiv:2403.01673. [Google Scholar]
- Miao, H.; Zhang, Y.; Ning, Z.; Jiang, Z.; Wang, L. TDG4MSF: A temporal decomposition enhanced graph neural network for multivariate time series forecasting. Appl. Intell. 2023, 53, 28254–28267. [Google Scholar] [CrossRef]
- Guo, K.; Yu, X. Long-Term Forecasting Using MAMTF: A Matrix Attention Model Based on the Time and Frequency Domains. Appl. Sci. 2024, 14, 2893. [Google Scholar] [CrossRef]
- Wang, D.; Chen, C. Spatiotemporal Self-Attention-Based LSTNet for Multivariate Time Series Prediction. Int. J. Intell. Syst. 2023, 2023, 9523230. [Google Scholar] [CrossRef]
- Zhou, H.; Zhang, S.; Peng, J.; Zhang, S.; Li, J.; Xiong, H.; Zhang, W. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 2–9 February 2021; Volume 35, pp. 11106–11115. [Google Scholar]
- Wu, H.; Xu, J.; Wang, J.; Long, M. Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting. Adv. Neural Inf. Process. Syst. 2021, 34, 22419–22430. [Google Scholar]
- Liu, S.; Yu, H.; Liao, C.; Li, J.; Lin, W.; Liu, A.X.; Dustdar, S. Pyraformer: Low-complexity pyramidal attention for long-range time series modeling and forecasting. In Proceedings of the Tenth International Conference on Learning Representations (ICLR 2022) New Orleans, Louisiana, USA, 25–29 April 2022. [Google Scholar]
- Zhou, T.; Ma, Z.; Wen, Q.; Wang, X.; Sun, L.; Jin, R. Fedformer: Frequency enhanced decomposed transformer for long-term series forecasting. In Proceedings of the 39th International Conference on Machine Learning (PMLR), Baltimore, MD, USA, 17–23 July 2022; pp. 27268–27286. [Google Scholar]
- Du, D.; Su, B.; Wei, Z. Preformer: Predictive transformer with multi-scale segment-wise correlations for long-term time series forecasting. In Proceedings of the ICASSP 2023—2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Rhodes Island, Greece, 4–10 June 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 1–5. [Google Scholar]
- Xiao, Y.; Liu, Z.; Yin, H.; Wang, X.; Zhang, Y. STFormer: A dual-stage transformer model utilizing spatio-temporal graph embedding for multivariate time series forecasting. J. Intell. Fuzzy Syst. 2024, 46, 6951–6967. [Google Scholar] [CrossRef]
- Bahdanau, D. Neural machine translation by jointly learning to align and translate. arXiv 2014, arXiv:1409.0473. [Google Scholar]
- Wu, Z.; Pan, S.; Long, G.; Jiang, J.; Chang, X.; Zhang, C. Connecting the dots: Multivariate time series forecasting with graph neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Virtual Event, San Diego, CA, USA, 6–10 July 2020; pp. 753–763. [Google Scholar]
Models | LSTMa | LSTnet | MTGNN | Transformer | Informer | Autoformer | Pyraformer | FEDformer | Crossformer | AMSformer | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Metric | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | |
ETTh1 | 24 | 0.650 | 0.624 | 1.293 | 0.901 | 0.336 | 0.393 | 0.620 | 0.577 | 0.577 | 0.549 | 0.439 | 0.440 | 0.493 | 0.507 | 0.318 | 0.384 | 0.305 | 0.367 | 0.299 | 0.365 |
48 | 0.720 | 0.675 | 1.456 | 0.960 | 0.386 | 0.429 | 0.692 | 0.671 | 0.685 | 0.625 | 0.429 | 0.442 | 0.554 | 0.544 | 0.342 | 0.396 | 0.352 | 0.394 | 0.347 | 0.395 | |
168 | 1.212 | 0.867 | 1.997 | 1.214 | 0.466 | 0.474 | 0.947 | 0.797 | 0.931 | 0.752 | 0.493 | 0.479 | 0.781 | 0.675 | 0.412 | 0.449 | 0.410 | 0.441 | 0.413 | 0.441 | |
336 | 1.424 | 0.994 | 2.655 | 1.369 | 0.736 | 0.643 | 1.094 | 0.813 | 1.128 | 0.873 | 0.509 | 0.492 | 0.912 | 0.747 | 0.456 | 0.474 | 0.440 | 0.461 | 0.444 | 0.462 | |
720 | 1.960 | 1.322 | 2.143 | 1.380 | 0.916 | 0.750 | 1.241 | 0.917 | 1.215 | 0.896 | 0.539 | 0.537 | 0.993 | 0.792 | 0.521 | 0.515 | 0.519 | 0.524 | 0.510 | 0.520 | |
ETTm1 | 24 | 0.621 | 0.629 | 1.968 | 1.170 | 0.260 | 0.324 | 0.306 | 0.371 | 0.323 | 0.369 | 0.410 | 0.428 | 0.310 | 0.371 | 0.290 | 0.364 | 0.211 | 0.293 | 0.199 | 0.283 |
48 | 1.392 | 0.939 | 1.999 | 1.215 | 0.386 | 0.408 | 0.465 | 0.470 | 0.494 | 0.503 | 0.485 | 0.464 | 0.465 | 0.464 | 0.342 | 0.396 | 0.300 | 0.352 | 0.288 | 0.343 | |
96 | 1.339 | 0.913 | 2.762 | 1.542 | 0.428 | 0.446 | 0.681 | 0.612 | 0.678 | 0.614 | 0.502 | 0.476 | 0.520 | 0.504 | 0.366 | 0.412 | 0.320 | 0.373 | 0.317 | 0.364 | |
288 | 1.740 | 1.124 | 1.257 | 2.076 | 0.469 | 0.488 | 1.162 | 0.879 | 1.056 | 0.786 | 0.604 | 0.522 | 0.729 | 0.657 | 0.398 | 0.433 | 0.404 | 0.427 | 0.392 | 0.418 | |
672 | 2.736 | 1.555 | 1.917 | 2.941 | 0.620 | 0.571 | 1.231 | 1.103 | 1.192 | 0.926 | 0.607 | 0.530 | 0.980 | 0.678 | 0.455 | 0.464 | 0.569 | 0.528 | 0.529 | 0.510 | |
WTH | 24 | 0.546 | 0.570 | 0.615 | 0.545 | 0.307 | 0.356 | 0.349 | 0.397 | 0.335 | 0.381 | 0.363 | 0.396 | 0.301 | 0.359 | 0.357 | 0.412 | 0.294 | 0.343 | 0.292 | 0.343 |
48 | 0.829 | 0.677 | 0.660 | 0.589 | 0.388 | 0.422 | 0.386 | 0.433 | 0.395 | 0.459 | 0.456 | 0.462 | 0.376 | 0.421 | 0.428 | 0.458 | 0.370 | 0.411 | 0.366 | 0.407 | |
168 | 1.038 | 0.835 | 0.748 | 0.647 | 0.498 | 0.512 | 0.613 | 0.582 | 0.608 | 0.567 | 0.574 | 0.548 | 0.519 | 0.521 | 0.564 | 0.541 | 0.473 | 0.494 | 0.469 | 0.490 | |
336 | 1.657 | 1.059 | 0.782 | 0.683 | 0.506 | 0.523 | 0.707 | 0.634 | 0.702 | 0.620 | 0.600 | 0.571 | 0.539 | 0.543 | 0.533 | 0.536 | 0.495 | 0.515 | 0.498 | 0.517 | |
720 | 1.536 | 1.109 | 0.851 | 0.757 | 0.510 | 0.527 | 0.834 | 0.741 | 0.831 | 0.731 | 0.587 | 0.570 | 0.547 | 0.553 | 0.562 | 0.557 | 0.526 | 0.542 | 0.521 | 0.537 | |
ECL | 48 | 0.486 | 0.572 | 0.369 | 0.445 | 0.173 | 0.280 | 0.334 | 0.399 | 0.344 | 0.393 | 0.241 | 0.351 | 0.478 | 0.471 | 0.229 | 0.338 | 0.156 | 0.255 | 0.150 | 0.254 |
168 | 0.574 | 0.602 | 0.394 | 0.476 | 0.236 | 0.320 | 0.353 | 0.420 | 0.368 | 0.424 | 0.299 | 0.387 | 0.452 | 0.455 | 0.263 | 0.361 | 0.231 | 0.309 | 0.223 | 0.307 | |
336 | 0.886 | 0.795 | 0.419 | 0.477 | 0.328 | 0.373 | 0.381 | 0.439 | 0.381 | 0.431 | 0.375 | 0.428 | 0.463 | 0.456 | 0.305 | 0.386 | 0.323 | 0.369 | 0.301 | 0.353 | |
720 | 1.676 | 1.095 | 0.556 | 0.565 | 0.422 | 0.410 | 0.391 | 0.438 | 0.406 | 0.443 | 0.377 | 0.434 | 0.480 | 0.461 | 0.372 | 0.434 | 0.404 | 0.423 | 0.408 | 0.426 | |
960 | 1.591 | 1.128 | 0.605 | 0.599 | 0.471 | 0.451 | 0.492 | 0.550 | 0.460 | 0.548 | 0.366 | 0.426 | 0.550 | 0.489 | 0.393 | 0.449 | 0.433 | 0.438 | 0.436 | 0.441 | |
ILI | 24 | 4.220 | 1.335 | 4.975 | 1.660 | 4.265 | 1.387 | 3.954 | 1.323 | 4.588 | 1.462 | 3.101 | 1.238 | 3.970 | 1.338 | 2.687 | 1.147 | 3.041 | 1.186 | 2.926 | 1.139 |
36 | 4.771 | 1.427 | 5.322 | 1.659 | 4.777 | 1.496 | 4.167 | 1.360 | 4.845 | 1.496 | 3.397 | 1.270 | 4.377 | 1.410 | 2.887 | 1.160 | 3.406 | 1.232 | 3.154 | 1.160 | |
48 | 4.945 | 1.462 | 5.425 | 1.632 | 5.333 | 1.592 | 4.746 | 1.463 | 4.865 | 1.516 | 2.947 | 1.203 | 4.811 | 1.503 | 2.797 | 1.155 | 3.459 | 1.221 | 3.256 | 1.158 | |
60 | 5.176 | 1.504 | 5.477 | 1.675 | 5.070 | 1.552 | 5.219 | 1.553 | 5.212 | 1.576 | 3.019 | 1.202 | 5.204 | 1.588 | 2.809 | 1.163 | 3.640 | 1.305 | 3.396 | 1.208 | |
24 | 0.668 | 0.378 | 0.648 | 0.403 | 0.506 | 0.278 | 0.597 | 0.332 | 0.608 | 0.334 | 0.550 | 0.363 | 0.606 | 0.338 | 0.562 | 0.375 | 0.491 | 0.274 | 0.481 | 0.270 | |
Traffic | 24 | 0.668 | 0.378 | 0.648 | 0.403 | 0.506 | 0.278 | 0.597 | 0.332 | 0.608 | 0.334 | 0.550 | 0.363 | 0.606 | 0.338 | 0.562 | 0.375 | 0.491 | 0.274 | 0.481 | 0.270 |
48 | 0.709 | 0.400 | 0.709 | 0.425 | 0.512 | 0.298 | 0.658 | 0.369 | 0.644 | 0.359 | 0.595 | 0.376 | 0.619 | 0.346 | 0.567 | 0.374 | 0.519 | 0.295 | 0.506 | 0.285 | |
168 | 0.900 | 0.523 | 0.713 | 0.435 | 0.521 | 0.319 | 0.664 | 0.363 | 0.660 | 0.391 | 0.649 | 0.407 | 0.635 | 0.347 | 0.607 | 0.385 | 0.513 | 0.289 | 0.512 | 0.287 | |
336 | 1.067 | 0.599 | 0.741 | 0.451 | 0.540 | 0.335 | 0.654 | 0.358 | 0.747 | 0.405 | 0.624 | 0.388 | 0.641 | 0.347 | 0.624 | 0.389 | 0.530 | 0.300 | 0.528 | 0.299 | |
720 | 1.461 | 0.787 | 0.768 | 0.474 | 0.557 | 0.343 | 0.685 | 0.370 | 0.792 | 0.430 | 0.674 | 0.417 | 0.670 | 0.364 | 0.623 | 0.378 | 0.573 | 0.313 | 0.572 | 0.310 |
Models | Transformer | ACA | MSA | ACA + MSA | ACA + MSA + HED | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Metric | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | |
ETTh1 | 24 | 0.620 | 0.577 | 0.612 | 0.571 | 0.615 | 0.573 | 0.331 | 0.387 | 0.299 | 0.365 |
48 | 0.692 | 0.671 | 0.684 | 0.665 | 0.687 | 0.669 | 0.381 | 0.423 | 0.347 | 0.395 | |
168 | 0.947 | 0.797 | 0.941 | 0.791 | 0.932 | 0.783 | 0.461 | 0.465 | 0.413 | 0.441 | |
336 | 1.094 | 0.813 | 1.089 | 0.806 | 1.074 | 0.793 | 0.728 | 0.632 | 0.444 | 0.462 | |
720 | 1.241 | 0.917 | 1.238 | 0.914 | 1.219 | 0.897 | 0.869 | 0.706 | 0.510 | 0.520 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhang, Q.; Zhang, W.; Huang, Q.; Wan, C.; Li, Z. AMSformer: A Transformer for Grain Storage Temperature Prediction Using Adaptive Multi-Scale Feature Fusion. Agriculture 2025, 15, 58. https://doi.org/10.3390/agriculture15010058
Zhang Q, Zhang W, Huang Q, Wan C, Li Z. AMSformer: A Transformer for Grain Storage Temperature Prediction Using Adaptive Multi-Scale Feature Fusion. Agriculture. 2025; 15(1):58. https://doi.org/10.3390/agriculture15010058
Chicago/Turabian StyleZhang, Qinghui, Weixiang Zhang, Quanzhen Huang, Chenxia Wan, and Zhihui Li. 2025. "AMSformer: A Transformer for Grain Storage Temperature Prediction Using Adaptive Multi-Scale Feature Fusion" Agriculture 15, no. 1: 58. https://doi.org/10.3390/agriculture15010058
APA StyleZhang, Q., Zhang, W., Huang, Q., Wan, C., & Li, Z. (2025). AMSformer: A Transformer for Grain Storage Temperature Prediction Using Adaptive Multi-Scale Feature Fusion. Agriculture, 15(1), 58. https://doi.org/10.3390/agriculture15010058