Spatiotemporal distribution prediction of coughing airflow at mouth based on machine learning—Part II: Boundary inference using neural network

. In the post-epidemic era, the trajectory of pathogenic airflows and droplets generated by coughing have been widely studied. However, owing to the limitations of measurement methods, there is a lack of detailed data on their spatiotemporal distribution at the mouth during coughing, which are the basis of research and the critical boundary conditions for computational simulation. Previous experiments have determined the velocity distribution of coughing airflow in spaces located far from the mouth. This study aims to collect detailed data at the mouth for use as the Computational Fluid Dynamics (CFD) boundary conditions from the experimental data. In Part I of this study, the critical parameters that describe the boundary conditions at the mouth for CFD simulation were obtained. Based on these parameters, this part infers the detailed temporal and spatial distribution velocity data of the coughing airflow at the mouth using a neural network. We performed CFD simulation on the prediction results with V=10.76 and M=4, and got FAC2=0.56 compared with the experimental values. The results obtained provided a generic detailed boundary condition for coughing airflow at the mouth and appropriate machine-learning parameters. This study can provide more accurate boundary conditions for simulating the propagation of pathogenic airflow and a supplementary database for epidemic prevention research.


Introduction
In the post-pandemic era, people are spending more hours living and working in rooms hours, but there are many kinds of indoor airborne pollutants. Among them, the airflows and droplets containing pathogens produced by coughing are important media for the spread of respiratory infectious diseases. Therefore, the indoor trajectory and distribution of pathogenic airflow and droplets generated by coughing are very important for health and safety in the indoor air environments of researcher-dense public buildings.
The focus of most previous studies has been on the dynamic characteristics of coughing airflows; however, in Computational Fluid Dynamics (CFD) studies, the boundary conditions for cough airflow propagation are lacking. Although there have been many experiments on coughing, owing to the limitations of measurement methods, there is a lack of accurate data regarding the spatiotemporal distribution of oral airflow during coughing. Data of the coughing airflow at the mouth are the basis of CFD research and the key boundary conditions for computational simulation; therefore, it is difficult to quantitatively and accurately study the dynamic dispersion and distribution of pathogenic airflows.
* Corresponding author: hanmt@hust.edu.cn This study aims to dynamically analyze the movement trajectory and distribution law of pathogenic gases, such as coughs, in densely populated public buildings in order to reduce the risk of infection by controlling their indoor air environments. In previous experiments, we obtained the velocity distribution of cough airflows in spaces away from the mouth. This study aims to complement the experimental data regarding the measurement of the airflow velocity of human coughs using particle image velocimetry based on artificial intelligence methods combined with fluid dynamics, from which detailed mouth data for CFD boundary conditions can be inferred.
In Part I, we obtained the key parameters M and V for the mouth boundary conditions in the CFD simulation. Based on these parameters and combined with previous experimental data, a neural network was used to reverse the detailed temporal and spatial distribution velocity data of the airflow of coughs.
This study serves as part II of this research. Here, we construct a pathogenic airflow training model based on an artificial neural network using machine learning with the simulation database built in part I and verify it using experimental data to confirm the feasibility of the dynamic analysis of disease-borne airflows based on neural networks. Additionally, we discuss the influence of the neural network parameters on the learning accuracy, such as the gradient descent method, activation function, hidden layer, training set sample size, and learning rate. Finally, the general detailed boundary conditions and appropriate machine learning parameters for oral cough airflows are obtained. We performed CFD simulation on the prediction results with V=10.76 and M=4, compared the obtained data with the experimental values. We used the fraction of data points in which the predictions are within a factor of two observations (FAC2) as the evaluation criteria, and FAC2=0.56 was obtained, implying a good agreement with the experiment data. The results of this study could provide more accurate boundary conditions for simulating the spread of disease-carrying droplets, theoretical and data support for the continuous in-depth research of social medicine and health, and a supplementary database for epidemic prevention research.

Neural network setup
The application of machine learning is constantly being promoted for simulating and improving building performance. Machine learning algorithms, particularly deep learning algorithms such as neural networks, have certain advantages in accurately predicting the performance of the built environment when predicting different parametric model parameters.
In this study, BP neural networks were adopted as the main research method, and existing experimental data and CFD simulation data were processed using algorithm fitting to predict the droplets and airflows with pathogens near the mouth generated by coughing. For the input value, we selected the X-and Y-direction coordinates of the data point and the wind speed U, which is the sum of the square of the average wind speeds in the X-direction (Umean) and Y-direction (Wmean) of the data point, and then normalized the value with the peak speed (PV). For the output value, we selected the maximum wind speed (V) and the air velocity distribution shape (M) at the mouth. The neural network structure is illustrated in Fig. 1.

