Artificial Intelligence Decision Support System Based on Artificial Neural Networks to Predict the Commercialization Time by the Evolution of Peach Quality

Climacteric fruit such as peaches are stored in cold chambers after harvest and usually are maintained  there until  the desired ripening  is reached  to direct  these  fruit  to market. Producers, food industries and or traders have difficulties in defining the period when fruit are at the highest level of quality desired by consumers in terms of the physical‐chemical parameters (hardness –H–, soluble solids content –SSC–, and acidity –Ac–). The evolution of peach quality  in terms of these parameters depends directly on storage temperature –T– and relative humidity –RH–, as well on the storage duration –t–. This paper describes an Artificial Intelligence (AI) Decision Support Sys‐ tem (DSS) designed to predict the evolution of the quality of peaches, namely the storage time re‐ quired before commercialization as well as the late commercialization time. The peaches quality is stated in terms of the values of SSC, H and Ac that consumers most like for the storage T and RH. An Artificial neuronal network (ANN) is proposed to provide this prediction. The training and val‐ idation of  the ANN were conducted with experimental data acquired  in  three different  farmers’ cold storage facilities. A user interface was developed to provide an expedited and simple predic‐ tion of the marketable time of peaches, considering the storage temperature, relative humidity, and initial physical and chemical parameters. This AI DSS may help the vegetable sector (logistics and retailers), especially smaller neighborhood grocery stores, define the marketable period of fruit. It will contribute with advantages and benefits for all parties—producers, traders, retailers, and con‐ sumers—by being able to provide fruit at the highest quality and reducing waste in the process. In this sense, the ANN DSS proposed in this study contributes to new AI‐based solutions for smart


Introduction
The number of people worldwide has been increasing and the demand for fruit and vegetables that promote health has increased steadily. The consumption of fruit, part of a healthy lifestyle, contributes to regulating nutrients, such as vitamins, minerals, dietary fibers and, also phenolic compounds that, despite not being nutrients, are essential substances for health.
The peach is a popular fruit for its softness, sweet aroma, juiciness, and high nutrients. According to [1], 25.737 t (tons) in 1.527 kha (kilo-hectares) of peaches and nectarines were produced, with Asia representing 71.8%, Europe 16.5%, Americas 7.3%, Africa 4.1%, and Oceania 0.3%. Table 1 shows the top 10 peach and nectarine producing countries in 2019 and the statistical data for Portugal. The peach is a climacteric fruit and is very perishable because firmness decays rapidly at room temperature, resulting in a short storage life period [2].
The quality of perishable foods (fruit, vegetables, and others) is a dynamic variable. It varies with time and with extrinsic and intrinsic parameters at different velocity. The quality of these products results from the combination of sensorial parameters such as color, texture, flavor, nutritional value, and safety [3,4]. Fruit quality declines over time, and physiological, physical, microbial, and chemical processes are responsible for its maturation and consequently for its loss. Quality has different implications at different stages of the value chain. At the production level, the qualities related to crop yields, such as weight and resistance to pests and diseases, contribute to the product's value. During distribution, fruit quality is related to visual properties such as color and size, as well as to the preservability and resistance along the marketing chain required to reduce the losses. Finally, at the consumer level, at an initial stage again the visual properties, such as color and size are evaluated, as well as the absence of defects. However, there are other characteristics, such as hardness, texture, and flavor that will determine demand [3]. Thus, the fruit quality is qualified through some parameters. The physical and chemical parameters most used to characterize the quality of the fruit are color, size (weight and diameter), hardness (H), soluble solids content (SSC), and acidity (Ac) [3][4][5]. The details of each of these parameters are provided below:  Color: The first indicator of fruit ripeness used by producers is its color. This parameter is determined by the naked eye, by the presence of pigments in the epicarp, which may vary between yellow, red, or spots. The color is strongly influenced by climatic conditions [3][4][5][6].  Size (weight): Fruit continues its respiration process after harvest, which results in weight loss [6]. This condition represents a monetary loss along the commercial chain. Peach weight depends on cultivar and agricultural activities. Most peaches' weight will vary between 500 and 600 grams [3][4][5].  Hardness (H): The most important parameter in assessing the quality of the peach is the hardness (or firmness), as it helps determine harvest date. Hardness is related to the strength of the pulp. When the fruit has a low ripeness, that is, a high resistance to manipulation and low organoleptic characteristics, it has a high hardness. Low hardness is determined when the fruit has an advanced stage of ripeness.
 Soluble Solids Content (SSC): This parameter is one of the most influential factors for the consumer because it is related to the sugar content. The soluble solids content is given by the edaphoclimatic conditions associated with the production location. The sugar content increases throughout the maturation of the fruit. This parameter is given as a percentage (%) or Degrees Brix (°Bx) (sugar content of an aqueous solution) [3][4][5].  Acidity (Ac): In addition to SSC, acidity is also one of the most influential parameters for the consumer. Acidity is determined based on a titration and is expressed in grams of malic acid per liter of juice. Acidity decreases throughout the maturation process. A high acidity has values between 7 and 9 (malic ac. g/L) and low acidity cultivars have 3 to 5 (malic ac. g/L) [3][4][5]. When fruit acidity is low, farmers can harvest the fruit earlier because consumer acceptance is not affected.
