Introduction

Food is a fundamental component for the survival of any organisms and plays a vital role to gain energy from the process of metabolism and thus supporting all physiological processes. Subsequently, the good nutritional value of food is essential for an organism to prevent aliments of physical and mental health. Macronutrients (i.e., carbohydrates, proteins, and fats) provide energy necessary for the cellular processes required for daily functioning. Micronutrients (i.e., vitamins and minerals) are required in comparatively small amounts for normal growth, development, metabolism, and physiologic functioning (Stipanuk and Caudill 2016). Viable evidence underlines a significant link between diet, immunity and disease susceptibility (Chandra 1996). Furthermore, the quality of food is a critical aspect and becoming a major concern with increase in malicious activities of adulteration and eventually would turn out to be fatal for human beings. Food fraud is defined as the intended act of substituting, adding, tampering, or misrepresenting food, food ingredients, or food packaging (Spink and Moyer 2011). According to the report from FSSAI (Food Safety and Standards Authority of India), 28% of food samples tested in 2018–2019 were found to be adulterated. Generally, the limited supply of food and vested interests of earning money are key factors for adulteration. Till date, various instances of food adulteration have been documented and remain in practice. Examples include the addition of cheaper oils and fats to milk and milk products (Poonia et al. 2017), industrial sugars to honey (Naila et al. 2018), plant and animal proteins to minced beef and pork (Rady and Adedeji 2018), addition of metanil yellow to curcumin, and bleaching of garlic.

Garlic (Allium sativum L.) is a polyphenolic and organosulfur enriched nutraceutical spice consumed since ancient times. Garlic and its secondary metabolites have shown excellent health-promoting and disease-preventing effects on many human common diseases, such as cancer, cardiovascular and metabolic disorders, blood pressure, and diabetes, through its antioxidant, anti-inflammatory, and lipid-lowering properties, as demonstrated in several in vitro, in vivo, and clinical studies (Ansary et al. 2020). Garlic has acquired a reputation in different traditions as a prophylactic as well as therapeutic medicinal plant (Awan et al. 2019; Melguizo-Rodríguez et al. 2022). The therapeutic effects of garlic are mainly due to the impressive activity of its bioactive compounds, such as organic sulphides, saponins, phenolic compounds, and polysaccharides. Each clove contains a small amount of zinc, calcium, iron, potassium, magnesium, sodium, vitamin B-6, vitamin C, and few amino acids. However, this amazing spice is vulnerable to adulteration with various chemicals predominantly sodium hypochlorite (NaOCl). Large volume ingestion of bleach, typically associated with suicide attempts, can result in disastrous complications including death. Ingestion of this toxic substance leads to severe oesophageal and airway burns along with perforation of the gastroesophageal junction, bilateral pneumothorax, and pneumoperitoneum. Gastrointestinal, pulmonary, hematologic, and renal toxicity are the primary threats caused by the bleaching agents (Arévalo-Silva et al. 2006; Peck et al. 2011).

Several conventional methods have been employed for monitoring the food quality. Some of the major techniques include high-performance liquid chromatography (HPLC) (Liu et al. 2018), mass spectrometry (MS)-based methods (liquid chromatography(LC)-MS/MS, GC/MSD), electrophoretic methods (sodium dodecyl sulphate polyacrylamide gel electrophoresis (SDS-PAGE)), polymerase chain reaction (PCR), PCR-restriction fragment length polymorphism (RFLP) (Hong et al. 2017), enzyme linked immunosorbent assay (ELISA), chemiluminescence (CL), and Fourier transform infrared spectroscopy (FTIR) (Muthukumar et al. 2021). Techniques like ion chromatography (IC) and iodometric titration headspace gas chromatography–flame ionization detection (GC–FID) are used for detection of the bleaching agent NaOCl (Jackson et al. 2006). These techniques have been widely used by the government food quality organizations are highly accurate yet have some specific drawbacks. These techniques are time-consuming, laborious, equipment and resource-intensive and require highly skilled scientists and technicians to conduct the tests (Gao et al. 2018).

