Batch-Level Average Market Weight Estimation and Interpretability Analysis for Pigs with Regional K-Means Clustering and AMFormer
Simple Summary
Abstract
1. Introduction
2. Materials and Methods
2.1. Data
2.1.1. Batch Production Records of Pigs
- Organizational and regional indicators: The l2 unit, l3 company, l4 company, and l5 unit indicate the affiliation path of each farm within the enterprise’s multi-level management system. The Region feature describes the geographical location of the farm.
- Initial batch conditions: Placement month, placement count, and placement weight. These indicators characterize the initial status of each batch.
- Production process indicators: Feeding days, 2w mortality, 5w mortality, medication cost, and feed consumption. These indicators reflect pig status and cost input during the feeding process.
- Marketing outcome indicator: market weight. This variable serves as the estimation target in this study.
2.1.2. Production Phase and Data Collection
2.1.3. Indicator Definitions and Data Sources
- Feed Consumption. In actual production, the enterprise delivers piglets and feed to contract farmers and records the placement count and cumulative feed supply for each production batch through the production management system. Feed is supplied on farms through automatic feeding lines. However, the feed consumption per pig used in this study is not individual or group-level feed intake monitoring data. Instead, it is a production indicator calculated by the company headquarters based on the cumulative feed supply recorded in the production database and the placement count, which is calculated as follows:where represents the cumulative feed delivered to the batch over the entire feeding period, as recorded by the enterprise’s management system.
- Feeding Days. This indicator denotes the cumulative number of days that pigs in a batch have been raised since piglet placement. It is used to characterize the growth stage and farming progress of the batch.
- Organizational hierarchy feature. Wens has established a relatively complete multi-level organizational management structure. The organizational hierarchy features used in this study correspond to management companies or units at different granularities below the group headquarters. Specifically, this hierarchy is structured as follows, headquarters → business division (l2 unit) → regional company (l3 company) → production company (l4 company) → farm (l5 unit).As shown in Figure 1, under large-scale standardized pig production, each production batch can be traced through this hierarchy to obtain its complete management affiliation path. In addition, each batch is labeled with its geographical region, including South China, East China, North China, Central China, and Southwest. The Region feature mainly reflects the macro-geographical location of the batch and its possible climatic and environmental differences. It is not part of the enterprise’s internal organizational hierarchy.

