**4. Discussion**

Apples are prone to spoilage due to physical damage and microbial infections, which can lead to widespread infection and post-harvest losses. The current study has developed a sensor prototype for apple spoilage monitoring and an early warning system for apples. The gas composition information collected by the sensor prototype from the simulated warehouse was used to develop a multi-factor fusion early warning model to predict apple spoilage during storage. Among the different models employed for the purpose, the ACO-PLS model showed the highest correlation coefficient in calibration as well as prediction set. However, it is worth mentioning that the SA-PLS model was suitable for identifying the characteristic variables. A similar outcome was obtained by Ren et al. [38] when a multilayer perceptron neural network (MLPN) model was employed on volatile components released by damaged apples upon mechanical injury. The model was able to classify the degree of damage with 100% accuracy based on the volatile components released from apples. However, the selection of a model for the prediction of the quality of fruits greatly varies depending on the specific situation and intention. Similarly, monitoring gas emitted by fruits and vegetables in combination with multivariate chemometric analysis has been proven to be effective in detecting spoilage inside refrigerators [42]. The use of artificial neural networks as a machine learning model is prevalent in developing a predictive model from electronic nose data [43]. However, compared to neural network models, PLS models are more interpretable, robust to noise and faster to train, making them suitable for real-world applications. With the involvement of too many predictor variables, the PLS model becomes unstable, and the prediction can be inaccurate. Thus, the selection of optimum parameters for modeling is an important task in the process of model building. In this study among the different variable selection methods (ACO, CARS, GA and SA) employed for the reduction of computational complexity, the SA method showed better results. Similarly, Zhao et al. [44] employed SSA to select optimal parameters for the BPNN network model developed for the prediction of fungal infection in apples using electronic nose data.

The developed prototype has a gas monitoring array to collect data on VOC, CO2, O2, C2H4, temperature and humidity. These data are then employed to build a multifactor fusion early warning model. Other works have reported that a mathematical model for shelf-life analysis could not be established based only on one specific parameter. The development of the model has shown very high efficiency in establishing shelf-life predictions in several industries, including dairy [45].

The developed model based on the gas sensor prototype has the potential to be employed in the early detection of fruit spoilage, which prevents postharvest losses and reduces economic loss significantly. There were similar attempts to predict the spoilage of bananas based on the 3D fluorescence data of the storage room gas. The spoilage benchmark for the stored banana was estimated as early as the 4th day, which demonstrates the reliability of the early warning systems [46]. However, it is worth mentioning that the early detection system was established based on the fusion of information from no less than five representative physical and chemical indicators from bananas. Moreover, Putnik et al. [47] have developed a mathematical model to compare the influence of modified atmosphere packaging in the prevention of apple browning, and the model was published online as a computer simulation that predicts shelf life given the basic quality parameters of apples, thus proving the practical applicability of model development in predicting apple spoilage. The models can be employed to answer questions about the economic benefits of using different treatments in industrial apple production and storage. This is indirectly helpful in extending the shelf-life of apples and providing economic benefits to producers, while also ensuring that consumers receive high-quality food.

Overall, this work presents a novel approach for monitoring and providing early warning of spoilage of apples in storage based on a gas sensor prototype. The developed system can help reduce post-harvest losses by preventing the spread of infection in the

storage environment. Moreover, the developed method can assist in streamlining the process of monitoring and inspecting apples for fungal spoilage.

### **5. Conclusions**

In view of the current problems and difficulties of spoilage monitoring in apple warehouses, we analyzed the overall framework of a sensor prototype for the detection of various gases produced during apple spoilage. The prototype was developed by integrating software and hardware development of acquisition terminals to continuously obtain sensor data from simulated warehouses and analyze the process of spoilage in batches of apples. The change in various gaseous composition and their influence on spoilage was identified to be a result of multi-factor coupling. The early warning model for apple spoilage was developed by considering multiple factors, including temperature, humidity and gas composition, and a variable selection method was employed to optimize the characteristic variable, which predicted the degree of spoilage. The developed remote monitoring platform had three major modules, including data upload module, remote monitoring module and spoilage early warning module. These modules enabled the upload of sensor data, visualization of the trends in the data over time and visual display of spoilage levels. Thus, the study proved that analyzing the change in gas composition in an apple spoilage micro-environment and real-time monitoring and warning of indicator gas is an effective way to reduce postharvest losses of fruits.

**Author Contributions:** Conceptualization, Z.G.; methodology, L.Y.; software, L.Y.; validation, L.Y. and H.J.; formal analysis, X.Z.; investigation, L.Y.; resources, Z.G.; data curation, J.C.; writing—original draft preparation, L.Y. and H.J.; writing—review and editing, H.R.E.-S.; visualization, L.Y.; supervision, Z.G. and J.C.; project administration, Z.G.; funding acquisition, Z.G. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the National Key R&D Program of China (No. 2022YFD2100604), the Outstanding Young Teachers of Blue Project in Jiangsu Province, Key R&D Project of Jiangsu Province (BE2022363), Jiangsu Agriculture Science and Technology Innovation Fund (CX(22)3069), Postgraduate Research & Practice Innovation Program of Jiangsu Province (SJCX21\_3383), the Open Fund of Key Laboratory of Modern Agricultural Equipment and Technology of Ministry of Education (MAET202117) and the Youth Project of Faculty of Agricultural Equipment of Jiangsu University (NZXB20210205).

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** The data used to support the findings of this study can be made available by the corresponding author upon request.

**Conflicts of Interest:** The authors declare no conflict of interest.