Additionally, in developing and under-developed countries, majority of consumers generally obtain goods from flea markets, where the products are not subjected for on-the-spot testing. Consequently, there is a growing necessity for the development of robust and cost-effective methods to ensure the safety and authenticity of these goods. To address the above issues, cellulose-based devices have garnered a significant amount of attention over the past few decades (Mani et al. 2019; Prabhu et al. 2020b; Hasandka et al. 2021; Prabhu et al. 2021; Kelkar et al. 2022). Recent developments in cellulose-based microfluidics have significantly helped to identify adulterants, pathogens, and other analytes in a cost-effective way (Prabhu et al. 2020a; Mani et al. 2020; Hasandka et al. 2022; Ray et al. 2022a; Selvam et al. 2022), without the need for sophisticated techniques and with exploration of different methods for sensitivity enhancement(Mani et al. 2013; Sudarsan et al. 2023a, 2023b). Herein, frugal devices are made from paper or other porous materials (such as threads), that manipulate small (10−6 to 10−9 L) volumes of fluids by capillary action (Nishat et al. 2021; Ray et al. 2022b). This approach can be successfully used by the consumers to detect the adulterants in a flea market. It also holds the advantages of portability, disposability (Trinh et al. 2019; Xie et al. 2019; Baldo et al. 2021; Khachornsakkul et al. 2022; Lewińska et al. 2023; Li et al. 2023) and ease of integration with different detection (Maxwell et al. 2013; Cate et al. 2015; Kumar and Santhanam 2019; Trofimchuk et al. 2020; Katelakha et al. 2021).

To address this issue, we have developed “smart bags” using thread as robust way to detect the NaOCl bleached garlic. We have used phenolphthalein, a pH-sensitive triphenylmethane-based phthalein indicator dye which is colourless in the range of 1–8.2 and turns pink at higher pH values. This class of dyes are used in dyeing textile fibres such as cotton, wool, silk, and nylon, where mainly non-covalent interactions are involved between the dyes and the fibres (Fleischmann et al. 2012, 2015). Apart from NaOCl, phenolphthalein can also be used to detect detergent in milk (Salve et al. 2018) and measure free alkali content (Zhang et al. 2018). Fabricated smart bags dipped in phenolphthalein and further dried showed a qualitative change when interacted with the NaOCl bleached garlic. Change of colour proves the addition of a bleaching agent and thus easily identifying whether the garlic is adulterated or not. Moreover, to reduce the subjectivity, we have developed smartphone application named “Allium Detect.” The developed biodegradable smart bags are portable and cost-effective which can be utilized for rapid and semi-quantitative on-site detection of bleaching agent in garlic (Fig. 1). This developed smart-bag can contribute to the United Nations Sustainable Development Goal focusing on Good Health and Well-being (Nations 2017).

Fig. 1
figure 1

Schematic illustration of bleached garlic colorimetric detection using smart-bags and smartphone

Materials and Methods

Materials Used

Woollen thread was purchased from a local craft store. Phenolphthalein solution (1% w/v) and NaOCl (5% v/v) were procured from Spectrum Reagents and Chemicals Private Limited, India. Garlic was obtained from a local vegetable vendor. All the other chemicals were of AR grade and used without further purification.

Fabrication of Smart Bags

Woollen thread roll was used to weave smart-bags of dimension 5 cm × 4 cm approximately with a handle using the technique of Crochet. The mesh design was selected owing to its simplicity and ability to hold the garlic appropriately.

Detection of Bleached Garlic

Preparation of Bleached Garlic

Aqueous solutions (1%, 3%, and 5% v/v) of NaOCl (bleaching agent) were prepared; three different samples of garlic were dipped in each solution for 10 min and then dried at room temperature for 10 min and overnight, respectively.

UV-Visible Spectrometric Analysis of Colorimetric Response

10 mL of 1% w/v phenolphthalein indicator solution were taken in different tubes, and 180 μl of 1%, 3%, and 5% v/v NaOCl solution were added. The solutions were mixed properly, and the colour absorbance values of the solutions were measured at 560 nm using BioSpectrometer (Eppendorf).

