Next Article in Journal
An Efficient Bidirectional Point Pyramid Attention Network for 3D Point Cloud Completion
Previous Article in Journal
Comparison of the Effectiveness of Reducing the Leaching of Formaldehyde from Immobilized Wool in Geopolymer and Cement Mortar
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Battery-Free Pork Freshness Estimation Based on Colorimetric Sensors and Machine Learning

1
Artificial Intelligence Laboratory, Pukyong National University of Institute of Engineering, Pusan 48513, Republic of Korea
2
Department of Electronic Engineering, Pukyong National University of Institute of Engineering, Pusan 48513, Republic of Korea
*
Author to whom correspondence should be addressed.
Appl. Sci. 2023, 13(8), 4896; https://doi.org/10.3390/app13084896
Submission received: 2 March 2023 / Revised: 30 March 2023 / Accepted: 6 April 2023 / Published: 13 April 2023
(This article belongs to the Section Food Science and Technology)

Abstract

:
In this study, a compact smart-sensor tag is developed for estimating pork freshness. The smart sensor tag can be placed in areas where packaged meat is stored or displayed. Antennas and simulated models were developed to maximize the efficiency of radio frequency (RF) energy harvesting. The proposed smart sensor tag includes a red, green, and blue sensor that detects changes in the freshness of meat. To detect the color changes in pork stored at a perishable hot temperature in an outdoor environment, this study applies Hue, Saturation, and Value conversion using machine learning, through which the freshness can be determined with a high degree of accuracy. Validation experiments of the sensor tag performance demonstrate that meat freshness can be detected at distances up to 50 cm from the RF using only the RF energy harvesting without changing the battery source. The 1D convolutional neural network model outperforms the traditional MLP and ConvLSTM models in terms of accuracy and loss.

1. Introduction

The expiration date is typically set at 70% to 80% of the recommended consumption time, indicating whether or not the product is safe for consumption. If this standard is too strict, there may be an increase in unnecessary food disposal, and if it is too loose, there is a risk of foodborne illnesses, such as various bacterial food poisonings. When there is no systematic process in place to detect the freshness of meat, its sale within the expiration date depends on the refrigeration system. Currently, the state of food is determined by human senses, such as vision and smell, which may be unreliable. The color of meat changes based on the remaining myoglobin, and its structure changes depending on the state of iron oxide and the degree of oxygen binding, affecting the properties of light reflection and resulting in a color change [1,2,3,4]. During the first slaughtering of red meat, blood accumulates, causing a purplish-red appearance due to the iron in the blood. When oxygen is obtained, it transforms into oxy-myoglobin, resulting in a red color, similar to fresh red meat purchased at the market. If oxygenation continues, the red meat may temporarily return to hemoglobin, but this is uncommon, and the duration of the change is also temporary. Generally, it changes from myoglobin to oxy-myoglobin and met-myoglobin, and the color changes from purplish-red to light-red, and then to brown. When stored in winter or dry-ripened, it transforms from brown to darker brown, and during summer or wet ripening, it turns to gray-brown. In other words, for red meat purchased at the market, the color changes from light-red to brown and gray, and the changes in myoglobin are as follows: myoglobin→oxy-myoglobin→met-myoglobin→denatured met-myoglobin.
Furthermore, when red meat is spoiled, it becomes unappetizing and emits a foul odor. In the case of packaged products, if they are stored for a prolonged period and the contents expire, the packaging may bulge, and the spoiled smell may be difficult to detect [5]. The odor is the most apparent factor in determining whether the meat has gone bad [6]. However, smelling meat closely can be harmful to one’s health; hence, it is not a recommended approach [3]. According to the FDA, fresh meat (beef, veal, lamb, and pork) can be refrigerated for three to five days at 4.4 °C. Red meat stored for more than five days is usually recommended to be discarded. However, it may be displayed or sold due to a distribution or seller error, and if the refrigerator’s operation is disrupted by a power outage or a mistake in the handling, the storage period will be significantly reduced. Meat freshness changes under refrigeration, albeit at a slower rate. An automated measurement system using smart sensor tags is designed to prevent management errors. Special attention is paid to ensure the stability of pork packages exposed to room temperature during the summer months, which requires caution. Currently, researchers are exploring an approach to detecting the state of a target object, and the development of a color measurement system using NFC technology is fascinating [7,8,9]. Researchers test for pH reactivity [7] or use temperature, humidity, oxygen, and carbon dioxide sensors to determine fruit maturity [8]. Additionally, a nanoparticle (AgNP)-based approach for detecting pollution in aquatic life has been developed [10]. Furthermore, an analytical system for detecting heavy metal pollutants in drinking water has been proposed [11].
Previous studies have been conducted to determine the freshness of existing foods. Once-used meat is stored in a sealed container and measured with a pressure sensor, which is occasionally used to detect its condition and can be useful [9,12]. However, this method is not suitable when measuring the freshness of a new product in circulation or in storage. In this study, a smart sensor tag system was established that measures the status of pork using low-cost red, green, and blue (RGB) sensors, along with the development of a machine learning model that estimates the pork’s state, and the system was completed.
Where batteries are used, there is a problem with their disposal and exchange. Particularly, if replacement is not carried out when appropriate, mass disposal problems can arise. These problems can be addressed through the application of RF energy harvesting technology. Furthermore, using electromagnetic energy is a clean energy source, so no additional waste is produced [9,12,13,14,15,16].
The primary contributions of this study can be summarized as follows:
  • The design of a compact sensor tag as a key component for monitoring the freshness of pork;
  • The design of a system that can harvest RF energy, simplifying the process of designing and configuring the system;
  • The design of a printed collinear antenna operating in the UHF band of 915 MHz, with the system’s efficiency enhanced by using an antenna with high RF energy harvesting efficiency;
  • The design of a machine learning algorithm for detecting meat quality, with the 1D convolutional neural network (CNN) model outperforming other machine learning models;
  • The development of an early warning system that prevents meat poisoning due to improper storage and exposure to warm temperatures during summer.
