completed

MED Desalination ML Replication

Can a published MED neural-network workflow be independently reproduced in Python using a 6,000-record experimental subset to predict distillate production?

StatuscompletedDatesJune–July 2026RoleResearch InternAffiliationLUMS research internship
1

Context & question

Can a published MED neural-network workflow be independently reproduced in Python using a 6,000-record experimental subset to predict distillate production?

Built a Python neural-network workflow to predict multi-effect desalination output from seven thermal and flow variables. Using 6,000 experimental records obtained from the source-paper authors, the saved model achieved a test R² of 0.8794 and RMSE of 0.07921 on 1,800 held-out records.

The source study—U. Ahmad et al., “Performance prediction of multi-effect desalination (MED) plant: Experimental evaluation, machine learning modelling and optimization,” Desalination 635 (2026), Article 120329—investigated ANN, SVR, Random Forest, and Gradient Boosting models using approximately 12,000 experimental MED operating records.

The seven inputs were hot-water inlet temperature; feed temperatures entering the steam generator, Stage 1, and Stage 2; and feed flow rates to the steam generator, Stage 1, and Stage 2. Distillate production was the supervised-regression target.

The final CSV contains exactly 6,000 records, with no missing values or duplicate rows. A shuffled 70/30 split with random seed 42 allocated 4,200 records to training and 1,800 to testing. MinMaxScaler was fitted only on the training inputs, mapping their range to [0, 1], then applied to the test inputs. The distillate target was left on its recorded scale.

The implemented ANN uses scikit-learn’s MLPRegressor with a 7 → 100 → 50 → 25 → 1 topology, ReLU hidden layers, Adam optimization, and random seed 42. Its initial learning rate is 0.001 and L2 penalty is 0.0001. The iteration limit is 1,000; the saved model completed 16 iterations under training-loss convergence criteria, with validation-based early stopping disabled.

Evaluation reloads the saved model and uses the same deterministic test split to calculate R², MAE, MSE, and RMSE. Error values below use the CSV’s distillate scale; its physical unit is not specified. MSE uses the squared scale. These results describe one random holdout from the available dataset, rather than an independent plant or operating-campaign validation.

Test R²
0.8794
coefficient of determination
Test RMSE
0.07921
root mean squared error
Test MAE
0.05947
mean absolute error
Test MSE
0.006274
mean squared error
Experimental records
6,000
seven inputs · one target
Training records
4,200
70% · split seed 42
Test records
1,800
30% held out from fitting
Training iterations
16
1,000 maximum configured
2

My contribution

  • Studied the source MED paper and reconstructed its machine-learning methodology.
  • Identified the seven operating-condition inputs and the distillate-production target.
  • Built the replication pipeline in Python using NumPy, pandas, matplotlib, and scikit-learn.
  • Created a preliminary synthetic-data implementation to validate the pipeline before experimental records became available.
  • Separated preprocessing, model training, evaluation, and plotting into reusable Python modules. The pipeline runner executes each stage in order and assembles an evaluation summary.
  • Implemented the 70/30 split, training-only [0, 1] Min-Max scaling, and a three-hidden-layer MLPRegressor; saved the fitted model and scaler with joblib.
  • Evaluated held-out predictions with R², MAE, MSE, and RMSE, and produced predicted-versus-actual, residual, and training-loss plots.
  • Created an annotated Pearson-correlation heat map covering the seven inputs and distillate target to examine variable relationships and input redundancy.
3

Outcome

The implemented ANN achieved R² = 0.8794, RMSE = 0.07921, and MAE = 0.05947 on the 1,800-record test split. The workflow connects experimental operating data, reproducible preprocessing, a saved regression model, and diagnostic plots. Clustered predictions and uneven residual spread identify remaining within-regime error, while strong correlations between inputs limit independent interpretation of individual variables. Validation by operating campaign or on independent data would be the next step toward assessing performance beyond this random split. The supplied implementation evaluates the ANN only; it does not establish comparative performance against the source paper’s other models.

4

Excerpts

Original figures from the completed ANN pipeline. Test metrics were independently recalculated from the saved model and final CSV and match the evaluation summary. SG denotes the steam generator; S1 and S2 denote the two stages. Select a figure to view it at full size.

Predicted versus actual distillate

Held-out test predictions: R² = 0.8794 and RMSE = 0.07921. The diagonal marks perfect agreement. Predictions cluster into bands near 0.20, 0.46, 0.68, and 0.86, capturing broad operating regimes while missing some variation within each regime.

Actual versus predicted distillate for 1,800 test records, with a diagonal line of perfect agreement and predictions clustered into four bands.
Variable correlation heat map

Pearson correlations across all 6,000 records, including the target. Distillate correlates with hot-water inlet temperature (r = 0.907), Stage 2 feed temperature (0.905), and steam-generator feed flow (−0.737). Stage 1 and Stage 2 feed temperatures are strongly correlated (0.994), while steam-generator and Stage 1 feed flows are strongly anticorrelated (−0.990). These are pairwise associations, not causal effects or model feature importance.

Eight-variable Pearson correlation matrix including the distillate target. Hot-water inlet temperature correlates with distillate at 0.907; the two stage feed temperatures correlate at 0.994.
Residual analysis

Residual = actual − predicted. The overall mean residual is approximately −0.000205, but the spread varies by prediction band and is largest around 0.68. Near-zero average error therefore does not imply uniformly accurate predictions.

Actual-minus-predicted residuals against predicted distillate, showing a larger error spread around predictions of 0.68.
Training loss

The saved training objective fell from 0.01334 to 0.002952 over 16 iterations. This is the MLP’s regularized training loss, not test MSE. No separate validation-loss curve was recorded, so this plot alone cannot establish generalization or rule out overfitting.

Training objective over 16 iterations, dropping from 0.01334 to approximately 0.00295 and then flattening.