Tomography-like for hyperspectral bi-directional grape tissue reconstruction based on machine learning: Implications for diagnosis composition and precision maturation monitoring

. This study used a tomography-like analysis to reconstruct the hyperspectral data from different tissues of the grapes: skin, pulp, and seeds. The dataset included 216 grapes of Loureiro (VIVC 25085) and 205 Vinhão (VIVC 13100) at various dates from the veraison until the harvest. A more comprehensive spectral data analysis identified how the internal tissues are related to the total grape spectra. Each tissue was reconstructed separately by decomposing the whole grapevine hyperspectral information. The results showed that the spectral reconstruction was more successful for Loureiro than Vinhão, with a mean absolute error of 6.08% and 33.32%, respectively. Partial least squares (PLS) regression models were developed for both cultivars using the reconstructed spectral data, enabling the modelling of ºBrix, puncture force (N), chlorophyll (a.u.), and anthocyanin content (a.u.). These models exhibited strong performance, with R 2 > 0.8 and mean absolute percentage errors (MAPE) below 37%. This study emphasises the critical role of considering the grape’s internal tissue in assessing its maturation process. The findings introduce an innovative methodology for efficiently evaluating grape maturation dynamics and inner tissue characteristics. By highlighting the importance of internal tissue analysis, this research paves the way for expedited and accurate monitoring of grape maturation, offering valuable insights into physiological-based viticultural practices and grape quality assessment.


Introduction
Traditionally, grape maturation assessment involves destructive techniques, such as physically removing a sample of grapes from the vine and analysing their chemical composition, which is unsuitable for field mapping [1].Non-destructive techniques, such as Vis-NIR, have been used to assess grape maturation expediently.However, the typical acquisition of external spectral information of grapes cannot provide detailed insights into the development of the inner tissues.
During grape maturation, significant alterations occur in the composition of the grape, specifically within its skin, pulp, and seeds.
The grape's skin undergoes notable transformations throughout this process as its initially green and firm texture gives way to thinner, softer skin exhibiting diverse tones.The accumulation of pigments, notably anthocyanins, significantly contributes to the development of colour in both red and select white grape varieties [2].In addition, the skin encompasses numerous compounds that promote roles in flavour, aroma, and colour [3].For example, anthocyanins are responsible for the red colouration observed in red wines.At the same time, specific aromatic compounds, such as terpenes, are present in the skin of certain white grape varieties, contributing to their distinctive aromas [2].Additionally, the tannins within the skin influence the taste and ageing potential of the resultant wine.
Parallel with grape ripening, the pulp suffers alterations in its sugar content, acidity, and flavour compounds.The pulp composition is critical in determining wine quality, as it establishes the potential alcohol content and the equilibrium of flavours within the resulting wine [4].The sugar content in the pulp undergoes conversion into alcohol during the fermentation process, while the acidity profoundly affects the wine's overall sensory profile and freshness [3].Moreover, the presence of flavour compounds within the pulp, such as esters and organic acids, substantially contributes to the aromatic and flavour profiles exhibited by the wine [4].
Furthermore, the grape seeds significantly contribute to grape physiology and wine quality.During maturation, the seeds experience a transition in colour from green to brown and develop lignified seed coats.In addition, these seeds contain tannins and other phenolic compounds, which effectively contribute to the structural attributes, bitterness, and astringency observed in the resultant wine [5].While winemaking usually does not involve crushing the seeds themselves, the maceration and fermentation processes extract the phenolic compounds from the seeds, thereby influencing the overall composition of the wine [6].Notably, the tannins derived from the seeds substantially contribute to the wine's overall mouthfeel, ageing potential, and stability [6].Despite the significant influence of various grape tissues on wine quality, there is a lack of efficient and rigorous systems enabling prompt non-destructive access to the physiological dynamics of these tissues throughout grape maturation.
Vis-NIR spectroscopy has emerged as a promising technique for predicting grape quality parameters, enabling non-destructive analysis of grape samples.For example, vis-NIR methods can predict sugar content [7], one of the standard parameters for assessing grape quality, as well as acidity, pH, and anthocyanin content [8].Also, through Vis-NIR, it is possible to quantify analytically pigments such as carotenes and chlorophyll, essential factors in assessing the abiotic stresses (e.g., water scarcity, high temperature) [9].
The main goal of this work is to present a "tomography-like" system.The term tomography-like describes the capacity of class reconstruction using hierarchical relationships among the tissue spectra.In other words, it allows the separation of grape spectra into different tissue spectra (skin, pulp, and seed) and vice versa.Furthermore, this approach provides for a non-destructive analysis of the internal composition of the fruit.Therefore, the presented method has the potential to open a new class of non-destructive fruit tissue metabolic analysis methods that are "tomographylike".
Thus, this paper presents a tomography-like reconstruction and decomposition of the spectra of grapes.This paper established three main goals: i. to benchmark the spectral reconstruction and decomposition of the grape and the skin, pulp and seed; ii.To test the tomography-like system in providing insights into grape maturation.

