In various domains of research and business, the statistical analysis of big data has gained prominence owing to the enormous volume of big data requiring analysis within a progressively shortened period. By establishing a correlation between raw sensing data and ambiguously defined physical quantities, researchers have recently reported a growing versatility in the functionality and enhanced performance of traditional sensors when combined with machine learning (ML) based statistical analysis.1–7 Furthermore, the utilization of advanced sensing versatility by computational sensing systems through different home appliances enables hyper-personalization and hyper-customization of human everyday life including food inspection, healthcare, and beauty care.8–10
With the steadily rising consumption of meat along with gastronomic flavor, its freshness and aging have emerged as the most intriguing quality control factors for food inspection. Defining the freshness or aging degree of meat as a physical quantity is intriguing, ambiguous, and strongly influenced by personal preference. Currently, standard techniques for the evaluation of meat freshness or its aging degree are mostly destructive, non-portable, expensive, and difficult to access by general users.11,12 Thus, optical inspection techniques such as the reflectance of UV–Vis–NIR from meat surfaces have been investigated over several decades. 13–15 However, several approaches rely on extracting the degree of freshness without understanding the underlying mechanism related to specific molecular changes in freshness, which has rendered the results unreliable and unreproducible.13–15 To investigate the freshness of pork meat, suitable biomarkers such as collagen, reduced nicotinamide adenine dinucleotide (NADH), and flavin have been deemed suitable.16,17 Studies have monitored the ~ 390, 460, and 525 nm fluorescence as a function of time from pork specimens stored at room and refrigerator temperatures (4 oC), when stimulated by a 340 nm light emitting diode (LED) for up to three days.16,17 However, statistical and areal map studies of meat freshness in specimens have not been performed based on the correlation between meat freshness and fluorescence from biomarkers. Thus, a hyperspectral imaging system (HIS) is considered suitable for extracting invisible information on food inspection by imaging morphological and spectroscopic data collected from macroscale meat samples through ML grafting.
In this study, meat freshness is monitored using HIS and ML as proof-of-concept. It can be clearly distinguished not by an RGB camera but spectral information from HIS. By combining HIS with ML, meat freshness can become a tangible physical quantity for applications in daily life. This study can be applied in the domain of smartphone business, which would allow people to test and evaluate meat readily at any place and situation.
Acquisition of Hyperspectral Data Cube and Evaluation of Meat Freshness by ML
Figure 1 shows the entire process behind obtaining data cubes using HIS and ML for identifying meat freshness. In this study, the line-scan and snapshot types of HIS were used to image the morphology and spectral information of meat specimens. A line-scan-type HIS was designed to move 365 nm LED arrays, while a long rectangular window was developed to excite and collect fluorescence signals over the meat specimens. The fluorescence signal transported to a commercially available grating was collected in the form of 3D (one spectral dimension and two spatial dimensions) hyperspectral data cube, as shown in Fig. 1. For the snapshot-type HIS, Fabry–Perot filters were fabricated periodically on a complementary metal–oxide–semiconductor (CMOS) image sensor, which worked in the range 380–840 nm (see methods). The schematics for line-scan and snapshot types of HIS are shown in in Extended Data Figs. 1 and 2, respectively. High spectral and spatial resolution of the line-scan-type HIS is beneficial for investigating parameters correlated with meat freshness from the fluorescence spectrum. For details on the scanning area and spatial resolution for both types of HIS, see methods. Meat freshness could be extracted from the hyperspectral images by processing data efficiently. Particularly, ML on a hyperspectral data cube with the merit of data size obtained by snapshot-type HIS, based on fundamental studies on line-scan-type HIS, was conducted to evaluate the information on meat freshness.
Hyperspectral images of the meat surface were decomposed into a series of spectral bands (λ1, λ2, λ3, λ4, ...), forming a hyperspectral data cube. The full spectrum of each local point was constructed by combining intensity and wavelength in the vertical direction. Typical fluorescence spectra of fresh and rotten meat specimens are shown in Extended Data Fig. 3a and b. The broadband from NADH at 490 nm and its enhancement in intensity with lowered freshness agreed with those observed in previous studies.17,18 Conversely, the sharp peak at ~ 600 nm appeared to have a relation with myoglobin, which exists inside living cells of mammals and is related to their breathing activity. The reference spectra of NADH and myoglobin purchased from Aldrich Inc. were exceptionally similar to those of meat and are shown in in Extended Data Fig. 3c and d, respectively.
Traditional Analysis of Meat Freshness and 2D Freshness Index Map
To understand the morphological and chemical changes in meat specimens as a function of refrigerator storage time (T ≈ 4 oC), RGB images illuminated with white LED and hyperspectral images of fluorescence excited by 365 nm were captured by a digital camera and line-scan-type HIS, respectively. The process was conducted on the same piece of specimen under the same conditions for approximately 17 days and the results are shown in Fig. 2a and b. The meat specimens were packaged in polyethylene (PE) wraps to avoid contamination and other handling issues. The RGB images of the meat specimens as a function of storage time were analyzed using the CIELAB color space, referred to as L*a*b*, where L* represents lightness, a* represents green–red opponent colors with negative and positive values toward green and red, respectively, and b*denotes blue–yellow opponents with negative and positive values toward blue and yellow, respectively. The distributions of a* and b* values, represented by red and yellow bars, are displayed on the right side for each RGB image, while their average values are indicated by red and yellow dots in the guideline, respectively. With increase in storage time, both a* and b* values merged to 10 starting from the 7th day, implying that the color of meat turned less reddish and yellowish. In addition, distinguishing the state of meat freshness after the 7th day was not possible. Another type of RGB images defined by “RGBhyper” was obtained by transforming hyperspectral images of meat fluorescence via the CIEXYZ color space, as shown in Fig. 2b, where the representative fluorescence spectrum of each storage day is displayed on the right side. With longer storage time, the relative intensity of NADH located at ~ 490 nm against 600 nm increased. F. I. was defined as
$$\text{F}. \text{I}.=\left({I}_{N}-{I}_{M}\right) / \left({I}_{N}+{I}_{M}\right)$$
1
where \({I}_{N}\) and \({I}_{M}\) are the intensities of NADH and myoglobin peaks deconvoluted from the fluorescence spectrum, shown by the blue and pink shaded areas, respectively. Figure 2c shows a 2D map of F. I. for each storage day, while Fig. 2d shows the average F. I. value of each hyperspectral image, which increased monotonously up to the 10th day and finally saturated. The number of bacteria per unit area (CFU/cm2) (\({N}_{bac}\)) measured using the standard method (see methods) gradually increased on a logarithmic scale, as shown in Fig. 2e, where the pink shaded area indicates the inedible state of meat at \({N}_{bac}\) > 107 (CFU/cm2)17. Thus, F. I. was confirmed to have a strong correlation with meat freshness. However, the CIELAB color space analysis of the RGB images confirmed that meat freshness could not be distinguished after the 7th day of storage, although meat remained edible at \({N}_{bac}\) < 107 (CFU/cm2). The correlation among \({N}_{bac}\), storage date (d), and F. I. was obtained by fitting the experimental data shown in Fig. 2d and e using a relation defined as
$$\text{log}\left({N}_{bac}\right)=2.6\sqrt{d+6.4}-3.4$$
2
$$F.I. =0.066\left(\text{log}\left({N}_{bac}\right)+2.5\right)$$
3
.
Using these functions, guidelines were added to the experimental data by applying a width of ± 1.0 and ± 0.1 in Fig. 2d and e. According to Eq. (3), F. I. > 0.63 for the inedible state and is indicated as the pink shaded area in Fig. 2d.
The F. I. of the meat specimens, one stored in a refrigerator and the other in a freezer, was monitored as a function of storage time to prove the representativeness of meat freshness at unknown storage or commercial distribution channel history. Predictably, the F. I. values of the sample stored in the refrigerator increased gradually to approximately 0.7, but those of the sample stored in the freezer remained at approximately 0.55, as shown in Fig. 2f. At the first stage, the initial increase in the F. I. value for the frozen meat could be attributed to the structural changes in the meat specimen or an actual increase in \({N}_{bac}\) before freezing.
The color of meat specimens is particularly related to the oxidation of myoglobin. Meat is bright red, which looks fresh to the human eyes, owing to iron oxidation at the center of the heme ring in myoglobin molecules by attaching oxygen or water molecules. When the meat specimen is vacuum-packaged, its color turns dark brown, which looks stale to the human eye. The freshness of PE wrap and vacuum-packaged meat specimens is investigated as a function of storage time using the F. I. and a*/b* values from hyperspectral and RGB images, respectively. The color of the meat specimen was darker even on the 0th day, as shown in Fig. 3, due to the desorption of oxygen molecules from myoglobin on the meat surface during vacuum packaging. Figure 3a shows an RGB image under white light captured by a digital camera, an RGBhyper image, and the F. I. map of a vacuum-packaged meat specimen on the 0th day. On the 0th day, a* and b* for the vacuum-packaged meat were distributed in a range, shown in Fig. 3b, similar to that of inedible meats, and they remained similar until the 12th day, as shown in Extended Data Fig. 4a. The values of F. I., a*, and b* were monitored as a function of storage time for both vacuum- and PE-packaged samples, and the results are presented in Fig. 3c and d, respectively. \({N}_{bac}\) was monitored in the PE-packaged meat specimen stored together with the vacuum-packaged meat specimen (Extended Data Fig. 4b). \({N}_{bac}\) for the present batch increased rapidly when compared to that shown in Fig. 2 because of different environmental conditions, including weather, preparation process, and distribution channel history. The representative fluorescence spectra on the 0th and 12th day are shown in Extended Data Fig. 4c. The PE-packaged meat exhibited a gradual increase in the F. I. value, which was similar to that of \({N}_{bac}\), as shown in Fig. 3c due to exposure to air. However, the F. I. value of the vacuum-packaged meat was maintained approximately to the 12th day because the meat stayed fresh by preventing oxygen adsorption on its surface. The freshness of the vacuum packaged meat was verified through the hyperspectral image of the meat fluorescence and its F. I., as shown in Extended Data Fig. 4d. The gray shaded area in Fig. 2d and e represent the guidelines that were calculated using Eqs. (2) and (3). The slight discrepancy between the experimental data (black dots) illustrated in Fig. 3c may have originated from the different relative ratios of fat and flesh contents in the meat specimens used, as shown in Fig. 2a. Since the characteristic band of fatty acids is located in a wavelength range similar to that of NADH, Eqs. (2) and (3) were modified to fit F. I. with a higher accuracy by excluding the areas of fat while calculating F. I..19 On the 0th day, the vacuum-packaged meat in Fig. 3b exhibited relatively lower average values of a* and b* when compared to those of the PE-packaged specimen in Fig. 2a. a* and b* are shown to be < ~ 22 and < ~ 30, and < ~ 30 and < ~ 40 for vacuum packaged and PE wrapped specimen, respectively. With prolonged storage time, the mean values of a* and b* of the PE-packaged meat tended to decrease, while they remained almost constant for the vacuum-packaged specimen, as shown in Fig. Figure 3d. From the 0th to the 12th day, the mean values of a* and b* changed slightly from 13.7 to 12.5 and from 7.6 to 4.7 for the vacuum-packaged meat, respectively. Furthermore, the color of meat could be influenced by various factors such as its freshness, pH, part of meat, and nutritional state. However, larger differences between the F. I values of the PE- and vacuum-packaged specimens than a* and b* were observed. Thus, the results suggest that meat freshness can be classified more clearly by using hyperspectral image sensors than by RGB image sensors. Expectedly, meat freshness can also be distinguished by imaging meat fluorescence under a 365 nm LED using an RGB camera. We simulated the RGB image of meat fluorescence by converting the hyperspectral image into RGBhyper images as a function of the storage time. We observed that the a* and b* values of the RGBhyper images did not change sensitively within the edible state (≤ 7th day of storage), as shown in Extended Data Fig. 5. Thus, hyperspectral imaging was confirmed to be a powerful tool for discerning meat freshness against RGB images taken under white or 365 nm LED. Since the freshness stage of meat is not easily accessible to consumers, the proper analysis tool needs to be devised for precise freshness evaluation.
In an experiment, four types of packaging materials, listed in table S1, were investigated to understand their influence on the fluorescence spectrum. The results are shown in Extended Data Fig. 6a and b. PE and PVC wrap or zipper bags produced unnoticeable fluorescence signals, while vacuum packaging material produced a non-negligible intensity of broad fluorescence at approximately 470 nm. However, the condition was magnified more than 20 times as shown in Extended Data Fig. 6a, where 5 s integration with two layers was performed as compared with the experimental condition of 400 ms to obtain fluorescence from the meat specimen. On packaging the meat in PE or PVC wrap and zipper bags, the shape of the fluorescence spectrum was maintained while its intensity decreased, as shown in Extended Data Fig. 6b. The overall line-shape of the fluorescence was independent of the packaging material. This result indicates that fluorescence spectroscopy can be applied in daily life to analyze meat freshness when commercial food packaging materials are used.
Hyperspectral Imaging and ML for Meat Freshness by Snapshot-type HIS
Furthermore, a 16-channel(CH) snapshot-type HIS was fabricated and Fabry–Perot filters were formed periodically on a CMOS image sensor operating in the 380–840 nm range while including a blank channel. To optimize transmission and its resonance wavelength, alternative TiO2 and SiN films with variable thicknesses were stacked vertically along with Cu or Al reflectors at the top and bottom, behaving as a Fabry–Perot filter. The final characteristic transmission curves shown in Fig. 4a were obtained by multiplying the quantum efficiency (QE) of the CMOS image sensor and transmission of each filter. Figure 4b shows the hyperspectral image of fluorescence from the meat specimen supported by a black Styrofoam tray, excited by 365 nm LEDs. The image was demosaiced into each CH, as shown on the right side of Fig. 4b, where the enlarged CH distribution of the small yellow square in the hyperspectral image is shown on the right-hand side. Hyperspectral images from the same meat specimen were taken as a function of storage time. For the 0th and 15th day, two representative fluorescence spectra from the fresh and rotten states of the meat specimen taken by the snapshot-type HIS, respectively, are shown in Fig. 4c. Comparatively, a large enhancement at approximately 500 nm was observed on the 15th day as opposed to the 0th day. Thus, the results were consistent with those obtained from the line-scan-type HIS, as illustrated in Fig. 2. ML can be applied to reduce the dimensions of hyperspectral data cubes and to extract features related to meat freshness from hyperspectral images. The reduction in data dimensionality can maximize the efficiency of computing resources, such as computing time and memory. Moreover, the risk of overfitting data resulting from a complicated analysis model can be reduced, and the dimension reduction can prove to be advantageous for the ease of data interpretation. Among various algorithms available for dimension reduction, principal component analysis (PCA) and LDA are commonly used.20,21 LDA is opted for dimensionality reduction of hyperspectral data from 11 to 2 dimensions (indicated by \({\text{L}\text{D}\text{A} \text{c}\text{o}\text{m}\text{p}\text{o}\text{n}\text{e}\text{n}\text{t}}_{1}\) and \({\text{L}\text{D}\text{A} \text{c}\text{o}\text{m}\text{p}\text{o}\text{n}\text{e}\text{n}\text{t}}_{2}\) in Fig. 5a). Four long-wavelength CHs and one blank CH were initially excluded out of the 16 CHs that did not convey information on the fluorescence signal from the meat specimen. The raw intensity profiles of the remaining 11 CHs as a function of wavelength were standardized by their mean value and standard deviation. Furthermore, dimensionality reduction from 11 to 2 dimensions was conducted by subtracting the channel-dependent constant (\(\stackrel{-}{{x}_{j}}\)) from value of each CH (\({x}_{j})\), followed by the multiplication of two coefficients (\({\text{s}\text{c}\text{a}\text{l}\text{i}\text{n}\text{g} \text{f}\text{a}\text{c}\text{t}\text{o}\text{r}}_{1}\)and \({\text{s}\text{c}\text{a}\text{l}\text{i}\text{n}\text{g} \text{f}\text{a}\text{c}\text{t}\text{o}\text{r}}_{2}\)), which were determined using the LDA method. The data points are shown in Extended Data Fig. 7. Here,
$${\text{L}\text{D}\text{A} \text{c}\text{o}\text{m}\text{p}\text{o}\text{n}\text{e}\text{n}\text{t}}_{i}= \sum _{j=1}^{11}{\text{s}\text{c}\text{a}\text{l}\text{i}\text{n}\text{g} \text{f}\text{a}\text{c}\text{t}\text{o}\text{r}}_{j}\left({x}_{j}-\stackrel{-}{{x}_{j}}\right), i=1, 2$$
4
LDA component1 was plotted against LDA component2 of the hyperspectral images of meat as a function of storage time, as illustrated in Fig. 5a. With longer durations of storage time, highly scattered data were gradually merged to the negative values of the LDA component1, where each dot was extracted from dimensionality reduction using LDA. Even on the 0th day, the negative values of LDA component1 appeared to originate from the fat tissues whose fluorescence was similar to that of NADH. The decision or evaluation boundaries of F. I. produced by QDA are shown in Fig. 5b as contour plots.22 Information on F. I., averaged over each hyperspectral image by line-scan-type HIS as reference data, and hyperspectral images taken by snapshot-type HIS were obtained for identical meat specimen as a function of storage time. Since the average value of F. I. of the meat specimen was initially known from the analysis of line-scan-type HIS, QDA was adopted to obtain decision boundaries of the F. I. for the two LDA components under supervised learning. By hyperspectral imaging of meat fluorescence and extracting two components through LDA, the value of F. I. was estimated using the decision boundary contour plot shown in Fig. 5b. RGBhyper images were constructed from snapshot hyperspectral images, as shown in the upper row of Fig. 5c. Gradually, the image turned bluish. The values of R, G, and B were calculated by averaging the intensities of the three channels at (630 nm, 670 nm, 690 nm), (520 nm, 540 nm, 575 nm), and (430 nm, 460 nm, 495 nm), respectively. The F. I. maps constructed from the hyperspectral images by the LDA and QDA are shown in the lower panel of Fig. 5c. Thus, gradual changes in the F. I. values of the meat specimens were visualized as a function of storage time.
Furthermore, ML analysis with snapshot-type hyperspectral images was applied to vacuum-packaged meat for comparison with the PE-wrap-packaged meat. The results are presented in Extended Data Fig. 8. For the vacuum-packaged meat, the RGBhyper images converted from the hyperspectral images and its F. I. map were compared on the 0th and the 28th day. The F. I. distribution up to the 28th day remained similar to the initial state, as shown in Extended Data Fig. 8a. The dependency of the F. I. values of PE- and vacuum-packaged meat specimens on storage time, obtained by line-scan-type and snapshot-type HIS, is shown in Extended Data Fig. 8b. Irrespective of the HIS type, the time-dependent behavior of F. I. was quite similar, both qualitatively and quantitatively
Despite low spatial and spectral resolution compared to line-scan-type HIS, the snapshot-type HIS offered competitive advantages in several aspects, such as cost effectiveness and efficiency of computing resources. Using this methodology, a smartphone installed with a hyperspectral camera can be used to capture both outer appearance and hyperspectral images of meat at any place to determine meat freshness. To make hyperspectral cameras more powerful in business domains, proper ML-based algorithms have to be developed to find the true color, spectrum, and applications of the objects under interest.