Neural network databases
In Part I, we discussed the parameter determination of the boundary conditions, taking the maximum wind speed (V) and air velocity distribution shape (M) at the mouth as the main boundary conditions for the simulation. For the other experiments for setting the reference boundary conditions, a 0.8 m (x) × 0.5 m (y) × 0.5 m (z) cuboid was selected as the target domain, with a circular opening with a diameter of 0.05 m in the middle of the left surface. By comparing the MSE of the CFD simulation value and the experimental value, the values of V determined in part I were 10 m/s, 15 m/s, and 20 m/s, and the values of M were 3, 6, and 12 (see Table 1). Nine worksheets for machine learning were obtained from the permutation and combination of two parameters, V10M3, V10M6, V10M12, V15M3, V15M6, V15M12, V20M3, V20M6, and V20M12. The dataset for machine learning was composed of two parts: the CFD simulation and experimental values; X and Y were unified with the experimental average value through interpolation, and U was normalized using the peak velocity time (PVT).
In each case, t takes the value of 1, 2, 3…15, 15; x takes the value of 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 7; and the value of z ranges from -1.2 to 1.2, and 64. For each case, there were a total of 6720 data values, and the dataset had 60480 data values in total.

Neural network parameters
The main factors affecting the prediction effect of neural networks are the number of hidden layers in the neural networks, number of hidden layer nodes, output layer activation function, hidden layer activation function, and learning rate. In a previous study, we found that the error when using the Softmax prediction activation function was large; therefore, Softmax was not considered in this study. We also found that the machine-learning effect was better when the learning rate was 0.01.
In this study, there were three, five, and seven hidden layers, 20, 40, and 80 hidden layer nodes, and the commonly used Tanh and Relu activation functions, including the activation functions of the hidden layer and output layer. The learning rate was 0.01, the Adam gradient descent method was used as the learning function, and the epoch took a value of 200. 3 Results and discussion.

Comparison of neural network parameters
Using machine learning for the cases in Table 3, the training loss values of different training parameters were determined, as follows. The above figure shows the machine learning loss values when there were three, five, and seven hidden layers. The loss value can intuitively reflect the degree of fit and learning performance of a machine-learning model on a training set. As shown in the figure, the loss value of most cases was concentrated around 0.15, indicating, under those conditions, the training result was better. One exception occurred for each of the three hidden layers. For case14, the loss value, predicted value V, and M were 0.2238, 9.824, and 1.316, respectively; in case21, the loss value, predicted value V, and M were 0.246, 10.73, and 0.0012, respectively; and for case45, the loss value, predicted value V, and M were 0.2757, 19.822, and 4.296, respectively.

Fig. 3. Losses with different numbers of hidden layer nodes
The figure above shows the loss values of machine learning when there are 20, 40, and 80 hidden layer nodes. The number of hidden layer nodes in a neural network significantly impacts its prediction accuracy. If the number of nodes is too small, the network cannot learn well, the amount of training data needs to be increased, and the training accuracy is affected. If the number of nodes is too large, the training time increases and the network is prone to overfitting.
As can be seen from the above figure, when there are 20 hidden layer nodes, the loss values of the 15 sets of cases were stable, at approximately 0.15, and the machine learning training effect was better. When there were 40 hidden layer nodes, an exception occurred; in case21, there were five hidden layers and the activation function was Relu. When there were 80 hidden layer nodes, two exceptions occurred: the number of hidden layers in case14 was three, the hidden layer activation function was Tanh, and the output layer activation function was Relu; and in case45, there were seven hidden layers and the activation function was Tanh.

Prediction results
The prediction results in 3.1 were simulated by CFD, and the inversion results were compared with the real experimental values. The results obtained are as follows.  As shown in the above charts, when the loss value of machine learning was stable at approximately 0.15, the learning effect was better and the predicted M and V values were relatively close. The predicted value was V is mostly around 10-12, except for the values of case6, 16, and 18, which were approximately 15, and the value of case45, which was 19.822. The predicted value of M was mostly around 4-5, except for case14, with a value of 1.3164, and case21, with a value of 0.0012. The average predicted value V was 10.76 and the average value of M was 4.14. As M can only take integer values, its average value was approximately 4.

Comparison of predicted results and experimental values
We performed CFD simulation on the above prediction results with V=10.76 and M=4 and compared the obtained data with the experimental values; the results are shown in Figs 6-9. As can be seen from the above chart, the predicted horizontal and vertical velocity distribution values of the cough airflow were better than the actual experimental values close to and far from the mouth. This may be because the experiment averaged cough data from multiple people with relatively large errors and did not consider the different angles of cough air inflow and injection for different people during the experiment.
After qualitatively describing the results through graphs, we quantitatively analyzed the results based on the FAC2 results using the following formula: where P i and O i are the values obtained from the simulation and experiment, respectively, and Wq is the tolerance-relative deviation between P i and O i . The FAC2 value was calculated to be 0.56. According to the VDI guideline, FAC2 > 0.5 is the acceptable range.

Conclusion
In this study, we constructed a training model for pathogenic airflow based on an artificial neural network and performed machine learning on the basis of experimental data, confirming the feasibility of the dynamic analysis of diseased airflow based on a neural network. By designing a series of neural network parameter-adjustment experiments, the influence of the neural network parameters on the prediction of the pathogenic airflow trajectory was studied. The results show that parameters such as the activation function, number of hidden layers, and learning rate had a significant impact on the prediction of pathogenic airflow boundary conditions. The optimal parameters predicted by the neural network constructed in this study were V=10.76 and M=4.14, and the CFD results with these values as the mouth boundary conditions were the most consistent with the experimental values. We compared the obtained data with the experimental values, and FAC2=0.56 was obtained, implying a good agreement with the experiment data. However, this study still has shortcomings, such as the need to try more neural network models and not considering the up and down swings of the human head when coughing.