Researchers have developed a low-cost, paper-based sensor system paired with AI to accurately assess seafood freshness, offering a practical alternative to traditional lab testing.

Image Credit: luveko/Shutterstock.com
Seafood is spoiled by a series of biochemical changes, predominantly microbial growth and enzymatic degradation reactions. These changes cause shifts in the chemical makeup of the fish, most notably increasing compounds such as ammonia and trimethylamine. These volatile nitrogen-based compounds affect the tissue's pH, serving as key indicators of freshness loss.
Traditionally, detecting these shifts has required lab-based techniques, which are precise but unsuitable for real-time use. In response, researchers are turning to visual pH indicators such as Methyl Red and Bromocresol Purple, which change colour based on acidity levels.
Embedded in an agar-agar film and mounted on a paper support, the study published in Scientific Reports demonstrates the potential of non-invasive biosensors capable of visibly tracking spoilage progression.
Collecting And Storing Fish Samples
The study focused on six widely consumed seafood species, freshly collected: Rastrelliger kanagurta, Sardinella longiceps, Metapenaeus dobsoni, Parastromateus niger, Lutjanus campechanus, and Sepia pharaonis.
Researchers packaged the samples in three ways to simulate typical storage scenarios: vacuum-sealed, shrink-wrapped, and covered with traditional low-density polyethylene. The samples were kept at around 4 °C, and tested every three days over 12 days to track changes in quality.
Measuring Colour Changes And Biochemical Data
The researchers developed these paper-based sensors by embedding Methyl Red and Bromocresol Purple into an agar-agar film and attaching them directly to the fish. A Hunter Lab Colorimeter was used to record colour changes in the sensor, measured with three standard values: L* (lightness), a* (red-green), and b* (yellow-blue).
These colour values served as visual proxies for pH changes during spoilage.
They simultaneously carried out biochemical analysis to monitor lipid and nitrogen levels. Protein content was measured using Lowry's method, lipids with Soxhlet extraction, and Total Volatile Basic Nitrogen (TVB-N), a key spoilage marker, evaluated using macro-Kjeldahl distillation and titration.
Predicting Freshness with AI
After the data was collected, it was preprocessed, which involved cleaning the dataset, normalising numerical inputs, and encoding categorical variables.
The dataset was then split into training and testing groups for model development.
A Random Forest regression model was trained to predict the pH values based on both the sensor's colour data and the biochemical results. Researchers then fine-tuned key parameters, including the number of decision trees and their depth, to improve model performance.
The model's accuracy was validated using Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE).
Strong Performance Across Fish Types
The colour-changing agar-based biosensor reliably indicated the spoiling visually, with L*, a*, and b* values providing a strong basis for machine learning predictions.
Biochemical data showed a steady decline in protein and lipid content, consistent with microbial decomposition. TVB-N levels increased during storage, confirming spoilage, but remained within edible limits for up to 12 days under refrigeration.
Alongside this biosensor data, the machine learning models accurately predicted pH levels across all fish types. Pomfret and Mackerel showed particularly strong results, with the lowest MSE values (0.004625 and 0.005034, respectively) and correspondingly low RMSE figures, indicating very small errors. MAE values also remained low, demonstrating the model's predictive strength.
Download your PDF copy now!
Freshness Classification And Packaging Impact
Researchers categorised the predicted pH values into "Fresh," "Moderately Fresh," and "Spoiled" ranges. These classifications aligned closely with TVB-N readings, confirming the potential of the sensor-AI combination as a practical tool for spoilage detection.
Packaging significantly affected freshness. Vacuum-sealed samples spoiled less quickly with slower changes in pH and chemical composition. These results reinforce the value of low-oxygen storage in preserving seafood quality.
Looking Ahead
This work offers a scalable and cost-effective method for real-time freshness monitoring, which could be especially useful for processors, retailers, and regulators seeking fast, non-lab-based assessments. By combining accessible sensor technology with machine learning, the approach offers real-time insights that could improve shelf life management and support safer handling.
Future work will explore a more diverse range of fish, packaging strategies, and storage environments to strengthen the system's adaptability and reliability.
Journal Reference
Kumaravel B., et al. (2025). Automated seafood freshness detection and preservation analysis using machine learning and paper-based pH sensors. Scientific Reports 15, 26051. DOI: 10.1038/s41598-025-08177-x, https://www.nature.com/articles/s41598-025-08177-x