## 3 On-Site AI Engine and Risk Index Estimation with Safety Rule  
As shown in Figure 3, an on-site AI engine consists of multimodal ensemble models that combine the predictions of several base estimators built with a given learning algorithm to improve generalizability/robustness over a single estimator [25]. Each ensemble model chooses one of two approaches: voting and bagging to decide on the final result after combining the predictions of base estimators. Identical learning algorithms for the base estimators in the voting approach are trained with the same dataset. In contrast, different learning algorithms for those in the bagging approach are trained with different sampled datasets that have been bootstrapped. In particular, we considered a modified soft rule that averages out the predictions of the base estimators and rescales the averaged value between 0 and \(S_{rmsx_{j}}\) (shown in Table 1). To build the ensemble models, we created various datasets by collecting raw data such as video streams and BI data in the proposed SAP, labeling them with crowdsourced data annotation, and verifying them through cross-validation by a group of experts [14]. We built the Dlib/convolution neural network (CNN) model [26] as a base estimator for workers' facial detection, the time series anomaly detection generative adversarial network (TadGAN) model [27] as a base estimator for their anomaly detection, and the YOLOv7 model [28] as a base estimator for workplace hazards-related object detection with custom datasets. The final result of the modified soft rule in each ensemble model is fed into the safety rule to estimate the risk index (RI) for risk assessment. The high-value RI data are loaded in the Message Queue Telemetry Transport (MQTT) message queue, and they are sent to an alarm notification module and a supervisor application to notify the administrator, supervisor, and workers about the risk situations. To estimate the RI ranging from 0 to 1 in Figure 4, we made the safety rule based on the risk level of a current task complying with the standard operating procedures (SOPs) in the ISO45001, a worker profile, the output of an ensemble model in an on-site AI engine, etc. The safety rule was defined in Equation (1). \[RI=R_{i}-\sum_{j=1}^{n}S_{param_{j}}S_{ratio_{j}} \tag{1}\]  
where \(R_{i}\) denotes the risk level ranging from 0 to 1, obtained through the risk assessment of the \(i\)-th task according to the SOPs, and \(S_{param_{j}}\) and \(S_{ratio_{j}}\) denote the \(j\)-th safety parameter with a value of 0 or 1 and its weight ratio to reduce the risk level, respectively. As shown in Table 1, \(S_{param_{j}}\) is predefined and can be extended if necessary, the maximum value of \(S_{ratio_{j}}\), referred to as \(S_{max_{j}}\), is also predefined, and their sum is equal to \(R_{i}\), shown in Equation (2). Figure 2: Data-driven risk management procedure among the safety autonomous platform, safety mobility gateways, supervisors, and workers. \[\sum_{j=1}^{n}S_{\textit{max}_{j}}=R_{i} \tag{2}\]  
For instance, when it is assumed that \(R_{i}=1\), \(n=3\), \(S_{\textit{part}_{1}}=1\) (\(S_{\textit{max}_{1}}=0.1\)), \(S_{\textit{part}_{2}}=1\) (\(S_{\textit{max}_{2}}=0.1\)), and \(S_{\textit{part}_{3}}=1\) (\(S_{\textit{part}_{3}}=0.8\)), the RI can be represented by  
\[RI=1-S_{\textit{ratio}_{1}}-S_{\textit{ratio}_{2}}-S_{\textit{ratio}_{3}} \tag{3}\]  
Also, if both worker proficiency and the worker education level are the highest (\(S_{\textit{ratio}_{1}}=0.1\) equals to \(S_{\textit{max}_{1}}\), and \(S_{\textit{ratio}_{2}}=0.1\) equals to \(S_{\textit{max}_{2}}\)), but the output of an ensemble model in an on-site AI engine is unsafe or anomalous (\(S_{\textit{ratio}_{3}}=0.1\) is less than \(S_{\textit{max}_{3}}=0.8\)), then  
\[RI=1-0.1-0.1-0.1=0.7 \tag{4}\]  
Because the estimated RI value is high, it will be loaded in the MQTT message queue and sent to an alarm notification module and a supervisor application.