# Battery-Free Pork Freshness Estimation Based on Colorimetric Sensors and Machine Learning
## 4 RF Harvesting Experiment
### Kalman Filter for RF Harvesting Evaluation
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 eCO\({}_{2}\), 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 eCO\({}_{2}\) 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. Figure 11: Pattern of change against the time through the measured sensor values; (**a**) red value, (**b**) Value value, (**c**) eTVOC value, and eCO\({}_{2}\) value. The pork was stored at room temperature of 26 \({}^{\circ}\)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 eCO\({}_{2}\) 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 eCO\({}_{2}\) 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. Figure 12: SVM classification results. ### 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 104 th epoch, the accuracy recorded the highest value of 0.9797, with slight deviations between the epochs.