Test site and grape measurements
The conduction of this experiment was in the Região dos Vinhos Verdes, located in the northwest region of Portugal.Precisely at the Campus Agrário de Vairão (41°19'31.91"N and 8°40'27.45"W) situated in Vila do Conde.Grape sampling occurred in 2020 after veraison (August 14 th ), involving 12 dates after veraison for the Loureiro (VIVC 25085), a white grape cultivar, and Vinhão (VIVC 13100), a dye grape cultivar.
Figure 1 presents the experimental setup for performing spectral and biophysical measurements of intact grapes (non-destructive) and their tissues (destructive).The non-destructive procedure for measuring the grapes involved several steps: i.) Put the grape on a platform fitted with a deep-power LED (Philips SpotOn Ultra 69141/31/PH) at the bottom, and the entire grape was analysed spectrally using a highresolution spectrometer (Ocean Insite HR4000, 195.34-1118.33nm) equipped with a reflectance fibre optic probe (Ocean Insite), optimising the integration time for each sample to ensure that most spectra were within the linear response range (Fig. 1); ii.) Measurement of the maximum puncture force (N) with a digital penetrometer (PCE-PTR 200, PCE Group, D-59872 Meschede, Germany); iii.) measurement of the Soluble Solids Content (TSS) using a hand refractometer (Milwaukee model MR32ATC) with a scale range of Brix degrees (°Brix) from 0 to 32.0%.
After these non-destructive measurements, the last step involved dissecting the grape, separating the skin, pulp and seed, placing it on a glass microscopy slide, and putting it back on the platform to obtain spectral information described in item i (Fig. 1).
The spectral information derived from the entire grape spectra will be employed to undertake the 'decomposition' of the spectra data into distinct components representing the skin, pulp, and seed spectral data.Reciprocally, the spectral data obtained from the skin, pulp, and seed components are utilised for the 'reconstruction' of the entire grape spectral information.The acquisition of this information is essential for the tomography-like methodology presented in this paper.Further elaboration and explanation regarding this matter is described in the next subsection.
The spectral data obtained underwent correction for baseline and scattering artefacts using logarithmic multiplicative scattering correction [7].

Hierarchical analysis and interconnections in grape spectral data
Spectral data analysis of different grape internal tissues can involve a hierarchical approach that considers multiple levels of data organisation and chemometrics to enhance pattern understanding.This hierarchical approach allows for the breakdown of data into smaller spectral components called latent structures, aided by techniques such as Principal Component Analysis (PCA).By applying PCA, significant patterns can be identified at each level, enabling the extraction of essential features specific to different grape tissue types [10].Integrating these features can provide a comprehensive understanding of the grape's overall spectral characteristics.Within a grape, hidden patterns exist in various spectral components, including the skin, pulp, and seeds.These patterns can aggregate and form a larger dataset, which exhibits similarities to the patterns observed in grape spectral data analysis.This spectral correspondence suggests a direct correlation between the combined patterns and significant grape features.Spectral grape samples sharing similar spectral characteristics demonstrate similar patterns in the aggregated dataset and the feature space.This association facilitates the identification of internal tissues in unknown grape samples by analysing their spectral data and identifying samples with resemblant patterns.Integrating information from the different grape parts constructs a comprehensive representation that effectively encapsulates the distinct spectral characteristics of the grape.
Interconnections exist among different grape spectral components, allowing information to flow bidirectionally.For example, data from the skin, pulp, and seeds are interconnected when studying grape samples.Leveraging this interconnection, it becomes possible to identify the spectral characteristics of an unknown grape sample by comparing it to similar samples and understanding the neighbouring spectral components.Considering and combining information from these different parts leads to a comprehensive understanding of the grape's characteristics, encompassing its spectral properties and overall composition.
In the reconstruction process, it is essential to standardise both the original and reconstructed spectra.This standardisation is done to mitigate the effects of signal intensity among the different tissues, ensuring that the spectra are comparable and consistent.Furthermore, by standardising the spectra, any variations in signal intensity are accounted for, allowing for more accurate analysis and interpretation of the grape's spectral properties and overall composition.

