Differentiation of Livestock Internal Organs Using Visible and Short-Wave Infrared Hyperspectral Imaging Sensors

Automatic identification and sorting of livestock organs in the meat processing industry could reduce costs and improve efficiency. Two hyperspectral sensors encompassing the visible (400–900 nm) and short-wave infrared (900–1700 nm) spectra were used to identify the organs by type. A total of 104 parenchymatous organs of cattle and sheep (heart, kidney, liver, and lung) were scanned in a multi-sensory system that encompassed both sensors along a conveyor belt. Spectral data were obtained and averaged following manual markup of three to eight regions of interest of each organ. Two methods were evaluated to classify organs: partial least squares discriminant analysis (PLS-DA) and random forest (RF). In addition, classification models were obtained with the smoothed reflectance and absorbance and the first and second derivatives of the spectra to assess if one was superior to the rest. The in-sample accuracy for the visible, short-wave infrared, and combination of both sensors was higher for PLS-DA compared to RF. The accuracy of the classification models was not significantly different between data pre-processing methods or between visible and short-wave infrared sensors. Hyperspectral sensors, particularly those in the visible spectrum, seem promising to identify organs from slaughtered animals which could be useful for the automation of quality and process control in the food supply chain, such as in abattoirs.


Introduction
The routine differentiation of livestock organs at abattoirs by meat inspectors occurs based on organ type combined with the gross exclusion diagnosis of potential diseases rendering offal safe for human consumption by trained meat inspectors and a supervising veterinarian [1]. This differentiation is a manual-labour-intensive process and includes the potential for human error. Automation of the post-mortem process in abattoirs has been trialled in previous studies using non-contact and non-invasive imaging methods, including x-ray attenuation, computed tomography, and hyperspectral (HS) imaging for livestock body composition analysis [2,3]. Such systems have allowed for meat and organs to not be destroyed or contaminated during analysis, with rapid on-line technologies providing instant feedback at processor chain speed and no need for sample preparation or external transportation [2][3][4]. However, these non-invasive imaging systems generate extensive data, which require pre-processing methods and algorithm development to be sufficiently accurate and efficient for use in industry [2,3,5].

Materials and Methods
No animals were slaughtered for the purpose of this study, with offal being obtained from an abattoir and a butcher. Therefore, animal ethics approval was not required.

Sample Collection and Scanning Procedure
A total of 104 parenchymatous bovine and ovine organs were collected over two days from a collaborating abattoir and local butcher and maintained at refrigerator temperatures (1-4 • C) prior to scanning ( Table 1). The organs included in this study were heart (n = 33), kidney (n = 20), liver (n = 29) and lung (n = 22). The sampling was random, and, therefore, breed and production system information was not known because abattoirs do not normally collect such information. Table 1. Description and number of bovine and ovine parenchymatous organs used to develop automatic identification algorithms from visible (VIS) and short-wave infrared (SWIR) hyperspectral sensors and their combination (COMB) following removal of outliers. One heart from all spectra, one lung and one liver from VIS and COMB spectra, respectively, were removed. Heart  32  32  31  Kidney  20  20  20  Liver  28  29  28  Lung  21  22  21  Total  101  103  100 A prototype multi-sensory platform consisting of dual-view multi-energy X-ray attenuation and a VIS and SWIR HS imaging system (Rapiscan Inspection System AK198, Rapiscan Systems Pte Ltd., Singapore) connected to a Cube computer running Ubuntu (Linux OS) was used for the imaging of the organs (Figure 1). Organs were placed in a sealed tray with a transparent acrylic lid to ensure HS penetration and double containment, which was placed within protective lead curtains for scanning. A conveyor transported the samples from end to end (6.64 s for 1260 mm, 189.8 m/s) with both sides protected by lead shielding while X-rays were on. Illumination was provided by a light-emitting diode (LED) strip lamp for VIS and a quartz infrared (QIR) lamp for SWIR.

