Open Access Article
Parita A.
Mangroliya
a,
Tanmay
Hazra
*b,
Kunal
Ahuja
b,
Rohit
Sindhav
b,
Anamika
Das
c,
Subhadip
Manik
d and
Vimal
Ramani
b
aDepartment of Dairy Technology, Parul Institute of Technology, Parul University, Vadodara, Pin Code-391760, Gujarat, India
bCollege of Dairy Science, Kamdhenu University, Pin Code-365601, Gujarat, India. E-mail: th@kamdhenuuni.edu.in
cSanjay Gandhi Institute of Dairy Technology, Bihar Animal Science University, Pin Code-800014, Bihar, India
dDairy Technology Division, ICAR-National Dairy Research Institute, Karnal, Pin Code-132001, Haryana, India
First published on 18th November 2025
Milk is highly prone to spoilage due to its rich nutrient and moisture content. This study presents a dual-indicator system for real-time milk freshness assessment by integrating a natural pH-sensitive dye from Clitoria ternatea (butterfly pea) with riboflavin-based fluorescence spectroscopy. Anthocyanins were extracted in aqueous media and characterized via UV–vis (400–700 nm) and FTIR spectroscopy, confirming pH-sensitive transitions (λmax shift from 548 nm to 628 nm) and relevant functional groups. A chromogenic assay showed progressive color change during storage at 37 °C, with CIE-LAB values shifting from L* = 64.61 to 13.42, a* from −2.24 to 27.90, and ΔE from 23.26 to 60.27 over 24 hours. Simultaneously, riboflavin fluorescence (λex = 450 nm, λem = 520–525 nm) quenched from ∼8100 to 4300 RFU, correlating with pH drop (from 6.67 to 4.81), titratable acidity rise (0.125% to 0.456% lactic acid), and SPC increase (5.00 × 104 to 7.85 × 106 cfu mL−1). The study successfully demonstrates a dual-indicator platform combining visual anthocyanin-based chromogenic strips and riboflavin fluorescence spectroscopy for non-invasive, real-time milk spoilage detection. Both these indicators are extremely potent and mainly work on pH.
Sustainability spotlightThis research study provides a sustainable solution for real time monitoring of milk freshness via utilizing natural biodegradable substances and non-invasive techniques. By utilizing anthocyanins from Clitoria ternatea (butterfly pea flower) with riboflavin-based fluorescence, a dual indicator system was developed to accurately predict the freshness of milk without generating any waste. SDG 3: Good health and well-being – by ensuring safer dairy consumption and minimizing risks of foodborne illness. SDG 9: Industry, innovation, and infrastructure – by enabling integration of low-cost smart sensing tools into dairy packaging and supply chains. SDG 12: Responsible consumption and production – biobased inputs and processes in the development of freshness indicators utilize plant-derived anthocyanins and milk riboflavin, avoiding harmful materials. The combined system minimizes chemical waste and supports decision-making to reduce dairy losses across the supply chain. By providing clear freshness indications on-pack, it helps prevent food waste while enhancing operational efficiency. |
Given the perishable nature of milk, the development of reliable, rapid, and user-friendly methods for detecting spoilage is essential. Traditional assessment techniques typically involve monitoring physicochemical and microbiological parameters such as pH, titratable acidity, and total bacterial count. While informative, biological methods are often time-consuming, destructive, and difficult to automate or integrate into real-time monitoring systems.4,5 Similarly, conventional approaches such as electrode-based measurements and acid-base titration are not ideal for field-level on-site applications due to their procedural complexity and equipment requirements. Although advanced analytical technologies such as near-infrared (NIR) and fluorescence spectroscopy offer high sensitivity and non-destructive testing capabilities, their implementation is limited by the need for expensive instrumentation and trained personnel. In contrast, visually interpretable freshness indicators, particularly pH-responsive colorimetric dye or dye-based strips, have emerged as attractive alternatives due to their low cost, portability, and ability to provide immediate spoilage assessment.6–8
The most reliable and widely adopted methods for evaluating milk freshness are the measurement of pH and titratable acidity. Fresh milk typically exhibits a pH of around 6.7 to 6.8. During spoilage, microbial fermentation, primarily by lactic acid bacteria (LAB), converts lactose into lactic acid, resulting in a progressive decrease in pH and an increase in titratable acidity.9–11 Monitoring these parameters provides a direct and effective indication of milk quality and the extent of deterioration.
To address the growing demand for sustainable and rapid freshness monitoring tools, natural pH-sensitive dyes derived from fruits, vegetables, and flowers are receiving increasing attention. These natural indicators offer advantages over synthetic dyes, which are often associated with toxicity, carcinogenic risks, and the need for careful handling. In contrast, natural pigments such as anthocyanins, betalains, and carotenoids exhibit strong pH sensitivity while being biodegradable, sustainable, non-toxic, and safe for food-related applications.12,13 Numerous studies have demonstrated the application of such natural dyes in monitoring the freshness of perishable products, including meat, fish, and fruits.12–14
Clitoria ternatea (butterfly pea) is a well-known leguminous plant valued for its vivid blue to violet flowers, which are rich in anthocyanin pigments, primarily ternatins, a group of acylated delphinidin derivatives. These compounds are not only responsible for the characteristic coloration of the petals but also exhibit high pH sensitivity, making them suitable as natural colorimetric indicators. Their chromatic behavior spans a wide pH range: blue at neutral to alkaline conditions and shifting to purple, red, or pink as the pH becomes increasingly acidic.15
The potential of C. ternatea-derived anthocyanins for monitoring food spoilage has garnered increasing interest in recent years, particularly in the context of dairy and other perishable food systems. Spoilage of such products is commonly associated with microbial metabolism, leading to the production of organic acids (e.g., lactic, acetic), volatile nitrogen compounds, and other metabolites. These biochemical changes often result in a progressive decline in pH, which directly correlates with food deterioration.9,10 Traditional analytical methods, such as titratable acidity and microbial enumeration, are laborious, time-consuming, and not suited for real-time monitoring. In this context, pH-responsive natural dyes from C. ternatea offer a rapid, cost-effective, and visual alternative for spoilage detection.12
The efficacy of this natural dye has been proven as part of intelligent packaging to monitor the freshness of different food products. These indicators exhibit distinct and irreversible color transitions in response to acidification caused by microbial activity, allowing for real-time, non-invasive assessment of food quality without the need for instrumentation. This is especially relevant for milk, where a drop in pH from ∼6.7 to below 5.5 often signals spoilage and curdling.8,11 Moreover, anthocyanins from C. ternatea are Generally Recognized as Safe (GRAS), biodegradable, and non-toxic, making them preferable over synthetic dyes, which may pose carcinogenic or environmental hazards.12,13
In addition to external physicochemical changes, internal chemical markers provide valuable insight into the spoilage progression of milk. Among these, riboflavin (vitamin B2) has emerged as a promising non-destructive spoilage indicator. Riboflavin is a naturally occurring, water-soluble vitamin found in milk, known for its characteristic fluorescence under specific light excitation, typically exhibiting strong emission near 520 nm when excited at 370–450 nm. However, this fluorescence intensity is highly sensitive to environmental conditions. During spoilage, microbial metabolism and oxidative reactions degrade riboflavin, resulting in a progressive decline in fluorescence intensity, and such a decline correlates strongly with increasing titratable acidity and decreasing pH.16,17
Front-face fluorescence spectroscopy (FFF) is particularly well-suited for monitoring such changes, as it enables direct analysis of opaque and turbid food systems such as milk without requiring extensive sample preparation or destruction. FFF selectively measures surface fluorescence, minimizing light scattering effects that typically hinder spectroscopic analysis in complex matrices. Therefore, riboflavin fluorescence serves as a reliable, real-time, and non-invasive biomarker for assessing milk freshness.
The present study aims to validate a dual-mode milk freshness monitoring approach by integrating both external and internal spoilage indicators. Specifically, the strategy involves: (i) a visual, pH-responsive freshness indicator developed using anthocyanin-rich butterfly pea (Clitoria ternatea) flower extract, which undergoes distinct color transitions in response to pH changes associated with milk spoilage and can be used easily at the in-field level without the chance of toxicity; and (ii) a fluorescence-based assessment of riboflavin degradation using FFF spectroscopy to monitor internal chemical changes.
By coupling a consumer-friendly, eye-readable, simple colorimetric assay with a scientifically robust spectroscopic technique, this integrated system offers a comprehensive, non-invasive, and potentially scalable solution for real-time milk quality assessment in both field-level as well as in quality control laboratory systems. Such a synergistic approach not only enhances the accuracy of spoilage detection but also contributes to broader goals of ensuring food safety and minimizing milk or dairy waste. To the best of our knowledge, no other study explores these dual approaches to ascertain the freshness of milk.
For controlled spoilage analysis, the milk was transferred into sterile glass bottles, with each bottle representing a specific storage time point. The samples were then incubated (stored) at 37 °C, a temperature conducive to accelerated microbial activity and commonly used to simulate spoilage progression, for predetermined durations of 0, 2, 4, 6, 8, 10, 12, 18, and 24 h. This time-course design enabled the assessment of physicochemical and biochemical changes associated with microbial spoilage over time.
Each dye-buffer mixture was incubated at room temperature (25 ± 2 °C) for 10 min to ensure complete interaction between the dye components and the buffer ions. The absorbance spectra of the samples were recorded in the visible range of 400–700 nm using a UV–visible spectrophotometer (Model UV-1900, Shimadzu Corporation, Japan) with a 1 cm quartz cuvette. The baseline was corrected using the corresponding buffer as the blank.
The spectral data were analyzed to identify the λmax (wavelength of maximum absorbance) at each pH value, thereby characterizing the colorimetric shift exhibited by anthocyanins, particularly ternatins, as a function of hydrogen ion concentration. This spectral analysis provided key insights into the pH responsiveness and color transition range of the extract, supporting its potential application as a visual freshness indicator for pH-sensitive food matrices such as milk.19
:
100 (w/w) ratio. The mixture was pressed into transparent pellets using a hydraulic press under vacuum to form discs suitable for spectral analysis.
The FTIR spectra were recorded using an FTIR spectrometer (Model UV-1900, Shimadzu Corporation, Japan) over the wavenumber range of 4000 to 400 cm−1. Each spectrum was obtained by averaging 100 scans at a resolution of 4 cm−1 to ensure optimal signal-to-noise ratio and spectral clarity. The spectra were analyzed to identify characteristic absorption bands corresponding to major functional groups such as O–H, C–H, C
O, C
C (aromatic), and C–O–C, which are typically present in anthocyanins and phenolic compounds. The data were used to confirm the molecular constituents responsible for the pH-sensitive behavior of the extract and its application potential as a natural colorimetric indicator for monitoring milk spoilage.
Fluorescence measurements were carried out using a fluorescence spectrophotometer (Model: RF-6000, Shimadzu Corporation, Japan). The excitation wavelength (λex) was set at 450 nm, which corresponds to the maximum absorption of riboflavin. Emission spectra were recorded over the range of 500 to 565 nm to capture the characteristic emission peak of riboflavin fluorescence, typically centered around 520–525 nm.17 All measurements were performed in a 1 cm quartz cuvette at room temperature. The linearity of the fluorescence response was confirmed over the different pH of milk (fluorescence intensity (RFU) against pH) to ensure the detector's linearity. All measurements were taken in triplicate (n = 3 independent sample preparations for each time point) and are reported as mean ± standard deviation (SD). To quantify the relationships among the indicators, simple linear regressions were performed for fluorescence intensity (RFU) against pH. Illustrative regression plots, along with their R2 values, can be found in the supplementary file. The fluorescence intensity values were collected and used to evaluate the progressive loss of riboflavin fluorescence over time (decreasing pH), corresponding to microbial and oxidative degradation during milk spoilage.
In addition, conventional parameters indicative of milk quality were measured for all samples. The pH was determined using a calibrated digital pH meter, and titratable acidity was measured by titration with 0.1 N NaOH using phenolphthalein as an indicator, with results expressed as percentage lactic acid. Furthermore, total microbial count was performed using the standard plate count method on nutrient agar and expressed as colony-forming units per millilitre (CFU mL−1). These parameters provided a reference framework for correlating the colorimetric responses of the chromogenic assay with established indicators of milk spoilage.
To objectively quantify the extent of color change, the total color difference (ΔE) was calculated using the following standard equation20
,
, and
are the CIELAB values of the reference strip exposed to pH 7.0, and
,
, and
are the color values of the strip after exposure to the respective milk sample. The ΔE values provided a quantitative measure of the visual color transition, supporting the use of butterfly pea-based indicator strips for monitoring milk freshness.
In this investigation, the total anthocyanin content of the butterfly pea extract (expressed as cyanidin-3-glucoside equivalents) was quantified as 0.5072 mg L−1, indicating a sufficient concentration of bioactive pigments to serve effectively as a natural pH indicator. The extract demonstrated a progressive change in color from magenta at pH 1–3, to purple at pH 4, intense blue between pH 5–8, and blue-green at pH 9–10. These visual transitions correspond to structural changes in the anthocyanin molecules, specifically the interconversion among flavylium cation (acidic, red/magenta), quinonoidal base (neutral, blue/violet), and anionic chalcone or hemiketal forms (alkaline, greenish-blue), consistent with known anthocyanin equilibrium mechanisms.19,21
Spectrophotometric analysis (see Fig. 1(a)) indicated that at low pH (1–3), the extract exhibited a prominent absorbance peak (λmax) around 548 nm, confirming the presence of the flavylium cation. As the pH increased to 4, additional peaks appeared at approximately 570 nm and 622 nm, which correspond to the formation of quinonoidal base structures. In the neutral to mildly alkaline range (pH 5–8), the extract showed a stable absorbance profile within the 580–620 nm range, associated with increased quinonoid and alhydrobase forms. At higher alkaline pH levels (9–10), a further bathochromic shift occurred; the peaks merged to form a broad maximum near 628 nm, indicating deprotonation and the formation of anionic chalcone-like species.19,22
The well-defined and reversible spectral transitions of butterfly pea extract demonstrate its effectiveness as a natural, biodegradable, and visually interpretable pH-sensitive dye. Unlike synthetic indicators, which often raise safety and environmental concerns, anthocyanins derived from C. ternatea provide a safer and eco-friendly alternative for real-time pH monitoring in food systems, including milk. Importantly, the stability of its color properties within the near-neutral pH range makes it particularly relevant for dairy applications, as fresh milk typically has a pH between 6.6 and 6.8.21
A broad absorption band centred at 3399.76 cm−1, along with a sharp peak at 3473.80 cm−1, corresponds to O–H stretching vibrations, indicating a high concentration of hydroxyl groups. These characteristics are typical of polyhydroxylated anthocyanin structures and play a crucial role in hydrogen bonding. The presence of aliphatic C–H stretching vibrations, associated with methyl or methylene groups, is evident from the absorption band at 2937.96 cm−1, which is consistent with previous findings on plant-derived flavonoids.23
The strong peak observed at 1651.88 cm−1 was attributed to C
O stretching vibrations, indicative of conjugated carbonyl functionalities commonly found in anthocyanin chromophores. Adjacent to this, a distinct band at 1590.12 cm−1 corresponds to C
C aromatic stretching, affirming the presence of benzene ring structures, which are integral to the flavylium backbone of anthocyanins. The band at 1453.72 cm−1 reflects C–H bending vibrations, which may arise from aromatic or methyl substituents.
Further, the fingerprint region between 1000 and 1200 cm−1 revealed notable peaks at 1126.92 cm−1 and 1034.28 cm−1, attributed to C–O stretching and C–O–C glycosidic linkages, respectively. These are consistent with the glycosylated nature of anthocyanins such as ternatins, which contribute to the dye's water solubility and pH-responsive color properties. Additionally, absorption bands at 632.84 cm−1 and 432.12 cm−1 in the lower frequency range are associated with out-of-plane C–H bending of aromatic rings, further supporting the presence of complex aromatic structures in the extract.
| Storage period at 37 °C (h) | Colour change | L * | a * | b * | ΔE |
|---|---|---|---|---|---|
| a Mean ± SD (n = 3) with different superscriptsa,b,c,e,f,g,h is significantly different (p < 0.05) to each other column-wise. | |||||
| 0 |
|
64.611 ± 0.594a | −2.235 ± 0.373a | −44.580 ± 0.606b | — |
| 2 |
|
54.344 ± 0.429b | 9.796 ± 0.227c | −50.763 ± 1.353c | 23.255 ± 0.294b |
| 4 |
|
53.368 ± 0.266c | 4.438 ± 0.241b | −54.801 ± 0.456d | 17.203 ± 0.267a |
| 6 |
|
52.741 ± 0.102d | 10.425 ± 0.090c | −50.579 ± 0.185c | 26.803 ± 0.111c |
| 8 |
|
48.214 ± 0.344e | 15.881 ± 0.365d | −54.430 ± 0.481d | 25.050 ± 0.198c |
| 10 |
|
40.629 ± 0.555f | 23.402 ± 0.587e | −55.686 ± 0.356e | 29.455 ± 0.456d |
| 12 |
|
16.918 ± 0.539g | 30.273 ± 0.156g | −47.166 ± 0.119b | 52.341 ± 0.149e |
| 18 |
|
15.549 ± 0.163g | 29.385 ± 0.156g | −43.521 ± 0.050b | 56.281 ± 0.090f |
| 24 |
|
13.422 ± 0.900h | 27.899 ± 0.308f | −39.699 ± 0.303a | 60.269 ± 0.271g |
Objective assessment showed that fresh milk produced the highest L* (lightness) value (64.611 ± 0.594), alongside strongly negative a* (−2.235 ± 0.373) and b* (−44.580 ± 0.606) values, reflecting a vivid blue-green hue. Gradual spoilage was accompanied by steady declines in L*, indicating darkening, likely due to pH-driven progression of anthocyanin structural changes.19
Significantly, a* values shifted from negative to highly positive (peaking at 29.385 ± 0.156 at 18 h), indicating a visible shift from greenish-blue to reddish tones—a hallmark of flavylium ion formation under acidic conditions. Simultaneously, b* values became less negative, corresponding to reduced blue intensity, which aligns with known anthocyanin deprotonation and breakdown during spoilage.21,24
The total color difference (ΔE), quantifying cumulative deviation from the baseline at 0 h, increased significantly from 23.255 ± 0.294 at 2 h to 60.269 ± 0.271 at 24 h. Because ΔE values above ∼10 are visually noticeable and values exceeding ∼40 are considered pronounced, these results indicate strong perceptibility of color change even at early spoilage stages.25 These findings align with prior studies in which butterfly pea anthocyanin-based films or aqueous extracts exhibited distinct colorimetric responses to spoilage or pH changes in milk and seafood matrices.25 The strong correlation between chromatic shifts and spoilage indicators confirms that this colorimetric method offers high sensitivity, visual interpretability, and rapid freshness detection, making it suitable for integration into smart food packaging systems or consumer-level test strips.19,21 Indicators made from anthocyanins derived from edible flowers are biodegradable and compatible with food-contact materials, such as cellulose films. Integrating these indicators into pH label stickers or dipsticks could help reduce chemical waste while enhancing decision-making processes to minimize dairy losses throughout the supply chain.
| Storage period at 37 °C (h) | pH | Acidity (%LA) | SPC (cfu ml−1) |
|---|---|---|---|
| a Mean ± SD (n = 3) with different superscriptsa,b,c,e,f,g,h is significantly different (p < 0.05) to each other column-wise. | |||
| 0 | 6.67 ± 0.004a | 0.125 ± 0.000a | 5 × 104 ± 0.521a |
| 2 | 6.56 ± 0.009b | 0.145 ± 0.000b | 10 × 104 ± 0.000b |
| 4 | 6.34 ± 0.002c | 0.163 ± 0.000c | 23 × 104 ± 0.000c |
| 6 | 6.08 ± 0.000d | 0.196 ± 0.000d | 62 × 104 ± 0.000d |
| 8 | 5.78 ± 0.004e | 0.214 ± 0.001e | 252 × 104 ± 0.000e |
| 10 | 5.53 ± 0.005f | 0.285 ± 0.001f | 356 × 104 ± 0.000f |
| 12 | 5.27 ± 0.007g | 0.343 ± 0.000g | 552 × 104 ± 0.000g |
| 18 | 5.03 ± 0.012h | 0.395 ± 0.001h | 688 × 104 ± 0.327h |
| 24 | 4.81 ± 0.003i | 0.456 ± 0.001i | 785 × 104 ± 0.764i |
The pH of fresh milk was initially recorded at 6.67 ± 0.004, in alignment with standard quality benchmarks for raw milk. Over time, a significant and progressive decrease in pH was observed, reaching 4.81 ± 0.003 at 24 h, indicating increased acidity due to microbial fermentation of lactose into lactic acid. This trend was paralleled by a steady increase in titratable acidity, rising from 0.125 ± 0.000% lactic acid at 0 hours to 0.456 ± 0.001% at 24 hours. The increase in acidity closely correlated with the pH decline, reflecting acidogenesis by lactic acid bacteria (LAB), which are primary spoilage organisms in milk.17 Microbial proliferation was further confirmed by standard plate count (SPC) data, which showed a dramatic rise from 5 × 104 cfu mL−1 at the beginning of storage to 7.85 × 106 cfu mL−1 at 24 hours. The exponential increase in microbial load validates the biochemical changes observed and supports the premise that microbial metabolism is the driving force behind spoilage-related shifts in milk composition.
The strong alignment between the colorimetric transitions in the chromogenic assay and the measured pH, acidity, and SPC demonstrates that the butterfly pea-based freshness indicator provides a visually interpretable, rapid, and reliable proxy for underlying microbiological spoilage mechanisms. This integrated validation confirms the suitability of the system for early detection of spoilage in perishable dairy systems.
At the initial time point (0 h), the milk sample exhibited strong fluorescence emission, with a prominent peak centred at 520–525 nm, characteristic of native riboflavin (vitamin B2). This high intensity signifies the presence of intact, unaltered riboflavin in fresh milk. However, as storage progressed, a gradual and consistent decline in fluorescence intensity was observed. By 2 hours, a slight reduction in signal was detectable, which became progressively more pronounced with longer storage. At 12 hours, the fluorescence intensity had decreased substantially, indicating significant degradation or conformational alteration of riboflavin. By 24 hours, the intensity had dropped to nearly half its initial value, from approximately 8100 relative fluorescence units (RFU) at 0 h to ∼4300 RFU, suggesting a time–temperature-dependent loss of riboflavin integrity also during storage. Microbial action and oxidation degraded riboflavin, leading to the formation of an isoalloxazine ring-opened product, which resulted in decreased fluorescence intensity.
The fluorescence spectroscopy results offer valuable insight into the deterioration kinetics of milk during storage, with a specific focus on riboflavin degradation as a molecular indicator of spoilage. Riboflavin, a naturally fluorescent, water-soluble vitamin, is sensitive to environmental factors such as light, heat, and oxidative stress. Its characteristic fluorescence emission, typically observed around 520–530 nm, allows for non-destructive real-time monitoring of its stability in food matrices.26
As shown in Fig. 3, the consistent quenching in fluorescence intensity over time correlates well with microbial activity and physicochemical degradation occurring during milk spoilage. The degradation of riboflavin can be attributed to thermal stress, microbial metabolism, and the formation of reactive by-products, which either chemically modify riboflavin or interfere with its electronic structure, reducing its fluorescence emission.17,27
These results highlight the potential of riboflavin fluorescence as an internal quality marker that responds to both time and temperature, making it particularly suitable for spoilage monitoring in thermally sensitive dairy products. When used alongside external indicators such as pH-responsive chromogenic strips, riboflavin fluorescence offers a dual-mode, non-invasive diagnostic approach that enhances the accuracy and reliability of freshness detection systems (Fig. 4).
![]() | ||
| Fig. 4 (a) Fluorescence spectrum of riboflavin; (b) change in fluorescence intensity of milk stored at 37 °C for 0, 2, 4, 6, 8, 10, 12, 18 and 24 hours. | ||
The butterfly-pea-based chromogenic test acts as a pH-selective indicator, monitoring acidification (lower the pH) during storage. In contrast, riboflavin front-face fluorescence is specific for detecting riboflavin loss during storage due to a change in pH. Both methods are extremely helpful in detecting freshness in milk.
Supplementary information (SI) is available. See DOI: https://doi.org/10.1039/d5fb00467e.
| This journal is © The Royal Society of Chemistry 2026 |