Modelling grape ºBrix, puncture force and pigments
The modelling of several grape organoleptic characteristics considered spectral information.The Brix and puncture force (N) were determined by the values obtained directly by the refractometer and penetrometer, while chlorophyll and anthocyanin by indirect methods using spectral information, proving that spectral information of the whole fruit contains information of the inner tissues [7].Chlorophyll estimation considered calculating the mean band ratio of the green spectral zone (520-570 nm) to the red spectral zone (571-700 nm).Anthocyanin determination (only for Vinhão) considered the calculation of the mean band ratio of Red Edge 5 (705 nm) to Red Edge 3 (680 nm) spectral zones.The arbitrary units (a.u.) for both pigments were adopted.This study used Partial Least Square Regression (PLS) to forecast quality parameters for each grape cultivar.In the case of the Loureiro cultivar, 151 observations were randomly divided into training (70%) and validation (30%) sets.For the Vinhão dataset, 143 observations were used for training (70%) and 62 for validation (30%).The number of latent variables was selected based on the Root Mean Square Error (RMSE), and the model was assessed using Leave-One-Out Cross-Validation (LOOCV).
The original and reconstructed/decomposed datasets were compared based on metrics such as R 2 , root mean square error (RMSE), and mean absolute percentage error (MAPE).

Grape spectral tomography
Table 1 presents the reconstruction metrics of skin, pulp, and seed spectra for the two grape cultivars and the decomposition of the entire grape spectrum into its internal tissues.The results indicate that the Loureiro cultivar exhibited superior performance in bi-directional reconstruction, likely attributed to its higher light transmittance (both pulp and skin) and the improved signal obtained by the fibre probe (Fig. 1).However, the accuracy of seed reconstruction was lower, possibly due to its small size and difficulty locating a spot that yields a strong signal intensity.Consequently, the integration time for seed measurements had to be prolonged to enhance the results.However, this extension amplified the probe's sensitivity and introduced spectral noise, making it susceptible to even minor involuntary hand movements.On the contrary, the Vinhão cultivar, known for its deep colouration, presented challenges due to the limited light penetration through the grapes.Furthermore, the tomography system did not have a secure attachment for the fibre probe, leading to signal noise caused by hand movements.
Although the equipment characteristics can lead to imprecision in measuring some tissues (e.g., seed) and dye cultivars (e.g., Vinhão), in general, the reconstruction is good (Table 1).These results can be used to predict the internal tissues' spectral signatures and perform pigment quantification to see how the internal tissues have developed.This study focuses on a selection set of dates following veraison, representing grape maturation in how the spectral changes in all tissues and how pigments can be quantified.This different date selection also aims to see how the maturation evolutes in a white and red grape cultivar.
The average spectral reconstruction of grapes and their internal tissues is presented in Fig. 2. Despite these challenges, the reconstruction and decomposition of the spectral data for all tissues of both cultivars were successful.The differences in the maturation process between the two cultivars are primarily due to variations in pigment concentration.
Figure 2 illustrates the reconstructed spectral signatures of the Loureiro and Vinhão grape cultivars at two different dates after veraison (DAV) for each cultivar.
Thee spectral signatures of the Loureiro cultivar exhibit minimal variation between 07 and 47 DAV, primarily influenced by physiological factors like sugar accumulation and acid levels.Changes in spectral characteristics may emerge throughout grape maturation, encompassing sugar content, acidity, and other chemical components.These distinctions become evident across the total spectral signatures and in the pulp and seeds.The accumulation of sugar within the pulp during maturation and the browning of the seeds play a role in shaping the overall grape spectral signature.
In the case of the Vinhão cultivar, Fig. 2 represents the spectral signatures at 05 and 24 DAV.Notably, there is a distinct difference in the spectral signatures of the total grape and the skin.Over 19 days between the represented dates, it is evident that the skin accumulates pigments, resulting in changes in the total spectral signature.However, the spectral signatures of the pulp and seeds show minimal variation, indicating that the different tissues mature at different timings.These findings suggest that the maturation process of grape tissues occurs at different rates, with the skin accumulating pigments earlier than the pulp and seeds.
The reconstructed spectral signatures provide valuable insights into the dynamic changes occurring during the maturation of different grape cultivars.