2.1.4. Data Cleaning
2.2. Problem Definition
2.3. Weight Estimation Model
2.3.1. Regional Clustering Method
2.3.2. Cyclic Feature Encoding
2.3.3. Row-Column Fusion Representation
2.3.4. Arithmetic Attention Backbone Network
2.4. Compared Models
- Tree-based models. XGBoost [22] is an optimized framework based on gradient-boosted decision trees and has strong regularization capability, which is widely used in pig weight estimation. CatBoost [23] is a gradient boosting model specifically designed for categorical features. By using ordered boosting, it alleviates gradient estimation bias and shows clear advantages on mixed-type tabular data. Random Forest [46] is an ensemble learning method that improves generalization ability and robustness by constructing multiple independent decision trees and averaging their predictions or taking a majority vote. It is also one of the most commonly used baseline models for tabular tasks.
- Attention-based models. AutoInt [37] is one of the earliest models to apply self-attention to tabular data, and it captures high-order feature interactions through stacked self-attention layers. SAINT [38] is a tabular-specific architecture that improves learning performance through a hybrid attention mechanism and contrastive pretraining. FT-Transformer [39] adapts the standard Transformer to tabular data and captures high-order feature interactions through contextual embeddings, where its self-attention mainly reflects conventional additive interactions. ExcelFormer [40] introduces semi-permeable attention, interaction attenuation initialization, and tabular-specific data augmentation and can outperform GBDT without hyperparameter tuning. AMFormer [41] is a deep tabular model based on an improved Transformer architecture, whose core design lies in parallel additive and multiplicative attention mechanisms.
- Classical deep learning models. ResNet-like [39] adopts a multilayer perceptron with residual connections, which can alleviate the vanishing gradient problem in deep networks. TabNet [53] employs a sequential attention mechanism and performs feature selection through learnable sparse feature masks. It emphasizes model interpretability and is commonly used in pig weight estimation tasks.
2.5. Training Settings
3. Results and Discussion
3.1. Evaluation Metrics
3.2. Estimation Results
3.3. Ablation Study
3.4. Statistical Evaluation of Performance Improvement
3.5. Results with Region-Stratified Splitting
3.6. Impact of the Regional Clustering Feature on Tree-Based Models
3.7. Interpretability Analysis
3.7.1. Analysis of Growth, Health, and Seasonal Features
3.7.2. Analysis of Hierarchical and Regional Features
3.7.3. Contribution of Regional Clustering
3.7.4. Insights into Batch-Level Non-Invasive Weight Estimation
3.8. Analysis of Regional Farming Patterns
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- He, Y.; Tiezzi, F.; Howard, J.; Maltecca, C. Predicting body weight in growing pigs from feeding behavior data using machine learning algorithms. Comput. Electron. Agric. 2021, 184, 106085. [Google Scholar] [CrossRef] [Scilit]
- Jang, J.W.; Lee, J.H.; Nam, G.P.; Lee, S.H. System Design of Optimal Pig Shipment Schedule through Prediction Model. Agriculture 2023, 13, 1520. [Google Scholar] [CrossRef] [Scilit]
- Lee, J.; Jin, L.; Park, D.; Chung, Y. Automatic recognition of aggressive behavior in pigs using a kinect depth sensor. Sensors 2016, 16, 631. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wang, Z.; Shadpour, S.; Chan, E.; Rotondo, V.; Wood, K.M.; Tulpan, D. ASAS-NANP SYMPOSIUM: Applications of machine learning for livestock body weight prediction from digital images. J. Anim. Sci. 2021, 99, skab022. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wang, Z.; Li, Q.; Yu, Q.; Qian, W.; Gao, R.; Wang, R.; Wu, T.; Li, X. A review of visual estimation research on live pig weight. Sensors 2024, 24, 7093. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chen, Y.; Li, Z.; Yin, L.; Kuang, Y. A Novel Approach of Pig Weight Estimation Using High-Precision Segmentation and 2D Image Feature Extraction. Animals 2025, 15, 2975. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kwon, K.; Mun, D. Iterative offset-based method for reconstructing a mesh model from the point cloud of a pig. Comput. Electron. Agric. 2022, 198, 106996. [Google Scholar] [CrossRef] [Scilit]
- Tu, G.J.; Jørgensen, E. Vision analysis and prediction for estimation of pig weight in slaughter pens. Expert Syst. Appl. 2023, 220, 119684. [Google Scholar] [CrossRef] [Scilit]
- Xie, C.; Cang, Y.; Lou, X.; Xiao, H.; Xu, X.; Li, X.; Zhou, W. A novel approach based on a modified mask R-CNN for the weight prediction of live pigs. Artif. Intell. Agric. 2024, 12, 19–28. [Google Scholar] [CrossRef] [Scilit]
- Wan, S.; Fang, H.; Wang, X. Monocular Visual Pig Weight Estimation Method Based on the EfficientVit-C Model. Agriculture 2024, 14, 1571. [Google Scholar] [CrossRef] [Scilit]
- Ma, Z.; Xiong, T.; Wu, L.; Xia, W. Combining Machine Learning and Econometric Forecasts for Hog Markets: A Decision Framework for Price Prediction and Production Planning. Agribusiness 2026. [Google Scholar] [CrossRef] [Scilit]
- GB/T 40945-2021; Code of Practice for Quality Grading of Livestock and Poultry Meat. China Standard Press: Beijing, China, 2021.
- Wu, F.; Vierck, K.R.; DeRouchey, J.M.; O’Quinn, T.G.; Tokach, M.D.; Goodband, R.D.; Dritz, S.S.; Woodworth, J.C. A review of heavy weight market pigs: Status of knowledge and future needs assessment. Transl. Anim. Sci. 2017, 1, 1–15. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kim, Y.S.; Kim, S.W.; Weaver, M.A.; Lee, C.Y. Increasing the pig market weight: World trends, expected consequences and practical considerations. Asian Australas. J. Anim. 2005, 18, 590–600. [Google Scholar] [CrossRef] [Scilit]
- Benjamin, M.; Yik, S. Precision livestock farming in swine welfare: A review for swine practitioners. Animals 2019, 9, 133. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Hasan, M.K.; Mun, H.S.; Ampode, K.M.B.; Lagua, E.B.; Park, H.R.; Kim, Y.H.; Sharifuzzaman, M.; Yang, C.J. Transformation toward precision large-scale operations for sustainable farming: A review based on China’s pig industry. J. Adv. Vet. Anim. Res. 2024, 11, 1076–1092. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wang, L.; Li, D. Current status, challenges and prospects for pig production in Asia. Anim. Biosci. 2024, 37, 742–754. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Losacco, C.; Pugliese, G.; Forte, L.; Tufarelli, V.; Maggiolino, A.; De Palo, P. Digital transition as a driver for sustainable tailor-made farm management: An up-to-date overview on precision livestock farming. Agriculture 2025, 15, 1383. [Google Scholar] [CrossRef] [Scilit]
- Karlsson, E.; Yngvesson, J.; Jeppsson, K.H.; Westin, R. Housing systems with automatic sorting for finishing pigs in large groups—A field study. Front. Anim. Sci. 2026, 7, 1773476. [Google Scholar] [CrossRef] [Scilit]
- Ulguim, R.R.; Pereira, M.A.; Tavares, J.; Linhares, D.C.L.; Mellagi, A.P.G.; Bortolozzo, F.P.; Tecchio, C.A.; Nagae, R.Y.; Cavazini, N.C.; de Lara, A.C.; et al. Application of unsupervised learning to cluster swine breeding herds based on key performance indicators in Southern Brazil. Transl. Anim. Sci. 2026, 10, txag036. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Will, K.J.; Magalhaes, E.S.; Moura, C.A.; Trevisan, G.; Silva, G.S.; Mellagi, A.P.G.; Ulguim, R.R.; Bortolozzo, F.P.; Linhares, D.C. Risk factors associated with piglet pre-weaning mortality in a Midwestern U.S. swine production system from 2020 to 2022. Prev. Vet. Med. 2024, 232, 106316. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chen, T.; Guestrin, C. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; pp. 785–794. [Google Scholar] [CrossRef] [Scilit]
- Prokhorenkova, L.; Gusev, G.; Vorobev, A.; Dorogush, A.V.; Gulin, A. CatBoost: Unbiased boosting with categorical features. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 3–8 December 2018; pp. 6639–6649. [Google Scholar]
- Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; Liu, T.Y. Lightgbm: A highly efficient gradient boosting decision tree. In Proceedings of the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017; pp. 3146–3154. [Google Scholar]
- Hollmann, N.; Müller, S.; Purucker, L.; Krishnakumar, A.; Körfer, M.; Hoo, S.B.; Schirrmeister, R.T.; Hutter, F. Accurate predictions on small data with a tabular foundation model. Nature 2025, 637, 319–326. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Somvanshi, S.; Das, S.; Javed, S.; Antariksa, G.; Hossain, A. A Survey on Tabular Data: From Tree-based Methods to Tabular Deep Learning. ACM Comput. Surv. 2026. [Google Scholar] [CrossRef] [Scilit]
- Grinsztajn, L.; Oyallon, E.; Varoquaux, G. Why do tree-based models still outperform deep learning on typical tabular data? In Proceedings of the Advances in Neural Information Processing Systems, New Orleans, LA, USA, 28 November–9 December 2022; pp. 507–520. [Google Scholar]
- Micci-Barreca, D. A preprocessing scheme for high-cardinality categorical attributes in classification and prediction problems. SIGKDD Explor. Newsl. 2001, 3, 27–32. [Google Scholar] [CrossRef] [Scilit]
- Otter, D.W.; Medina, J.R.; Kalita, J.K. A survey of the usages of deep learning for natural language processing. IEEE Trans. Neural Netw. Learn. Syst. 2021, 32, 604–624. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Voulodimos, A.; Doulamis, N.; Doulamis, A.; Protopapadakis, E. Deep learning for computer vision: A brief review. Comput. Intell. Neurosci. 2018, 2018, 7068349. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Khaksar Ghalati, M.; Hao, Z.D.; Zhang, J.; Dong, H. Deep Transformers for Analyzing BOF Steelmaking Data. Metall. Mater. Trans. B 2025, 56, 4201–4217. [Google Scholar] [CrossRef] [Scilit]
- Borisov, V.; Leemann, T.; Seßler, K.; Haug, J.; Pawelczyk, M.; Kasneci, G. Deep neural networks and tabular data: A survey. IEEE Trans. Neural Netw. Learn. Syst. 2024, 35, 7499–7519. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Sumon, M.S.I.; Islam, M.S.B.; Rahman, M.S.; Hossain, M.S.A.; Khandakar, A.; Hasan, A.; Murugappan, M.; Chowdhury, M.E.H. CardioTabNet: A novel hybrid transformer model for heart disease prediction using tabular medical data. Health Inf. Sci. Syst. 2025, 13, 44. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Barkov, V.; Schmidinger, J.; Gebbers, R.; Atzmueller, M. Modern Neural Networks for Small Tabular Datasets: The New Default for Field-Scale Digital Soil Mapping? Eur. J. Soil Sci. 2026, 77, e70299. [Google Scholar] [CrossRef] [Scilit]
- Zhu, X.; Su, P.; Yu, J.; Pei, J.; Teng, Z.; Li, Y.; Liu, Y. A prediction model for hazard levels of shallow natural gas in tunnel based on K-means clustering and tabular prior-data fitted network. Results Eng. 2025, 27, 106873. [Google Scholar] [CrossRef] [Scilit]
- McElfresh, D.; Khandagale, S.; Valverde, J.; Prasad, V.C.; Ramakrishnan, G.; Goldblum, M.; White, C. When do neural nets outperform boosted trees on tabular data? In Proceedings of the 37th International Conference on Neural Information Processing Systems, New Orleans, LA, USA, 10–16 December 2023; pp. 76336–76369. [Google Scholar]
- Song, W.; Shi, C.; Xiao, Z.; Duan, Z.; Xu, Y.; Zhang, M.; Tang, J. AutoInt: Automatic Feature Interaction Learning via Self-Attentive Neural Networks. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management, Beijing, China, 3–7 November 2019; pp. 1161–1170. [Google Scholar] [CrossRef] [Scilit]
- Somepalli, G.; Goldblum, M.; Schwarzschild, A.; Bruss, C.B.; Goldstein, T. Saint: Improved neural networks for tabular data via row attention and contrastive pre-training. arXiv 2021, arXiv:2106.01342. [Google Scholar]
- Gorishniy, Y.; Rubachev, I.; Khrulkov, V.; Babenko, A. Revisiting deep learning models for tabular data. In Proceedings of the 35th International Conference on Neural Information Processing Systems (NeurIPS 2021), Online, 6–14 December 2021; pp. 18932–18943. [Google Scholar]
- Chen, J.; Yan, J.; Chen, Q.; Chen, D.Z.; Wu, J.; Sun, J. Can a Deep Learning Model be a Sure Bet for Tabular Prediction? In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Barcelona, Spain, 25–29 August 2024; pp. 288–296. [Google Scholar] [CrossRef] [Scilit]
- Cheng, Y.; Hu, R.; Ying, H.; Shi, X.; Wu, J.; Lin, W. Arithmetic feature interaction is necessary for deep tabular learning. In Proceedings of the 38th AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 26–27 February 2024; pp. 11516–11524. [Google Scholar] [CrossRef] [Scilit]
- Li, X.; Li, Y.; Liu, J.; Jin, X.; Hu, X. Multi-branch of Attention Yields Accurate Results for Tabular Data. arXiv 2025, arXiv:2502.12507. [Google Scholar]
- Ahmed, M.; Seraj, R.; Islam, S.M.S. The K-Means Algorithm: A Comprehensive Survey and Performance Evaluation. Electronics 2020, 9, 1295. [Google Scholar] [CrossRef] [Scilit]
- Bruininx, E.M.A.M.; van der Peet-Schwering, C.M.C.; Schrama, J.W.; Vereijken, P.F.G.; Vesseur, P.C.; Everts, H.; den Hartog, L.A.; Beynen, A.C. Individually measured feed intake characteristics and growth performance of group-housed weanling pigs: Effects of sex, initial body weight, and body weight distribution within groups. J. Anim. Sci. 2001, 79, 301–308. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Tang, A. Optimization of Interest Linkage Mechanism between Agricultural Leading Enterprises and Breeding Farmers: A Case Study of Wen’s Group. Rural Econ. Sci.-Technol. 2025, 36, 118–121. (In Chinese) [Google Scholar]
- Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef] [Scilit]
- Svirsky, J.; Lindenbaum, O. Interpretable deep clustering for tabular data. In Proceedings of the 41st International Conference on Machine Learning, Vienna, Austria, 21–27 July 2024; pp. 47314–47330. [Google Scholar]
- Feng, G.; Feng, Y.; Chang, H. Comprehensive Measures to Reduce Mortality of Weaned Piglets. Jilin Anim. Husb. Vet. Med. 2025, 46, 52–54. (In Chinese) [Google Scholar]
- Guan, C.; Ling, B.; Kong, Y.; Zhang, G. Dynamic Monitoring System of Different Dimensions for Nursery-Finishing Integrated Pig Herd Feeding and Its Guiding Significance for Production. Swine Prod. 2019, 81–84. (In Chinese) [Google Scholar] [CrossRef]
- Zhang, S.; Wong, H.S.; Shen, Y. Generalized adjusted rand indices for cluster ensembles. Pattern Recogn. 2012, 45, 2214–2226. [Google Scholar] [CrossRef] [Scilit]
- Renaudeau, D.; Gourdine, J.L.; St-Pierre, N.R. A meta-analysis of the effects of high ambient temperature on growth performance of growing-finishing pigs. J. Anim. Sci. 2011, 89, 2220–2230. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wu, T.; Cao, L.; Wang, S.; Wang, J.; Zhu, S.; Wu, Y.; Feng, Y. City-level foreign direct investment prediction with tabular learning on judicial data. In Proceedings of the 34th International Joint Conference on Artificial Intelligence, Montreal, QC, Canada, 29–31 August 2025; pp. 9936–9944. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Arik, S.Ö.; Pfister, T. TabNet: Attentive interpretable tabular learning. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 2–9 February 2021; Volume 35, pp. 6679–6687. [Google Scholar] [CrossRef] [Scilit]
- Yan, J.; Zheng, B.; Xu, H.; Zhu, Y.; Chen, D.Z.; Sun, J.; Wu, J.; Chen, J. Making pre-trained language models great on tabular prediction. In Proceedings of the 12th International Conference on Learning Representations (ICLR 2024), Vienna, Austria, 7–11 May 2024. [Google Scholar]
- Akiba, T.; Sano, S.; Yanase, T.; Ohta, T.; Koyama, M. Optuna: A Next-generation Hyperparameter Optimization Framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Anchorage, AK, USA, 4–8 August 2019; pp. 2623–2631. [Google Scholar] [CrossRef] [Scilit]
- Zhang, S.; Peng, J.; Huang, Q.; Li, Z.; Yin, L. Pig body weight prediction based on weight waveform graph. Comput. Electron. Agric. 2025, 236, 110412. [Google Scholar] [CrossRef] [Scilit]
- Qin, Y.; He, C.; Huang, T. Refined Feeding and Management Techniques for Early-Weaned Piglets in Large-Scale Pig Farms. Anim. Breed. Feed. 2026, 25, 71–74. (In Chinese) [Google Scholar] [CrossRef]
- Fu, Q.; Bai, B.; Zhou, S.; Zhao, Y.; Yang, Y.; Zhang, X.; Liu, X.; Wu, M.; Zhao, W.; Bao, J.; et al. A new therapy to alleviate the inflammatory injury of piglet intestine caused by short-distance transportation—Music. PLoS ONE 2025, 20, e0313354. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chang, J. Key technical points for feeding and management of weaned piglets. Swine Ind. Sci. 2026, 43, 106–107. (In Chinese) [Google Scholar]