Section 2 presents an overview of smart sensor tags based on RF energy harvesting, and outlines the machine learning models used in the freshness monitoring system based on the presented sensor tag. In Section 3, the content of RF harvesting experiments using the proposed system is described, along with the antenna design approach and sensor module for RF energy harvesting. Section 4 explains the RF energy harvesting experiments. Section 5 presents the approach for food monitoring using machine learning and data preprocessing processes. Section 6 introduces dimensionality reduction for data visualization, and in Section 7, the machine learning framework is presented. Finally, Section 8 presents the conclusions of this study.

2. System Configuration

In this study, a color sensor that detects the value of RGB and a gas sensor that detects TVOC and eCO2 are used to measure the freshness of packaged red meat, and the system’s entire architecture is shown in Figure 1.
A training dataset was generated using the values measured from pork in the smart sensor tag system equipped with RF energy harvesting capability. Four types of machine learning models are built, and their performances are compared:
  • A Support Vector Machine (SVM) model;
  • A Multilayer Perceptron (MLP) model;
  • A 1D-CNN model with the characteristics of a CNN applied;
  • A ConvLSTM model, which applies a CNN to the long short-term memory (LSTM). This model is specialized for time-series training characteristics.

3. Material and Method

The freshness of pork is measured by the data generated by the decay over time inside a closed box. The smart sensor tag system consists of two types of sensors: color sensor (TCS34725, ams-OSRAM) and air quality sensor (CCS811, ams-OSRAM). The sensor data are continuously measured every 5 min for 5 days in an indoor environment with an average temperature of 26 °C. The color sensor can discriminate the state up to 15 cm from the measurement target with 5 cm measurement increments. The freshness was measured at 13 cm from the sample. Additionally, the color sensor value was used to establish a criterion for the change in the state of pork according to the Hue, Saturation, and Value (HSV) data. The proposed sensor tag system’s RGB measurements of pork were converted into data through the HSV color model, generating a training dataset for machine learning. Figure 2 shows the monitoring of pork using the smart sensor.

3.1. High-Efficiency Energy Harvesting with the Collinear Antenna

When monitoring the freshness of packaged pork using the proposed sensor, the location of the observed object may change. Therefore, it is advantageous to have an omnidirectional radiation pattern if the possibility of transplantation increases, allowing the sensor tags to move freely. Additionally, compared to Yagi or Patch antennas, a printed circuit board (PCB) printed collinear antenna [12,16,17,18] is more suitable for small-scale manufacturing and has enhanced power-receiving efficiency. In this study, a collinear antenna designed by applying a flat broadband dipole operating at 915 MHz [19,20,21] is used. The term “collinear” refers to an antenna designed to increase its gain.
The left side of Figure 3 shows the signal’s dipole element, which functions not only as a radiating and absorbing element but also as a 1:1 balun. On the right side of Figure 2, the ground is located at the bottom and was adjusted in terms of area, length, and shape through repeated simulations to achieve a smaller antenna that can operate at 915 MHz.
Through simulations and measurements of the S11 parameters, the proposed collinear antenna was found to be within the 800–1000 MHz band (Figure 4). When using the network analyzer, the center frequency shifted from 915 MHz in the simulation to 913 MHz in the measurement, with a return loss of −21.22 dB. The antenna is acceptable and suitable for RF energy harvesting as the center frequency remains within the UHF range. The proposed antenna’s return loss parameter is −21.22 dB, and it reflects only 0.755% of the input power, allowing it to achieve near-exact impedance matching at the input:
L R T = 20 l o g 10 ( Γ )
Γ = 10 L R T 20 ,
P R = R e f l e c t e d   P o w e r = P i n Γ 2 ,
Therefore, −21.11 dB indicates that approximately 1% of the input power is reflected back to the source.
In Figure 5, the surface plot of the proposed antenna’s 3D gain is shown. The simulated gain reaches up to 2.59 dBi in the direction of maximum radiation.
To design a narrowband antenna operating at 915 MHz, the basic design provided by the Magus tool was used as a reference. In the CST tool, the geometric parameters of each antenna were adjusted to enhance its efficiency. The dimensions of the PCB collinear antenna are as follows:
  • Length 36 mm;
  • Width 149 mm;
  • Thickness 2.4 mm.

3.2. Friis Transmitter Formula

The power received by RF energy harvesting can be calculated using the Friis transmission formula, which takes into account the aperture area of the antenna.
As shown in Figure 6, the Friis transmission formula describes the relationship between the transmission power and the reception power when the transmitting and receiving antennas are separated by a distance of r. It assumes that r is large enough to satisfy the far-field conditions and calculates the density of the radiation emitted from the transmitting antenna.
S = G P i n G t 4 π r 2
When the actual area of the antenna’s aperture is A p , and the aperture’s valid area is A e ( A e < A p ), the ratio of these two areas is defined as the aperture efficiency.
η a p = A e A p
The valid aperture’s area is as follows:
A e = λ 2 4 π D
According to the S of the power density of the receiving antenna, the power of reception is as follows:
P r = S A e
Thus, when Formulas (3) and (4) are used, the power of reception is as follows:
P r = P i n G t 4 π r 2 λ 2 4 π D
The output’s power containing η e r , the receiving antenna’s efficiency, is as follows, and is called the Friis transmission formula:
P o u t = P r η e r = P i n G t 4 π r 2 λ 2 4 π D r η e r = P i n G t 4 π r 2 λ 2 4 π G r = ( λ 4 π r ) 2 G t G r P i n
Here, the term ( λ 4 π r ) 2 is called the free space loss factor, which is caused by the release of energy from the antenna into the entire space in the form of a sphere [16]. Recent studies have focused on the development of omnidirectional antennas that generally have lower benefits of less than 2 dBi.
Figure 7 depicts the simulated and actual harvesting performance of the proposed antenna at different distances ranging from 0 m to 2 m. According to Equation (9), the power harvested from a dedicated transmitter decreases as the distance increases. In RF systems, a small unit of power in mW is usually expressed in dB format, known as dBm. A total of 10 dBm corresponds to 10 mW, and 20 dBm corresponds to 100 mW. The Friis transmission formula results were sequentially simulated and placed at intervals from the source of RF radiation to ensure that they matched the actual harvesting experiments.
Figure 6 shows a decrease in power as the distance from the transmitter increases, resulting in a negative slope. To minimize the effects of noise and variations in received power due to environmental factors, a moving average filter can be applied to the power measurement data. This filter calculates the average power over a moving window of a certain size, helping to smooth out fluctuations in the measured power. The resulting graph will depict the power received by the receiver after filtering with the moving average filter. Although the graph will still exhibit a negative slope as the distance from the transmitter increases, the variations in the measured power will be reduced, yielding a smoother curve. The experimentally obtained harvested power was found to differ from the simulation value by 10 dBm (on average) per distance unit. This discrepancy arises because the simulation assumes that the transmitter and receiver antennas are 100% conductively and dielectrically efficient. Within a 1.75 m distance, where the RF energy reaches −5.29 dBm (295 µW), the system can detect the freshness of pork.

