Introduction

Despite the high corn grain production, it is verified that there are great losses in the post-harvest stages due to the precarious transport, facilities, and handling of the grain receiving, drying, and storage operations. During grain transportation, it is estimated that there are losses of 0.25% per ton of grain transported1. Losses in road transport occur due to poor roads, vehicle speed, deteriorated truck bodies, among others2. Furthermore, once the grains are harvested, they remain biologically active and depending on the conditions in which they are found can trigger several metabolic reactions causing both quantitative and qualitative losses3.

Among the factors influencing grain quality at postharvest are high grain moisture content, temperature, and intergranular relative humidity4,5. Elevation of these parameters can increase grain respiration and metabolic activity, causing deteriorations in the physicochemical quality of the grain and dry matter consumption, insect proliferation, and fungal infection in the grain mass6,7.

Taking into consideration that often the grain transport is carried out over long distances, and that the grain mass transported may have moisture content above the optimal conditions for storage, the risks of moisture and heat transfer during transport are high, causing possible grain mass heating8,9,10.

Thus, to avoid these problems in transport and possible potential factors of alterations in the following post-harvest processes, it is important to perform real-time monitoring of the temperature and relative humidity of the intergranular air in order to estimate the equilibrium moisture content, as well as to monitor the levels of carbon dioxide and the respiratory intensity of the grain mass over the transport11,12. From this information, it is possible to detect early and predict changes in grain quality13.

Several studies on quantitative and qualitative postharvest losses have been carried out7,10. However, there are few studies addressing the qualitative losses due to metabolic activity in the transport process as a possible influencer for the triggering and intensification of losses across the subsequent post-harvest operations.

Thus, real-time monitoring of corn grain mass during transportation and the employment of predictive algorithms could help in the early detection and prediction of possible quantitative and qualitative losses of corn grains. Thus, this study aimed to validate a non-destructive technological system for real-time monitoring of temperature, relative humidity, and carbon dioxide in corn grain mass during transportation and storage as a function of different initial moisture content, in order to detect early losses of dry matter using Machine Learning algorithms and predict possible changes in the physical quality of the grains.

Material and methods

Hardware and software design

For monitoring the grain mass during road transport, a portable device has been developed14. The device consists of an Arduino Mega 2560 microcontroller (model Mega 2560, Arduino LLC, Italy) as the control core. The system hardware includes three digital sensors to detect air temperature and relative humidity (model DHT22, Aosong Electronics, Guangzhou, China), a non-destructive infrared sensor to detect CO2 concentration (model MHZ-14, Winsen, China), real-time clock modules (model DS3231, flip-flop, China), and a micro-SD card (model Greatzt, import, China). The block diagram of the control system is shown in Fig. 1A. Output data from the digital sensor, infrared sensor and modules are connected to the I/O communication terminals of the microcontroller which are responsible for physical communication, component integration, and data calculation. The electrical connection diagram of each component via jumper cables is shown in Fig. 1B.

Figure 1
figure 1

Block diagram of the monitoring operating system (A). Connection of the components to the microcontroller using jumper cables (B). Structural part of the probe for application in the grain mass (C), where: 1- polyvinyl chloride tube, 2—holes for air entry, 3—fixing elements, 4—DHT22 sensors, 5—MH-Z14 sensor, 6—threaded bar and support cabling, 7—equipment hardware, 8—internal view of the probe, 9—probe for application in the grain mass. Flowchart of the programming used for the operation of the monitoring system (D).

Temperature and relative humidity sensors (model DHT22, Aosong Electronics, Guangzhou, China) were attached to three ends of a threaded bar and the CO2 sensor (model MHZ-14, Winsen, China) was attached to the central part. The real-time clock module (model DS3231, flip-flop, China) and the micro-SD card (model Greatzt, Import, China) were packed in a plastic box (Patola Electroplastics Ind. Com. Ltda, Brazil). Figure 1C shows the structure of the equipment with the sensors arranged along the threaded bar and protected by a polyvinyl chloride probe. The equipment has its own power supply with three series-connected batteries.

The software used on the Arduino board was programmed using the C++ language, with most of the libraries provided by the platform (S1). Arduino IDE (Integrated Development Environment) was used to develop the embedded firmware for the Atmega 2560 microcontrollers. The flowchart shown in Fig. 1D refers to the operation program of the equipment used to monitor the grain mass during road transport15.