It is noteworthy that there are other parameters that can be evaluated in addition to these presented to assess fruit quality more precisely. Nevertheless, the above parameters are widely used to describe fruit quality. The devices used to measure the different parameters are, for example, scales (weight), calibrators (caliber), penetrometers (hardness), and refractometers (SSC). Other methods can be used to measure some of these parameters (H, SSC, and Ac): near and visible infrared spectroscopy [7,8], electronic nose [9,10], and analytical methods (physical and chemical). These methods are applied not only to peaches, but also to pears, pineapples, apples, tangerines, oranges, etc. Among all the methods described, spectroscopy has several attractive features, including fast analytical speed, ease of operation, and non-destructive measurements.
In the specific case of the peach, the values of the physical and chemical parameters that are considered suitable for consumption within the consumers' perception of quality are shown in Table 2 [3][4][5]. Table 2. Ideal values range of physical and chemical parameters of perceived quality of peaches.

Parameters
Ideal Value Hardness: H (kg/0.5cm 2 ) 2.3 to 6.1 Soluble Solids Content: SSC (Bx) 10 to 12 Acidity: Ac (malic ac. g/L) 3 to 5 Peach commercial life can be extended by harvesting fruit with higher hardness and using cold storage to delay ripening and maintain fruit quality. Thus, there is a need to preserve and store the fruit under controlled and/or modified conditions, extending its shelf life and preserving its organoleptic characteristics [3][4][5][6].
Liu et al. [11] shows that storing peaches in a refrigerated chamber presents better results, that is, their properties are less degraded by time, temperature, and humidity, which will affect the flavor. The temperature remains a critical factor for fruit transport. Some studies show that the mechanical damage (vibration) to fruit can be influenced by the temperature at which the damage occurs and the material by which they are protected [12]. The ideal storage temperature for peaches is between 0 C and 2.2 C and 85% to 95% humidity [2][3][4][5]13].
However, both high hardness and cold storage, may compromise selling quality. The former because, if peaches are sold with high hardness, they may be unsuitable for market if the perceived quality for consumers is inadequate. The latter because storage in a lowtemperature storage range (2.2 C to 7.6 C) may lead to a decrease in quality through dry texture, floury pulp, and flavor loss (known as chilling injury) [14][15][16][17][18][19][20][21].
To overcome these difficulties, several studies have been carried out to predict the evolution of some parameters, which are mainly influenced by duration (time), temperature, and relative humidity of the conservation environment. Some examples have used artificial intelligence techniques based on the development of artificial neuronal networks to study and classify plum varieties using image analysis and deep learning techniques [22], to detect damage and diseases in melons with an intelligent image alert system [23], and to detect, recognize, and classify fruit [24]. The current study aims to extend this type of research, through the development of an artificial intelligence (AI) decision support system (DSS) that predicts the number of days to reach the peach's optimal quality as well as the number of days afterwards until it deteriorates. This prediction allows consumers to buy and eat peaches at their highest quality and sellers to define their sales strategies. This DSS uses the values range of hardness, soluble solids content, and acidity for the highest perceived quality by consumers as thresholds. Knowing how these parameters change during the conservation time at some temperature and relative humidity, the initial parameters (post-harvest) are used to predict the time frame for optimum quality.
The remainder of the paper is organized as follows. Section 2 presents the materials and methods. Section 3 presents the results and their analysis and discussion. Finally, conclusions and future work are given in Section 4.