3.3. Calculation of PI Matching Network via Smith Chart

RF energy harvesting approaches are utilized to power the proposed smart-sensor tag. Impedance matching circuits are necessary to increase the efficiency of receiving energy in the form of electromagnetic fields generated by resonance at the signal source of RF in the 915 MHz band. This method allows for maximum power to be transferred to the antenna-connected load. Impedance matching circuits are placed where the receiving antenna and sensor tag are connected.
The Smith chart is used to match impedance by showing the relationship between the reflection coefficient and impedance on the transmission line [22,23]. The equation relating the reflection coefficient and impedance expresses the impedance value on the complex plane where the reflection coefficient is expressed. The equation makes the load impedance equal to the complex conjugate of the impedance derived from the signal source.
Z s = Z L * = ( R L + j X L ) * = R L j X L
The proposed collinear antenna in this study uses a PI-type circuit for impedance matching.

3.4. The Proposed Smart-Sensor Tag Design

Figure 8 shows the blueprint of the proposed smart-sensor module. The TSC34725 sensor (ams-OSRAM Ltd., Premstätten, Austria) was selected to measure color changes at the top of the pork. The TCS3472 has an integrated on-chip IR blocking filter and provides a digital output of RGB, which are clear light sensing values.
The sensor operates at 3.3 V and has a current consumption of 2.25 mA when operating and 2.45 mA when communicating over Bluetooth. In the case of the MCU, 8.5 uA is consumed when low-power run is conducted at 32 kHz. The sensor is a small package of 8.8 × 4.2 cm, and the circuit was optimized and designed. A collinear antenna that matches the actual antenna to the impedance matching simulation value and allows for further miniaturization in the system’s construction is selected.

4. RF Harvesting Experiment

4.1. RF Harvesting Evaluation of the Collinear Dipole Antenna

In the case of the RF harvesting system proposed in this study for food monitoring, measurements were not taken in an anechoic chamber. As measurements had to be taken in a normal environment, the distance from the RF source changed, and the average harvesting amount was computed after conducting multiple measurements. Performance evaluations of the antennas were carried out indoors in a space of 10 m (L) × 10 m (W) × 5 m (H). An axle cable was used to connect the antenna to the measuring unit (Agilent ENA Series Network Analyzer, Keysight Technologies, Elk Horn, IA, USA). An overall measurement system, including a network analyzer, an antenna, and an RF transmitter, was constructed on a wooden table placed in the center of the room. The proposed sensor tags took 150.8 s to charge up to 4 V at a distance of 50 cm from the RF source [24,25,26,27].

4.2. Kalman Filter for RF Harvesting Evaluation

The power received per 1 cm by the collinear antenna connected to the proposed sensor tag is measured, and the received power is shown in Figure 9. The actual amount of RF energy received by the sensor tag may vary slightly. To estimate the state of a linear dynamic system based on measured values, including noise [28,29], a Kalman filter was used.
This Algorithm 1 represents the Kalman Filtering algorithm for energy harvesting. Kalman Filtering is a widely-used technique for estimating the state of a system in the presence of noisy measurements.
Algorithm 1: Kalman Filtering for Energy Harvesting
1:Initialization:
 Input: Initial state estimate x ^ 0 , initial error covariance P 0
 Output: None
x ^ k = x ^ 0 # Initialize state estimate
P K = P 0 # Initialize error covariance
2:Prediction:
 Input: State transition matrix A , state estimate at previous step x ^ k 1 , process noise covariance Q
 Output: Predicted state estimate x ^ k , predicted error covariance P K
x ^ k = A x ^ k 1 # State estimate prediction
P K = A P k 1 A T + Q # Error covariance prediction
3:Kalman Gain Calculation:
 Input: Observation matrix H , predicted error covariance P K , measurement noise covariance R
 Output: Kalman gain K K
K K = P K H T ( H P K H T + R ) 1 # Kalman gain calculation
4:Update
 Input: Observation z t , observation matrix H , predicted state estimate x ^ k , Kalman gain K k
 Output: Updated state estimate x ^ t , updated error covariance P t
x ^ t = x ^ k + K t ( z t H x ^ t ) #State estimate update
P t = ( 1 K t H ) P t # Error covariance update

4.3. RF Energy Scavenging Performance

To validate the proposed Colinear-type antenna design, the efficiency of energy acquisition was evaluated. The material plate (ε = 4.4) of the 2.4 mm thick FR4 substrate was chosen as the circuit surface for printing the antenna. The dimensions were selected according to optimal parameters in simulations. The PCB layer of the antenna was designed using Altium Designer software, and the actual antenna of the Collinear Dipole type is shown in Figure 3C (Section 3.1).
An experiment was conducted to investigate the energy density around the energy harvesting module’s antenna. The receiving Collinear Dipole type antenna is connected to the spectrum analyzer (N9320, Keysight Technologies, USA) to collect the wavelengths of the RF emitted from the 1 W transmitter at a specific distance. Figure 4 demonstrates the curve of the collected RF energy simulations and actual lines. The distance between the TX transmitter and the RX receiver’s module varied from 0 m to 2 m. The antenna’s harvested power (dBm) gradually reduced in the simulation, in accordance with the official formula (4). At a distance of 50 cm, the RF energy reaches 5.47 dBm, and the output power is 3.54 mW, which is sufficient for the buck-boost converter to start working.

5. Food Monitoring Method and Data Preprocessing for Machine Learning

