Development and statistical validation of an image processing system for total ammonia nitrogen monitoring in aquaculture
Keywords:
Total ammonia nitrogen, Image processing, Aquaculture water quality, Mathematic modelAbstract
Aquaculture has become essential for global food security and economic growth, but its productivity relies heavily on effective water quality management. Total ammonia nitrogen (TAN) concentration is a key parameter, as high concentrations can harm aquatic life and disrupt cultivation systems. Conventional TAN measurement methods including colorimetric tests, spectrophotometry, electrochemical techniques, and biological assays offer high analytical accuracy but remain costly, complex, and often inaccessible for small-scale farmers. To overcome these limitations, this study developed a low-cost, TAN monitoring prototype using image processing techniques integrated with a Raspberry Pi microcontroller. Standard TAN solutions (0-5 mg/L) were prepared to construct regression models based on red (R) green (G) blue (B) color values extracted from captured images. Validation experiments showed that although both the R and G channel models provided strong predictive capability, the G channel model demonstrated superior practical performance. The G channel achieved the coefficient of determination (R2)=0.969, mean absolute error (MAE)=0.535 mg/L, root mean squared error (RMSE)=0.805 mg/L, a sensitivity of 1.397, and a limit of detection (LOD) of 0.215 mg/L, delivering stable and consistent predictions in the concentration range of 0.2-2.0 mg/L. In contrast, the R channel model, despite achieving higher numerical accuracy, exhibited greater drift at higher TAN concentrations, reducing its reliability in operational settings. The prototype system displays TAN values on a liquid crystal display (LCD) screen and sends notifications via the LINE application, enabling aquaculturists to respond promptly to potential water quality risks. By offering an affordable, accessible, and user-friendly alternative to conventional analytical methods, the proposed system supports more effective water quality management and contributes to the sustainable development of aquaculture practices.
Keywords: total ammonia nitrogen, image processing, aquaculture water quality, mathematic model
DOI: 10.25165/j.ijabe.20261901.10224
Citation: Puangsuwan K, Wongpanich J, Hama R. Development and statistical validation of an image processing system fortotal ammonia nitrogen monitoring in aquaculture. Int J Agric & Biol Eng, 2026; 19(1): 26–32.
References
[1] Sampantamit T, Ho L, Lachat C, Sutummawong N, Sorgeloos P, Goethals P. Aquaculture production and its environmental sustainability in Thailand: Challenges and potential solutions. Sustainability, 2020; 12(5): 2010. doi: 10.3390/su12052010.
[2] Eddy F B. Ammonia in estuaries and effects on fish. Journal of Fish Biology, 2005; 67(6): 1495–1513. doi: 10.1111/j.1095-8649.2005.00930.x.
[3] Camargo J A, Alonso Á. Ecological and toxicological effects of inorganic nitrogen pollution in aquatic ecosystems: A global assessment. Environment International, 2006; 32(6): 831–849.
[4] Isahak J, Thepahudi W, Jongcharoensuk R, Bia Kaeo T, Pan Dee T. Application of a webcam and image processing techniques for measuring total ammonia and nitrite concentrations in freshwater. RMUTSB Academic Journal, 2015; 3(2): 129–136. (in Thai
[5] Molins-Legua C, Meseguer-Lloret S, Moliner-Martínez Y, Campíns-Falcó P. A guide for selecting the most appropriate method for ammonium determination in water analysis. TrAC Trends in Analytical Chemistry, 2006; 25(3): 282–290.
[6] Durborow R M, Crosby D M, Brunson M W. Ammonia in fish ponds. Southern Regional Aquaculture Center, SRAC publication, 1997; 463. Available: http://www.msstate.edu/dept/srac/fslist.htm. Accessed on [2025-]
[7] Zamora-Garcia I, Correa-Tome F E, Hernandez-Belmonte U H, Ayala-Ramirez V, Ramirez-Paredes J P. Mobile digital colorimetry for ammonia determination in aquaculture. Computers and Electronics in Agriculture, 2021; 181(1): 105960.
[8] Goldshleger N, Grinberg A, Harpaz S, Shulzinger A, Abramovich A. Real-time advanced spectroscopic monitoring of ammonia concentration in water. Aquacultural Engineering, 2018; 83(3): 103–108.
[9] Randall D J, Tsui T K N. Ammonia toxicity in fish. Marine Pollution Bulletin, 2002; 45(1-12): 17–23.
[10] Martins C I M, Eding E H, Verdegem M C J, Heinsbroek L T N, Schneider O, Blancheton J P, et al. New developments in recirculating aquaculture systems in Europe: A perspective on environmental sustainability. Aquacultural Engineering, 2010; 43(3): 83–93.
[11] Li H C, Yu K W, Lien C H, Lin C, Yu C R, Vaidyanathan S. Improving aquaculture water quality using dual-input fuzzy logic control for ammonia nitrogen management. Journal of Marine Science and Engineering, 2023; 11(6): 1109.
[12] Elmessery W M, Abdallah S E, Oraiath A A T, Espinosa V, Abuhussein M F A, Szűcs P, et al. A deep deterministic policy gradient approach for optimizing feeding rates and water quality management in recirculating aquaculture systems. Aquaculture International, 2025; 33(1): 253.
[13] Jiang F H, Tao J Y. UV-Visible spectrophotometric method for the determination of ammonia nitrogen using potassium bromate as oxidant. Desalination and Water Treatment, 2023; 306(1): 159–164.
[14] Ling T L, Ahmad M, Heng L Y. UV-vis spectrophotometric and artificial neural network for estimation of ammonia in aqueous environment using cobalt(II) ions. Analytical Methods, 2013; 5: 6709–6715. doi: 10.1039/C3AY40887F.
[15] Cho Y B, Jeong S H, Chun H, Kim Y S. Selective colorimetric detection of dissolved ammonia in water via modified Berthelot’s reaction on porous paper. Sensors and Actuators B: Chemical, 2018; 256: 167–175. doi: 10.1016/j.snb.2017.10.069
[16] Tamim A T, Begum H, Shachcho S A, Khan M M, Yeboah-Akowuah B, Masud M, et al. Development of IoT based fish monitoring system for aquaculture. Intelligent Automation & Soft Computing, 2022; 32(1): 55–71.
[17] Amirjani A, Fatmehsari D H. Colorimetric detection of ammonia using smartphones based on localized surface plasmon resonance of silver nanoparticles. Talanta, 2018; 176: 242–246. doi: 10.1016/j.talanta.2017.08.022.
[18] Siribunbandal P, Kim Y H, Osotchan T, Zhu Z, Jaisutti R. Quantitative colorimetric detection of dissolved ammonia using polydiacetylene sensors enabled by machine learning classifiers. ACS Omega, 2022; 7(22): 18714–18721. doi: 10.1021/acsomega.2c01419.
[19] Soudi M, Cencillo-Abad P, Patel J, Ghimire S, Dillon J, Biswas A, et al. Self-assembled plasmonic structural color colorimetric sensor for smartphone-based point-of-care ammonia detection in water. ACS Applied Materials & Interfaces, 2024; 16(34): 45632–45639. doi: 10.1021/acsami.4c06615.
[20] Kamel A H, Abd‐Rabboh H S M. A dual-ion-selective electrode system for real-time monitoring of dissolved ammonia. Analyst, 2025; 18: 4145–4154. doi: 10.1039/d5an00647c.
[21] Chen Y, Goh S S, Damalerio R, Chen W, Choong D S W, Lim J Y C, et al. Development of long term stable multiple-ion- selective sensors for agriculture and aquaculture applications. Electronic Components and Technology Conference (ECTC), Orlando, FL, USA: IEEE, 2020; pp.997–1002. doi: 10.1109/ECTC32862.2020.00162
[22] Su X, Sutarlie L, Loh X J. Sensors, biosensors, and analytical technologies for aquaculture water quality. Research, 2020; 2020: 8272705.
[23] Endo H, Wu H. Biosensors for the assessment of fish health: A review. Fisheries Science, 2019; 85: 641–654.
[24] Siribunbandal P, Kim Y-H, Osotchan T, Zhu Z, Jaisutti R. Quantitative colorimetric detection of dissolved ammonia using polydiacetylene sensors enabled by machine learning classifiers. ACS Omega, 2022; 7(22): 18714–18721.
[25] Kilic V, Horzum N, Solmaz M E. From sophisticated analysis to colorimetric determination: Smartphone spectrometers and colorimetry. IntechOpen, 2018; doi: 10.5772/INTECHOPEN.82227.
[26] Kilic V, Alankus G, Horzum N, Mutlu A Y, Bayram A, Solmaz M E. Single-image-referenced colorimetric water quality detection using a smartphone. ACS Omega, 2018; 3(5): 5531–5536.
[27] Rani S, Biswas P C, Hossain A, Islam R, Canning J. Polynomial regression of multiple sensing variables for high-performance smartphone colorimeter. OSA Continuum, 2021; 4(2): 374–384.
[28] Mahmuda, Barkatullah, Haque E, Al Noman A, Ahmed F. Image processing based water quality monitoring system for biofloc fish farming. In: 2021 Emerging Technology in Computing, Communication and Electronics (ETCCE), Dhaka, Bangladesh: IEEE, 2021; pp.1–6, doi: 10.1109/ETCCE54784.2021.9689904.
[29] Phat N H, Hoan N D. Propose an automatic ammonia concentration of water measuring system combining image processing for aquaculture. Journal Européen des Systèmes Automatisés, 2021; 54(3): 453–460.
[30] Chicco D, Warrens M J, Jurman G. The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation. PeerJ Computer Science, 2021; 7(3): e623.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 International Journal of Agricultural and Biological Engineering

This work is licensed under a Creative Commons Attribution 4.0 International License.
IJABE is an international peer reviewed, open access journal, adopting Creative Commons Copyright Notices as follows.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).