Modelling of grape ºBrix, puncture force and pigments using spectral data
This study examined the effectiveness of reconstructed spectral information in predicting various grape quality parameters.The findings are presented in Table 2, where the predictions for ºBrix (sugar content), chlorophyll, anthocyanin (colour pigments), and puncture force (texture) are displayed using the Partial Least Squares (PLS) regression method.
Table 2 provides valuable insights into the accuracy of the predictions for these important grape quality parameters.By utilising reconstructed spectral data, the study demonstrates the potential to estimate and assess the levels of ºBrix, chlorophyll, anthocyanin, and puncture force, which are vital indicators of grape quality.
Moreover, it is essential to consider that environmental conditions play a significant role in developing grape characteristics.The relationship among different grape cultivars becomes evident when observing the impact of environmental factors on parameters such as ºBrix and puncture force.This highlights the intricate connection between grape varieties and their response to varying environmental conditions, ultimately influencing the final quality of the grapes that should be measured.

Biophysical parameters along the maturation
Figure 3 represents the temporal progression of maturation in the Vinhão cultivar, focusing on three specific time points: 5, 24, and 59 DAV.These time points correspond to the initial stage, an intermediary stage, and the final stage of maturation, which is close to the harvest period.This showcase aims to highlight the distinct variations in spectral signatures and the quantification of pigments within the skin, pulp, and seed during different stages of maturation.
By analysing the spectral signatures obtained from the internal tissues, valuable insights can be gained into the colour and pigment concentration of the grapes.This allows for reliable indicators of the grape's overall appearance and the specific pigments present within the different parts of the grape.
Notably, all Vinhão grape tissues exhibit a prominent rise in anthocyanin content, with the skin showing a particularly pronounced effect.This observation is supported by an increased absorption in the red region (620-750 nm) of the electromagnetic spectrum, indicating the development of intensified pigmentation.Consequently, the accumulation of anthocyanins contributes significantly to the colouration in red grape varieties.
Additionally, the pulp's spectral signature reveals a noticeable association with the concentration of ºBrix.The sugar accumulation during maturation influences the distinctive patterns and intensities exhibited in the pulp's spectral signature, reflecting in the pulp's spectral signature and providing valuable insights into the grape's sweetness and overall flavour profile.
Each tissue follows a distinct maturation timeline (Fig. 3).Notably, the skin matures and outpaces the pulp and seed.During maturation, the pulp exhibits an increase in ºBrix and a decrease in chlorophyll levels.On the other hand, the seeds display substantial differences in spectral signature but show minimal changes in chlorophyll and anthocyanin levels throughout the maturation process.This discrepancy in the spectral signature of the seeds may be attributed to the development of the seed coat as it reaches full ripeness.Figure 4 illustrates the biophysical changes that occur during the maturation of Loureiro grapes.In the skin tissue, the Loureiro cultivar exhibits a high concentration of chlorophyll pigment, followed by the pulp and seed.As the grape matures, there is a decrease in chlorophyll content, with a more pronounced reduction observed in the skin and pulp.This information is in accordance what is known about grape maturation and the modelling of these parameters will be discussed in the next section.

