Open Access Article
This Open Access Article is licensed under a Creative Commons Attribution-Non Commercial 3.0 Unported Licence

Dual-indicator approach for real-time milk freshness detection using butterfly pea anthocyanins and riboflavin fluorescence

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

Received 14th August 2025 , Accepted 17th November 2025

First published on 18th November 2025


Abstract

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 spotlight

This 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.

1. Introduction

Milk is a widely consumed, nutrient-rich food that supports growth and promotes good health among all age individuals.1 However, owing to its high moisture and nutrient content, milk is particularly susceptible to microbial growth, which can lead to rapid spoilage. Milk spoilage refers to the reduction in milk quality caused by microbial contamination or chemical changes, resulting in off-flavors and curdling, with potential health risks.2 Although milk is typically marked with an expiry date, factors such as a failure in the cold chain management and improper storage conditions can be responsible for the spoilage of milk.3

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.

2. Materials and methods

2.1 Collection of milk and sample preparation

Fresh raw milk was used for the preparation of spoilage-stage milk samples. To ensure authenticity and minimize pre-contamination, the milk was procured directly from local dairy farmers in Amreli, Gujarat, India, using clean, sterilized, and dry food-grade containers. Immediately after collection, the milk samples were transported under refrigerated conditions (approximately 4 °C) to the laboratory and stored at refrigeration temperature until further processing.

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.

2.2 Extraction of butterfly pea dye and determination of total anthocyanin content

Fresh butterfly pea (Clitoria ternatea) flowers were procured from a local garden in Amreli, Gujarat, India. Upon arrival at the laboratory, the flowers were thoroughly rinsed under running tap water to remove surface impurities and dust. The green calyx and stem portions were carefully removed to ensure uniformity and minimize potential interference in the pigment extraction process. Subsequently, 25 g of cleaned flower petals were weighed and homogenized using a mechanical blender with 50 mL of double-distilled water as the extraction solvent. The resulting mixture was macerated for 5 minutes to facilitate maximum pigment release. The homogeneous mixture was then filtered through four layers of muslin cloth to remove particulate matter and obtain a clear aqueous extract rich in anthocyanins. The extract was immediately transferred to an amber-colored bottle to prevent photodegradation and stored at refrigeration temperature (4 ± 1 °C) until further use. The total anthocyanin content (TAC) expressed as cyanidin-3-glucoside equivalents of the butterfly pea extract was quantified using the pH differential method described by Lee et al.18

2.3 Spectral characteristics of butterfly pea dye

The pH-dependent spectral behavior of the butterfly pea (Clitoria ternatea) extract was evaluated to determine its suitability as a natural pH indicator. The aqueous extract was diluted appropriately and mixed with universal buffer solutions adjusted to pH values ranging from 1.0 to 10.0 (in increments of one unit). The buffer solutions were prepared using standard buffer systems (e.g., citric acid–phosphate–borate), and the pH was verified using a calibrated digital pH meter.

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

2.4 Fourier transform infrared (FTIR) analysis

Fourier Transform Infrared (FTIR) spectroscopy was performed to characterize the functional groups present in the butterfly pea (Clitoria ternatea) flower extract and to evaluate its suitability as a natural pH-sensitive dye. The extract was first freeze-dried to remove moisture and then finely ground into a uniform powder using a mortar and pestle. Approximately 2 mg of the dried sample was thoroughly mixed with 200 mg of spectroscopic-grade potassium bromide (KBr) in a 1[thin space (1/6-em)]:[thin space (1/6-em)]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[double bond, length as m-dash]O, C[double bond, length as m-dash]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.

2.5 Fluorescence analysis of riboflavin

Fluorescence spectroscopy was employed to monitor the degradation of riboflavin (vitamin B2) as a non-invasive internal indicator of milk spoilage. Milk samples stored at 37 °C for various time intervals were diluted to 1% (v/v) using double-distilled water to reduce sample opacity and minimize inner filter effects. The diluted samples were gently vortexed to ensure homogeneity before analysis.

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.