5.1. Criteria for Data Preprocessing Process and Degree of Rotten

The environment for storing meat varies substantially based on the region’s location, climate, and timing. The degree of decomposition varies depending on the meat breed, the breeding environment, and the slaughter age. According to the FDA’s recommendations on food storage [7,17], pork will be safe if stored in the refrigerator for three to five days. Pork deteriorates quickly at room temperature within 24 h, necessitating the use of an automated system to detect changes.
For stable sensor operation, a 3W transmitter was employed as the RF source, with the transmission distance to the sensor module adjusted to 50 cm. The sensor tag’s energy harvesting unit is powered by built-in MCUs and sensors as the collected RF energy is converted into electricity. It is stored in a low-power microprocessor (STM32L053, STMicroelectronics, Coppell, TX, USA) and transmitted to the BLE chip using a Universal Asynchronous Receiver/Transmitter (UART). Finally, an I2C (Inter-Integrated Circuit) communication module was employed for sensors. To compare the value of the sensors measured using the proposed smart-sensor tag system, pork purchased at a nearby mart was observed for 5 days, which is the same as the measurement time of this system. Several samples were simultaneously measured for continuous monitoring. The measured samples are shown in Figure 10. The average room temperature was 26 °C.
In this study, machine learning used data obtained from a low-cost RGB sensor, and the HSV conversion was conducted as follows.

5.2. Changes in the Color Space of RGB to HSV

The RGB color model is the only color model recognized by humans, based on the Tristimulus theory. In computer vision and image processing approaches, the RGB value is often converted into the HSV color model, which consists of Hue, Saturation, and Value [30,31]. Hue indicates pure color, Saturation indicates clarity in color depth, and Value indicates brightness. Hue is arranged at a 360° angle in a circle, with colors combined. As the center axis rises, the Value becomes greater, and the higher the Value, the brighter the color becomes. Saturation is centered on the center axis to the edge, with the color becoming clearer the farther it is from the center axis. Both Value and Saturation have values between 0 and 1.
Since the Value’s value is separated compared to the existing RGB model, the HSV model can be used to measure changes in color brightness. Thus, the HSV model is commonly used in computer vision. When the Value’s value is 0, it indicates black, and when it is 1, it indicates white. Furthermore, the area of HSV is composed of Hue, Saturation, and Value, and since the factor of Hue does not change significantly despite changes in lighting, it is commonly used in color detection. The color difference can be determined sensitively using Euclidean distance. The HSV cone model can be used to determine the distance between the coordinates of the converted space after obtaining the space coordinates for H, S, and V.

5.3. Reference Data of the Degree of Rotten in the Storage of Livestock Products in Summer

The Korea Consumer Agency discovered that when livestock products were stored without refrigeration in the external (33 °C) and trunk (43 °C) areas of vehicles during summer, bacteria began to multiply after 4 h and continued to do so after 6 h. Furthermore, it reached 5 in 106 CFU/g (CFU represents the number of bacteria), indicating the initial stage of decomposition [32,33]. Additionally, the Korean Ministry of Food and Drug Safety researched and investigated the distribution of Salmonella bacteria and changes in their numbers after raw chicken was injected with Salmonella and stored at refrigerated temperatures (4 °C) and room temperatures (25 °C) for 4 h and 12 h, respectively [24].
In the study, a change in the distribution of Salmonella was discovered by analyzing the metagenome (an aggregate of the genomes of all microorganisms) present in the environment (such as raw chicken and pork) using next-generation sequencing equipment. Moreover, the genetic analysis approach (RT-PCR) was used to identify changes in the number of Salmonella bacteria. According to the study, when raw chickens were stored at room temperature, the distribution of Salmonella and the number of bacteria increased. The change in the distribution of Salmonella indicated little change in raw chicken kept refrigerated for up to 12 h, but increased 1.3 times compared to the refrigerator’s temperature when stored at room temperature for 4 h and tripled when stored for 12 h. Compared to refrigerated storage, Salmonella bacteria increased 3.8 times after 4 h and 14 times after 12 h when stored at room temperature.
Figure 11 shows an average of multiple measurements taken during the months of July and August, which indicate a similar pattern. These data are the result of measurements using the smart sensor tag monitoring system presented in Figure 2. In Figure 11c, the left arrow serves as a guide indicating that the red graph on the left represents eCO2, while the right arrow acts as a guide showing that the blue graph on the right represents eTVOC.
To increase the reliability of responding to changing RGB data, the TVOC value was measured using the same sensor tag. The measurement data obtained using the proposed sensor tags include RGB, eTVOC, and eCO2 values. The measured eTVOC values can determine the degree of meat spoilage over time. The HSV values obtained through the RGB measurements were used as the input data in the proposed machine learning system. To enhance the stability and performance of the machine learning algorithm, continuous training was performed on RGB sensors and gas sensors, and parameter optimization processes were carried out.
The pork was stored at room temperature of 26 °C for 5 days, and the gas production and discoloration data caused by bacterial decomposition are shown in Figure 11. When observed pork kept in the refrigerator at the market is stored at room temperature, it undergoes a slight change in condition. The measured value reaches the initial state of decay after 6 h, causing color changes and changes in the eCO2 level. In other words, a change in the red value is accompanied by a change in the pork condition. The Value value changed by RGB is almost the same as the value of red, indicating that the eCO2 value is also rapidly increasing. In the case of eTVOC with organic volatile compounds, there is a slight time difference and change. This is thought to be caused by bacteria inside the pork, which results in chemical changes in which protein is decomposed, mucus is released, and it takes time for organic volatile gas to be produced. The results of these experiments are similar to those of previous studies [9,13,16]. Although the measured temperature and environment are different, we can confirm that the flow of sensor data changing over time is similar.

6. Dimensionality Reduction for Data Visualization

The relationship between the characteristics in the data can be visualized, which is useful when dealing with multidimensional or input data with more types.

Support Vector Machine

SVM aims to optimize the margin, which is the distance between the hyperplane (decision boundary) that separates the classes and the training sample closest to this hyperplane. This approach can separate one class from all other classes at once, and in this study, we use SVM with a radial basis function. The value obtained from the conversion of HSV from the value obtained from the RGB sensor is used as input for the SVM classifier [34,35].
In Figure 12, the results are classified using the SVM classification model.