Materials and Methods
The experimental study described in [5] allows us to determine the influence of conservation environment conditions (air temperature and relative humidity) on the quality of peaches of cultivar "Royal Time" through the evolution of physical-chemical parameters such as hardness, soluble solids content, and acidity. The experimental tests considered three refrigeration conditions using farmer's cold chambers (farmer G, farmer L, and farmer V), of cultivar "Royal Time". The fruit was picked from the container on the morning of harvest. Fruits were then selected based on size and color to obtain the most homogeneous sample without imperfections. Fruits were divided into 18 boxes of 24 fruit each, each box corresponding to a sampling time. Each fruit was marked individually, and weight and color were evaluated. After this characterization, fruit was transported to farmers' cold chambers with a datalogger inside the lowest box to monitor air temperature and humidity. Figure 1 shows the evolution of air temperature and relative humidity for each cold chamber for the time of the experimental study. Completely different values of storage temperature were measured in the three cold chambers. The cold chamber of farmer G experienced high variation during the 42 test days. The average values of relative humidity were similar and higher than 75%. Six sampling times (t7, t14. t21, t28, t35 and t42) plus reference (t0) were used during the 42 days of the study. The index corresponds to the day (weekly frequency) that one sample with 24 fruit was removed from each of the producers' cold chamber. Half of the fruit was analyzed in that day and the remainder were analyzed after 2 days in the domestic environment. The fruit was analyzed for (a) weight; (b) color in 2 points/fruit (using colorimeter Minolta model CR-and CIE system L* a* b*; (c) hardness (using a PENEFEL device with 8 mm diameter point); (d) total soluble solids (TSS) expressed as Bx, using digital Atago refractometer using some drops of juice extracted from the holes of PENEFEL use; (e) titratable acidity, expressed as g malic ac./L, obtained by potentiometric titration to pH 8.3 by a 0.1 M NaOH solution. The parameters of hardness, soluble solid content, and acidity measured weekly are shown in Figure 2. A second order trend was used for the remainder values between measurements. These experimental results increase the knowledge regarding the evolution of peach quality over time and at chilling temperature conditions. The study helps to identify the recommended time to commercialize the fruit without losing the main organoleptic characteristics. However, these results were static and did not allow us to predict the evolution of the quality, as perceived by consumers, depending on the refrigeration temperature and time of storage. Thus, these experimental values are the input values for the artificial neural network (ANN) developed to predict the time frame with highest consumer perceived quality. ANNs are algorithms implemented in a computer program or electronic model based on the functioning of the human brain [25,26]. They are composed by interconnected neurons or nodes so that the output of one neuron can be used as an input for others. The function of the network is determined by the connection between neurons, usually organized in groups called layers (input, hidden, and output). Figure 3 shows the typical architecture of an ANN, where the input layer represents the data provided to the network, whereas the output layer shows the network response for a given input. The hidden layer is usually made up of many interconnected neurons to merge a result. Matlab was used to develop, train, validate, and test the ANN. It developed a feedforward backpropagation ANN with one hidden layer with 10 neurons, with hyperbolic tangent sigmoid transfer function ʺtansigʺ. The input and output layers have three neurons each, with linear transfer function ʺpurelinʺ. Figure 4 shows the structure of the artificial neuronal network created with three inputs (time, temperature, and humidity) and three outputs (H, SSC, Ac). The Levenberg-Marquardt backpropagation algorithm [27] was used as the network training function that updates weight and bias values. The iterative procedure was set to stop at a minimum performance gradient of 1  10 −6 . Additionally, another stop criterion was set as the maximum number of training epochs (iterations) (to 1000) if the performance gradient was not reached.
Subsequently, the user interface for the AI decision support system shown in Figure  5 was developed to allow the user to enter the input data of the conservation conditions related to air temperature and relative humidity of the chamber where the fruit is stored (A) as well as the values of the initial physical-chemical parameters of the peaches (B). After pressing the "calculate" button (C), the output data of the decision support system predicted are the time (days) of pre (D) and post (E) sales and final parameters (SSC, H, Ac) and the validation status (OK/NOK if the parameters are in accordance with the ideal). Figure 5 shows the user interface of the ANN decision support system.

