## 2 Methodology
### The 1 st ML Model to Predict the Spatial Distribution of Particles on the Substrate
#### 2.2.3 Projection Algorithm  
As depicted in Figure 8b, due to the inherent randomness of probability distributions--especially given that the sampling is conducted using a KDE-based probabilistic method--some predicted points may still fall within the dead zone. To ensure that the final predictions adhere to physical priors (i.e., particles cannot deposit in regions obstructed by the mask), the model employs a projection algorithm to rectify such physically infeasible predictions. This correction process principally involves constructing a two-dimensional number density map, applying morphological operations to delineate valid regions, fitting a target number density function based on local statistics and radial decay, and finally executing a local reallocation algorithm to remap invalid prediction points. The reallocated predictions are then merged with the valid predictions to form the final prediction set. Byleveraging local, weight-based probabilistic sampling, this method effectively corrects the invalid points in the dead zone, ensuring that the final predictions maintain physical continuity while accurately reflecting the particle distribution observed in the training data. This comprehensive approach guarantees that the final prediction outcomes are consistent with the underlying physical constraints. The complete algorithmic workflow--including kernel choices, bandwidth heuristics, morphological structuring elements, density profile fitting, and reallocation logic--is presented in Appendix A for reproducibility and implementation reference.  
Figure 7: Overall optimization workflow for the first submodule.  
The 2 nd ML Model to Predict the Velocity and Temperature of Each Particle upon Impact on the Substrate  
The second ML model is introduced as the second-stage predictive framework that builds on the first model's spatial distribution results. It takes the particle positions predicted by the first model and, along with other input features (e.g., particle diameter, mask type, standoff distances, and inlet conditions), forecasts the dynamic impact characteristics of the particles--namely, their velocity components (\(u\), \(v\), and \(w\)) and temperature (\(T\)) upon impact. The second model is implemented through a multi-step process that begins with an interpolation step to enrich and refine the dataset along key parameter directions, followed by mathematical transformation using symbolic regression to extract more representative features, and finally culminates in a weighted random forest optimization that enhances the prediction accuracy.  
Figure 8: (**a**) KNN-KDE-based prediction vs. ground truth distribution along the \(y\)- and z-axes for the test sample (inlet pressure: 4 MPa, inlet temperature: 800 \({}^{\circ}\)C, substrate SOD: 20 mm, mask SOD: 16 mm, wire diameter: 0.46 mm, opening size: 1.14 mm, and open area: 51%). Where the bars overlap, they appear as a purple. This indicates where the predicted distribution closely matches the ground truth; (**b**) predicted particle spatial distribution by KNN+KDE for the same test sample.