Discussion
This study investigates the effectiveness of a tomography-like method for analysing grape spectral data, focusing on the Loureiro and Vinhão grape varieties.The results in Table 1 and Fig. 2 reveal differences in the reconstruction and decomposition processes between the two varieties due to their inherent characteristics.With its high transparency, Loureiro allows for detailed information extraction from the skin, pulp, and seeds, resulting in accurate reconstruction.In contrast, Vinhão, a dye grape, presents challenges in light transmission, requiring angle adjustments and increased sensitivity and spectral noise.Therefore, a more powerful LED and huck holding the fibre probe could be employed to minimise issues encountered during the reconstruction and decomposition of spectral data.Table 1 provides insights into the difficulties encountered during reconstruction.Loureiro demonstrates high accuracy in reconstructing the entire grape, skin, and pulp, while Vinhão exhibits more noise and slight differences in reconstructed tissues.The reconstruction of seeds presents challenges for both varieties, with significant noise present.Notably, the smaller size of the seeds in Loureiro poses a more significant challenge in obtaining accurate spectral signatures than the larger seeds of Vinhão.
Figure 2 showcases distinct absorption peaks observed in the spectral signatures, indicating pigmentation and chemical composition variations among grape varieties.For example, white grape cultivars typically exhibit pigments like chlorophyll, while red grape cultivars demonstrate higher concentrations of anthocyanins and tannins [11].These absorption peaks offer valuable insights into different grape varieties' chemical composition and quality characteristics.
During maturation, biochemical changes occur within the internal tissues of the grape, leading to the accumulation and degradation of various compounds [8].Consequently, Loureiro and Vinhão cultivars exhibit differences in pigmentation and chemical composition, as reflected in their spectral signatures.Loureiro grapes' skin tissue shows a higher chlorophyll concentration, whereas Vinhão grapes undergo dynamic changes with decreased chlorophyll and increased anthocyanin levels.The pulp tissue follows a similar pattern in both cultivars.Vinhão grapes experience a colour change towards the final stages of maturation due to increased anthocyanin content.Although not shown, a direct relationship exists between ºBrix and grape puncture force (N), with an increase in ºBrix leading to a decrease in puncture force (N).When considered mature, the browning of grape seeds in both varieties can indicate chlorophyll degradation and seed coat formation.
The observed spectral peaks in grape tissues closely correlate with various quality parameters such as organic acids, sugars, and pH [8].Therefore, understanding these biochemical changes during grape maturation is crucial for assessing grape quality and determining the optimal harvest time.
Figure 3 visually represents the maturation process of the Vinhão cultivar, highlighting the spectral attributes of internal tissues and their interrelation with colour development, pigment concentration, and sugar content.These findings enhance the understanding of the complex dynamics of grape maturation and have practical implications for grape growers and winemakers.
The differential maturation dynamics observed in different tissues significantly impact the resulting wine's quality and flavour, making them essential considerations for grape growers and winemakers.The spectral signatures of each tissue exhibit distinct characteristics for each assessed date in the Vinhão cultivar.For example, the skin tissue accumulates more pigments, while the pulp tissue may not develop desirable quality parameters at the same rate.
The analysed system's significance in grape berry analysis is crucial for supporting viticultural practices such as irrigation, fertilisation, and canopy management based on physiological foundations.By analysing grape berries, this system can provide valuable insights into their physiological characteristics, including sugar content, acidity levels, phenolic compounds, and maturity stage.This information can aid in making physiologically based viticultural management practices and decisions regarding, among others, irrigation scheduling and optimal fertilisation strategies.Furthermore, understanding the physiological status of grape berries enables vineyard managers to adapt interventions to ensure optimal growth and fruit development by providing necessary resources to the vines.Ultimately, this system contributes to overall grape quality and yield, supporting sustainable and efficient viticultural practices.
Compared to other Vis-NIR or similar systems that primarily gather information from external tissues, the significance of the results obtained with the tomography-like system lies in its non-destructive nature.Unlike traditional methods requiring invasive sampling or destructive analysis, the tomography-like system allows for examining internal grape tissues without altering or damaging the fruit.This nondestructive approach provides a unique advantage in obtaining comprehensive and accurate information about the physiological characteristics of grape berries, including their internal composition.Furthermore, by exploring the internal tissues, the tomography-like system offers a more holistic and reliable assessment of grape quality parameters, enabling vineyard managers and winemakers to make informed decisions and take appropriate actions to optimise grape production and wine quality.
In the future, the tomography-like system holds the potential to evolve into an on-the-go system integrated into robotic platforms.This advancement would enable precise mapping of vineyard quality parameters by considering the integration of biophysical and chemical properties associated with different grape tissues.The system has the potential for high-throughput spatiotemporal sampling and the ability to provide multiple measurements throughout grape maturation at various locations within the vineyard, promising to revolutionise vineyard management practices.This technological advancement ensures precision and efficiency in monitoring grape quality parameters, supporting enhanced decision-making and sustainable viticultural practices.
Moreover, the non-destructive method presented in this study can be integrated into existing grape sorting and grading systems, providing additional information to ensure the quality of the grape harvest.This nondestructive technique can offer the grape industry a more efficient and accurate method for monitoring grape maturation and quality assessment.