To ensure the same condition for the evaluations, the temperature and relative humidity sensors (model DHT22, Aosong Electronics, Guangzhou, China) were heated to a temperature of 24 °C. With an initial temperature of 24 °C, the sensors operated for 40 min and their measurement was recorded every minute. Using the infrared sensor (model MHZ-14, Winsen, China), the initial calibration was performed on the Arduino itself and the CO2 concentration was recorded16.

Setting the probe hole diameter

To define the hole diameter, the temperature, relative humidity and carbon dioxide sensors were placed in probes with different hole diameters (7.5, 7.0 and 6.5 mm), drilling heights (470, 235 and 117.5 mm) and grain moisture content (12 and 16%). The holes were drilled to allow air to enter and facilitate the sensors’ response. For setting the best fitting probe diameter and drilling height, one of the requirements was that they meet the two moisture content analyzed.

After defining the hole diameter and drilling height that best suited the corn kernels, at different moisture content, the equipment was validated in the laboratory. For this purpose, temperature and relative humidity sensors were placed in the probe at the higher, center, and lower positions, while the carbon dioxide sensor was placed in the center position.

To perform the monitoring of the above-mentioned variables in the grain mass, the probe with the sensors was placed into a box built with plywood material (dimensions 0.2 × 0.2 × 1.8 m), simulating the grain load profile in a transportation system. Sensor readings were taken until the values of temperature, relative humidity and carbon dioxide concentration were stabilized.

Probe development and construction

Probe was constructed using a polyvinyl chloride tube with 50 mm diameter and 1500 mm height, with three drilled regions (higher, center and lower), with holes with 6.5 mm diameter and 235 mm drilling height. Setting the diameter of the holes and the height of the probe drilling were given based on the shortest response time that the sensors had for the measured variables (temperature, relative humidity, and CO2) in the intergranular air. Figure 1C shows the distribution of the holes at the higher, center and lower of the probe.

A metal grain sampling tube was developed to couple to the probe (Fig. 2A). The tube consisted of two overlapping tubes, with a tip at the lower position and a swivel arm at the higher position. This enabled the probe to be protected and increased the accuracy of the intergranular grain reading. Furthermore, it allowed for sampling in the different layers of the grain lot profile. The tube contained openings/cells at the higher, center and lower along its length, as shown in Fig. 2B.

Figure 2
figure 2

Grain sampling tube (A). Representation of the grain mass profile (higher, center and lower positions) and the monitoring system (B). Representation of the monitoring system and grain transportation (C).

Real-time monitoring of grain mass quality

The metal sampler and the probe with the sensors were inside the grain mass. The variables temperature, relative humidity, and carbon dioxide in the intergranular grain mass were monitored in real-time at intervals of 1.87 s per response for 24 h, simulating the transport conditions (Figs. 2B,C). Filling of each load was performed using grains with 12 and 14% moisture content. Samples were collected at 0, 120, 480, and 1440 min of transport at the three positions (higher, center and lower) of the load. The variation in the equilibrium moisture content was calculated using a modified version of Henderson’s equation (Eq. 1)17.

$$ EMC = \left\{ {{ln(1} - a_{w} {)/}\left[ { - a{(T} + b{)}} \right]} \right\}^{1/c} $$
(1)

where EMC—equilibrium moisture content (°C), aw—water activity (decimal), T—air temperature (°C), a, b, c—corn parameters (a = 8.6541 × 10–5, b = 49.810, c = 1.8634).

To determine the loss of dry matter (LDM) over time, an estimation model was used regarding the CO2 concentration (Eq. 2)18.

$$ LDM = {100(CO}_{{2}} - {O}_{{2}} {)}\left( {\frac{{\varepsilon \rho {U}}}{{{2}\rho ({1} - {U)RT}}}} \right) $$
(2)

where LDM—loss of dry matter (%), O2—oxygen concentration (21%), CO2—carbon dioxide concentration measured in the grain mass (%), Ɛ – intergranular porosity (%), P—local atmospheric pressure (96 kPa), Wg—molar mass of glucose (180 kg kmol−1), ρ—apparent specific mass of grains (kg m−3), U—grain moisture content (decimal), R—constante dos gases perfeitos (8.314 kJ kmol−1 K−1), T—temperatura intergranular (K).