FT-IR Characterization of Colorimetric Reaction

Fourier transform infrared (FT-IR) spectral analysis of NaOCl and phenolphthalein indicator was performed. Various functional groups present in NaOCl, phenolphthalein, and NaOCl-phenolphthalein mixture were recorded in the form of FT-IR (ATR) spectra using Shimadzu FTIR spectrometer in the range of 4000–400 cm−1.

Thread-Based Detection of Bleached Garlic

Five-centimetre pieces of woollen thread were taken, soaked in 1% w/v phenolphthalein solution for 10 min, and dried for 10 min at room temperature. The bleached garlic samples were rehydrated by spraying with water and rubbed over the surface of already dried thread. Three trials of the test were conducted, and the RGB colour intensity values of the colour change observed were measured using the Fiji software. Statistical significance between intensity values obtained before and after colour change was checked by paired two tailed t-test using Microsoft Excel. Statistical significance was considered at p < 0.05 and p < 0.01.

Detection Using Smart Bags

The fabricated smart bags were dipped in 1% w/v phenolphthalein indicator solution and dried for 15 min. Dried garlic (15 min and overnight) were packed into the phenolphthalein coated smart bags, rehydrated with water, and jolted for few seconds. Three trials were performed, and the bags were observed for colour change.

Field Trial

Garlics were purchased from local vendors of Udupi district of Karnataka (Southern India) and tested using 1% w/v phenolphthalein indicator coated smart bags for proofing the originality. The images of the tested garlic were captured using smartphone (Realme GT Neo 3T, Pro Mode, Exposure Value (EV) = −2, 2 × Zoom).

Computational Analysis

To assess the chemical interactions between garlic, NaOCl, and phenolphthalein indicator, the Gaussian 09 revision E.01 software program was utilized. Optimized molecular geometry was acquired from the in silico prediction to study the experimental hypothesis behind decolorization.

Development of Smartphone Application “Allium Detect”

System Structure

This project utilizes the YOLOv5 method and the Open Source Computer Vision module in Python to address the challenges of detecting a bag (device) and subsequently determining the extent of a reaction. To facilitate the entire procedure and pipeline, an Android application called “Allium Detect” has been developed. The solution is deployed on an AWS Linux server. Fig. 6 illustrates the application of our unique trained YOLOv5 model on an image that potentially contains the device, enabling the extraction of the region of interest, i.e., the bag. Our tailor-made approach is applied to this extraction and is implemented using OpenCV. The Android app functions through a PHP-based API, while Python is employed for processing tasks.

Pipeline

Our image processing and analysis pipeline comprises four essential steps: image selection, bag detection and extraction, and utilization of openCV for processing and reporting of the computed results.

Image Selection

The initial stage of our pipeline involves the user selecting an image through our Android application, either by choosing an existing picture or capturing a new one. Once the image is confirmed, a connection is established with the server using a dedicated API. The image is then transmitted to the server for processing, and the device awaits a response.

Bag Detection and Extraction

Upon receiving the image on the server, it undergoes detection using our custom-trained YOLOv5 model, which accurately identifies and marks the bag within the image. The detected bag is cropped and stored for further processing.

Processing Using openCV

The saved bag crops from the previous step are subjected to validation using our proprietary algorithm. This algorithm leverages the required colour range for the application, where the bag falls within the white to pink colour spectrum. To isolate the elements within this colour range, the RGB image is converted to the HSL (hue saturation lightness) format. By adjusting the lightness value and applying a colour mask, non-white detections are filtered out, eliminating any false objects labelled as bags in the previous step. Furthermore, this module of the pipeline calculates the extent of the reaction based on the number of pixels with colour values within the reaction colour range. A simple threshold is used to determine whether a reaction has occurred. The algorithm is implemented using openCV functions and is coded in Python.

Reporting Computed Results

The determined results are transmitted back from the API to the application and presented to the user in a user-friendly manner.