Extraction and Analysis of Spectral Data
Scanned images (PNG) trimmed to comprise the tray containing organ samples were constructed from 200-400 frames generated by the HS sensors using MATLAB programming language (MATLAB R2021a, Mathworks Inc., Portola Valley, CA, USA). ImageJ (version 1.53a; RRID:SCR_003070) was used to markup regions of interest (ROI) with 7 × Figure 1. Rapiscan multi-sensory imaging system used to scan livestock parenchymatous organs. (a) The external view of the complete prototype imaging system (AK198); and (b) A schematic showing placement of the hyperspectral cameras within the imaging system. Source: Rapiscan Systems Pte Ltd., Singapore. The HS imaging system consisted of two sensors covering the spectral range from 400 to 900 nm (VIS) and 900 to 1700 nm (SWIR). The VIS (Basler Ace GigE, Photonic Science, East Sussex, UK) and SWIR (Snake A/C GigE v3 AK081, Photonic Science, East Sussex, UK) sensors were powered by 12 V power supply units and fitted with Specim spectrographs (VNIR V10E and NIR V17E, respectively) and a Grade 1 InGaAs detector with air-cooled housing. Spectral resolutions were 3 and 5 nm for VIS and SWIR, respectively, with both sensors capturing 200 spectral slices per second. Exposure time, image size (width, length, offset) and acquisition rate were controlled by Ubuntu (Linux OS) computer programs (eBUSPlayer SDK, Pleora Technologies, Kanata, Canada) and stream2camstodisk command line (B Allman, pers. comm.) in the Aravis environment of Linux. Spectral increment was approximately 1.5 nm between contiguous bands, with 300 bands for VIS and 512 for SWIR. The VIS sensor had a 1920 × 1200 (spectral × spatial) pixel sensor, spectral binned four times and offset 70 pixels, spatial dimension was not binned, and offset was 550 pixels, equalling 300 bands. The SWIR sensor had a 640 × 512 (spatial × spectral) pixel sensor, offset by 64 pixels, and the area captured was 256 pixels. These dimensions were chosen in order to achieve 150 frames per second (fps) for both HS sensors. Exposure times were calculated from 150 Hz, resulting in a 6.666 ms refresh rate, so exposure times were 6.4 ms for VIS and 4 ms for SWIR to download data at this refresh rate.

Extraction and Analysis of Spectral Data
Scanned images (PNG) trimmed to comprise the tray containing organ samples were constructed from 200-400 frames generated by the HS sensors using MATLAB programming language (MATLAB R2021a, Mathworks Inc., Portola Valley, CA, USA). ImageJ (version 1.53a; RRID:SCR_003070) was used to markup regions of interest (ROI) with 7 × 7 pixels in size upon each complete organ image avoiding visible fat and pixels appearing out of focus. Three to eight ROI were marked-up upon each organ depending on the organ's size, with larger organs having more ROI than smaller organs. Images were viewed in GIMP (GNU Image Manipulation Program version 2.10.18, RRID:SCR_003182), and, subsequently, pixel values of the ROI were obtained, which were then written into a MATLAB algorithm (B. E. Allman, pers. comm.) to obtain reflectance spectra for each image. Spectra extracted from each ROI were visually checked for uniformity with other ROIs within each sample. Output spectral data (VIS and SWIR) were averaged per organ.