Corn quality analysis

Moisture content was determined by drying in a forced air circulation oven at a temperature of 105 ± 1 °C for 24 h in four replicates19. The apparent specific mass was obtained by weighing a mass of grains placed in a known volume19. Four replicates were performed for each treatment. Electrical conductivity was determined according to ISTA20 methodology. Four replicates with 50 grains for each treatment were counted and weighed. Samples were placed in plastic cups containing 75 mL of distilled water and placed in a temperature-controlled chamber at 25 °C for 24 h. The electrical conductivity was obtained by conductivity meter and the result was expressed in µS cm−1 g−1. Germination test was performed in four experimental units with four subsamples of 50 grains for each treatment. Grains were placed on germitest paper, which was soaked in distilled water. The amount of distilled water was 2.5 times the dry substrate mass. Paper rolls were stored in a Mangelsdorf germinator at 25 °C. Counting was performed on the seventh day after sowing and the results were expressed in percentage19.

Multivariate statistical analysis

Firstly, a principal component analysis (PCA) was performed along with k-means clustering, which clusters treatments whose centroids are closest until there is no significant variation in the minimum distance of each observation to each of the centroids. Next, to verify the interrelationship between variables and treatments, a canonical variable analysis (CA) was performed. This technique is similar to PCA but allows the residual variation between replicates of the same treatment to be taken into account. Afterward, Pearson's correlation coefficients were estimated to verify the association between variables in processing conditions. A correlation network was constructed to graphically express the results. In this procedure, green lines link variables with positive correlation while red lines link negatively correlated variables. The thickness of the line is proportional to the correlation magnitude. These analyses were performed using the ggfortify package from the R software and followed the recommended procedures by Naldi et al.21 (Table 1).

Table 1 Multivariate statistics as a function of initial grain water content, position/layer and grain monitoring time.

Machine learning models

Machine learning (ML) models tested were: artificial neural network (ANN), the decision tree algorithms M5P and REPTree, random forest (RF), and support vector machine (SVM). A multiple linear regression (LR) was used as the control model. The ANN tested consists of a multilayer perceptron with a single hidden layer formed by a number of neurons equal to the number of attributes plus the number of classes, all divided by 222.

M5P model is a reconstruction of Quinlan’s M5 algorithm, which is based on the conventional decision tree with the addition of a linear regression function to the leaf nodes23. M5P is an adaptation of the C4.5 classifier that can be used in regression problems with an additional pruning step based on an error reduction strategy. REPTree model uses decision tree logic and creates several trees at different repetitions. It then selects the best tree using information gain and performs error reduction pruning as the splitting criterion24. RF model is able to produce multiple prediction trees for the same dataset and uses a voting scheme among all these learned trees to predict new values25.

The prediction of the variables apparent specific mass (ASM), electrical conductivity (EC), germination (GERM), and loss of dry matter (LDM) of corn was performed by LR and ML models in a tenfold stratified randomized cross-validation with 10 repetitions (100 runs for each model). The input variables were: grain moisture content, monitoring time, intergranular temperature and relative humidity, equilibrium moisture content, and carbon dioxide concentration. The statistics used to verify the quality of the fit were Pearson's correlation coefficient (r) between the observed values and those predicted by each model and the mean absolute error (MAE) of the predicted values in relation to the observed ones. Machine learning analyses were performed on Weka 3.9.4 software using the default configuration for all models tested26. All analyses were performed on an Intel® CoreTM i5 CPU with 6 GB of RAM.

After obtaining the r and MAE statistics, analysis of variance was performed considering an entirely randomized design with 10 repetitions (folds). Means were grouped by the Scott–Knott test at 5% probability. Bar graphs were constructed for each variable (r and MAE) considering the models and inputs tested. These analyses were performed on R software27 using the packages ExpDes.pt and ggplot2.

Ethical statements

Te experimental research and feld studies on plants and plant material were comply with local and national regulations. Te study complied with institutional, national, and international guidelines and legislation. Te authors complied with the IUCN Policy Statement on Research Involving Species at Risk of Extinction and the Convention on the Trade in Endangered Species of Wild Fauna and Flora for the collection of plant or seed specimens. Te authors declare that no wild plants were collected and/or used in this scientifc work.

Results and discussion

Validation of the corn grain mass monitoring system

