## 2 Methods
### Regression for Local Model Corrections  
The FIML paradigm involves two main steps. The first step explained in Section 2.2 is an optimization procedure. This procedure aims to find a correction field that alters the source term of the SA equation, specifically the production term in this work. By solving this modified equation alongside the Navier-Stokes equations, we can find a solution that minimizes the objective function, thereby matching the experimental or high-fidelity data used as the objective. The second step of the classical FIML approach involves using a machine learning algorithm, such as a neural network, to augment the result and find a correlation for the correction field. Specifically, a feed-forward neural network is typically used. A FFNN is a type of artificial neural network where connections between nodes do not form cycles. It consists of an input layer, one or more hidden layers, and an output layer. Each layer is composed of units called neurons, which process input data by applying weights and activation functions to produce an output. The FFNN learns to map input variables to the desired output by adjusting the weights through a process called backpropagation during training. In this work, we utilized a FFNN with 5 hidden layers, each consisting of 10 nodes. The FFNN takes 5 input features (discussed in Section 2.3.1) and outputs the correction field, as shown in Figure 1.  
We used the [PERSON] backpropagation algorithm, which offers adaptive learning rates, computational efficiency, robustness to hyperparameters, and bias correction, enhancing convergence speed and stability. The Rectified Linear Unit (ReLU) activation function was chosen for its simplicity, computational efficiency, ability to induce sparse activation, and mitigation of the vanishing gradient problem, making it suitable for deeper networks. The dataset includes simulations from different angles of attack. For SD7003, data from two angles were used, while for NACA0021, six angles were included. The dataset was divided into 70% training and 30% validation. A variable learning rate was employed for faster initial learning and stable convergence. Early stopping, based on validation loss, was used to prevent overfitting by stopping the training when the validation loss ceased to improve, ensuring the maintenance of the best model parameters. The strength of the field inversion approach lies in its flexibility to use both global and local coefficients obtained experimentally or from high-fidelity data. Typically, measuring integral coefficients such as lift or drag is straightforward and depends exclusively on the fields calculated at the boundary layer. Consequently, the correction field will primarily alter the equation in the boundary layer region. When constructing the training dataset for the neural network, it is advisable to select a specific region of the domain rather than using the entire domain. This is because the correction field will remain equal to its initial value in regions where it is not necessary to alter the original SA model. Focusing only on the regions of the domain where the correction field shows significant variations reduces the complexity of the problem and improves the efficiency of the training process. The correction field is expected to differ from its initial value only near the body. To select the portion of the domain of interest, we utilize a modified version of the shield function that was initially adopted in the Detached Eddy Simulation (DES) [49] model to blend the LES and RANS models. The values of the shield function range between 0 and 1, with 0 indicating a region inside the boundary layer and 1 indicating a region outside the boundary layer. Using this parameter, we can target the region where the correction field is expected to be active. By leveraging this approach, we select the dataset values from the region of the domain where the modified shield function \(fd^{\prime}\) takes values less than or equal to 0.9. The definition of the modified shield function is given below.