| Feature | Type | Statistics | Description |
|---|---|---|---|
| Region | Categorical | 5 categories | The macro-geographical region to which the farm and pig batch belong, including South China, North China, East China, Central China, and Southwest. |
| L2 Unit | Categorical | 6 categories | A level-2 business management unit under the group headquarters, responsible for coordinating specialized production and operations across business sectors. |
| L3 Company | Categorical | 19 categories | A level-3 regional management company under the level-2 unit, responsible for overall operations in a specific region. |
| L4 Company | Categorical | 96 categories | A level-4 production management company under the level-3 company, directly connected with contract farms. |
| L5 Unit | Categorical | 215 categories | A level-5 grassroots management unit close to front-line farmers, responsible for production services, process tracking, and information recording for pig batches. |
| Placement Month | Categorical | 12 months | The month when piglets in a production batch are placed into the farm. |
| Placement Count | Numerical | 1260.8 ± 766.4 | The initial number of piglets at placement. |
| Placement Weight | Numerical | 6.74 ± 0.70 kg | The average initial body weight of piglets at placement. |
| 2W Mortality | Numerical | 0.73 ± 1.09% | The proportion of pigs that die or are culled within two weeks after placement, calculated based on the initial placement count. |
| 5W Mortality | Numerical | 2.78 ± 2.64% | The proportion of pigs that die or are culled within five weeks after placement, calculated based on the initial placement count. |
| Feeding Days | Numerical | 170.8 ± 6.9 | The cumulative number of days from piglet placement to marketing, used to characterize the growth stage and farming progress of the batch. |
| Medication Cost | Numerical | 38.83 ± 12.45 CNY/head | The medication cost per pig accumulated before marketing, calculated based on the initial placement count. |
| Feed Consumption | Numerical | 289.31 ± 22.01 kg/head | An average feed input per pig, calculated from batch-level feed supply records and normalized by the initial placement count. |
| Market Weight | Target | 125.51 ± 5.91 kg | The average body weight of pigs in a production batch at marketing. |
| Rule Category | Specific Rules | Removed Records |
|---|---|---|
| Basic validity constraints | Feeding Days < 0 or Placement Count < 0 | 0 |
| Ratio constraints | 2W Mortality ∉ [0, 1] or 5W Mortality ∉ [0, 1] | 128 |
| Business logic constraints | Market Weight ≤ Placement Weight or 5W Mortality < 2W Mortality | 537 |
| Extreme-value thresholds | 5W Mortality > 0.5, Feeding Days < 50 or >280, Feed Consumption < 75 or >500 kg/head, Placement Weight ∉ [3, 12.5] kg, Market Weight ∉ [50, 175] kg | 142 |
| Region | K | Mean ARI | SD |
|---|---|---|---|
| Central China | 3 | 0.9787 | 0.0133 |
| East China | 3 | 0.9888 | 0.0069 |
| South China | 3 | 0.9958 | 0.0038 |
| North China | 4 | 0.9791 | 0.0112 |
| Southwest | 3 | 0.9668 | 0.0200 |
| Model | MSE | MAE | |
|---|---|---|---|
| XGBoost | 12.2608 | 2.6736 | 0.6560 |
| CatBoost | 12.4987 | 2.6894 | 0.6493 |
| Random Forest | 12.8798 | 2.7399 | 0.6386 |
| TabNet | 13.9502 | 2.8357 | 0.6086 |
| ResNet-like | 12.4602 | 2.7139 | 0.6503 |
| AutoInt | 12.8631 | 2.7478 | 0.6390 |
| SAINT | 12.8595 | 2.7450 | 0.6392 |
| FT-Transformer | 12.0846 | 2.6635 | 0.6609 |
| ExcelFormer | 13.0303 | 2.7554 | 0.6344 |
| AMFormer | 12.0401 | 2.6679 | 0.6622 |
| Ours | 11.7667 | 2.6353 | 0.6698 |
| Backbone | RC | Cyclic | Fusion | MSE | MAE | |
|---|---|---|---|---|---|---|
| AMFormer | - | - | - | 12.0401 | 2.6679 | 0.6622 |
| √ | - | - | 11.8963 | 2.6464 | 0.6662 | |
| - | √ | - | 11.8051 | 2.6402 | 0.6688 | |
| - | - | √ | 12.0711 | 2.6517 | 0.6613 | |
| √ | √ | - | 11.7785 | 2.6387 | 0.6695 | |
| √ | √ | √ | 11.7667 | 2.6353 | 0.6698 |
| Clustering Feature | MSE | MAE | |
|---|---|---|---|
| 2w mortality | 11.8963 | 2.6464 | 0.6662 |
| 5w mortality | 12.0691 | 2.6624 | 0.6613 |
| Seed 1 | AMFormer | RC-AMFormer | ||||
|---|---|---|---|---|---|---|
| MSE | MAE | MSE | MAE | |||
| 30 | 12.0100 | 2.6570 | 0.6630 | 11.7338 | 2.6270 | 0.6708 |
| 111 | 12.2086 | 2.6748 | 0.6574 | 11.9511 | 2.6461 | 0.6647 |
| 253 | 12.0542 | 2.6666 | 0.6618 | 11.8397 | 2.6379 | 0.6678 |
| 367 | 12.0628 | 2.6685 | 0.6615 | 11.8482 | 2.6345 | 0.6676 |
| 518 | 11.9320 | 2.6597 | 0.6652 | 11.6534 | 2.6292 | 0.6730 |
| 613 | 12.1396 | 2.6673 | 0.6594 | 11.8392 | 2.6361 | 0.6678 |
| 678 | 12.2027 | 2.6756 | 0.6576 | 11.7972 | 2.6314 | 0.6690 |
| 714 | 11.9938 | 2.6624 | 0.6635 | 11.8021 | 2.6381 | 0.6689 |
| 809 | 12.0659 | 2.6764 | 0.6615 | 11.9151 | 2.6456 | 0.6657 |
| 955 | 12.0170 | 2.6577 | 0.6628 | 11.7547 | 2.6295 | 0.6702 |
| Metric | AMFormer | RC-AMFormer | t-Test (p) | Wilcoxon (p) |
|---|---|---|---|---|
| MSE | 12.0687 ± 0.0902 | 11.8134 ± 0.0867 | ||
| MAE | 2.6666 ± 0.0073 | 2.6355 ± 0.0066 | ||
| 0.6614 ± 0.0025 | 0.6685 ± 0.0024 |
| Model | MSE | MAE | |
|---|---|---|---|
| XGBoost | 12.4020 | 2.6836 | 0.6557 |
| CatBoost | 12.5855 | 2.6982 | 0.6506 |
| Random Forest | 12.8962 | 2.7441 | 0.6420 |
| TabNet | 13.9674 | 2.8558 | 0.6122 |
| ResNet-like | 12.5929 | 2.6989 | 0.6504 |
| AutoInt | 13.1136 | 2.7629 | 0.6359 |
| SAINT | 13.1239 | 2.7671 | 0.6357 |
| FT-Transformer | 12.3575 | 2.6765 | 0.6569 |
| ExcelFormer | 13.5360 | 2.7868 | 0.6242 |
| AMFormer | 12.4380 | 2.6955 | 0.6547 |
| Ours | 12.2065 | 2.6624 | 0.6611 |
| Model | MSE | MAE | |
|---|---|---|---|
| RC-XGBoost | 12.0821 | 2.6596 | 0.6610 |
| RC-CatBoost | 12.3457 | 2.6841 | 0.6536 |
| RC-RF | 12.9309 | 2.7443 | 0.6372 |
| Feature | vs. Previous | Relative to Region | |
|---|---|---|---|
| Region | 0.032 | – | 1.00× |
| L2 Unit | 0.066 | +0.034 | 2.06× |
| L3 Company | 0.095 | +0.029 | 2.97× |
| L4 Company | 0.134 | +0.039 | 4.19× |
| L5 Unit | 0.145 | +0.011 | 4.53× |
| Model | MSE | MAE | |
|---|---|---|---|
| AMFormer | 12.0401 | 2.6679 | 0.6622 |
| w/o L5 | 12.4097 | 2.6807 | 0.6518 |
| w/o L5, L4 | 13.1029 | 2.7579 | 0.6324 |
| w/o L5, L4, L3 | 13.1561 | 2.7556 | 0.6309 |
| w/o L5, L4, L3, L2 | 13.4266 | 2.7942 | 0.6233 |
| Region | Cluster | Number of Batches (n, %) |
|---|---|---|
| Central China | Central_China_1 | 1753 (4.9%) |
| Central_China_2 | 608 (1.7%) | |
| Central_China_3 | 4054 (11.4%) | |
| East China | East_China_1 | 2515 (7.1%) |
| East_China_2 | 385 (1.1%) | |
| East_China_3 | 1255 (3.5%) | |
| East_China_4 | 1298 (3.7%) | |
| South China | South_China_1 | 793 (2.2%) |
| South_China_2 | 6227 (17.5%) | |
| South_China_3 | 3848 (10.8%) | |
| North China | North_China_1 | 2228 (6.3%) |
| North_China_2 | 3969 (11.2%) | |
| Southwest | Southwest_1 | 1902 (5.4%) |
| Southwest_2 | 3818 (10.8%) | |
| Southwest_3 | 837 (2.4%) |
| Farming Mode | Representative Clusters |
|---|---|
| Long-cycle weight-gain type | Central_China_1, East_China_4, South_China_3, Southwest_1 |
| Robust and balanced type | Central_China_3, East_China_1, South_China_2, North_China_2, Southwest_2 |
| High-risk type | Central_China_2, East_China_2, South_China_1, Southwest_3 |
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. |
© 2026 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.
Share and Cite
Chen, Y.; Liu, R.; Liang, Y.; Peng, H.; Huang, G. Batch-Level Average Market Weight Estimation and Interpretability Analysis for Pigs with Regional K-Means Clustering and AMFormer. Animals 2026, 16, 2092. https://doi.org/10.3390/ani16132092
Chen Y, Liu R, Liang Y, Peng H, Huang G. Batch-Level Average Market Weight Estimation and Interpretability Analysis for Pigs with Regional K-Means Clustering and AMFormer. Animals. 2026; 16(13):2092. https://doi.org/10.3390/ani16132092
Chicago/Turabian StyleChen, Yan, Ruiwen Liu, Yanbin Liang, Hongxing Peng, and Guangmin Huang. 2026. "Batch-Level Average Market Weight Estimation and Interpretability Analysis for Pigs with Regional K-Means Clustering and AMFormer" Animals 16, no. 13: 2092. https://doi.org/10.3390/ani16132092
APA StyleChen, Y., Liu, R., Liang, Y., Peng, H., & Huang, G. (2026). Batch-Level Average Market Weight Estimation and Interpretability Analysis for Pigs with Regional K-Means Clustering and AMFormer. Animals, 16(13), 2092. https://doi.org/10.3390/ani16132092