Figures 3A–F show the curves of temperature, relative humidity, and intergranular CO2 diffusion using real-time monitoring by sensors as a function of probe diameter and drilling height for corn grains with initial moisture contents of 12, 16, and 25%. (w.b.). The behavior of the curves was similar within each monitored variable (Tables 2, 3, 4). After calibration of the sensors at time zero, there was a reduction in temperature and an increase in relative humidity and intergranular CO2, with a tendency for the curves to stabilize over time. These findings demonstrate the consistency of the monitored variables, as well as the accuracy and functionality of the monitoring system28.

Figure 3
figure 3

Temperature and relative humidity of corn grain mass with 12% (A), 16% (B), 25% (C) moisture contents in tube with holes of 6.5, 7.0 and 7.5 mm and drilling heights of 117.5, 235 and 470 mm. CO2 concentration of corn grain mass with 12% (D), 16% (E), 25% (F) moisture contents in tube with holes of 6.5, 7.0 and 7.5 mm and drilling heights of 117.5, 235 and 470 mm.

Table 2 Polynomial regression equations for air temperature (°C), air relative humidity (%) and CO2 (ppm) of corn grain mass at 12% moisture content in tubes with different hole diameters and heights drilling.
Table 3 Polynomial regression equations for air temperature (°C), air relative humidity (%) and CO2 (ppm) of corn grain mass at 16% moisture content in tubes with different hole diameters and heights drilling.
Table 4 Polynomial regression equations for air temperature (°C), air relative humidity (%) and CO2 (ppm) of corn grain mass at 25% moisture content in tubes with different hole diameters and heights drilling.

Among the curves, a variation of the monitored variables in function of the initial moisture content of the grains, diameter and drilling height of the probe, and monitoring time was observed. There was a difference of around 4 °C between the temperature curves, 5% in relative humidity, and 500 ppm of CO2 from the stabilization of the curves. The largest variations of temperature, relative humidity, and CO2 occurred in the grain mass with 16 and 25% moisture content throughout the monitoring time. Intergranular temperature and relative humidity sensors took about 10 min to stabilize, while the CO2 sensor needed about 5 min to reach an equilibrium in the diffusion process. Zhang et al.5 evaluated the CO2 concentration at various points in the mass of stored grain. The authors found that CO2 concentration was sensitively detected at a horizontal distance of 2 m from the hot spot, and 1 m from the hot spot in the vertical direction. According to the authors, the method of detecting CO2 concentration at multiple fixed points helped to more accurately quantify grain deterioration.

Huang et al.10 evaluated the effective diffusion coefficient of carbon dioxide (CO2) through bulk corn grain mass at temperatures of 10, 20, and 30 °C and grain moisture contents of 14.0, 18.8, and 22.2% (w.b). The authors found that the respiration rate of corn increased with increasing grain temperature and moisture content. As the respiration rate increased, it had a greater effect on the diffusion pattern when measuring the effective CO2 diffusion coefficient. The effective CO2 diffusion coefficients ranged from 3.10 × 10–6 to 3.93 × 10–6 m2 s−1.

Among the hole diameters and drilling heights of the probe, we found that 6.5 mm and 235 mm, respectively, achieved the best fit and stabilization of the temperature, relative humidity, and CO2 monitoring curves over time (Tables 2, 3, 4). In general, the R2 values were low, which is justified by the scale of application, which was close to a real condition in grain volume.

Monitoring corn grain mass during transport

After the equipment validation, it was applied to a real scale analysis, where a grain transportation system was simulated. In this experiment, the variables temperature, relative humidity, and CO2 were monitored to determine the indirect physical quality of the grains with moisture contents of 12 and 16% in three vertical positions of the grain mass profile (higher, center and lower) over 0, 2, 8, and 24 h.

By Fig. 4A it can be seen that the grain mass with moisture contents at 12% obtained an increase in temperature in the lower and center layer in the first 8 h of monitoring, and subsequently a decrease in temperature until 24 h of monitoring. Differently occurred for the higher position of the grain layer, when a decrease in temperature was observed in the first hours (until 10 h) and an increase in temperature until 24 h of monitoring. These results influenced the intergranular relative humidity (Fig. 4B), which was constant from the beginning to the end of the monitoring time in the lower and center positions but showed an oscillation with a slight reduction after 10 h of monitoring.