Conclusion
The findings of this study demonstrate the feasibility and potential of the non-destructive tomography-like system in predicting the internal characteristics of grapes.The research focused on two grape cultivars, Loureiro and Vinhão, and successfully examined their pigment composition and biophysical changes during maturation using spectral analysis.The results provide valuable insights into the maturation patterns of these cultivars, highlighting differences in pigment composition and spectral signatures between the skin and pulp tissues.
This study contributes to understanding grape maturation and its implications for wine quality.By analysing spectral information from grape tissues, essential parameters such as sugars, puncture force, anthocyanin, and tannin levels can be estimated, enabling winemakers to make informed decisions to optimise grape production and enhance wine quality.
It is worth noting that this non-destructive system is a pioneering approach in the field, and no similar studies have been reported to date.However, further improvements and testing are necessary to address equipment limitations, evaluate its performance with additional grape cultivars, and validate the results with laboratory analyses.Nevertheless, these future developments can provide a commercial solution, a manual stop-and-go or on-the-go transportation system, based on the improved tomography-like system.
Overall, the findings of this study demonstrate the potential of the non-destructive tomography-like system in predicting grape characteristics and its relevance in optimising grape production and wine quality.Furthermore, this research opens up new routes for the grape industry, providing an efficient and cost-effective approach to monitoring grape maturation and estimating biophysical parameters by involving the potential of the on-the-go platform integrated into robotic platforms providing a high-throughput spatiotemporal sampling in mapping parameters related to the grape physiology and wine quality in an optic of precision viticulture.

Figure 1 .
Figure 1.Experimental setup for data acquisition.(a) Grapes at different stages of maturation are illustrated.(b) The spectrometer captures internal grape tissue information using a light source.(c) Spectral signatures are obtained from the entire grape, the skin, the pulp, and the seed.

Figure 2 .
Figure 2. Reconstructed spectra of Vinhão and Loureiro grapes for the entire grape (a and b), skin (c and d), the pulp (e and f), and seed (g and h).The reconstructed spectra are presented for 07 and 47 days after veraison (DAV) for Loureiro cultivar and 05 and 24 for Vinhão cultivar.

Figure 3 .
Figure 3. Maturation progression of the Vinhão cultivar at 5, 24, and 59 days after veraison (DAV), describing the interrelationship between the skin, pulp, and seed, pigment concentration in arbitrary units (a.u.), and spectral signature within the internal tissues.

Figure 4 .
Figure 4. Changes in the concentration of anthocyanin (Ant.), chlorophyll (Chl.) in the skin (SK), the pulp (PU) and seeds (SE) and ºBrix, during the maturation of the Loureiro cultivar.

Table 1 .
Reconstruction benchmark of the Loureiro e Vinhão cultivars.