2.6 Chromogenic assay and validation of butterfly pea extract for visual milk spoilage detection

A chromogenic assay was performed to evaluate milk freshness using the pH-sensitive anthocyanin extract derived from butterfly pea (Clitoria ternatea). For each test, 1 mL of milk sample was placed into a clean, dry test tube, followed by the addition of 2 mL of the butterfly pea extract. The contents were gently mixed to ensure proper interaction, and the resulting color change was observed visually. The shift in color, driven by the pH-sensitive ternatins present in the extract, served as a qualitative indicator of milk freshness. To assess the reproducibility and detection capability of the assay, the procedure was repeated 100 times across milk samples incubated (stored) at 37 °C for varying durations (0 to 24 h). The sensitivity of assay was validated by comparing the observed color transitions with standard indicators of 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.

2.7 Colour response

The resulting color change of colorimetric assay was recorded using a smartphone camera under standardized lighting conditions. The images were analyzed using Color Picker software, which extracted the CIELAB color coordinates: L* (lightness), a* (red-green axis), and b* (yellow–blue axis) from the region of interest.

To objectively quantify the extent of color change, the total color difference (ΔE) was calculated using the following standard equation20

image file: d5fb00467e-t1.tif
where image file: d5fb00467e-t2.tif, image file: d5fb00467e-t3.tif, and image file: d5fb00467e-t4.tif are the CIELAB values of the reference strip exposed to pH 7.0, and image file: d5fb00467e-t5.tif, image file: d5fb00467e-t6.tif, and image file: d5fb00467e-t7.tif 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.

2.8 Statistical analysis

All experimental data were expressed as mean ± standard error (SE) based on independent replicates. The data were statistically analyzed to assess the significance of differences among treatments. One-way analysis of variance (ANOVA) was employed to determine the effects of storage time and treatment conditions on the measured parameters. When significant differences were detected (p ≤ 0.05), post hoc comparisons were performed using the Critical Difference (CD) test to identify statistically distinct means among treatment groups. Statistical computations were carried out using IBM SPSS Statistics software, version 26.0 (IBM Corp., Armonk, NY, USA). A significance level of 5% (p ≤ 0.05) was used throughout the analysis to determine the reliability of the observed effects.

3. Results and discussion

3.1 Spectral characteristics of butterfly pea dye

The butterfly pea (Clitoria ternatea) flower extract exhibited distinct and visually observable pH-dependent color changes, as illustrated in Fig. 1(a). These changes are attributed to the structural transformation of anthocyanins (specifically ternatins) under varying pH conditions, which alter their molecular configuration and corresponding light absorption behavior. This leads to characteristic chromatic shifts observable both visually and spectroscopically.19,21
image file: d5fb00467e-f1.tif
Fig. 1 Flow diagram.

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

3.2 Fourier transform infrared (FTIR) analysis

The FTIR spectrum of butterfly pea (Clitoria ternatea) extract, shown in Fig. 2, provides critical insights into the functional groups responsible for its pH-sensitive properties. The spectral profile confirms the presence of key structural features typical of anthocyanins and flavonoid-based polyphenolic compounds.
image file: d5fb00467e-f2.tif
Fig. 2 (a) Color change and (b) UV-visible spectrum of butterfly dye in solution (pH 1–10).

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[double bond, length as m-dash]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[double bond, length as m-dash]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.

3.3 Chromogenic assay and color response