Data Processing and Outlier Removal
Mean reflectance HS data per organ were imported into R software [25]. Both VIS and SWIR spectra were subjected to a principal components analysis (PCA) model as per Logan et al. [26]. Each dataset was independently visualised using PCA (Q residuals and T 2 Hotelling values) with 2 components using the mdatools package [27] to detect outliers defined as observations with orthogonal and score distances >20 on the residual plot [28]. Three outliers were detected and removed from VIS and one from SWIR (Table 1). Subsequently, all datasets were trimmed manually to remove machine artifact effects at the start and end of each spectrum, which presented as flat regions. The final spectra for analysis contained wavelengths from 470.5 to 800.5 nm for VIS and 1000.5 to 1600.5 nm for SWIR. A combination dataset (COMB) was created by merging the trimmed VIS and SWIR spectra. To smooth the spectra and avoid spectral noise, trimmed centred moving average equations were used with a window length of 5 and 20% trim for VIS, whereas SWIR and COMB used a window length of 11 and 10% trim. Cubic polynomial Savitzky-Golay filters [22,29] with identical window lengths were also fitted but did not smooth the spectra as effectively as centred moving average and were therefore not considered. Both reflectance (R) and absorbance (A = 1/log(R) as per Lanza [20]) spectra were subsequently pre-processed using first (d1) and second (d2) derivatives, with all these datasets used to develop subsequent classification models of the organs. All spectral datasets (R, Rd1, Rd2, A, Ad1, Ad2 for VIS, SWIR and COMB) were centred and scaled before model development. Data processing was implemented using the tidyverse (RRID:SCR_019186) suite of packages [30].

Statistical Modelling
Classification models using spectral data from three datasets (VIS, SWIR, COMB) and six pre-processing treatments (R, Rd1, Rd2, A, Ad1, Ad2) were tuned using leave-oneout cross-validation (LOOCV). The choice of LOOCV was primarily due to the relatively low sample sizes. The PLS-DA and RF methods used the pls and randomForest functions, respectively, within the caret package [31] to differentiate organ type. Model metrics for goodness-of-fit were evaluated using the multi-class summary in the caret package [31]. Model tuning was achieved using a number of components (ncomp) ranging from 1 to 25 for PLS-DA and the number of variables available for splitting at each tree node (mtry) between 300 to 500 for RF [32,33], based on the highest accuracy and the lowest log loss, respectively, on the LOOCV data. Plots for ncomp were visually assessed for the minimal ncomp to reach the peak in order to prevent overfitting of PLS-DA models. After the optimal tuning parameters were obtained, the final model was run using the pls package [34].
Accuracy, precision, sensitivity, specificity and coefficient of agreement (Kappa) were the model metrics obtained by resampling the PLS-DA and RF discrimination models using LOOCV [35,36]. The best model among all datasets with six pre-treatments was selected based on LOOCV accuracy and Kappa for determination of the in-sample accuracy [32]. Following this, the sensitivity, specificity, precision and balanced accuracy were obtained per organ and HS sensor following PLS-DA and RF modelling. Sensitivity corresponds to the inverse of the out of bag error for each organ. Wavelength variable importance (scaled from 0 to 100) of the COMB dataset was determined using the varImp function in the caret package [31].
Principal components analysis modelling of the three datasets was completed and visualised using the R package ggfortify [37,38].

Reflectance Spectroscopy
Visible reflectance spectra for the four organs are shown in Figure 2a, with the heart and lung showing greater reflectance compared to the liver and kidney across the range between 500 and 850 nm. The liver and kidney had similar spectral signatures throughout the VIS spectrum except for between 500 and 600 nm, where kidneys had slightly greater intensity. Similarly, hearts showed greater intensity compared to lungs between 500 and 600 nm, but both organs showed similar intensity between 600 and 850 nm. Much stronger separation of the spectra occurred in the SWIR region, particularly between 1050 to 1300 nm, where the lung showed greater reflectance than the heart, followed by the liver, and finally the kidney with the lowest intensity ( Figure 2b).

