Jun Wang, Shujie Wu, Ziyi Qu, Jianhong Shen, Shoeb Ahmed Memon, Martin Skitmore, Leyuan Ma
Purpose This study aims to enhance the classification of construction accident reports by addressing challenges including limited high-quality datasets, class imbalance and constraints of traditional machine learning models. A novel framework integrating ensemble learning with lightweight large language models (l-LLMs) is proposed to improve the accuracy, robustness and practical utility of safety management in the construction industry. Design/methodology/approach A dataset of 10,994 Occupational Safety and Health Administration (OSHA) construction accident reports was manually labeled using the Occupational Injury and Illness Classification System (OIICS). To address class imbalance, random oversampling and Synthetic Minority Oversampling Technique (SMOTE) were applied and compared. Five l-LLMs (TinyBERT, MobileBERT, ELECTRA, DistilBERT and ALBERT) were fine-tuned for classification, and three ensemble methods (soft voting, hard voting and stacking) were evaluated. Findings Random oversampling substantially improved performance, whereas SMOTE decreased effectiveness. Ensemble classifiers consistently outperformed individual large language models (LLMs), with the soft-voting ensemble achieving the highest F1 score (0.9261 ± 0.0063), surpassing baseline models support vector machine (SVM), Naïve Bayes (NB) and long short-term memory (LSTM) network. The results demonstrate the framework’s ability to accurately classify rare and complex accident types, supporting early hazard detection, targeted safety training and risk mitigation strategies. Originality/value The study advances construction safety analytics by integrating ensemble learning with l-LLMs, offering a robust solution for imbalanced textual datasets. It highlights practical applications, including enhanced safety management, decision support and accident prevention, with potential adaptation to other datasets and international contexts. By linking technical innovation to tangible societal and economic benefits, the framework contributes to safer, more efficient construction practices and promotes a culture of safety.