The efficacy of the butterfly pea anthocyanin-based indicator dye in detecting milk freshness in real time was assessed through a chromogenic assay. The results (Table 1) reveal a clear and progressive colour transition correlated with pH changes caused by microbial spoilage during storage at 37 °C. Initially, the indicator strip appeared bright blue upon exposure to fresh milk (0 h) but deepened into darker blue and purplish tones as storage time increased, consistent with acidification driven by lactic acid bacteria.9–11
Table 1 Colour response of butterfly pea dye with different milk samplesa
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 image file: d5fb00467e-u1.tif 64.611 ± 0.594a −2.235 ± 0.373a −44.580 ± 0.606b
2 image file: d5fb00467e-u2.tif 54.344 ± 0.429b 9.796 ± 0.227c −50.763 ± 1.353c 23.255 ± 0.294b
4 image file: d5fb00467e-u3.tif 53.368 ± 0.266c 4.438 ± 0.241b −54.801 ± 0.456d 17.203 ± 0.267a
6 image file: d5fb00467e-u4.tif 52.741 ± 0.102d 10.425 ± 0.090c −50.579 ± 0.185c 26.803 ± 0.111c
8 image file: d5fb00467e-u5.tif 48.214 ± 0.344e 15.881 ± 0.365d −54.430 ± 0.481d 25.050 ± 0.198c
10 image file: d5fb00467e-u6.tif 40.629 ± 0.555f 23.402 ± 0.587e −55.686 ± 0.356e 29.455 ± 0.456d
12 image file: d5fb00467e-u7.tif 16.918 ± 0.539g 30.273 ± 0.156g −47.166 ± 0.119b 52.341 ± 0.149e
18 image file: d5fb00467e-u8.tif 15.549 ± 0.163g 29.385 ± 0.156g −43.521 ± 0.050b 56.281 ± 0.090f
24 image file: d5fb00467e-u9.tif 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.

3.4 Physicochemical and microbial validation of milk spoilage

To substantiate the results of the chromogenic assay, complementary analyses of pH, titratable acidity, and standard plate count (SPC) were conducted on milk samples stored at 37 °C for up to 24 hours. The findings are summarized in Table 2, which illustrates a consistent pattern of declining pH, rising acidity, and increasing microbial load, collectively confirming the progression of milk spoilage under accelerated storage conditions.
Table 2 Changes in quality parameter over the storage perioda
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.

3.5 Fluorescence analysis of riboflavin

The fluorescence characteristics of riboflavin in milk samples stored at 37 °C for up to 24 hours were examined using fluorescence spectroscopy to assess its viability as a non-invasive indicator of spoilage. The results are presented in Fig. 3, where panel (a) illustrates the fluorescence emission spectra (500–565 nm) at successive time intervals, and panel (b) quantifies the corresponding fluorescence intensity decay over time.
image file: d5fb00467e-f3.tif
Fig. 3 FTIR spectrum of Butterfly pea (Clitoria ternatea) dye.

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).


image file: d5fb00467e-f4.tif
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.

4. Conclusion

This study evaluates the effectiveness of butterfly pea flower extract as a natural, pH-sensitive indicator for detecting milk spoilage through visible color changes. The anthocyanin-based chromogenic assay showed a strong correlation with pH decline, increased acidity, and microbial growth. Additionally, the quenched riboflavin fluorescence intensity provided a reliable internal marker of milk degradation. Together, these findings validate a dual-indicator approach that combines external visual cues and internal fluorescence monitoring, offering a practical, non-invasive, and sustainable method for evaluating milk freshness in real time. However, the effectiveness of these methods in various dairy products, such as cheese, paneer, or other concentrated dairy products, is always a challenging task. Future work should focus on validating the performance differences among various dairy products to determine their freshness.

Conflicts of interest

There is no conflict of interest.

Data availability

The data supporting the findings of this study can be obtained from the corresponding author upon a reasonable request.

Supplementary information (SI) is available. See DOI: https://doi.org/10.1039/d5fb00467e.

Acknowledgements

This research project has been funded by the Gujarat State Biotechnology Mission, Govt. of Gujarat, and jointly managed by Savli Technology and Business Incubator, under grant number GSBTM/HRD/E-CBC/2023-24/01137101.

