## 2 Materials and Methods  
Two waste streams, namely a supermarket and childcare center, were used as feed for BSFL under commercial rearing conditions [1,3]. The waste streams were received from local suppliers, de-packaged, and ground using an industrial grinder in a commercial waste processing facility (particle size approximately between 10 and 15 mm) [1,3]. The ground waste material (approx. 3 kg) was placed into triplicate trays for each waste (tray dimension 60 \(\times\) 40 \(\times\) 12 cm) where approximately 15,000 5-day-old BSFL (chronological age) were added to each tray. The trays and BSFL were then subjected to the rearing conditions and protocols established by the industrial facility. The rearing conditions were protected by industrial rights (e.g., temperature and humidity protocols) and not disclosed in this paper [1,3]. In this study, the 5 th instar BSFL was used after harvesting using sterile tweezers upon sighting the first pre-pupae. The harvested live BSFL samples were blanched (100 \({}^{\circ}\)C for 5 min) and freeze-dried (Laboconco(tm) FreeZone(tm) 4.5L \(-\)50 \({}^{\circ}\)C Benchtop Freeze Dryer, Kansas City, MO, USA) (\(-\)50 \({}^{\circ}\)C, 0.054 bar for 96 h). The freeze-dried samples were stored in the freezer at \(-\)20 \({}^{\circ}\)C until analysis.  
To evaluate the effect of the number of BSFL on the scans, the NIR spectra of the BSFL were collected by placing the samples into a cylinder borosilicate cuvette (2 cm diameter) and scanned in the wavelength range between 950 and 1600 nm (10 nm wavelength resolution). A portable NIR instrument (Micro-NIR 1700. Viavi, Milpitas, CA, USA) was used where the proprietary software provided by the instrument manufacturer was used to control the instrument and to collect the spectra of the samples. An integration time of 11.3 us and an average of 50 scans were applied during spectra collection (MicroNIR Pro 3.1, Viavi, Milpitas, CA, USA). A reference spectrum was collected every 20 samples using a Spectralon(r) tile provided by the instrument manufacturer. The experimental design is shown in Figure 1. Samples from each of the feed streams were scanned as half, 1, 2, and 3 larvae samples with or without the back of aluminum foil. A total of 320 scans were obtained [2 waste streams \(\times\) 20 replicates \(\times\) 4 larvae treatments \(\times\) 2 back cover (with or without aluminum foil)].  
The spectra were exported in the MicroNIR Pro format into The Unscrambler software (Version 11, CamoAnalytics AS, Oslo, Norway) for chemometric analysis. The NIR spectra were pre-processed before data analysis (smoothened and pre-processed using the Savitzky-Golay second derivative, second-order polynomial, 21 smoothing points) [33; 34].  
Principal component analysis (PCA) and linear discriminant analysis (LDA) were developed using full cross-validation (leave one out) [35]. LDA was used to classify the BSFL samples according to the waste stream used to feed the larvae (e.g., supermarket and childcare). The LDA technique was used to find linear combinations of features that allow the best separation of the two different waste streams analyzed. During the development of an LDA model, differences between groups (waste streams) were maximized, whilst within-class variance was minimized, guaranteeing maximal separability [36; 37; 38]. In this study, 4 data sets were created and used to develop the classification models, namely half larvae (0.5) (L) (n = 80), 1 L (n:80), 2 L (n = 80), and 3 L (n:80).