Partial Least Squares Discriminant Analysis
Classification results of the different mathematical pre-processing methods using PLS-DA are shown in Table 2. For VIS spectra, absorbance (A) was selected as the best model because it showed 88% accuracy and 84% Kappa on the LOOCV dataset (ncomp = 9) for PLS-DA. However, the accuracy of reflectance (R) was similar to A. The in-sample accuracy for A was 96%, with only four samples misclassified ( Table 3). The first and second derivatives of R and A yielded slightly lower accuracy compared to the raw data. All hearts were correctly classified using the VIS spectra, along with 18 of 20 kidneys, 27 of 28 livers, and 20 of 21 lungs (Table 3). Figure 2. Trimmed centred moving average (a) visible (470.5-800.5 nm); and (b) short-wave infrared (1000.5-1600.5 nm) spectra for livestock organs by organ type (heart, kidney, liver, and lung).

Partial Least Squares Discriminant Analysis
Classification results of the different mathematical pre-processing methods using PLS-DA are shown in Table 2. For VIS spectra, absorbance (A) was selected as the best model because it showed 88% accuracy and 84% Kappa on the LOOCV dataset (ncomp = 9) for PLS-DA. However, the accuracy of reflectance (R) was similar to A. The in-sample accuracy for A was 96%, with only four samples misclassified ( Table 3). The first and second derivatives of R and A yielded slightly lower accuracy compared to the raw data. All hearts were correctly classified using the VIS spectra, along with 18 of 20 kidneys, 27 of 28 livers, and 20 of 21 lungs (Table 3). Table 2. Partial least squares discriminant analysis (PLS-DA) classification accuracy and coefficient of agreement (Kappa, κ) from visible (VIS), short-wave infrared (SWIR) and combination VIS and SWIR (COMB) hyperspectral sensors to differentiate bovine and ovine hearts, kidneys, livers, and lungs using various pre-processing methods on the leave-one-out cross validation (LOOCV) and insample datasets.  short-wave infrared (1000.5-1600.5 nm) spectra for livestock organs by organ type (heart, kidney, liver, and lung). Table 2. Partial least squares discriminant analysis (PLS-DA) classification accuracy and coefficient of agreement (Kappa, κ) from visible (VIS), short-wave infrared (SWIR) and combination VIS and SWIR (COMB) hyperspectral sensors to differentiate bovine and ovine hearts, kidneys, livers, and lungs using various pre-processing methods on the leave-one-out cross validation (LOOCV) and in-sample datasets.

Spectra LOOCV Dataset
In-Sample Dataset  For SWIR spectra, the first derivative of absorbance (Ad1) was selected for PLS-DA because of the highest accuracy on the LOOCV dataset (accuracy 92%, Kappa 90%, ncomp = 21), although this did not differ from raw A or second derivative of A of the SWIR spectra (Table 2). In-sample accuracy of 98-99% indicated overfitting; therefore, ncomp was reduced to six based on a peak when ncomp values were plotted by accuracy on the LOOCV dataset, whereupon accuracy was slightly reduced to 88%. Three hearts were misclassified as lungs, four lungs as livers and two livers as kidneys ( Table 3).
The combination of VIS and SWIR spectra resulted in very high overfitting, where all datasets resulted in 100% in-sample accuracy and all ncomp > 16 (Table 2). Therefore, the ncomp was reduced to six to avoid overfitting, giving in-sample accuracies ranging from 79 to 93% (data not shown). The Ad1 treatment was selected as it had the highest LOOCV accuracy (88%), and PLS-DA modelling of COMB data correctly classified all 28 livers, 28 of 31 hearts, 18 of 20 kidneys, and 19 of 21 lungs (Table 3). Table 4 shows the goodness-of-fit metrics for VIS, SWIR and COMB for all organs. All metrics across organs ranged between 77 and 100%, with VIS producing more accurate results overall than SWIR, being 90% or more across metrics. Hearts and livers were the best-classified organs by VIS and COMB, showing sensitivity, specificity, precision and accuracy above 90%. On the other hand, SWIR showed the greatest accuracy and sensitivity in classifying kidneys.
Variable importance for PLS-DA predictions of each organ type by the combined spectral model (VIS and SWIR using Ad1 pre-processing) is shown in Figure 3. Hearts showed the greatest importance at 540 nm; kidneys at 780 and 1100 nm; livers at 580 and 780 nm; and lungs at 580 to 600 nm. Livers showed greater variable importance peaks than lungs and kidneys, which in turn were generally higher than hearts, although hearts tended to exhibit more stability across the spectra.  Variable importance for combination of visible (470.5-800.5 nm) and short-wave infrared (1000.5-1600.5 nm) spectra using partial least squares discriminant analysis to identify bovine and ovine organs by type.