References

  1. F. Cimmino, A. Catapano, L. Petrella, I. Villano, R. Tudisco and &G. Cavaliere, Role of milk micronutrients in human health, Front. Biosci., 2023, 28, 41,  DOI:10.31083/j.fbl2801041.
  2. R. Dhakane, R. Gulve, A. Shinde, A. Jadhav and S. Bhusnar, Spoilage and preservation of milk and milk products: A review, J. Emerg. Technol. Innov. Res., 2019, 6, 173–179 Search PubMed.
  3. V. Fusco, D. Chieffi, F. Fanelli, A. F. Logrieco, G. S. Cho, J. Kabisch and C. M. A. P. Franz, Microbial quality and safety of milk and milk products in the 21st century, Compr. Rev. Food Sci. Food Saf., 2020, 19, 2013–2049,  DOI:10.1111/1541-4337.12568.
  4. M. Lu, Y. Shiau, J. Wong, R. Lin, H. Kravis, T. Blackmon and N. S. Wang, Milk spoilage: Methods and practices of detecting milk quality, Food Nutr. Sci., 2013, 4, 113,  DOI:10.4236/fns.2013.48A014.
  5. M. Lu, and N. S. Wang, Spoilage of milk and dairy products. in The Microbiological Quality of Food, ed. A. Bevilacqua, M. R. Corbo and M. Sinigaglia, Woodhead Publishing, 2017, pp. 151–178,  DOI:10.1016/B978-0-08-100502-6.00009-5.
  6. S. Huang, S. Ge, L. He, Q. Cai and C. A. Grimes, A remote-query sensor for predictive indication of milk spoilage, Biosens. Bioelectron., 2008, 23, 1745–1748,  DOI:10.1016/j.bios.2008.01.036.
  7. L. R. Magnaghi, C. Zanoni, G. Alberti, P. Quadrelli and R. Biesuz, Towards intelligent packaging: BCP-EVOH@optode for milk freshness measurement, Talanta, 2022, 241, 123230,  DOI:10.1016/j.talanta.2022.123230.
  8. X. Hu, X. Zhang, Y. Li, J. Shi, X. Huang, Z. Li and X. Zou, Easy-to-use visual sensing system for milk freshness, sensitized with acidity-responsive N-doped carbon quantum dots, Foods, 11, 20221855,  DOI:10.3390/foods11131855.
  9. K. A. Santoso, The effects of milk age on the titratable acidity of raw milk, Int. J. Sci. Res., 2020, 9, 1041–1049,  DOI:10.21275/SR20623085526.
  10. K. M. Edwards, A. Badiger, D. R. Heldman and M. S. Klein, Metabolomic markers of storage temperature and time in pasteurized milk, Metabolites, 2021, 11, 419,  DOI:10.3390/metabo11070419.
  11. Y. Wang, J. Wu, M. Lv, Z. Shao, M. Hungwe, J. Wang and W. Geng, Metabolism characteristics of lactic acid bacteria and the expanding applications in food industry, Front. Bioeng. Biotechnol., 2021, 9, 612285,  DOI:10.3389/fbioe.2021.612285.
  12. S. Roy and J. W. Rhim, Anthocyanin food colorant and its application in pH-responsive color change indicator films, Crit. Rev. Food Sci. Nutr., 2021, 61, 2297–2325,  DOI:10.1080/10408398.2020.1776211.
  13. K. K. Gaikwad and L. Hakim, Natural dyes from plants for smart packaging and printing applications, J. Adv. Chem. Eng., 2022, 12, 246,  DOI:10.35248/2090-4568.22.12.246.
  14. T. Singh, V. K. Pandey, K. K. Dash, S. Zanwar and R. Singh, Natural bio-colorant and pigments: Sources and applications in food processing, J. Agric. Food Res., 2023, 12, 100628,  DOI:10.1016/j.jafr.2023.100628.
  15. G. C. Vidana Gamage, Y. Y. Lim and W. S. Choo, Anthocyanins from Clitoriaternatea flower: Biosynthesis, extraction, stability, antioxidant activity, and applications, Front. Plant Sci., 2021, 12, 792303,  DOI:10.3389/fpls.2021.792303.
  16. R. Karoui and C. Blecker, Fluorescence spectroscopy measurement for quality assessment of food systems—A review, Food Bioprocess Technol., 2011, 4, 364–386,  DOI:10.1007/s11947-010-0370-0.
  17. G. Pandey and A. Joshi, Riboflavin as an internal marker for spoilage and adulteration detection in milk, Food Chem., 2021, 357, 129742,  DOI:10.1016/j.foodchem.2021.129742.
  18. J. Lee, R. W. Durst and R. E. Wrolstad, Determination of total monomeric anthocyanin pigment content of fruit juices, beverages, natural colorants, and wines by the pH differential method: Collaborative study, J. AOAC Int., 2005, 88, 1269–1278,  DOI:10.1093/jaoac/88.5.1269.
  19. X. Fu, Q. Wu, J. Wang, Y. Chen, G. Zhu and &Z. Zhu, Spectral characteristic, storage stability and antioxidant properties of anthocyanin extracts from flowers of butterfly pea (Clitoriaternatea L.), Molecules, 2020, 26(22), 7000,  DOI:10.3390/molecules26227000.
  20. P. B. Pathare, U. L. Opara and F. A. J. Al-Said, Colour measurement and analysis in fresh and processed foods: A review, Food Bioprocess Technol., 2013, 6, 36–60,  DOI:10.1007/s11947-012-0867-9.
  21. N. N. Hasanah, E. Mohamad Azman, A. Rozzamri, N. H. Zainal Abedin and M. Rashedi, A systematic review of butterfly pea flower (Clitoriaternatea L.): Extraction and application as a food freshness pH-indicator for polymer-based intelligent packaging, Polymers, 2022, 15(11), 2541,  DOI:10.3390/polym15112541.
  22. L. Handayani, S. Aprilia, N. Arahman and &M. R. Bilad, Anthocyanin extraction and pH-modulated color alterations in butterfly pea flower (Clitoriaternatea L.), IOP Conf. Ser. Earth Environ. Sci., 2024, 1359(1), 012087,  DOI:10.1088/1755-1315/1359/1/012087.
  23. N. A. Ludin, M. A. Al-Alwani, A. B. Mohamad, A. A. H. Kadhum, N. H. Hamid, M. A. Ibrahim and &K. Sopian, Utilization of natural dyes from Zingiber officinale leaves and Clitoriaternatea flowers to prepare new photosensitisers for dye-sensitised solar cells, Int. J. Electrochem. Sci., 2018, 13(8), 7451–7465,  DOI:10.20964/2018.08.04.
  24. S. R. Omar, A. A. Noh and A. N. Rohaizan, The potential use of anthocyanin in butterfly pea (Clinoteriaternatea) petals as colorimetric indicator in intelligent food packaging, Malaysian J. of Sci. H. and Tech., 2022, 8(1), 71–76,  DOI:10.33102/2022243.
  25. T. F. Cho, A. Yassoralipour, Y. Y. Lee, T. K. Tang, O. M. Lai, L. C. Chong and E. T. Phuah, Evaluation of milk deterioration using simple biosensor, J. Food Meas. Charact., 2022, 16(1), 258–268,  DOI:10.1007/s11694-021-01145-9.
  26. U. Alvarado, A. Zamora, J. Liu, J. Saldo and M. Castillo, Rapid quantification of riboflavin in milk by front-face fluorescence spectroscopy: A preliminary study, Foods, 2019, 9(1), 6,  DOI:10.3390/foods9010006.
  27. U. Alvarado, A. Zamora, O. Arango, J. Saldo and M. Castillo, Prediction of riboflavin and ascorbic acid concentrations in skimmed heat-treated milk using front-face fluorescence spectroscopy, J. Food Eng., 2022, 318, 110869,  DOI:10.1016/j.jfoodeng.2021.110869.

This journal is © The Royal Society of Chemistry 2026
Click here to see how this site uses Cookies. View our privacy policy here.