7. Machine Learning Models for Pork Freshness Classification

The representative models of machine learning are developed and optimized by comparing their performance to be applied to this system.

7.1. Multilayer Perceptron Model

The MLP model consists of the most basic vanilla neural network [36,37]. Figure 13 shows the three layers of the MLP model, including a layer of input, a hidden layer, and a layer of output. The input layer’s size is the size of the input dataset’s features. The hidden layer consists of 128–68 neurons and the Rectified Linear Unit (ReLU). The SoftMax function is used for the classification and normalization of the network’s output.
Figure 14 shows the training process of the vanilla MLP model. It demonstrates the accuracy trend for each epoch. At the 104th epoch, the accuracy recorded the highest value of 0.9797, with slight deviations between the epochs. There was a slight increase in the validation data’s accuracy compared to the training data. The loss was also the lowest at 0.0347 in the 113th epoch, indicating a progressively similar performance. This model has little variation in accuracy and loss for each epoch, and the difference between the results learned from the validation data and test data for the loss is relatively small.

7.2. Long Short-Term Memory Model

LSTM is a type of RNN, a structure connected between internal units to preserve information over time, which consists of functions of sigmoid activation and gate cells [38].
As shown in Figure 15, a gate cell is a function that allows certain information to be read, written, and saved, and it can receive input values between 0 and 1. Information is blocked when the input value is close to 0, and all the information is delivered when the input value is close to 1. Additionally, to prevent problems with vanishing or exploding gradients, the forget gate multiplies the output value by either 0 or 1. The sigmoid function plays a crucial role in coordinating information at the gate by determining how much of the previous state value ( C t 1 ) should be disregarded or updated for new cell memory computations when the forget gate ( Γ F ) and the update gate ( Γ u ) are used together.
At time t of the LSTM unit, the memory cell (C) stores C t as follows:
C t = ( Γ u × C ~ t ) + ( Γ F × C t 1 )
The current memory value is calculated using the previous time step’s content value C ~ t and the memory value C t 1 . The forgetting gate is an activation function applied to the vector dot product and bias. The model is characterized by sequential data that are suitable for processing due to these features. The system in this study can be seen as having time continuity due to changes in the state of pork over time, and LSTM can be efficiently operated.
Figure 16 shows the structure of the LSTM model used in this study. It is a four-layer LSTM model that includes an input layer, a hidden layer, and a fully connected layer. The activation function was set to ReLU, and the SoftMax function was employed for classification normalization for the network’s output. The dropout rate is set at 0.3.
Figure 17 shows the LSTM model’s learning process. In the 141st epoch, the highest accuracy value was 0.9814. A relatively stable performance appeared after 78 epochs. The loss was also lowest at 0.0314 in the 146th epoch. In the validation data, the loss decreased slightly.

7.3. 1D-CNN Model

CNN is primarily used for classifying image features, but it is also widely used in the processing of biological signals such as ECG and EMG [39]. In this study, CNN was applied to pork measurement data, so the model was modified for 1D-CNN to apply to a sequence of 1D data. The 1D convolution layer generates a single spatial or time-lapse 1D layer and a kernel that becomes a convolution, producing a tensor of output.
The 1D-CNN model employed is shown in Figure 18 and consists of a six-layer structure. The input layer consists of 64 filters, kernel size 2, ReLU as the activation function, and a convolutional 1D Neural network. The hidden layer also consists of 32 filters, kernel size 2, and ReLU. Then, Max-Pooling is applied with a pooling size of 1, followed by a flattened layer. A hidden layer consists of 64–32 nodes and a ReLU activation function. The output layer uses the SoftMax function, and the optimizer used is Adam. The learning rate is set to 0.01, the dropout to 0.5, and the weight decay to 0.0001. Grid search is used to optimize the model layers and each hyperparameter [40,41,42].
Table 1 presents the results of applying the Grid Search algorithm for optimizing the parameters of the 1D-CNN model. The learning process of the 1D-CNN model is shown in Figure 19. The highest accuracy value of 0.9870 was recorded in the 86th epoch, with some deviations between epochs. The accuracy of the validation data increased slightly compared to the training data. The lowest loss was recorded in the 149th epoch at 0.0307, indicating a progressively similar performance. The validation loss was slightly reduced. Compared to LSTM, the trend of accuracy for each epoch appears similar, but it can be confirmed that the validation loss performance is similar and the stability during training is higher.

7.4. ConvLSTM Model

The convolution layer convolves the input of the layer to generate an output tensor. In order to use the HSV values obtained from the RGB data as input to the model, a reshaping process was conducted, and the features extracted through PCA feature transformation were used as input to the ConvLSTM model [39].
The employed ConvLSTM model is similar to Figure 20 and is designed with a five-layer structure. The input layer consists of 64 filters and a kernel size of (1,3), and the activation function used is ReLU. The ConvLSTM layer is followed by a flattened layer with a dropout ratio set to 0.3. The hidden layer has 32 nodes with a ReLU activation function and an L2 regularizer of 0.001. The output layer uses the SoftMax function, and the optimizer used is Adam. Additionally, grid search algorithms were used for tuning.
The learning process of the ConvLSTM model is shown in Figure 21. The highest accuracy value was recorded at the 138th epoch, which was 0.9676. In comparison to MLP, it shows less variability in performance at the beginning, with a relatively stable performance observed after 20 epochs. Additionally, the lowest loss value of 0.0950 was recorded at the 132nd epoch. This model exhibits some deviation in accuracy and loss for each epoch, and the difference between the results learned from the validation and test data for loss is larger than that of the previous MLP model.
Table 2 shows the performance comparison of machine learning models with parameters optimized using the Grid Search algorithm. After considering the performance of all the models, the 1D-CNN model is selected as the machine learning model for monitoring the status of the pork due to its superior performance.

8. Conclusions