Results, Analysis, and Discussion
Considering the 42 days of experimental tests, some samples were selected for training, testing, and validation of the artificial neuronal network. As the network tends to approximate a result based on the samples, it has an approximation error. For this, the method of mean square error (MSE) and linear regression (R) were used. Table 3 shows the numbers of the selected samples, mean quadratic error, and the respective linear regression value. Figure 6 shows as example the graph of the parameters measured in the experimental tests of samples stored in the cold chamber of farmer G as well as the results estimated through the neural network. The artificial neuronal network showed excellent results, both in training and in data validation. In the literature there is no restriction on the number of neurons: However, a larger number of neurons may or may not mean better results, opting for the variation of the same until finding good results (less error).
As determined in experimental tests, temperature, relative humidity, and storage time affected the physical and chemical parameters, with the soluble solids content and acidity being the most affected. The ANN decision support system was tested on a sample in which the initial parameters were: hardness: H = 5.07 (kg/0.5cm 2 ); acidity: Ac = 8.16 (gmalic acid/L); and soluble solids content: SSC = 10.63 (Bx). The average conservation parameters for each farmer are shown in Table 4.  Figure 7 shows the prediction results on the user interface of the decision support system for the storage conditions provided by the cold chamber of farmer L. Results previously presented in Figure 6 are the evolution of the parameters as a function of time. The decision support system predicts that peaches with the above initial physicalchemical parameters stored at a refrigeration temperature of 1.95 °C and 93.74% of relative humidity must remain in preservation for 23 days to reach a quality degree (in terms of hardness, acidity, and soluble solids content) perceived by consumers as high quality. After reaching that state, traders or retailers can market the peaches for only 5 days. After that time, the evolution of the physical and chemical parameters reduces the quality of the fruit, primarily because of low hardness. At that hardness, the fruit is too soft and will be easily injured during transport or manipulation. Therefore, the harvest must be performed at a proper time to sustain the organoleptic characteristics of the fruit and thus ensure the preservation of the fruit in order to provide a good quality in the future.
Cold storage is the most used method to extend the useful life of fruit and vegetables. There is a need to control the conservation conditions to avoid internal damage as very low temperatures can negatively influence the fruit quality. The refrigeration conditions corresponding to the cold chambers of the three farmers are quite different and, consequently, one of the major difficulties of this study was to find linearity between the three case studies. The predictive system performed a daily analysis instead of an analysis of 42 days simultaneously to overcome this condition. Thus, the DSS provided the commercial time of peaches at their highest quality, as perceived by consumers in terms of physicalchemical characteristics, for different environmental storage conditions.
Hardness is the parameter that most reflects the different predicted periods of consumption at highest quality. From a certain temperature, particularly 9 °C, hardness, soluble solids content, and acidity are parameters that will not have so much influence on determining the optimal period of consumption of peaches as the conservation temperature.
It is important to highlight that the results of this AI DSS are directly related to the environmental conditions, namely air temperature and relative humidity, that must be measured in real-time to be able to predict the variation of the physical-chemical parameters and consequently determine the upper limits of these values that are considered by consumers to be at the highest quality. To measure these parameters in a smart-cities context, wireless sensor networks must be used. These sensor networks will measure and transmit environmental conditions data to a central node. In this sense, this AI DSS can be applied in real-time, running in the central hub where all data converge, so it can be easily adopted.
However, coverage, connectivity, latency, and lifespan of the networks need to be deployed in a smart grid system. Study [28] proposed an AI-based quorum system that reduced the network latency due to an increase in time slots and reduced the energy consumption by weighted load balancing, improving the lifespan of sensor networks. Additionally, the AI DSS proposed in this paper can be extended to predict not only the quality evolution, but also health indicators for those who eat these fruit. Study [29] proposed an AI ANN to identify malnutrition and predict the body mass index from facial images using real-time image processing and machine learning.
In terms of AI-based solutions for smart cities, and particularly, for the cities' small retail and logistics, the DSS proposed can help avoid food loss and waste, ensuring that fruit is sold at its highest overall quality. The storage time required before commercialization as well as the late commercialization time is predicted in terms of the quality given by the physical-chemical parameters limits stated by consumers. To achieve these results, peaches should be harvested with physical-chemical parameter values very close to the upper limits of the values corresponding to the highest quality perceived by consumers, and the environmental conservation conditions should be near to those of farmer L. As future research work, this AI DSS can be extended to other climacteric fruit. However, it requires experimental research to measure the evolution of the physical-chemical parameters for the different environmental conservation conditions that will be used to train the ANN. Additionally, the AI DSS must be trained with isolated events that may affect the quality of the fruit, such as environmental conservation conditions outside those that were tested, high variation of these conditions due to continuous cold chambers door opening that promotes heat and mass (moisture) transfer, plagues and pests' occurrence, among others. Thus, the machine learning as an ANN used to develop this AI DSS that can be continuously trained. In that sense, it will be able to provide increasingly accurate predictions of the quality evolution supporting precise decision-making.

