# Using Artificial Neural Network to Detect Fetal Alcohol Spectrum Disorder in Children
## 3 Materials and Methods
### Data Analysis Using Machine Learning
#### 3.2.1 Neural Network Configuration Model  
The first model used numerical data from the psychometric test. We have 20 numerical variables and two categorical variables (FASD and Control). Then, the Keras library of  
Figure 2: ANN block diagram.  
TensorFlow was used in Python to implement the algorithm [48]. In addition, we designed various models with dense layer connections, changing the number of neurons in each input layer, hidden layer, and output layer. Besides, the network was configured the optimization function with \"Adam\" and loss function \"sparse categorical cross-entropy\" to compile the model. Finally, we added two neurons in the output layer for classifying children with FASD or Control. We employed the dropout regularization, i.e., disabled neurons in each iteration to prevent neuron dependency to each other, thus avoiding overfitting. We added a dropout layer before each hidden layer with 20% of the neurons disable, to improve the data correlation independence of the neural network. For more information on the code, please refer to Appendix A.  
Equation (2) shows the \"Leaky ReLU\" neurons activation function. This function improve the performance of the Rectified Lineal Unit (ReLU), widely used in ANN estimation. In this case, the psychometric data are not in the same range; some are between 1-10, and others of 70-100, and have 58 registers of children with FASD.  
\[f(x)=\left\{\begin{array}{l l}x&\quad\quad if\quad\quad x>0\\ \\ 0.01x&\quad\quad otherwise\end{array}\right.. \tag{2}\]  
Our approach introduces the use of an ANN as improved technique for FASD diagnosis without the need of images. This ANN would require that the prediction model should have a improved performance compared to previous techniques without overfitting. To do this, we made variations in the number of hidden layers and neurons per layer to improve the model's prediction and performance. We employed K-fold cross-validation [49] as criteria to choose each model and estimate their potential performance. The data used was split randomly into K-folds (K = 10) for each configuration of the net. We used nine folds for training and one for testing, repeating the process K times with different folds per time (group of data). The latter was used to validate the results of the K-fold cross-validation to estimate the best configuration of the network.  
Table 2 shows layered network neuron configurations. The results are the average accuracy of ten evaluations, calculating the standard deviation, and average loss. We made a variation in each model in terms of the number of hidden layers and the number of neurons. Later, for each of the combinations, the accuracy was measured and compared by the accuracy metric and loss function. The loss function is the sum of errors made for each example in testing.  
Our initial models showed a performance between 55% to 75.55%. Therefore, the cross-validation results was analyzed to shed light of each configuration's performance. Combining 25 neurons in the input layer (IL) and only one hidden layer (HL) with 15 neurons (0.92) or 20 neurons (0.98) presents the lower values average of loss, meaning how well a model behaves after each iteration of optimization compares with others. Then, we evaluated the accuracy metric to measure the model's performance. The combination of 25 (IL), 20 (HL) performed 77.37% average with the best performance confidence level of 66.28% to 88.46%. Due to its performance, this mode was selected to be used in the data analysis. We validated this model using same data to obtain the best performance, and it was possible to obtain a 75.55% accuracy compared to the real data.