Bag Detection Network — YOLOv5

We employed YOLOv5, a one-stage object detection network composed of three main components: backbone, neck, and head.

Backbone

The YOLOv5 framework builds upon the darknet53 backbone, which is also utilized in YOLOv3 with certain modifications to enhance its performance. While retaining the basic structure of darknet53, YOLOv5 introduced modifications to create a modified residual network. The backbone component is responsible for extracting relevant features from the input data.

Neck

To enable the detection of objects at multiple scales within the image, YOLOv5 incorporates a neck component that combines the Feature Pyramid Network (FPN) and PANet. This fusion of FPN and PANet enhances the network’s ability to detect objects across different scales. Additionally, CSP2 is employed to improve the integration of features within the network.

Head

In the head component of YOLOv5, we handle the output generation. Since YOLOv5 produces feature maps of three different sizes, each grid within these feature maps is assigned three prediction anchors. Each anchor provides a one-hot vector and a tuple of five values, including the number of object categories. This head component is responsible for generating the final predictions for object detection.

Loss Function

In YOLOv5, the General Intersection over Union (GIOU) Loss is employed as the loss function. This loss function involves several steps. Initially, the minimum area of two boxes is computed. Subsequently, the size of the enclosed area that is not shared by the two boxes is determined. Finally, the Intersection over Union (IOU) is calculated. To obtain the GIOU, this calculated portion is subtracted from the IOU value. This process enables the utilization of GIOU as an effective measure in the loss function for YOLOv5.

$${\displaystyle \begin{array}{c}{\lambda}_{iou}\sum\limits_{i=0}^{S^2}\sum\limits_{j=0}^B{1}_{ij}^{\textrm{obj}}{L}_{giou}\\ {}+{\lambda}_{cls}\sum\limits_{i=0}^{S_2}\sum\limits_{j=0}^B{1}_{ij}^{\textrm{obj}}{\lambda}_c{\left({C}_i-{\hat{\textrm{C}}}_i\right)}^2+{\lambda}_{cls}\sum\limits_{i=0}^{S_2}\sum\limits_{j=0}^B{1}_{ij}^{\textrm{noobj}}{\lambda}_c{\left({C}_i-{\hat{\textrm{C}}}_i\right)}^2\\ {}-\sum\limits_{i=0}^{S_2}\sum\limits_{j=0}^B{1}_{ij}^{\textrm{obj}}\sum\limits_{c\in \textrm{classes}}{\lambda}_c\left[{\hat{p}}_i(c)\log \left({p}_i(c)\right)+\left(1-{\hat{p}}_i(c)\right)\log \left(1-{\hat{p}}_i(c)\right)\right]\end{array}}$$

where,

S = 13, 26, 52 (size of grid)

B = 3 (no. of anchor boxes for each grid)

\({1}_{ij}^{\textrm{obj}}\) = represents if the overlapping of the bounding box is over the threshold, it is included and is equal to 1, else zero. Same way \({1}_{ij}^{noobj}\).

λiou = IoU normalizer (location loss)

λcls = cls normalizer (target confidence loss)

C i = confidence of the predicted box, \({\hat{C}}_i\) = confidence of the GT = 1

λ c = classes multiplier (classification loss)

p ̂ (c) = GT true classification function, pi(c) = predicted box classification function

Implementation of this algorithm required installation of PyTorch, openCV, and some other supporting lightweight python libraries. Nvidia RTX 2060 Super GPU was used for training and testing of the model. The interface of Allium Detect is shown below

Validation

Precision

mAP

Box loss

Object loss

Cross-validation 1

0.9946

0.995

0.0078559

0.0039481

Cross-validation 2

0.9948

0.995

0.0094251

0.0040029

Cross-validation 3

0.9946

0.995

0.0082551

0.0039248

Cross-validation 4

0.9946

0.995

0.0067932

0.0037895

Cross-validation 5

0.9946

0.995

0.0063917

0.0037184

Cross-validation 6

0.9948

0.995

0.0063383

0.0037302

Results and Discussion