This study utilized smart sensing sensor tags based on RF energy harvesting, demonstrating an effective approach for monitoring meat freshness. The system is designed to be attached anywhere for easy transplantation, and the use of low-cost commercial sensors and miniaturization technology has increased its productivity and portability. The proposed smart sensor tag system aims to observe the gas and discoloration data produced by the decomposition of pork, and based on the measured data, its purpose is to classify the freshness level. We developed an RF energy harvesting-based monitoring system to monitor the storage condition of pork at room temperature during the humid and hot month of August, which is prone to frequent cases of food poisoning accidents, and other humid summer months. Pork stored in a mart retains oxygen in the oxy-myoglobin state, resulting in a bright red color. Even during refrigerated storage, myoglobin gradually changes to met-myoglobin, progressively turning brown. In particular, when the pork is exposed to room temperature due to reasons such as transportation after purchase, it decays rapidly, and the browning process accelerates accordingly. Pork stored at room temperature reaches a state of decay within the first 6 h of measurement initiation. The data measured by the proposed system include the discoloration and changes in gas levels that occur with decay. When stored in a sealed container, eCO2 is initially produced, followed by an average production of TVOC after a short time. The color change and eCO2 change show a similar temporal trend, while TVOC data tend to occur slightly slower than eco data. Through this, it is suggested that the gas data produced by the decaying pork are related to eCO2, and depending on the degree of decay, the red Hue and Value in HSV are suitable indicators for decay. The 1D-CNN machine learning model was then applied using the measured RGB color values to classify the color difference, achieving a classification accuracy of 98.7%. This allows for the application of smart-sensor tags based on RF energy harvesting to develop an automated classification system and successfully determine pork freshness.

Author Contributions

