Diabetes is a widely recognized medical condition and is generally mentioned as a silent killer in global healthcare. It is a metabolic and chronic disease that causes an increase in blood glucose (BGL) levels, leading to long-term damage to the blood vessels, heart, nerves, eyes, and kidneys, among other vital organs. The causes of diabetes include genetic factors, alcohol consumption, smoking, weight, the absence of actual work, unfortunate dietary propensities, and hypertension. Depending on the type and severity of diabetes, other organs in the body, such as the kidneys, heart, and eyes, are more susceptible to diseases. In this research investigation, we extend a model, the MLP-WOA, which uses a fine-tuned weight of the multi-layer perceptron (MLP) with the diabetes onset prediction using the whale (WOA) optimization algorithm. We used a benchmark dataset from the Kagle repository to train and test our model, and we evaluated its accuracy, precision, and recall. Support Vector Machines (SVM), K-nearest (KNN) neighbor, and other ML methods were evaluated against our model's outcomes, WOA-MLP, and decision trees (DTs). Our results showed that the MLP-WOA model performed superiorly to the other experimental models, achieving an accuracy of approximately 76%. Furthermore, we tested our MLP model using other existing optimizers and observed that the WOA optimizer gave better results. In conclusion, our study demonstrates that the MLP-WOA model prototype is a promising approach for predicting diabetes and that it outperforms other ML models. Patients with diabetes may see an improvement in their quality of life as a result of this strategy's ability to improve diagnosis accuracy.