Random Forest
For RF, SWIR and COMB had Ad1 selected with the highest accuracy on the LOOCV dataset (all ≥ 85%); however, the accuracy across different datasets showed an accuracy between 68 and 89% (Table 5). Visible HS data had Rd2 selected with the highest accuracy on the LOOCV dataset. The mtry ranged from 310 to 490 with no overfitting. In-sample accuracies were slightly less than accuracies on the LOOCV dataset for all spectral data. Misclassification occurred by all spectra for each organ type (Table 6). Table 6 shows overall accuracies to be highest for livers using SWIR and COMB and for hearts using VIS data. Table 7 shows the RF in-sample classification metrics of organ type, where livers were the best classified overall by RF (sensitivity > 89%, accuracy > 90%). However, hearts showed greater sensitivity and equal accuracy and precision than livers by RF using VIS data. Lungs were the least correctly classified organ regardless of spectral data. However, all sensitivities and balanced accuracies were greater than or equal to 80% regardless of the organ. Table 5. Random forest algorithm classification accuracy and coefficient of agreement (Kappa, κ) from visible (VIS), short-wave infrared (SWIR) and combination VIS and SWIR (COMB) hyperspectral sensors to differentiate bovine and ovine hearts, kidneys, livers and lungs on the leave-one-out cross validation (LOOCV) and in-sample datasets. Variable importance for combination of visible (470.5-800.5 nm) and short-wave infrared (1000.5-1600.5 nm) spectra using partial least squares discriminant analysis to identify bovine and ovine organs by type.

Random Forest
For RF, SWIR and COMB had Ad1 selected with the highest accuracy on the LOOCV dataset (all ≥ 85%); however, the accuracy across different datasets showed an accuracy between 68 and 89% (Table 5). Visible HS data had Rd2 selected with the highest accuracy on the LOOCV dataset. The mtry ranged from 310 to 490 with no overfitting. In-sample accuracies were slightly less than accuracies on the LOOCV dataset for all spectral data. Misclassification occurred by all spectra for each organ type (Table 6). Table 6 shows overall accuracies to be highest for livers using SWIR and COMB and for hearts using VIS data. Table 7 shows the RF in-sample classification metrics of organ type, where livers were the best classified overall by RF (sensitivity > 89%, accuracy > 90%). However, hearts showed greater sensitivity and equal accuracy and precision than livers by RF using VIS data. Lungs were the least correctly classified organ regardless of spectral data. However, all sensitivities and balanced accuracies were greater than or equal to 80% regardless of the organ. Table 5. Random forest algorithm classification accuracy and coefficient of agreement (Kappa, κ) from visible (VIS), short-wave infrared (SWIR) and combination VIS and SWIR (COMB) hyperspectral sensors to differentiate bovine and ovine hearts, kidneys, livers and lungs on the leave-one-out cross validation (LOOCV) and in-sample datasets.   Combination VIS and SWIR (Ad1 pre-processing) variable importance of RF modelling is shown in Figure 4 on an overall basis rather than by organ types. In comparison to the PLS-DA clearer peaks were seen across the VIS and SWIR spectra at 590 to 600, 740 to 780, 1080 to 1140 and 1180 to 1200 nm. Combination VIS and SWIR (Ad1 pre-processing) variable importance of RF modelling is shown in Figure 4 on an overall basis rather than by organ types. In comparison to the PLS-DA clearer peaks were seen across the VIS and SWIR spectra at 590 to 600, 740 to 780, 1080 to 1140 and 1180 to 1200 nm. Variable importance for combination of visible (470.5-800.5 nm) and short-wave infrared (1000.5-1600.5 nm) spectra using random forest modelling to identify bovine and ovine organs by type.

Principal Components Analysis
The PCA score plots for PC1 against PC2 for Ad1 data were selected for both VIS and SWIR spectra because this series resulted in the highest accuracy. Figure 5 visually demonstrates that the data points cluster together for each organ type. The PCA showed similar results to PLS-DA and RF, where different organs showed different spectral features for identification, and hearts tended to be the most clustered organ with the least overlapping. Using the combination of both HS sensors (Figure 5c) resulted in greater separation by PCA than using VIS and SWIR sensors individually (Figure 5a,b). Variable importance for combination of visible (470.5-800.5 nm) and short-wave infrared (1000.5-1600.5 nm) spectra using random forest modelling to identify bovine and ovine organs by type.

Principal Components Analysis
The PCA score plots for PC1 against PC2 for Ad1 data were selected for both VIS and SWIR spectra because this series resulted in the highest accuracy. Figure 5 visually demonstrates that the data points cluster together for each organ type. The PCA showed similar results to PLS-DA and RF, where different organs showed different spectral features for identification, and hearts tended to be the most clustered organ with the least overlapping. Using the combination of both HS sensors (Figure 5c) resulted in greater separation by PCA than using VIS and SWIR sensors individually (Figure 5a,b).

Discussion
The objective of the present study was to explore the potential of VIS and SWIR hyperspectral data to classify parenchymatous organs by type (heart, kidney, liver, and lung), to assess the suitability of different data pre-processing techniques for HS data, and to compare RF modelling with the more conventionally used PLS-DA. This study was an exploration of the use of HS imaging in organ identification and inspection within the meat processing industry, potentially leading to automation and quality control. Results demonstrated that automated classification for organ type could be performed correctly 95% of the time for VIS and 87% for SWIR using PLS-DA without overfitting. These, in addition to the RF accuracy of 85% for automated classification using the combination of VIS and SWIR sensors, highlight the promise for potential uses of a multi-sensory platform in the beef and sheep meat industries. Potential applications include automated animal organ identification and sorting, processing using robotics, and quality assurance replacing tedious manual procedures normally performed manually by meat inspectors and veterinarians [39]. However, it is important to note that the present study dealt with the classification of organs from both sheep and cattle together. The objective of the present study was to differentiate organs independent of origin. However, it is important to note that large-scale processing plants or abattoirs either slaughter one or the other species, whereas smaller ones often slaughter both species. The differentiation of species using HS sensors is a potential avenue of exploration, though it was not undertaken in the present study because it was not the objective.
Both VIS and SWIR sensors produced similar accuracy in classifying organs by type, although VIS was slightly better and more consistent across pre-processing and classification methods. It was expected that SWIR would be superior, given it comprises a good portion of the near-infrared spectrum which is known to be able to detect C-H and N-H bonds [23,40]. Results from Baeten et al. [9] and Kamruzzaman et al. [15] showed SWIR to perform superior to VIS regions in differentiating fruits and agri-food products and the amount of offal present in a meat mixture, respectively. However, these studies used only

Discussion
The objective of the present study was to explore the potential of VIS and SWIR hyperspectral data to classify parenchymatous organs by type (heart, kidney, liver, and lung), to assess the suitability of different data pre-processing techniques for HS data, and to compare RF modelling with the more conventionally used PLS-DA. This study was an exploration of the use of HS imaging in organ identification and inspection within the meat processing industry, potentially leading to automation and quality control. Results demonstrated that automated classification for organ type could be performed correctly 95% of the time for VIS and 87% for SWIR using PLS-DA without overfitting. These, in addition to the RF accuracy of 85% for automated classification using the combination of VIS and SWIR sensors, highlight the promise for potential uses of a multi-sensory platform in the beef and sheep meat industries. Potential applications include automated animal organ identification and sorting, processing using robotics, and quality assurance replacing tedious manual procedures normally performed manually by meat inspectors and veterinarians [39]. However, it is important to note that the present study dealt with the classification of organs from both sheep and cattle together. The objective of the present study was to differentiate organs independent of origin. However, it is important to note that large-scale processing plants or abattoirs either slaughter one or the other species, whereas smaller ones often slaughter both species. The differentiation of species using HS sensors is a potential avenue of exploration, though it was not undertaken in the present study because it was not the objective.
Both VIS and SWIR sensors produced similar accuracy in classifying organs by type, although VIS was slightly better and more consistent across pre-processing and classification methods. It was expected that SWIR would be superior, given it comprises a good portion of the near-infrared spectrum which is known to be able to detect C-H and N-H bonds [23,40]. Results from Baeten et al. [9] and Kamruzzaman et al. [15] showed SWIR to perform superior to VIS regions in differentiating fruits and agri-food products and the amount of offal present in a meat mixture, respectively. However, these studies used only one HS sensor encompassing both regions and one classification method (PLS-DA). The combination of the two spectral regions in portable and benchtop devices was also promising in studies of meat quality [23,41] and microbial spoilage in fish fillets [10].
Despite the high accuracy for the spectral differentiation of individual organs, these results are to be interpreted with caution due to the small sample size. Larger trials with more samples from several species, breeds and ages are required to build on this pilot study for differentiation of organs within a multi-species abattoir or supply chain, where one or two incorrectly classified organs will not severely affect the model metrics. For instance, Cozzolino and Murray [18] showed very similar results to the present study when differentiating meat by species, although in this case, SWIR and COMB (94-96%) were more accurate than VIS (85%).
The use of such non-invasive devices in the meat processing industry has been hailed for a long period [3]. However, a lack of consistent accuracy, particularly for quality traits, in conjunction with the high costs of installation, has held such technologies back from industry adoption [23,42]. The present study presents a different application for such technologies, whereupon organ differentiation can take place objectively within the abattoir, and the cost of qualified staff could offset the installation and maintenance cost of the multi-sensory platform. Furthermore, such a platform could also add further value to the data collected by predicting chemical composition, quality control, and detection of health issues, as demonstrated in other studies [12,24,43,44]. Although RGB image analysis by computer vision may have been able to differentiate the organs by type in the present study due to their different appearances [8], the potential identification of other non-visible factors such as species, disease, the chemical composition of organs, or even the addition of other organs more similar in appearance may require broader spectral information for successful differentiation.
A novel aspect of the present study was the use of RF as an alternative classification method and its comparison to the conventional PLS-DA and PCA to discriminate organs based on the spectral signature. Random forest is a classification algorithm that has found multiple applications because of its efficiency in handling large datasets and achieving high accuracy [33]. However, decision tree RF modelling has been sparsely used in hyperspectral classification studies of food [7,11,45] in comparison to PLS-DA and linear discriminant analysis (LDA) [2,9,11,42]. Positive results for RF classification were found in the present study, with accuracy compared to PLS-DA being very similar on the LOOCV dataset and slightly lower on the in-sample dataset. For COMB, RF produced greater LOOCV and in-sample accuracies than PLS-DA. Kong et al. [45] found that RF modelling was superior to PLS-DA when classifying rice seed cultivars in the SWIR spectrum. In most previous qualitative studies with HS, PLS-DA has been preferred to RF and other classification methods [11] because PLS-DA provides a combination of partial least squares regression and LDA [43]. When comparing the PCA plots in Figure 5 with PLS-DA and RF results, most organ samples could be visually classified as a specific type through clustering, although the accuracy was lower (60-75%) compared to PLS-DA and RF on the LOOCV dataset (79-96%). It is worth noting that the PCA in the present study was exploratory and not meant for classification as it is unsupervised [7], whereas the supervised PLS-DA and RF methods were used to build robust classification models as per previous studies comparing PLS-DA and PCA [26,46].
The present study provided good overall accuracy (more than 80%) when using VIS and SWIR HS sensors individually and in combination to differentiate organs by type. However, one limitation was the time required to download, markup, extract and analyse the spectral data, all processes that can be automated based on the results of the present study. Despite a rapid scanning time (5-6 s), image sizes of 48 KB for VIS frames and 13 MB for SWIR frames were large, with some scans having up to 1000 frames downloaded per scan, which can be time and space consuming. This excess consumption may require a high-performance computer, and the time required for image download processing may slow the uptake of these automated HS processes in commercial conditions, as any technology would need to be run at chain speed [47]. Similar issues with image file size were reported by Elmasry et al. [2]. However, these limitations could be easily overcome, and the whole process could be fully automated. The small sample size of the present pilot study resulted in no testing of the calibration model against an independent dataset, although LOOCV is an accepted and widely used method for model evaluation in VIS and SWIR HS studies [7,12,48]. The automatic segmentation of an image into "organ" and "background" would allow for organ identification based on shape analysis and for discriminant analysis of each ROI for classification. Such programming would be needed prior to deployment in the industry, and a larger training library is also essential in improving the accuracy of the model.
Other characteristics that could be examined and quantified by HS imaging to assist with the uptake of these technologies include protein, fat, and mineral concentration of organs. Prior studies have investigated the prediction of these parameters with SWIR HS imaging of lamb meat [24], and near-infrared reflectance spectroscopy on different meat products to varying levels of accuracy [20,23]. However, the use of ground meat as opposed to intact meat for the most successful of these studies has similarly slowed the progress of uptake in processing plants [42].
The differences in reflectance and absorbance intensity between organ types arise from differences in the chemical composition, colour, and tissue morphology, which provide a spectral signature to each organ [7,13]. Biel et al. [49] found that of livers, hearts and kidneys, livers had the most protein, P and K; hearts had the most fat; kidneys had the most Ca and Na. In a study on lamb offal nutritional composition, the lungs had significantly more moisture and Fe than the other organs, whereas the heart had more fat, the liver more Zn, and the kidney more Na [50]. This may correspond to the findings of the present study, where hearts and lungs had stronger reflectance than livers and kidneys. However, a study on pork found that Raman spectral reflectance was higher in the heart, followed by the kidney, and lowest in the liver [51], which agreed with the present study.

Conclusions
The present pilot study showed that visible, short-wave infrared, and the combination of these hyperspectral sensors with wavelengths between 400 and 1700 nm could be implemented in a multi-sensory imaging system to accurately differentiate organ types. In addition, these sensors could have the potential for other future commercial applications at chain speed, such as measuring the chemical composition and detecting organs with defects or diseases. Both sensors had similar accuracy, although the VIS sensor tended to show greater classification accuracy than SWIR or COMB, and the system was very effective at differentiating livestock organs by type with good accuracy and sensitivity. For the purposes of organ differentiation, the present study showed that VIS HS sensors alone could reliably differentiate between organs without the requirement of an additional SWIR sensor, though further studies are required to ascertain this. The PLS-DA algorithms were slightly more accurate for differentiation compared to the random forest, whereas most data pre-processing methods did not provide significant advantages in spectral smoothing or model accuracy, except for centred moving average and first derivative, which were superior to raw spectra, second derivative, Savitzky-Golay smoothing and SNV. Improvements in sample size and in streamlining the analytical process to provide information in real-time could allow such systems to be deployed into the meat processing industry as control tools for authentication of livestock organs by organ type. The value of the system could potentially increase by including other characteristics such as the identification of species and disease, contamination, and other quality control outcomes.