Conceptualization, D.-E.K. and W.-Y.C.; methodology, D.-E.K.; software, D.-E.K.; validation, D.-E.K. and Y.A.N.; visualization, Y.A.N.; project administration, W.-Y.C.; funding acquisition, W.-Y.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Research Foundation of Korea (NRF) grant funded by the Korean government (MSIT), grant number 2019R1A2C1089139.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The experimental data will not be disclosed for reasons such as patent preparation and security.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Girolami, A.; Napolitano, F.; Faraone, D.; Braghieri, A. Measurement of meat color using a computer vision system. Meat Sci. 2013, 93, 111–118. [Google Scholar] [CrossRef] [PubMed]
  2. Nguyen, T.; Kim, S.; Kim, J.G. Diffuse reflectance spectroscopy to quantify the met-myoglobin proportion and meat oxygenation inside of pork and beef. Food Chem. 2019, 275, 369–376. [Google Scholar] [CrossRef] [PubMed]
  3. Holman, B.W.; van de Ven, R.J.; Mao, Y.; Coombs, C.E.; Hopkins, D.L. Using instrumental (CIE and reflectance) measures to predict consumers’ acceptance of beef colour. Meat Sci. 2017, 127, 57–62. [Google Scholar] [CrossRef] [PubMed]
  4. Li, C.; He, L.; Jin, G.; Ma, S.; Wu, W.; Gai, L. Effect of different irradiation dose treatment on the lipid oxidation, instrumental color and volatiles of fresh pork and their changes during storage. Meat Sci. 2017, 128, 68–76. [Google Scholar] [CrossRef] [PubMed]
  5. Huang, M.; Wang, J.; Zhuang, H.; Yan, W.; Zhao, J.; Zhang, J. Effect of in-package high voltage dielectric barrier discharge on microbiological, color and oxidation properties of pork in modified atmosphere packaging during storage. Meat Sci. 2019, 149, 107–113. [Google Scholar] [CrossRef]
  6. Mansur, A.R.; Song, E.J.; Cho, Y.S.; Nam, Y.D.; Choi, Y.S.; Kim, D.O.; Seo, D.H.; Nam, T.G. Comparative evaluation of spoilage-related bacterial diversity and metabolite profiles in chilled beef stored under air and vacuum packaging. Food Microbiol. 2019, 77, 166–172. [Google Scholar] [CrossRef]
  7. Boada, M.; Lazaro, A.; Villarino, R.; Girbau, D. Battery-less NFC sensor for pH monitoring. IEEE Access 2019, 7, 33226–33239. [Google Scholar] [CrossRef]
  8. Lazaro, A.; Boada, M.; Villarino, R.; Girbau, D. Color measurement and analysis of fruit with a battery-less NFC sensor. Sensors 2019, 19, 1741. [Google Scholar] [CrossRef] [Green Version]
  9. Nguyen, T.B.; Tran, V.T.; Chung, W.Y. Pressure measurement-based method for battery-free food monitoring powered by NFC energy harvesting. Sci. Rep. 2019, 9, 17556. [Google Scholar] [CrossRef] [Green Version]
  10. Emmanuel, N.; Haridas, R.; Chelakkara, S.; Nair, R.B.; Gopi, A.; Sajitha, M.; Yoosaf, K. Smartphone Assisted Colourimetric detection and quantification of Pb 2+ and Hg 2+ ions using Ag nanoparticles from aqueous medium. IEEE Sens. J. 2020, 20, 8512–8519. [Google Scholar] [CrossRef]
  11. Nguyen, H.; Misbah, I.; Shih, W.C. Smartphone nano-colorimetry for on-demand multiplex lead and mercury detection and quantitation in drinking water. IEEE Sens. J. 2020, 20, 6685–6691. [Google Scholar] [CrossRef]
  12. Do, H.; Kim, D.; Lam, M.B.; Chung, W. Self-powered food assessment system using LSTM network and 915 MHz RF energy harvesting. IEEE Access 2021, 9, 97444–97456. [Google Scholar] [CrossRef]
  13. Lam, M.B.; Dang, N.T.; Nguyen, T.; Chung, W. A neural network-based model of radio frequency energy harvesting characteristics in a self-powered food monitoring system. IEEE Sens. J. 2019, 19, 8813–8823. [Google Scholar] [CrossRef]
  14. Nguyen, N.H.; Lam, M.B.; Chung, W.Y. Battery-less pork freshness monitoring based on high-efficiency RF energy harvesting. J. Sens. Sci. Technol. 2020, 29, 293–302. [Google Scholar] [CrossRef]
  15. Lam, M.B.; Nguyen, T.H.; Chung, W.Y. Deep learning-based food quality estimation using radio frequency-powered sensor mote. IEEE Access 2020, 8, 88360–88371. [Google Scholar] [CrossRef]
  16. Cao, X.; Chung, W. Range-extended wireless food spoilage monitoring with a high energy efficient battery-free sensor tag. Sens. Actuators A Phys. 2019, 299, 111632. [Google Scholar] [CrossRef]
  17. Wu, J.; Li, J.; Cui, X.; Mao, L. Miniaturized dual-band patch antenna mounted on metallic plates for RFID passive tag. In Proceedings of the International Conference on Control, Automation and Systems (CASE), Gyeonggi-do, Republic of Korea, 30 July 2011; pp. 1–4. [Google Scholar]
  18. Bong, F.L.; Lim, E.H.; Lo, F.L. Flexible folded-patch antenna with serrated edges for metal-mountable UHF RFID tag. IEEE Trans. Antennas Propag. 2016, 65, 873–877. [Google Scholar] [CrossRef]
  19. Hu, Y.Y.; Sun, S.; Xu, H. Compact collinear quasi-Yagi antenna array for wireless energy harvesting. IEEE Access 2020, 8, 35308–35317. [Google Scholar] [CrossRef]
  20. Ballandovich, S.V.; Antonov, Y.G.; Kostikov, G.A.; Liubina, L.M.; Sugak, M.I. Collinear wideband-dipoles antenna array with the omnidirectional radiation pattern in the azimuth plane. In Proceedings of the IEEE Conference of Russian Young Researchers in Electrical and Electronic Engineering (EIConRus), St. Petersburg, Russia, 28–31 January 2019. [Google Scholar]
  21. Hosseini-Fahraji, A.; Manteghi, M. Design of a broadband high-gain end-fed coaxial collinear antenna. IEEE Antennas Wirel. 2021, 20, 1770–1774. [Google Scholar] [CrossRef]
  22. Liu, W.; Huang, K.; Wang, T.; Hou, J.; Zhang, Z. Broadband high-efficiency RF rectifier with a cross-shaped match stub of two one-eighth-wavelength transmission lines. IEEE Microw. Wirel. Compon. Lett. 2021, 31, 1170–1173. [Google Scholar] [CrossRef]
  23. Mohan, C.L.; Kavya, K.C.S.; Kotamraju, S.K. Design, and analysis of capacitive shunt RF MEMS switch for reconfigurable antenna. Trans. Electr. Electron. Mater. 2021, 22, 57–66. [Google Scholar] [CrossRef]
  24. Mishra, D.; De, S.; Jana, S.; Basagni, S.; Chowdhury, K.; Heinzelman, W. Smart RF energy harvesting communications: Challenges and opportunities. IEEE Commun. Mag. 2015, 53, 70–78. [Google Scholar] [CrossRef] [Green Version]
  25. Lu, X.; Wang, P.; Niyato, D.; Kim, D.I.; Han, Z. Wireless networks with RF energy harvesting: A contemporary survey. IEEE Commun. Surv. Tutor. 2014, 17, 757–789. [Google Scholar] [CrossRef] [Green Version]
  26. Ren, J.; Hu, J.; Zhang, D.; Guo, H.; Zhang, Y.; Shen, X. RF energy harvesting and transfer in cognitive radio sensor networks: Opportunities and challenges. IEEE Commun. Mag. 2018, 56, 104–110. [Google Scholar] [CrossRef]
  27. Jabbar, H.; Song, Y.S.; Jeong, T.T. RF energy harvesting system and circuits for charging of mobile devices. IEEE Trans. Consum. Electron. 2010, 56, 247–253. [Google Scholar] [CrossRef]
  28. Roy, S.K.; Nicolson, A.; Paliwal, K.K. DeepLPC: A deep learning approach to augmented Kalman filter-based single-channel speech enhancement. IEEE Access 2021, 9, 64524–64538. [Google Scholar] [CrossRef]
  29. Poncela, P.; Ruiz, E.; Miranda, K. Factor extraction using Kalman filter and smoothing: This is not just another survey. Int. J. 2021, 37, 1399–1425. [Google Scholar] [CrossRef]
  30. Yu, L.S.; Chou, S.Y.; Wu, H.Y.; Chen, Y.C.; Chen, Y.H. Rapid and semi-quantitative colorimetric loop-mediated isothermal amplification detection of ASFV via HSV color model transformation. J. Microbiol. Immunol. Infect. 2021, 54, 963–970. [Google Scholar] [CrossRef]
  31. Zhong, H.; Wang, R. A visual-degradation-inspired model with HSV color-encoding for contour detection. J. NeuroSci. 2021, 369, 109423. [Google Scholar] [CrossRef]
  32. Korea Consumer Agency. Korea Consumer Agency Website. Available online: https://www.kca.go.kr/home/sub.do?menukey=4006&mode=view&no=1001921090 (accessed on 10 November 2022).
  33. Korean Ministry of Food and Drug Safety. Food and Drug Safety Assessment Service. Available online: https://www.nifds.go.kr/brd/m_21/view.do?seq=12693 (accessed on 10 November 2022).
  34. An, R.; Xu, Y.; Liu, X. A rough margin-based multi-task ν-twin support vector machine for pattern classification. Appl. Soft Comput. 2021, 112, 107769. [Google Scholar] [CrossRef]
  35. Chakraborty, A.; Mitra, S.; De, D.; Pal, A.J.; Ghaemi, F.; Ahmadian, A.; Ferrara, M. Determining protein–protein interaction using support vector machine: A review. IEEE Access 2021, 9, 12473–12490. [Google Scholar] [CrossRef]
  36. Mai, N.D.; Lee, B.G.; Chung, W.Y. Affective computing on machine learning-based emotion recognition using a self-made EEG device. Sensors 2021, 21, 5135. [Google Scholar] [CrossRef]
  37. Kim, D.; Lee, J.; Chung, W.Y.; Lee, J. Artificial intelligence-based optimal grasping control. Sensors 2020, 20, 2020. [Google Scholar] [CrossRef]
  38. Greff, K.; Srivastava, R.K.; Koutnik, J. LSTM: A search space odyssey. IEEE Trans. Neural. Netw. Learn Syst. 2016, 28, 2222–2232. [Google Scholar] [CrossRef] [Green Version]
  39. Shi, X.; Chen, Z.; Wang, H.; Yeung, D.; Waong, W.; Woo, W. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. Adv. Neural. Inf. Process Syst. 2015, 28, 802–810. [Google Scholar]
  40. Mohine, S.; Bansod, B.S.; Bhalla, R.; Basra, A. Acoustic modality based hybrid deep 1D CNN-BiLSTM algorithm for moving vehicle classification. IEEE Trans Intell. Transp. Syst. 2022, 9, 16206–16216. [Google Scholar] [CrossRef]
  41. Alibrahim, H.; Ludwig, S.A. Hyperparameter optimization: Comparing genetic algorithm against grid search and bayesian optimization. In Proceedings of the 2021 IEEE Congress on Evolutionary Computation (CEC), Kraków, Poland, 28 June–1 July 2021; IEEE: Piscataway, NJ, USA, 2021; pp. 1551–1559. [Google Scholar]
  42. Bergstra, J.; Bardenet, R.; Bengio, U.; Kegl, B. Algorithms for hyper-parameter optimization. Adv. Neural. Inf. Process Syst. 2011, 24, 2546–2554. [Google Scholar]
