## 3 Materials and Methods  
The experiment was carried out using organic sweet cherries (c.v. _Sweet Heart_), harvested at the end of June from a commercial organic farm, \"Tenute D'Onghia\" located in Taranto province, Southern Italy. The harvested cherries were transported directly to the CIHEAM-Bari insectarium (Valenzano, Puglia, Italy), where a simulation of natural infestation was performed. Fruits were carefully checked under a stereoscope (Nikon SMZ 745T) to exclude damaged and unhealthy cherries. The selected healthy cherries were divided into three identical batches. The first batch was added to the rearing cage to allow \(D\). _suzukii_ adults to lay eggs on them. After two days, corresponding to the oviposition period determined by the life cycle estimation [16], infested fruits were moved from the cage and checked for the number of eggs per cherry under the stereoscope. The infested cherry fruits batch, composed of 100 infested fruits, was divided into four groups, composed of 25 fruits, according to the number of eggs by fruit:  
* 1 st group: from 1 to 5 eggs per cherry fruit;
* 2 nd group: from 6 to 10 eggs per cherry fruit. Each subgroup with the same number of eggs was composed of five fruits;
* 3 rd group: from 11 to 30 eggs per cherry fruit. Each subgroup with the same number of eggs was composed of five fruits;
* 4 th group: more than 30 eggs per cherry fruit. The second batch was composed of 100 healthy and non-infested cherries. The Vis/SWNIR measurement on the fruits of the two batches (infested and healthy fruits) was done on the same day, 48 h from the harvest, and all the fruits were maintained in the same conditions at room temperature and RH. Subsequently, all the fruits were stored in a cold room for 24 h (0 \({}^{\circ}\)C, 90-95% RH) and their Vis/SWNIR spectrum was further collected on the next day. This permitted the spectral variations due to temperature changes to be taken into account [49]. A VIS-NIR spectrophotometer (model AvaSpec-2048-UA, nominal 200-1100 nm, 2048 pixels InGaAs CCD detector, Avantes, The Netherlands) was used to collect the spectra from the samples using an integrating sphere (IS) (model AvaSphere-80-REFL, diameter 80 mm, nominal reflection range 250-2500 nm, sample port 15 mm, Avantes, The Netherlands), to provide diffuse reflectance measurements, equipped with a 100 W tungsten-halogen source light (model ASBN-100W-L, SP Spectral Products, Putnam, CT, USA). On each fruit, the diffuse reflectance spectrum was measured, placing the fruit below the sampling port of the IS; four spectra were collected, turning each fruit around its symmetry axis by 90 degrees and subsequently averaging the four acquired spectra. For the spectra collection, the dedicated software Avasoft Basic ver. 7.3 from Avantes wasused. The data were analyzed using in-house scripts programmed using MATLAB software (MATLAB R2024b, MathWorks, Natick, MA, USA). To model the data fit/prediction, PCR and PLS algorithms were selected, being both available from the \"Statistics and Machine Learning Toolbox\" of MATLAB software. Furthermore, to speed up calculations, the \"Parallel Computing Toolbox\" of MATLAB was used and the calculations were carried out on a Dell Precision T3610 computer (Intel Xeon, 12 cores, 3.7 GHz). The chemometric parameter Y to be predicted was categorical, HEALTHY versus INFECTED. To these two categories, the Y values of \(-1\) and \(+1\) were arbitrarily assigned for healthy and infected fruit, respectively. As the fitting model of the Y prediction is a continuous value, a threshold value of 0 has been considered to revert back to the two categories (HEALTHY versus INFECTED). When the predicted Y value is greater than or equal to the threshold then an INFECTED fruit is predicted; on the contrary, when the predicted Y value is less than the threshold, then the fruit is predicted to be a HEALTHY one. The EXTCV was set to 20% (the choice of samples was randomized) of the overall available samples. The methods were validated by a 2-fold CV.