Figure 4
figure 4

Monitoring temperature (A), relative humidity (B), equilibrium moisture content (C), carbon dioxide (D) of the intergranular air in the corn grain mass at 12% moisture content (w.b.) over time.

Temperature and relative humidity results indicated a constant condition of 14.2 and 13.9% equilibrium moisture content of the grain mass in the lower and center positions, respectively, throughout the monitoring time (Fig. 4C). On the other hand, following the variations observed in Figs. 4A,B, the equilibrium moisture content of the grains in the higher layer increased from 12 to 13% by 10 h of monitoring, subsequently reduced to 10.4% at 12 h, reaching a condition of 11.2% by the end of the monitoring time. Changes observed in the intergranular condition, especially in the higher layer were also influenced by the variation occurring with the temperature and relative humidity of the environment (Fig. 4A,B).

Bakhtavar et al.29 evaluated the water adsorption on wheat, corn, cotton and quinoa grains packed in airtight bags and traditional packaging materials, including paper, polypropylene, jute and cloth bags, in environments with 60, 70, 80 and 90% relative humidity. The authors observed that the moisture contents of the grain increased in the traditional packaging materials with increasing relative humidity. According to the authors, the storage of the grains in hermetic bags reduced the respiration of the mass of grains and the variation of the moisture contents, collaborating to the maintenance of the equilibrium moisture content of the grains in safe storage conditions.

The findings reported by Bakhtavar et al.29 match the results for the lower and center grain layers, which suffered less influence from the external environment. Under these conditions, the average respiration of the grain mass was found to rise to 450 ppm in the first 3.5 h of monitoring (Fig. 4D), then reduced to the initial condition, remaining until the end of the monitoring period. As respiration levels remained low, with a CO2 concentration close to the ambient (420 ppm), there was no dry matter consumption in the grains. In the evaluation of the grain mass with moisture content of 16%, the same behavior of the curves of temperature and relative humidity of the intergranular air in the three layers (higher, center, and lower) was verified, even with variations in the external environment (Figs. 5A,B).

Figure 5
figure 5

Monitoring temperature (A), relative humidity (B), equilibrium moisture content (C), carbon dioxide (D), loss of dry matter (E) of the intergranular air in the corn grain mass at 16% moisture content (w.b.) over time.

In this situation, the high moisture content (16%) had an influence on intergranular air gas exchange higher than the external condition (temperature and relative humidity). We observed that the temperature variation (Fig. 5A) was similar but higher (24.5–26.5 °C) than that observed in Fig. 4A. Meanwhile, the relative humidities in the three layers remained constant from the beginning to the end of the monitoring time (between 80 and 90%), being higher than the outside environment (between 50 and 60%) (Fig. 5B).

The conditions of 16% moisture content caused the grain mass to reach the equilibrium moisture content within the first hours of monitoring, remaining constant until the end of the period, between 19 and 21% in the lower and center layers and close to 24% in the top layer of the grain mass (Fig. 5C). Thus, in the first 2 h of monitoring, there was an intense respiration of the grain mass, reaching the limit of 5000 ppm of CO2 concentration and remaining constant until the final period of monitoring (Fig. 5D).

The high respiration of the grain mass provided a consumption and a loss of dry matter in the grains (Fig. 5E) during the first 2 h of monitoring. A 0.06% loss of dry matter was estimated over 24 h of monitoring, a significant result considering the short evaluation period30. Jian et al.7 evaluated interstitial carbon dioxide and oxygen concentrations in canola, soybean, and wheat seeds stored at different times, moisture contents, and temperatures. According to the authors, the greatest significant differences in CO2 concentrations were seen as a function of storage time and temperatures of 40 °C.

Ubhi and Sadaka31 found different respiration rates of corn grain mass as a function of temperatures of 23, 35 and 45 °C and 12.9, 14.8, 17.0, 18.8 and 20.7% initial moisture contents. The authors verified that the accumulated respiration reached 2.625 g/kg in grains with 18.8% moisture content and 35 °C average temperature after nine days of storage. Ochandio et al.32 reported a respiration rate of soybean seeds in airtight storage at 15, 25 and 35 °C and 13, 15 and 17% moisture contents from 0.130 to 20.272 mg CO2/(kgdms).