Fourier Transform Infrared Spectral Analysis of (a) Phenolphthalein (Indicator), (b) NaOCl, and (c) Phenolphthalein in NaOCl

Sensing a bleaching agent using an acid-base indicator has been preliminarily examined using spectral analysis for their functionality changes. To observe the functional groups, we have subjected the samples as follows: (a) the indicator, (b) the bleaching agent, and (c) the mixture respectively for FT-IR studies (Fig. 2). It was observed that the phenolphthalein indicator exhibits a sharp band between 3300 and 3500 cm−1 revealing the presence of a free hydroxyl group. Additionally, C=O stretching (essential band in phenolphthalein) was observed at 1700 cm−1. Since NaOCl is an inorganic compound, we have only observed a chlorite (OCl) stretching band at 1385 cm−1 leaving sodium ion (IR inactive). Also, a broad band was observed between 3200 and 3450 cm−1 due to the intermolecular hydrogen bonding between chlorite anion and hydrogen ion in water, since NaOCl is in an aqueous medium. In case of the mixture (phenolphthalein and NaOCl), an absorption band at 2825 cm−1 was observed which attributes to the C-H stretching of aromatic groups in the phenolphthalein moiety. Interestingly, there was a sharp intense band at 1030 cm−1 revealing the presence of the phenolic C=O group and it has not appeared in the spectra of NaOCl alone. From the above analysis, the aromatic C-H character and phenolic C=O stretching reflect the incorporation of indicator in NaOCl solution. We observed the colour of the bleaching agent from colourless to pink on interaction with phenolphthalein, which was due to the phenolic hydrogen having been replaced by the sodium ion of NaOCl. The above results revealed that the indicators can be acted as a sensor to find out the presence of the bleaching agent (NaOCl) through a simple redox/acid-base reaction. FT-IR spectral data supports the eventual change in the functionality of the above chemical reaction and is helpful in sensing aspects.

Fig. 2
figure 2

FT-IR spectra of a phenolphthalein (indicator); b NaOCl, bleaching agent, and c phenolphthalein in NaOCl

UV-Vis Color Absorbance Analysis

Phenolphthalein indicator interaction with the bleaching agent and the colour changes observed were measured using UV-Vis spectral analysis. Absorbance (OD560nm) for different concentrations of NaOCl (1%, 3%, and 5% v/v) was measured, and it was observed that upon increasing the concentration of NaOCl, there was a proportionate increase in the colour intensity (data not shown). From the above results, the variation in the colour intensity was due to the greater ion exchange capability of phenolphthalein during increasing concentration of NaOCl. This can be leveraged for the detection of different concentrations of bleaching agent on garlic.

Chemical Interaction of Garlic Peel, NaOCl, and Phenolphthalein Indicator

Garlic peel (GaP) is enriched with antioxidants and sugar units encompassing N-trans-coumaroyloctopamine, N-trans-feruloyloctopamine (Ichikawa et al. 2003), mannitol, rhamnose, modified amino acid 5-hydroxylysine, sorbitol, trehalose (Singiri et al. 2022), flavonoids, and phenolic compounds (Zayed et al. 2022). Upon the treatment of NaOCl(aq) solution on GaP, there is a possible weak non-covalent interaction between the electronegative sites of N-trans-coumaroyloctopamine and N-trans-feruloyloctopamine, and sodium metal ion, which leads to the impairment of bonding in NaOCl, leaving unstable hypochlorite anion (OCl-) around the peel. Subsequently, there is production of sodium hydroxide (NaOH) as a byproduct via ionic interaction between hydroxyl ion available in the aqueous medium and sodium metal ion. On the other side, hypochlorous acid (HOCl) is produced by acidification of the left over OCl anion with water molecule, thus releasing chlorine gas on the peel, which acts as the bleaching agent on garlic. When an acid-base indicator such as phenolphthalein comes in contact with bleached garlic peel, there is a colour change of the indicator in the presence of NaOH. This is the indirect method of detecting any chlorite generating alkali using phenolphthalein indicator. The plausible mechanism behind the chemical interaction between garlic peel (GaP), NaOCl, and phenolphthalein indicator is depicted in Fig. 3.

Fig. 3
figure 3

Chemical interaction of garlic peel, NaOCl, and phenolphthalein indicator

Theoretical Analysis to Complement the Experimental Hypothesis

In silico methodology has been implemented to emphasize the hypothesized chemical interaction between GaP, NaOCl, and phenolphthalein indicator using Gaussian 09 ground state DFT functional with 6-31G level of basis set. To represent the possible interactions between GaP-NaOCl, N-trans-coumaroyloctopamine was selected for optimization among all other constituents (Fig. 4). It was perceived that the bond distance of Na and OCl in NaOCl is 1.932 Å (inset of Fig. 4), since an impairment was observed between Na and OCl at a distance of 2.017 Å after the interaction with N-trans-coumaroyloctopamine. This is due to the interaction between the oxygen atom of amide C=O group in N-trans-coumaroyloctopamine and sodium metal through non-covalent interaction, leaving the OCl moiety gradually. The formation of NaOH is confirmed by the optimized molecular geometry through Na…OH2 intermolecular hydrogen bonding interaction, where the water molecule acts as the mediator to induce the reaction. Afterwards, the impaired OCl was protonated by hydrogen atom available in the water moiety. This strong evidence suggests the possible availability of HOCl (Cl2 source) for bleaching garlic and sensing NaOH through acid-base indicator.

Fig. 4
figure 4

Optimized molecular geometry of N-trans-coumaroyloctopamine-NaOCl(aq) and NaOCl (inset)

Detection of Bleached Garlic Using Smart Bags

In continuation to the chemistry of phenolphthalein and its colorimetric response with NaOCl discussed earlier, garlic acquired from local vegetable vendor and coated with 1%, 3%, and 5% v/v NaOCl were subjected to interact with 1% w/v phenolphthalein indicator solution. A change from colourless to pink was observed on the surface of the garlic which is shown in Fig. 5. There was an increase in the colour intensity of the pink colour formed on the garlic from 1 to 5% v/v NaOCl. The same test was performed for bleached garlic (dried overnight), which has shown some appreciable pink colour spots on some regions.

Fig. 5
figure 5

Bleaching process of garlic in different concentrations of NaOCl solution and interaction with 1% w/v phenolphthalein indicator

Recently, thread-based devices have been explored for detecting food adulterants and also for myriads of applications. Firstly, 1% w/v phenolphthalein-coated woolen threads were subjected to different concentrations of NaOCl. Similar to bulk study, we observed a change from colourless to pink threads, with a proportionate increase in intensity from 1 to 5% v/v NaOCl coating (Fig. 6). Secondly, the thread devices were fabricated (crocheted) as smart bags and subjected to detect bleached garlic based on colour change. Different concentrations of NaOCl-coated and dried garlic samples were loaded in biodegradable smart bags (Fig. 7) which was rehydrated and jolted to facilitate the interaction. Similar to single thread devices, we have obtained colour changes in the smart bag as well. These results suggested that rapid, on-site, and semi-quantitative detection of bleaching agent can be achieved in a cost effective and user-friendly manner.

Fig. 6
figure 6

Thread-based detection of bleaching agent over woolen thread pieces coated with 1% w/v phenolphthalein indicator

Fig. 7
figure 7

Biodegradable smart bag-based detection of bleaching agent in garlic

Based on the RGB colour intensity measurement performed (Supplementary Fig. 1), the increase in the colour intensity values of the 10-min dried phenolphthalein coated woollen threads after the reaction with different concentrations of NaOCl were found to be statistically significant (p < 0.05, p < 0.01) (Supplementary Fig. 1). However, the colour intensities of the overnight dried phenolphthalein coated woollen threads after the reaction with NaOCl were found to be significant (p < 0.05) only for 5% v/v NaOCl. The p-values measured for the 10 min and overnight dried phenolphthalein coated threads have been given in Supplementary Table S1.

Detection of Food Fraud on Garlic Using the Smartphone Application “Allium Detect”

Several studies have demonstrated the development of smartphone-based systems for rapidly and sensitively detecting food adulterants (Rateni et al. 2017; Nguyen et al. 2018; Nelis et al. 2020). One among them is to quantify the colorimetric assays (Qian et al. 2022; Ramírez-Coronel et al. 2023), which are simple, low-cost tests that rely on colour changes to detect the presence of adulterants in food samples. Smartphone devices equipped with a camera can be used to capture images of the colorimetric assay, and specialized software can be used to analyse the images and determine the presence of adulterants. It can control and monitor microfluidic devices, enabling rapid and sensitive detection of adulterants in food samples (Xu et al. 2018; Wang et al. 2019, 2023). To reduce the subjectivity, we have developed a smart-app “Allium Detect” to capture “pink colour” which attributes the presence of bleaching agent in garlic (Fig. 8a). Integration of the smartphone app in this research dispenses some notable assistance to the process of identification. Firstly, the app would add an extra screening layer to determine the presence of bleach used. Secondly, due to its high accuracy, it will detect even slight tinge of the pink colour deposited on the bag and thus extending its effectiveness to visually impaired or colour-blind people who cannot effectively comprehend the colour change. The smartphone approach will certainly play an important role to narrow down the subjectivity of obtained results. This fact also extends to certain circumstances where the supplier may still question the interference of thread-based sensor, to resolve such issue authenticity of this result would be consolidated by the reliable smartphone app developed in this study. The app is developed in a precise user-friendly way, where the user has to upload a picture of the smart bag with garlic in it; furthermore, the app carries out the analysis and displays a message “good garlic” (Fig. 8b) if no tincture of pink “phenolphthalein” is detected; likewise, it displays “bad garlic” (Fig 8c) if traces are detected. Moreover, it does not require internet connection to perform the analysis which in turn broadens its applicability to the under developed areas of society. In addition, it seamlessly displays the result within 10 s devoid of an error at any occasion of testing its functionality, thus facilitating a final digital read out to the thread-based sensor making it viable for on spot testing. Novelty of this investigation lies in the development and implementation of thread based sensor which can efficiently identify the bleached garlic by involving an extremely simple do-it-yourself (DIY) protocol (Ray et al. 2023) that can yield reliable colorimetric results with fast analysis time, minimal volumes of reagents and absolutely no requirement of complex equipment, thus encouraging consumers for on the spot detection of bleached garlic. The smartphone approach developed has thus changed the dynamics of detecting a food fraud. In future, we will program the app in such a way that it also displays the levels of bleach used by analysing the intensity of colour change displayed.

Fig. 8
figure 8

Utilization of smartphone app “Allium Detect” for detecting plain and bleached garlic

Conclusion

There is a rise in severe health risks among the human community because of lack of awareness on chemical adulterants incorporated in foods to enhance the physical appearance. To address these contaminants in food items requires high-end sophisticated equipment such as GC-MS, HPLC, and spectral methods with the need of scientific expertise and prolonged assay time. To overcome this, we have showcased that simple on-site detection tools in the form of “smart bags” can assist end-users to detect adulterants such as bleached garlic, which the end-user can directly perform. This biodegradable thread-based smart bag imbibed with phenolphthalein indicator solution interacts with NaOCl coated on garlic and resulted in pink colour that can be detected visually in 10 mins. This approach can further be extended to the detection of other chemical contaminants in foods which can significantly contribute to improving the quality of food items and reducing health issues arising through these adulterants. These developed cost-effective (~ US $ 0.092) DIY biodegradable smart bags can revolutionize the field of complementary on-site detection tools, further helping the food testing authorities efficiently manage food quality assurance. Computational studies of the reactions involved confirmed the chemistry of sensing (bleaching agent) through visual inter/intramolecular interaction patterns. We have also integrated smartphone by developing an application “Allium Detect,” which reinforced sensitivity and reduced the time when the end user can instantly detect the bleached garlic.