1. Introduction
Milk is a crucial nutritional source consumed globally, yet the dairy industry faces significant challenges due to prevalent adulteration practices such as the addition of water, starch, and other harmful substances. These adulterations compromise milk’s nutritional value and pose health risks to consumers, highlighting a critical gap in current detection methods, which often lack speed, accuracy, and cost-effectiveness. This study specifically addresses the gap by proposing a novel detection method using artificial neural network (ANN) models and multispectral sensor technology to identify starch adulteration in milk. This approach is expected to enhance the rapidity and accuracy of tests compared to traditional laboratory methods.
The objective of this research is to develop and validate an ANN model that can reliably detect starch adulteration in milk samples using spectral data analysis. By integrating multispectral sensing and advanced computational models, this study aims to provide a cost-effective and efficient solution to a widespread problem affecting the dairy industry.
Milk is a vital nutritional source consumed by a wide population, ranging from infants to the elderly. It boasts a robust nutritional profile, containing high-quality proteins, lipids, carbohydrates, vitamins, amino acids, and minerals [
1]. However, the global milk market is prone to adulteration with low-cost, substandard, and potentially harmful components, driven by motives such as increasing volume, concealing inferior products, or manipulating consumer purchasing power [
2]. This situation is evolving into a serious issue, posing a significant threat to global food safety, particularly within small rural farms that face greater challenges in maintaining regulatory compliance due to limited resources [
3]. Ensuring food safety in the dairy industry, especially on small-scale farms, is critical for protecting consumer health and sustaining the integrity of short food supply chains. With the world population expected to reach 10 billion by 2050 [
4], the nutritional richness and widespread consumption of dairy products indicate that the dairy market is becoming increasingly vulnerable to fraudulent activities. Therefore, the detection of milk adulteration is of critical importance for consumer health and food safety [
5]. Recent studies support this assertion [
6]. Milk adulteration is a global concern, carried out with various additives. The most common forms of adulteration include the addition of water, starch, urea, detergent, melamine, formalin, hydrogen peroxide, and sucrose [
7], while the simplest and most prevalent form of adulteration is the addition of water to increase the volume of milk [
8]. This form of adulteration has been extensively documented in various studies [
9]. Sometimes, water-diluted milk is further adulterated with melamine to increase the nitrogen content [
10]. Starch is used to increase the non-fat solid content of milk [
11]. Fraudsters continuously devise new methods of adulteration to evade inspections, posing serious challenges for the food industry and safety authorities. Milk-based adulterations hold a significant place among all types of food fraud [
12]. Increasing cases of adulteration and contamination in dairy products have become a major concern for food safety [
13].
In this context, the detection and prevention of starch adulteration are crucial, as starch is a commonly used adulterant that negatively impacts consumer health. Milk with excessive starch content cannot be fully digested by the digestive system and may lead to severe health problems, such as diarrhea [
14]. In diabetics, the accumulation of high levels of starch in the body can lead to fatal outcomes. Milk adulterated with starch not only lacks essential nutrients but also leads to health issues like headaches, visual disturbances, hypertension, and kidney stones [
15]. Starch can mask the effects of diluting and partially removing natural macromolecules in milk (such as fats), making it an advantageous adulterant for economic gain. Accurately detecting and preventing starch adulteration in milk is vital for upholding global health and nutrition standards.
Various methods are available for determining the concentration of starch in milk [
16], yet most of these methods either provide qualitative results or require the use of sensitive reagents, limiting their application. Most traditional methods necessitate the transportation of samples to a laboratory, which is time-consuming and costly. Additionally, samples can deteriorate during this process, potentially affecting the results. Recently, portable and cost-effective devices have been developed to determine starch concentrations in milk [
17]. These devices are notable for their user-friendliness and ability to produce rapid results. However, these devices have limitations; some are manually operated or require specific types of hardware [
18], and the necessary software for data collection and analysis in field conditions is not always available. Therefore, there is a continual need for new methods that can quickly, accurately, and cost-effectively determine starch concentrations in milk. Recent research has identified several potential approaches for achieving this goal [
6]. For example, one study focused on developing cost-effective portable devices for starch detection in milk [
8]. Another study emphasized the importance of field-ready solutions that can provide accurate results without requiring laboratory-based equipment [
2]. This study aims to fill this gap by proposing the use of multispectral sensor technology to detect starch concentrations in milk accurately and efficiently.
Mid and near-infrared spectroscopy techniques are commonly used for analyzing milk and its components [
19], particularly effective in determining the main components in milk powder (carbohydrates, lipids, and proteins) as well as quantifying whey, starch, and sucrose content. The enhancement of these techniques with quantitative analysis and artificial intelligence techniques for assessing the quality and authenticity of dairy products is noteworthy. This study explores the use of artificial neural networks (ANNs) and multispectral sensors for detecting starch adulteration in dairy products, offering a more advanced approach than current methods. In the current work, a developed MSANN device, utilizing multispectral sensor technology and artificial neural networks, enables rapid and portable detection of starch adulteration. This represents a significant advantage over laboratory-based methods, as it allows for swift analyses under field conditions, introducing a major innovation in food safety inspections. The model developed can detect various concentrations of starch with high accuracy, enhancing its generalization capability to a level of precision and generalization not achieved in prior studies. This study demonstrates that the ANN-based model can successfully differentiate between different levels of starch, thereby yielding more reliable results.
The cost of the devices and sensors used is considerably lower compared to traditional laboratory equipment, providing a significant cost advantage in large-scale applications. Particularly in developing countries, such low-cost solutions can be extensively utilized in food safety inspections. This study offers an innovative approach to data analysis using artificial intelligence and machine learning techniques, beyond traditional methods. Especially, the techniques employed for data preprocessing and model optimization enhance the model’s performance and provide a higher accuracy rate compared to previous studies. In conclusion, this study presents a portable, rapid, cost-effective, and highly accurate solution for detecting starch adulteration in dairy products. These features significantly contribute to the existing literature and have the potential to set a new standard in the field of food safety.
This paper is structured as follows:
Section 1 introduces the problem of milk adulteration, detailing the motivations behind such practices and their implications for consumer health and food safety.
Section 2 elaborates on the methodology, including the development and application of the artificial neural network (ANN) model along with spectral data analysis techniques for detecting starch adulteration.
Section 3 presents the results and discusses the effectiveness and implications of the proposed methods.
Section 4 summarizes the findings and their broader implications for food safety.
Section 5 critically evaluates the strengths and limitations of the study, providing insights into the methodological approaches and the generalizability of the results. The paper concludes with recommendations for future research.
2. Materials and Methods
2.1. MultiSpectroANN Device Setup and Functionality
The MultiSpectroANN (MSANN) device comprises various components essential for data acquisition and processing. This section details the integration of these components, the data collection methodologies, and the algorithms that drive the operation of the device. Additionally, modifications for portable use are discussed, highlighting the device’s adaptability for field applications.
Figure 1 displays the designed MSANN device, clearly highlighting the AS7265x multispectral sensor (SparkFun Electronics, Niwot, CO, USA) and the Arduino Nano 33 BLE Sense microcontroller (Arduino, Turin, Italy), and other key components. The figure illustrates the experimental setup in detail. First, milk samples are placed into a lightproof container to prevent external light interference. This container is then positioned in the measurement area where the AS7265x multispectral sensor captures spectral data by recording light reflections at various wavelengths from the milk samples. Subsequently, the data are transmitted to a computer via the Arduino Nano 33 BLE Sense microcontroller. Once transmitted, the data are stored on the computer, where it is processed and analyzed. The figure effectively summarizes these steps, showcasing the system’s workflow and data processing procedure.
Components of MultiSpectroANN (MSANN):
MSANN consists of the AS7265x Multispectral Sensor, the Arduino Nano 33 BLE Sense Microcontroller, and a computer.
AS7265x Multispectral Sensor: The AS7265x is a system comprising three sensors operating in the mid-infrared spectrum (610–860 nm) that provide an 18-channel multispectral detection solution. It can measure at 18 different wavelengths with 20 nm intervals. Each sensor communicates via the I2C interface and contains an internal temperature sensor, providing precise and accurate spectral analysis of milk samples.
Arduino Nano 33 BLE Sense Microcontroller: The Arduino Nano 33 BLE Sense is a small but powerful microcontroller board, featuring a 64 MHz ARM Cortex-M4 processor (ARM Ltd., Cambridge, UK) with Bluetooth connectivity. It has an extensive set of GPIOs (general purpose input/output) for easy connection with various sensors and modules. It is used to process and analyze the collected spectral data.
Computer: The computer used for data collection and analysis is equipped with an AMD Ryzen 5 5600G processor (Advanced Micro Devices, Inc., Santa Clara, CA, USA) and 16 GB RAM. It is capable of running Python and has the necessary specifications for data analysis and training artificial neural network models.
MultiSpectroANN (MSANN) Data Collection:
The data collection process for analyzing milk samples involves two primary stages. Initially, a 20 mL sample of milk is placed into a light-proof container to prevent any external light interference. This container is then positioned within a larger, light-proof box with dimensions of 15
. Positioned precisely 1 cm above the milk sample, the AS7265x sensor captures the spectral data [
20]. Once collected, these data are immediately transferred to a connected computer for further analysis.
MultiSpectroANN (MSANN) Data Collection Algorithm:
The MSANN device operates on the principle of collecting spectral data from a milk sample using the AS7265x Multispectral Sensor. This sensor detects light reflected or passed through the milk at specific wavelengths, allowing for detailed analysis of the sample’s spectral properties [
6]. Once these data are gathered, it is transferred to the Arduino Nano 33 BLE Sense Microcontroller using the I2C communication protocol, ensuring efficient data transmission [
21]. The microcontroller then processes the data, ensuring they are in the correct format and devoid of any noise or anomalies, which is critical for obtaining accurate results [
22]. These processed data are then displayed on a serial port screen in real-time, allowing users to instantly observe the spectral characteristics of the milk sample [
23]. The device continually repeats this process at regular intervals, ensuring continuous and real-time monitoring of the samples [
24].
Figure 2 illustrates the steps of the algorithm used for spectral data collection and processing from milk samples. The process begins with the initialization of the microcontroller and the AS7265x sensor. Next, the serial port settings are configured to ensure proper data communication, and a waiting time of 5 s is set to allow the sensor to stabilize. The microcontroller initiates communication with the sensor using the I2C protocol and sends a request to the sensor to start data collection. The sensor gathers spectral data from the milk sample and transfers these data to the microcontroller. The microcontroller then processes and formats the received data appropriately. The processed data are displayed on the serial port screen in real-time for user observation. This procedure is repeated at specified intervals to ensure continuous monitoring and analysis. The entire process allows for real-time data acquisition and processing in a systematic manner.
Portable MultiSpectroANN (MSANN) Device Mod:
This mode enables the MSANN device to operate independently by uploading a model file, derived from computer analyses, onto the microcontroller. Consequently, the device can autonomously evaluate spectral data of milk samples based on the loaded model and relay the results to the user in real-time via Bluetooth messages.
Figure 3 illustrates the operational steps of the MSANN device. The process begins with the model uploading phase, where the artificial neural network (ANN) model, developed through computer-based analyses, is saved as a file and uploaded to the Arduino Nano 33 BLE Sense microcontroller. Next, the microcontroller starts reading sensor values by gathering spectral data from the AS7265x Multispectral Sensor. These data are processed and evaluated based on the pre-loaded ANN model, which enables the microcontroller to assess the spectral data and derive valuable insights about the milk sample. Finally, the evaluation results are transmitted to the user’s mobile device or computer via Bluetooth, providing real-time information about the milk sample’s quality and potential adulteration. This systematic procedure enables effective and portable in-field analysis of milk samples.
2.2. Sample Preparation
For this study, samples of raw cow’s milk were commercially purchased from a local dairy supplier. Both unadulterated and starch-adulterated milk samples were prepared and analyzed using MSANN technology. The unadulterated raw cow’s milk serves as a control group. Adulterated milk samples were prepared by adding starch to the raw milk at various concentrations of 0.01%, 0.02%, 0.04%, 0.06%, and 0.08% by volume. The selection of these specific concentrations was based on prevalent levels of adulteration observed in the dairy industry, aiming to reflect realistic scenarios for testing the sensitivity and accuracy of our detection methods [
25]. To ensure robust model training and validation, a large dataset consisting of X samples for each concentration was prepared, resulting in a total of 5X samples. This extensive dataset allows for effective training and testing of the ANN, enhancing the model’s ability to generalize across different levels of adulteration. These concentration levels were chosen to evaluate the detectability of adulteration and the detection capacity of MSANN technology. The milk containing 0% starch by volume represents completely unadulterated raw milk and serves as a control sample. The concentration levels used in this study represent those commonly encountered in practical cases of starch adulteration [
26]. Each milk sample was carefully prepared and homogenized to ensure the reliability and repeatability of the data obtained during analysis. The prepared samples were stored and processed for analysis using MSANN technology. Visually, the samples showed no discernible signs of adulteration; they appeared identical to pure milk samples. This lack of visual differentiation highlights the necessity of employing advanced spectroscopic techniques, as the subtle nature of starch adulteration cannot be detected through standard visual inspection alone.
2.3. Data Preprocessing
Data preprocessing is the stage in which spectral data collected prior to analysis is prepared. This process enhances the effectiveness of data analysis and the accuracy of model training. During this stage, various data cleaning, filtering, and normalization operations were performed.
Figure 4 illustrates the normalized spectral data of milk samples with different starch concentrations. In this figure, the “Case 0” label represents raw milk (unadulterated), while the “Case 1”, “Case 2”, “Case 3”, and “Case 4” labels represent milk samples containing 0.01%, 0.02%, 0.04%, and 0.08% starch by volume, respectively. Each “case” label is designed to demonstrate how the spectral data of starch-adulterated milk samples changes compared to raw milk. It can be observed from this graph that there are noticeable changes in the spectral data as the concentration of starch increases. These changes are crucial for the MSANN model to accurately classify adulterated milk samples.
2.4. ANN Development and Implementation
This section describes the development and implementation of an artificial neural network (ANN) model designed to detect starch adulteration in milk. It covers the ANN’s architectural setup, the training processes, evaluation metrics, and optimization techniques employed to enhance model performance. Each step is critical in ensuring the accuracy and reliability of the ANN in real-world applications.
ANN Structure:
The ANN model used in this study consists of an input layer, three hidden layers, and an output layer:
Input Layer: This layer receives the scaled spectroscopic data, containing neurons equal to the number of features in the training dataset. The scaling equation used is
where
X is the feature matrix,
is the mean of the features, and
is the standard deviation of the features.
Hidden Layers: The three hidden layers contain 128, 64, and 32 neurons, respectively, each using the ’ReLU’ activation function, defined as
Output Layer: The output layer, which performs the classification task, contains five neurons using the ’softmax’ activation function.
Here, represents the probability of class j given the features X, and represents the logits.
A visual representation of the ANN architecture is provided in
Figure 5, illustrating the configuration of the input, hidden, and output layers along with their respective neuron counts and activation functions.
Model Training:
During model training, the ’adam’ optimizer and ’sparse_categorical_crossentropy’ loss function were used. Training was conducted with 5-fold cross-validation, with early stopping implemented for each fold, monitoring the validation loss (’val_loss’) with a patience parameter set to five.
Model Evaluation:
Predictions were generated for each fold, and the model’s performance was evaluated using a classification report, which includes accuracy and other performance metrics.
Model Optimization:
The model training process used a batch size of 32, 50 epochs, and 20% of the training set as the validation set. The model was trained and evaluated for each fold, and the obtained accuracy values were averaged to evaluate the overall performance of the model.
4. Discussion
In this study, the effectiveness of an artificial neural network (ANN)-based model for detecting starch adulteration was evaluated. The findings indicate that the model is capable of distinguishing milk samples with different starch concentrations with high accuracy. However, to better understand the model’s performance and enhance its general applicability, it is crucial to compare it with other detection methods reported in the literature. While this model has been tested primarily on cow’s milk, it can potentially be adapted for use with other types of milk, provided that adjustments are made to accommodate the specific spectral characteristics of each milk type [
27]. Previous studies have demonstrated that techniques like FTIR and NIR spectroscopy, which are integral to our method, can be effectively applied across different dairy matrices with minimal adjustments, ensuring the method’s broader applicability [
28]. Spectroscopic analysis methods are widely used for detecting starch adulteration in dairy products [
29]. These methods, while effective, often require significant sample preprocessing and are constrained by the high cost of the necessary equipment. Our approach using mid-infrared spectroscopy coupled with an ANN allows for the rapid and quantitative detection of starch without the need for extensive sample preparation [
25]. Techniques such as Fourier transform infrared spectroscopy (FTIR) and near-infrared spectroscopy (NIR) enable non-invasive analysis of milk components and can detect the presence of additives like starch [
30].
FTIR, in particular, allows for the rapid identification of components such as starch, sugars, and melamine in milk powders [
10]. However, these methods have certain limitations, including the need for sample preprocessing and the requirement for expensive equipment [
17]. The ANN-based model developed in our study offers a more portable and economical solution compared to spectroscopic methods like FTIR and NIR [
18]. Moreover, the environmental impact of our method is minimal, making it a ’greener’ alternative for milk adulteration detection [
18]. The model’s ability to successfully detect starch adulteration in raw milk samples, along with its capacity for real-time analysis in field conditions, represents a significant advantage. However, considering the level of detail and high accuracy rates provided by spectroscopic methods, it can be argued that these techniques perform better in laboratory settings. Therefore, the ANN-based model and spectroscopic methods could be used complementarily, depending on the specific needs of the application.
Chemical tests have long been widely used methods for detecting additives such as starch in dairy products. Specifically, the iodine test using Lugol’s solution offers a simple and rapid method for identifying the presence of starch [
7]. However, the main disadvantage of these tests is that they can only detect the presence of starch without providing information about the quantity or detecting other types of adulteration. Additionally, chemical tests are typically conducted in laboratory settings, making them unsuitable for field use.
The ANN-based model overcomes these limitations of chemical tests by not only detecting the presence of starch but also determining the concentration of starch adulteration at different levels. By utilizing spectral data, the model provides a more quantitative analysis and offers users more detailed information. Furthermore, due to its portability, the model can be used in real-time in the field, unlike chemical tests. This demonstrates the effectiveness of the model in practical applications. In recent years, radiographic methods such as X-ray and Raman spectroscopy have been employed for the detection of adulteration in dairy products. Raman spectroscopy stands out for its ability to detect chemical changes in milk with high accuracy [
9]. However, the high cost of equipment and the complexity of analysis processes make these methods impractical for widespread and field use. The ANN-based model developed in our study offers a more cost-effective and user-friendly alternative compared to advanced techniques like Raman spectroscopy. However, methods like Raman spectroscopy will continue to be suitable for detailed analyses with high accuracy rates in laboratory settings. In this context, the ANN-based model can be considered a suitable option for situations requiring faster and more economical solutions [
31]. In conclusion, the ANN-based starch adulteration detection model presented in this study stands out for its advantages such as portability, cost-effectiveness, and real-time analysis capability. However, the high accuracy and detail levels provided by spectroscopic and radiographic methods highlight the limitations of this model. Nonetheless, considering the shortcomings of chemical tests, the ANN-based model fills a gap by offering rapid and reliable detection in the field. Future studies could involve the integration of these different methods and testing on larger datasets, leading to more comprehensive and effective solutions for detecting adulteration in dairy products. It is also recommended that the Limit of Quantification (LOQ) be determined to establish the minimal detectable concentration of starch, enhancing the model’s applicability across various testing scenarios [
18]. It is recommended that tests be conducted on different starch concentrations and milk samples to enhance the model’s generalization capacity. Additionally, working on model optimization and integration strategies with alternative detection techniques could further improve the model’s effectiveness.
6. Conclusions
In conclusion, the findings of this study demonstrate that artificial neural networks (ANNs) can serve as a powerful and reliable tool for detecting starch adulteration in milk. The developed ANN model, notable for its portability, cost-effectiveness, and real-time analysis capabilities, provides a practical alternative to more complex spectroscopic and radiographic methods, which, despite their higher accuracy and detail, may not be feasible for on-site testing.
The ANN-based model addresses significant challenges in the dairy industry by offering rapid and reliable adulteration detection, which is crucial for maintaining food safety standards and protecting consumer health. This is particularly valuable in regions where access to advanced laboratory facilities may be limited.
However, while the model shows promising results, its current application is limited to specific starch concentrations and has not been tested across a more comprehensive dataset or for other types of adulteration. Future studies should focus on expanding the model’s capability to detect various adulterants and on validating its effectiveness in more diverse environmental conditions. This could involve integrating the ANN model with other detection technologies or exploring the use of larger and more varied datasets to enhance the model’s accuracy and generalizability.
Furthermore, optimization techniques could be employed to refine the model’s performance, potentially making it a standard tool in food safety inspections. Future research could also explore the integration of this technology into existing food safety management systems, providing a more robust solution for detecting adulteration across the food supply chain.
By continuing to develop and refine this technology, we can significantly improve the detection of adulteration, thereby enhancing food safety and consumer trust in dairy products.