Coradi et al.33 evaluated the loss of dry matter of corn stored at 10 °C and 90%, 30 °C and 40% temperature and relative humidity, respectively. The authors found that corn stored at the 10 °C and 90% conditions had fungal contamination, whereas grain stored at 30 °C and 40% had a higher loss of dry matter and physical changes during storage time. Taher et al.12 built a model for predicting losses in soybeans stored in bag silo based on monitoring the CO2 concentration and verified through grain mass respiration losses of 0.07–2.16% of dry matter. Garcia-Cela et al.34 evaluated the respiration of naturally contaminated corn grains under different storage conditions at 0.80–0.99 water activity and 15–35 °C temperature. The highest respiration rate occurred at 0.95 water activity and temperature between 30 and 35 °C. Under these conditions, the authors found a higher loss of dry matter35.

Evaluation of the physical quality of the grains

Electrical conductivity test (Fig. 6A) indicated that the cellular structure of the corn grains was affected along the monitoring time as a function of the initial moisture contents (12 and 16%) and by the evaluation position (higher, center and lower layers) of the grain mass. Among the layers, we observed that the grains positioned in the upper (higher) layer suffered, slightly, the greatest physical changes, in agreement with the results obtained from the monitoring (temperature, relative humidity, and CO2). However, the greatest physical damages in the grains were found at a moisture content of 12%.

Figure 6
figure 6

Evaluation of the cell structure of corn grains by the electrical conductivity test (A) and by the germination percentage (B) of corn grains with 12 and 16% moisture content (w.b.) over time.

The electrical conductivity results reflected on the germination of the grains (Fig. 6B). The percentage of germinated grains was lower in the higher position of the grain layer and mainly for the grains with moisture contents of 12%. The increase in temperature, intergranular relative humidity, and hence, equilibrium moisture content, provided heating and a higher respiratory intensity of the grain mass, mainly for the grains with moisture contents of 16%. However, the increase of the metabolic activity of grains with 16% of moisture content (hydrated) within 24 h of monitoring, simulating a system of grain transport, collaborated to the increase of the percentage of germination when submitted to the test. It is noteworthy that the germination of grains is not desirable during transportation. In this case, the results obtained from germination are indicative of possible physical changes that can influence the final quality of the mass of grains.

Santos et al.18 evaluated the quality and loss of dry matter in corn grains stored at different temperatures. For this purpose, corn grains with initial moisture contents of 14.8 and 17.9% were packed in bags and stored at temperatures of 15, 25, and 35 °C. Over 150 days, at 30-day intervals, the concentrations of oxygen (O2) and carbon dioxide (CO2) were measured, and samples of the grains were taken for determining the moisture content, apparent specific mass, dry matter, germination percentage, and physical classification. In 150 days, the loss of dry matter in corn grains stored with a 14.8% moisture content was approximately 3.5 times lower than that for the product stored with a 17.9% moisture content. Based on the results of germination, a limit of 0.015% of loss of dry matter can be considered acceptable to maintain the integrity of the grains.

In a study carried out by Paraginski et al.36, the authors evaluated the quality of corn grains stored at temperatures of 5, 15, 25 and 35 °C for 12 months. The results of thousand-grain weight, germination, and electrical conductivity indicated that the greatest changes were observed in grains stored at the highest temperatures, mainly between 25 and 35 °C, indicating that the safe storage time of grains under these conditions should be shorter when compared to storage at low temperatures.

Multivariate analysis

The analysis of the first two canonical variables gathered 98.4% of the total variation among treatments for the evaluated variables (Fig. 7A). In this biplot, treatments close to the Figure show high similarity. The vectors (arrows) point to the variables that most influenced the similarity of specific treatments.

Figure 7
figure 7

Analysis of the qualitative canonical variables of corn grains (A). Pearson correlation analysis of the qualitative variables of corn grains (B). Green lines link variables to positive correlation and red lines link negatively correlated variables. The thickness of the line is proportional to the correlation magnitude.

When analyzing the quadrants, we verified the formation of three distinct groups, with clear patterns of associations with most of the variables evaluated. The first group allocated the treatments 8, 10, 11, 14, 15, 16, 18, 19, 20, 22, 23, and 24 that stood out in relation to the LDM and CO2 variables. The second group gathered the treatments 1, 2, 4, 5, 6, 7, 9, 12 with less variation in the variables T and EC. The third group contained treatments 13, 17 and 21, which did not stand out for any variable in a specific way. The variables RH, EMC and G did not stand out for any of the treatments, specifically.

From the clustering results, we verified that treatments with 16% moisture content at the top position of the grain layers and from the monitoring time of 2 h had the greatest influence on the variables, especially for carbon dioxide (CO2) and loss of dry matter (LDM). Barreto et al.8 developed a mathematical model to analyze grain quality by CO2 concentration using initial grain contents of 12, 14, and 16% (w.b.) and temperatures of 25 °C and 40 °C. For the 12% and 25 °C conditions, the CO2 concentration increased to 4%. For 16% moisture at 25 °C and 40 °C, the O2 decreased to less than 1%.

Correlation analysis between the variables are shown in Fig. 7B. A strong positive correlation can be seen between the variables LDM × CO2, EMC × RH, RH × G, and EMC × G, and a moderate positive correlation were shown between CO2 × RH, LDM × RH, CO2 × EMC, EMC × LDM and G × LDM. However, between the variables EC × G, EC × EMC, EC × RH, there was a strong negative correlation, with a moderate negative correlation shown between the variables EC × CO2. The variable T had a weak negative correlation with RH, EMC, LDM, CO2 and G, and a weak positive correlation with EC. The results observed in the correlation analysis are consistent with the behavior of the qualitative variables in relation to the treatment factors established for corn grain storage. The results corroborate those obtained by Coradi et al.37.

Machine learning models

There were statistical differences (p-value < 0.01) between the evaluated machine learning techniques regarding the Pearson correlation coefficient (r) and mean absolute error (MAE) between the observed and estimated values for all the evaluated variables.

For apparent specific mass (Fig. 8A,B), the ANN, LR, M5P, REPTree, and RF techniques presented the highest r values, without statistically differing from each other. As for MAE, these same techniques, except M5P, presented the lowest averages. The ANN, LR, M5P, and REPTree techniques presented the highest r means between estimated and predicted values of electrical conductivity (Fig. 9A,B). However, when analyzing the MAE, it is observed that LR presented the lowest values.

Figure 8
figure 8

(A) Boxplot for Pearson correlation coefficient (r), and (B) mean absolute error (MAE) between observed and estimated values of apparent specific mass in corn grains by different machine learning models and inputs. Means followed by equal letters in the same column do not differ by the Scott–Knott test at 5% probability.

Figure 9
figure 9

(A) Boxplot for Pearson correlation coefficient (r), and (B) mean absolute error (MAE) between observed and estimated values of electrical conductivity in corn grains by different machine learning models and inputs. Means followed by equal letters in the same column do not differ by the Scott–Knott test at 5% probability.

For germination (Fig. 10A,B), the ANN, LR, M5P, and REPTree techniques presented the highest r values, without statistically differing from each other. As for MAE, these same techniques, except ANN, presented the lowest means. The ANN, LR, M5P, REPTree, and RF techniques presented the highest r means between estimated and predicted values of electrical conductivity (Fig. 11A,B). These same techniques presented the lowest mean MAE.

Figure 10
figure 10

(A) Boxplot for Pearson correlation coefficient (r), and (B) mean absolute error (MAE) between observed and estimated values of germination in corn grains by different machine learning models and inputs. Means followed by equal letters in the same column do not differ by the Scott–Knott test at 5% probability.

Figure 11
figure 11

(A) Boxplot for Pearson correlation coefficient (r), and (B) mean absolute error (MAE) between observed and estimated values of loss of dry matter in corn grains by different machine learning models and inputs. Means followed by equal letters in the same column do not differ by the Scott-Knott test at 5% probability.

Conclusions

Real-time monitoring of the variable temperature, relative humidity, and carbon dioxide (CO2) concentration in the intergranular air determined early and satisfactorily in an indirect way the changes in the physical quality of the grains during transportation, confirmed by the physical analyses of electrical conductivity and germination.

In the first two hours of corn grain transport under the conditions of 16% moisture content in the top position of the grain mass profile suffered the highest physical quality changes, mainly regarding dry matter loss, due to the high equilibrium moisture content and respiration of the grain mass.

The application of Machine Learning predictive algorithms predicted the quantitative and qualitative losses of corn grains during transportation. All machine learning models, except support vector machine, obtained satisfactory results, equaling the multiple linear regression analysis.