A Comparative Study of Advanced Transformer Learning Frameworks for Water Potability Analysis Using Physicochemical Parameters

Keeping drinking water safe is a critical aspect of protecting public health. Traditional laboratory-based methods for evaluating water potability are often time-consuming, costly, and labour-intensive. This paper presents a comparative analysis of four transformer-based deep learning models in the...

Full description

Saved in:
Bibliographic Details
Main Authors: Enes Algül, Saadin Oyucu, Onur Polat, Hüseyin Çelik, Süleyman Ekşi, Faruk Kurker, Ahmet Aksoz
Format: Article
Language:English
Published: MDPI AG 2025-06-01
Series:Applied Sciences
Subjects:
Online Access:https://www.mdpi.com/2076-3417/15/13/7262
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1849428758411345920
author Enes Algül
Saadin Oyucu
Onur Polat
Hüseyin Çelik
Süleyman Ekşi
Faruk Kurker
Ahmet Aksoz
author_facet Enes Algül
Saadin Oyucu
Onur Polat
Hüseyin Çelik
Süleyman Ekşi
Faruk Kurker
Ahmet Aksoz
author_sort Enes Algül
collection DOAJ
description Keeping drinking water safe is a critical aspect of protecting public health. Traditional laboratory-based methods for evaluating water potability are often time-consuming, costly, and labour-intensive. This paper presents a comparative analysis of four transformer-based deep learning models in the development of automatic classification systems for water potability based on physicochemical attributes. The models examined include the enhanced tabular transformer (ETT), feature tokenizer transformer (FTTransformer), self-attention and inter-sample network (SAINT), and tabular autoencoder pretraining enhancement (TAPE). The study utilized an open-access water quality dataset that includes nine key attributes such as pH, hardness, total dissolved solids (TDS), chloramines, sulphate, conductivity, organic carbon, trihalomethanes, and turbidity. The models were evaluated under a unified protocol involving 70–15–15 data partitioning, five-fold cross-validation, fixed random seed, and consistent hyperparameter settings. Among the evaluated models, the enhanced tabular transformer outperforms other models with an accuracy of 95.04% and an F1 score of 0.94. ETT is an advanced model because it can efficiently model high-order feature interactions through multi-head attention and deep hierarchical encoding. Feature importance analysis consistently highlighted chloramines, conductivity, and trihalomethanes as key predictive features across all models. SAINT demonstrated robust generalization through its dual-attention mechanism, while TAPE provided competitive results with reduced computational overhead due to unsupervised pretraining. Conversely, FTTransformer showed limitations, likely due to sensitivity to class imbalance and hyperparameter tuning. The results underscore the potential of transformer-based models, especially ETT, in enabling efficient, accurate, and scalable water quality monitoring. These findings support their integration into real-time environmental health systems and suggest approaches for future research in explainability, domain adaptation, and multimodal fusion.
format Article
id doaj-art-ce7fbdc2f1da494887375a290a8d8471
institution Kabale University
issn 2076-3417
language English
publishDate 2025-06-01
publisher MDPI AG
record_format Article
series Applied Sciences
spelling doaj-art-ce7fbdc2f1da494887375a290a8d84712025-08-20T03:28:36ZengMDPI AGApplied Sciences2076-34172025-06-011513726210.3390/app15137262A Comparative Study of Advanced Transformer Learning Frameworks for Water Potability Analysis Using Physicochemical ParametersEnes Algül0Saadin Oyucu1Onur Polat2Hüseyin Çelik3Süleyman Ekşi4Faruk Kurker5Ahmet Aksoz6Department of Computer Engineering, Bingöl University, Bingol 12000, TurkeyDepartment of Computer Engineering, Faculty of Technology, Gazi University, Ankara 06560, TürkiyeDepartment of Computer Engineering, Bingöl University, Bingol 12000, TurkeyManas Enerji Yonetimi Sanayi ve Ticaret A.S., Ankara 06935, TürkiyeManas Enerji Yonetimi Sanayi ve Ticaret A.S., Ankara 06935, TürkiyeDepartment of Electrical and Electronic Engineering, Faculty of Engineering, Adıyaman University, Adıyaman 02040, TürkiyeDepartment of Electrical and Electronics Engineering, Faculty of Engineering, Architecture and Design, Kayseri University, Kayseri 38380, TürkiyeKeeping drinking water safe is a critical aspect of protecting public health. Traditional laboratory-based methods for evaluating water potability are often time-consuming, costly, and labour-intensive. This paper presents a comparative analysis of four transformer-based deep learning models in the development of automatic classification systems for water potability based on physicochemical attributes. The models examined include the enhanced tabular transformer (ETT), feature tokenizer transformer (FTTransformer), self-attention and inter-sample network (SAINT), and tabular autoencoder pretraining enhancement (TAPE). The study utilized an open-access water quality dataset that includes nine key attributes such as pH, hardness, total dissolved solids (TDS), chloramines, sulphate, conductivity, organic carbon, trihalomethanes, and turbidity. The models were evaluated under a unified protocol involving 70–15–15 data partitioning, five-fold cross-validation, fixed random seed, and consistent hyperparameter settings. Among the evaluated models, the enhanced tabular transformer outperforms other models with an accuracy of 95.04% and an F1 score of 0.94. ETT is an advanced model because it can efficiently model high-order feature interactions through multi-head attention and deep hierarchical encoding. Feature importance analysis consistently highlighted chloramines, conductivity, and trihalomethanes as key predictive features across all models. SAINT demonstrated robust generalization through its dual-attention mechanism, while TAPE provided competitive results with reduced computational overhead due to unsupervised pretraining. Conversely, FTTransformer showed limitations, likely due to sensitivity to class imbalance and hyperparameter tuning. The results underscore the potential of transformer-based models, especially ETT, in enabling efficient, accurate, and scalable water quality monitoring. These findings support their integration into real-time environmental health systems and suggest approaches for future research in explainability, domain adaptation, and multimodal fusion.https://www.mdpi.com/2076-3417/15/13/7262water potabilitytransformer modelsdeep learningphysicochemical featurestabular data classificationattention mechanism
spellingShingle Enes Algül
Saadin Oyucu
Onur Polat
Hüseyin Çelik
Süleyman Ekşi
Faruk Kurker
Ahmet Aksoz
A Comparative Study of Advanced Transformer Learning Frameworks for Water Potability Analysis Using Physicochemical Parameters
Applied Sciences
water potability
transformer models
deep learning
physicochemical features
tabular data classification
attention mechanism
title A Comparative Study of Advanced Transformer Learning Frameworks for Water Potability Analysis Using Physicochemical Parameters
title_full A Comparative Study of Advanced Transformer Learning Frameworks for Water Potability Analysis Using Physicochemical Parameters
title_fullStr A Comparative Study of Advanced Transformer Learning Frameworks for Water Potability Analysis Using Physicochemical Parameters
title_full_unstemmed A Comparative Study of Advanced Transformer Learning Frameworks for Water Potability Analysis Using Physicochemical Parameters
title_short A Comparative Study of Advanced Transformer Learning Frameworks for Water Potability Analysis Using Physicochemical Parameters
title_sort comparative study of advanced transformer learning frameworks for water potability analysis using physicochemical parameters
topic water potability
transformer models
deep learning
physicochemical features
tabular data classification
attention mechanism
url https://www.mdpi.com/2076-3417/15/13/7262
work_keys_str_mv AT enesalgul acomparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT saadinoyucu acomparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT onurpolat acomparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT huseyincelik acomparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT suleymaneksi acomparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT farukkurker acomparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT ahmetaksoz acomparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT enesalgul comparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT saadinoyucu comparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT onurpolat comparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT huseyincelik comparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT suleymaneksi comparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT farukkurker comparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters
AT ahmetaksoz comparativestudyofadvancedtransformerlearningframeworksforwaterpotabilityanalysisusingphysicochemicalparameters