Figure 1. The proposed RF scavenging module.
Figure 1. The proposed RF scavenging module.
Applsci 13 04896 g001
Figure 2. RGB measurement environment for packaged pork.
Figure 2. RGB measurement environment for packaged pork.
Applsci 13 04896 g002
Figure 3. Structure of the collinear antenna; (a) Top view in simulation, (b) bottom view in simulation, (c) printed collinear antenna.
Figure 3. Structure of the collinear antenna; (a) Top view in simulation, (b) bottom view in simulation, (c) printed collinear antenna.
Applsci 13 04896 g003
Figure 4. Collinear antenna’s S-parameter.
Figure 4. Collinear antenna’s S-parameter.
Applsci 13 04896 g004
Figure 5. Simulation results of collinear antenna’s gain.
Figure 5. Simulation results of collinear antenna’s gain.
Applsci 13 04896 g005
Figure 6. Friis transmission formula application environment.
Figure 6. Friis transmission formula application environment.
Applsci 13 04896 g006
Figure 7. Simulated and measured RF scavenging power using transmission distance–collinear antenna.
Figure 7. Simulated and measured RF scavenging power using transmission distance–collinear antenna.
Applsci 13 04896 g007
Figure 8. Smart sensor tag using RF scavenging power.
Figure 8. Smart sensor tag using RF scavenging power.
Applsci 13 04896 g008
Figure 9. RF harvesting measurement data by the distance of collinear antenna.
Figure 9. RF harvesting measurement data by the distance of collinear antenna.
Applsci 13 04896 g009
Figure 10. Pork measured through the camera.
Figure 10. Pork measured through the camera.
Applsci 13 04896 g010
Figure 11. Pattern of change against the time through the measured sensor values; (a) red value, (b) Value value, (c) eTVOC value, and eCO2 value.
Figure 11. Pattern of change against the time through the measured sensor values; (a) red value, (b) Value value, (c) eTVOC value, and eCO2 value.
Applsci 13 04896 g011
Figure 12. SVM classification results.
Figure 12. SVM classification results.
Applsci 13 04896 g012
Figure 13. Structure of the Vanilla MLP model.
Figure 13. Structure of the Vanilla MLP model.
Applsci 13 04896 g013
Figure 14. Training process of the Vanilla MLP model.
Figure 14. Training process of the Vanilla MLP model.
Applsci 13 04896 g014
Figure 15. Internal structure of the LSTM model.
Figure 15. Internal structure of the LSTM model.
Applsci 13 04896 g015
Figure 16. Structure of the LSTM model.
Figure 16. Structure of the LSTM model.
Applsci 13 04896 g016
Figure 17. Training process for the LSTM model.
Figure 17. Training process for the LSTM model.
Applsci 13 04896 g017
Figure 18. Structure of the 1D-CNN model.
Figure 18. Structure of the 1D-CNN model.
Applsci 13 04896 g018
Figure 19. Training process of the 1D-CNN model.
Figure 19. Training process of the 1D-CNN model.
Applsci 13 04896 g019
Figure 20. Structure of the ConvLSTM model.
Figure 20. Structure of the ConvLSTM model.
Applsci 13 04896 g020
Figure 21. Training process of the ConvLSTM model.
Figure 21. Training process of the ConvLSTM model.
Applsci 13 04896 g021
Table 1. Parameter optimization using GRID Searching for 1D-CNN.
Table 1. Parameter optimization using GRID Searching for 1D-CNN.
FilterKernel SizeLearning RateDropout RateWeight DecayTrain Accuracy
64, 12820.0010.30.00010.9768
64, 12830.0010.30.00010.9851
64, 3220.0010.50.00010.9870
64, 3230.0010.30.0010.9861
Table 2. Performance comparison of the four machine learning models.
Table 2. Performance comparison of the four machine learning models.
MLPLSTM1D-CNNConvLSTM
Accuracy0.97970.98140.98700.9676
Loss0.03470.03140.03070.0950
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Kim, D.-E.; Nando, Y.A.; Chung, W.-Y. Battery-Free Pork Freshness Estimation Based on Colorimetric Sensors and Machine Learning. Appl. Sci. 2023, 13, 4896. https://doi.org/10.3390/app13084896

AMA Style

Kim D-E, Nando YA, Chung W-Y. Battery-Free Pork Freshness Estimation Based on Colorimetric Sensors and Machine Learning. Applied Sciences. 2023; 13(8):4896. https://doi.org/10.3390/app13084896

Chicago/Turabian Style

Kim, Dong-Eon, Yudi April Nando, and Wan-Young Chung. 2023. "Battery-Free Pork Freshness Estimation Based on Colorimetric Sensors and Machine Learning" Applied Sciences 13, no. 8: 4896. https://doi.org/10.3390/app13084896

APA Style

Kim, D. -E., Nando, Y. A., & Chung, W. -Y. (2023). Battery-Free Pork Freshness Estimation Based on Colorimetric Sensors and Machine Learning. Applied Sciences, 13(8), 4896. https://doi.org/10.3390/app13084896

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop