River water quality in the Special Region of Yogyakarta has declined significantly in recent years due to rapid urbanization and increasing anthropogenic pressures, causing several physicochemical and biological parameters to exceed environmental quality thresholds. To address the need for a consistent, data-driven assessment framework, this study develops an optimized river water quality classification model using a Multi-Layer Perceptron (MLP) architecture enhanced by Grid Search Cross-Validation. A critical challenge in the dataset is the severe class imbalance, particularly the dominance of the "Heavy Pollution" category. To mitigate this issue, Stratified Sampling was applied across five data-splitting scenarios (90:10, 80:20, 70:30, 60:40, 50:50), ensuring balanced representation of all classes. The optimization process systematically explored combinations of activation functions, learning rates, solvers, and hidden-layer configurations to identify the most efficient and generalizable model. The experimental results show that the optimized MLP model consistently achieves high performance, with an average accuracy above 95% across all scenarios. The 70:30 split was the most effective, yielding an accuracy of 98.66%, an F1-score of 97.99%, and a low Mean Squared Error (MSE) of 0.0285. The optimal architecture used the ReLU activation function, an SGD solver with a learning rate of 0.001, and a compact hidden layer of 30 neurons. The model demonstrates the potential for real-time integration into water quality monitoring systems, providing a scalable decision-support tool for sustainable water resource management and pollution control in Yogyakarta.