Conclusions
An artificial intelligence decision support system based on artificial neuronal networks was designed to predict the time to commercialization depending on the variation of physical chemical parameters and storage conditions (air temperature and relative humidity). In the scope of smart cities, this ANN DSS intends to provide consumers with peaches at their highest quality and simultaneously help retail and logistics, mainly, the smallest ones (e.g., neighborhood groceries) to sell the fruit on time, avoiding food loss and waste. The training and validation of the ANN was conducted with experimental data acquired in three different farmers' cold chambers. A user interface was developed to provide an expedited and simple prediction of the marketable time of peaches.
The variations on temperature and relative humidity, as well as fluctuations in the values of physical and chemical parameters (occurred within the ranges considered as highest quality), correspond to different time intervals in which the fruit is predicted to be optimal for consumption. The AI predictive system provides a solution to this problem. With its implementation, it is possible to provide information to the farmer that helps the decision-making, such as the pre-cooling temperature and the relative humidity of the air that should be in the cold chamber where fruit is stored. The AI predictive system also provides information about the required values of hardness, the soluble solids content, and the acidity of the fruit for the start of harvest. The final objective is to achieve the largest possible consumption time at the highest quality perceived by consumers. Thus, choosing the right cold chamber is important for the farmer, as well as measuring and analyzing the physical and chemical parameters before and after harvesting. The application of this AI decision support system based in an artificial neural network, which can be continuously fed with new data, can provide valuable information for decision-making. That allows increasing the competitiveness by selling peaches at the highest quality, with positive impacts such as consumer satisfaction, prevention of losses and waste, and reduction of the energy costs related to cold chambers operation. All of these impacts have a reflection on social, economic, and environmental sustainability of the fruit and vegetables sector, specifically for producers, traders, retailers, and consumers that receive the fruit at its highest quality. Future work is required to develop a reliable operational system. Additional tests must be conducted, considering other cultivars and other environmental storage conditions, in order to generalize the ANN results. The AI DSS needs to be tested in an urban community sample, performing sensory analysis to evaluate if the commercialization time predicted accurately predicts the fruit at its highest quality for the environmental conditions as it is stored. Moreover, the DSS may be extended to analyze other fruit. For that, new data measurements, sensory analysis, and experimental tests to determine the physical and chemical parameters are required. With all this information it will be possible to train and validate the ANN using new datasets. Funding: This study is within the activities of project PrunusPós-Otimização de processos de armazenamento, conservação em frio, embalamento ativo e/ou inteligente, e rastreabilidade da qualidade alimentar no póscolheita de produtos frutícolas (Optimization of processes of storage, cold conservation, active and/or intelligent packaging, and traceability of food quality in the postharvest of fruit products), Operation n. PDR2020-101-031695 (Partner), Consortium n. 87, Initiative n. 175 promoted by PDR2020 and co-financed by FEADER under the Portugal 2020 initiative