## 4 Results and Discussion
### Accuracy Analysis Using Confusion Matrix
#### 4.1.7. The Conventional Artificial Neural Network (ANN) Consists of Layers and Weights  
The behaviour of a network is dependent on communication between its nodes. ANN typically comprises three layers:  
* Input layer: Receiving the network's raw data input. * Hidden layer: The functioning of a hidden layer is defined by the inputs and the weight of the connections between them and the neuron in the hidden layer. These connection weights decide whether a neuron in the hidden layer must be active or inactive. * Output layer: The operation of this layer is determined by the outputs of the neurons in the hidden layer and the connection weight between these neurons and the neurons in the output layer. The proposed structure of an artificial neural network, as shown in Figure 16, has an input layer with 11 features; two hidden layers, each with ten neurons; and one output layer with two outputs, diabetes and non-diabetes. A few hidden layers were used to avoid the overfitting problem because the datasets were small. A sigmoid activation function was applied to this model. It used a two-factor level function that set all input values in the values in range from 0 to 1. By using cross-entropy, the model's performance considers the  
Figure 14: RF confusion matrix. Figure 15: LDA confusion matrix. probability in a log of data points [45]. The highest accuracy achieved by this model reached 97.3%, as shown in the confusion matrix in Figure 17b, presenting the training, validation, test, and overall matrix. The accuracy achieved by the dataset's training, validation, and testing was 97.6%, 97.4%, and 95.7%, respectively. The overall combined accuracy was 97.3%. In Figure 17d, the gradient decreased to a performance of 0.047062 and epoch number 49. This decrease means that the model was performing well up to this point, and the increase indicated the start of an overfitting problem. Another evaluation showcases the error histogram in Figure 17c, which has an error rate with a loss of the range \(-0.049\) value. This describes the quality of the data processor and the target achieved by the evaluation. The results of this study can be discussed, considering the results obtained from other studies. The Pima Indian Diabetes (PID) dataset (available from the University of California data repository) [16] is a dataset that has been considered in many studies. The results from similar studies were compared with our investigation and shown in Table 6.  
Figure 16: ANN supervised architecture proposed. Figure 17: ANN results: (**a**) receiver operation characteristic; (**b**) confusion matrix; (**c**) error histogram; (**d**) ANN performance. Considering the research results on the PID dataset, the best accuracy on that data was 94% using a random forest and 88% using a decision tree [30]. In comparison, the best accuracy on our dataset was about 98.37% using two algorithms, the random forest and decision tree. One reason for the improvement in the results was the dataset used in this research, which was much larger than the PID dataset with more features. The PID dataset only has eight features and 768 cases. Furthermore, in this research, the parameters for every algorithm were optimised for the best performance. For example, in the nearest neighbours method, the parameter k varied between one and five to find the most optimised method. Moreover, in choosing the parameters for the artificial neural network, the number of hidden layer neurons and the accuracy of the network were strongly correlated, which meant that for various neurons, the network was resolved to find the best accuracy. Finally, the optimised number of neurons with the highest accuracy was chosen. The comparison with similar studies which use the most used diabetes dataset, the PID dataset, and the classification approaches are presented in Table 6.  
All of the models in Table 7 were applied utilising two different feature sets.