Single Nanowire Gas Sensor Able to Distinguish Fish and Meat and Evaluate Their Degree of Freshness

: A non-invasive, small, and fast device is needed for food freshness monitoring, as current techniques do not meet these criteria. In this study, a resistive sensor composed of a single semiconductor nanowire was used at different temperatures, combining the responses and processing them with multivariate statistical analysis techniques. The sensor, very sensitive to ammonia and total volatile basic nitrogen, proved to be able to distinguish samples of ﬁsh (marble trout, Salmo trutta marmoratus ) and meat (pork, Sus scrofa domesticus ), both stored at room temperature and 4 ◦ C in the refrigerator. Once separated, the ﬁsh and meat samples were classiﬁed by the degree of freshness/degradation with two different classiﬁers. The sensor classiﬁed the samples (trout and pork) correctly in 95.2% of cases. The degree of freshness was correctly assessed in 90.5% of cases. Considering only the errors with repercussions (when a fresh sample was evaluated as degraded, or a degraded sample was evaluated as edible) the accuracy increased to 95.2%. Considering the size (less than a square millimeter) and the speed (less than a minute), this type of sensor could be used to monitor food production and distribution chains.


Introduction
Food safety is important nowadays, especially when it comes to fresh food. Fresh foods are healthier but are also more prone to rapid degradation. This has important repercussions both in terms of food losses along the distribution chain and on the health of consumers and therefore on the health system [1,2]. The modern development of longer distribution chains is not suitable for this type of food, as it extends the time that passes before the consumer has the product at home and therefore increases the possibility of degradation [3]. Fish and meat products are fresh products that represent optimal growth media for a large variety of spoiling microorganisms. The metabolic activity of these microbes can lead to the production of ammonia, biogenic amines, nitrogen compounds, alcohols, ketones, aldehydes, esters, gases (CO 2 ), etc. responsible for unpleasant odors [4]. For this reason, the number of microorganisms present for each gram of sample is used as a reference value when evaluating the degradation of a product and is called the total viable count (TVC). Since after fishing or slaughter the microorganisms reproduce, and their number increases greatly as they spread to the various tissues [5], the TVC measurement can be considered a standard [6].
Fortunately, the volatiles produced by the microorganisms can also be used to assess the degradation status of the product in a non-invasive way. An instrument capable of detecting these volatiles can give a rough estimate of the number of microorganisms on the meat or fish, therefore of its state of freshness/degradation [7,8]. A sufficiently sensitive device would be able to detect these volatiles at a very initial state, when the proliferation of microorganisms has not yet degraded the product. In this way, it could be used to monitor the quality of the product along its distribution chain, from production to sale to the final consumer. A group of volatile molecules widely used to measure the degradation of meat and fish is the so-called total volatile basic nitrogen (TVB-N). The main components of this group are trimethylamine (CH 3 ) 3 N (TMA), dimethylamine (CH 3 ) 2 NH (DMA), and ammonia NH 3 [9].
There are already tools capable of accurately analyzing these volatile compounds: they extract, separate, and identify them with chromatographic techniques and mass spectrometry [10]. This type of technique can identify every single compound present in the headspace so that it can be linked to the metabolic processes of spoilage microorganisms. Unfortunately, the other side of the coin is the complexity, size, and cost of this equipment, but above all, the time taken by highly qualified personnel. For this reason, it is not possible to use these techniques on a large scale, to monitor products along the production and distribution chain. For this purpose, it is necessary to develop sensors that are fast and inexpensive so that they can be used extensively. Resistive gas sensors based on metal oxide nanowires are a strong candidate, as they are tiny, simple, and inexpensive [11,12]. The mechanism is based on the chemical reactions that occur on the surface of the nanowires, where the volatile molecules react by releasing or absorbing electrons and thus influencing the resistance of the sensor. It has already been shown that such sensors can detect ammonia TVB-N at very low concentrations and thus evaluate the freshness of mackerel fish [13]. Unfortunately, a resistive sensor gives a one-dimensional response that cannot have selectivity and can therefore only be calibrated and used for a single food product at a time.
To overcome this problem, here, the responses obtained by the sensor at different working temperatures are combined and processed with multivariate statistical analysis techniques (principal component analysis (PCA)) and machine learning algorithms (support vector machine (SVM)) [14]. In this way, the sensor is able to distinguish different products (specifically marble trout and pork) with a first classifier and then independently evaluate, by means of two different classifiers, the degradation status of meat and fish. The distinction between meat and fish occurs correctly in 95.2% of cases, with only one misclassification per food. The degree of freshness/degradation of the sample is correctly indicated in 85.7% of cases for trout and in 95.2% of cases for pork. If the classification as edible/inedible is only considered, the classification is correct in 95.2% of cases for both types of food.

Synthesis of SnO 2 Nanowires
Initially, a layer of tin oxide nanowires (SnO 2 ) was grown by means of chemical vapor deposition (CVD) in a horizontal tube of quartz placed inside an oven (Lindberg Blue M, Thermo Fisher Scientific, Waltham, MA, USA). The nanowires were grown using an alumina boat filled with pure tin monoxide, placed in the center of the furnace, at its maximum temperature as the evaporation source. The nanostructures were grown on a silicon substrate of about 1 × 1 cm 2 , deposited with a thin gold film (about 5 nm thick) acting as a catalyst, and positioned 1 cm from the alumina boat. The quartz tube was pumped down to 10 −2 mbar and then purged with high purity argon (99.999%) three times, and finally, the system was pumped to limit the pressure. The temperature was then increased from 26 • C (room temperature) to 850 • C at a rate of 25 • C/min, and the oven was held at 850 • C for five minutes. The growth of the nanowires began by injecting an oxygen flow of 0.35 standard cubic centimeters (sccm) into the system. The growth of the nanostructures following the vapor-liquid-solid (VLS) mechanism [15] lasted 30 min, then the system was shut down and allowed to cool. At the end of the growth process, the substrate showed an evident soft and homogeneous white film.

Nanowires Characterization
The morphology of the metal oxide nanowires was investigated by scanning electron microscopy (SEM) with a Hitachi S-4800 (Tokyo, Japan) and by transmission electron microscopy (TEM) using a JEM-100CX (JEOL, Tokyo, Japan) operating at 90 kV. The structure of the SnO 2 nanowires was characterized by X-ray diffraction (XRD) using a Philips Xpert Pro (Malvern Panalytical, Malvern, UK) diffractometer working at 40 kV with CuKα radiation.

Sensor Fabrication
A piece of a substrate with grown SnO 2 nanowires was then treated under ultrasounds in dimethylformamide (DMF) for two seconds. Some drops of the resulting dispersion were spread on an entire Si/SiO 2 wafer while spinning it at 6000 rpm, in order to optimize the nanowire density. A Ti/Pt (10/250 nm) two-dimensional array composed of square electrodes was deposited on top of the dispersed nanowires using sputtering and UV lithography on the whole wafer. Titanium was used as an adhesion layer in this case, but this choice must be weighed in light of its influence on the performance of the device [16][17][18]. By observing the gap between all the pairs of electrodes under an optical microscope and measuring their resistance, pairs of electrodes bridged by one or more nanowires were found. Observing the candidates with the best characteristics by means of SEM microscopy, the pairs were verified in order to choose the single nanowire devices and check their characteristics (arrangement, length, morphology, diameter, etc.).

Gas Sensor Measurements
A single nanowire sensor was placed on a small heatable plate in a chamber connected to gas flow controllers connected to high purity gas cylinders. The electrodes were contacted with microprobes connected, through a multimeter (Keithely 2410, Cleveland, OH, USA), to a data acquisition program (LabView, National Instruments, Austin, TX, USA). The sensor was initially heat-treated for 8 h at 500 • C in nitrogen while being fed with 1 V, in order to stabilize the structure and its resistance so that they do not change during the experiments [19]. The sensor showed good ohmic contact between the nanowire and the metal electrodes and its resistance dropped from 7.5 MOhm at 200 • C down to 122 kOhm at 360 • C. The sensor was initially tested with different ammonia concentrations (5 to 0.1 ppm) while heated to various temperatures (200-360 • C).
The most common definition in the literature has been used for the sensor response, that is S = R air /R NH3 , where R air and R NH3 are, respectively, the resistance of the sensor in air and in the presence of ammonia. The speed of the single nanowire sensor is evaluated using a common definition of response and recovery times: t RESP is the time it takes to reach 90% of the maximum response, and t REC is the time to go down to 90% of the full recovery. The limit of detection (LoD), that is, the minimum detectable concentration, was calculated as 3 • N/D, where N is the noise of the sensor signal (its standard deviation) in air, and D is the derivative of the sensor response as a function of the ammonia concentration.

Meat and Fish Spoilage Measurement
The two foods (one marble trout and one piece of pork) were cut into cubes weighing about 20 g from a larger fresh piece, using disposable gloves and autoclaved tools. Each sample was stored individually, in a glass jar, until the moment of measurement. A part of the samples was stored at room temperature (about 26 • C) and another part instead in a refrigerator at a temperature of 4 • C. At each measurement (initially every hour, then 3, 6, and finally 12 h) a sample was placed in the measurement chamber to determine the response of the gas sensor, and immediately afterward, it was subjected to microbial analysis, in order to compare the two measurements. The total viable count (TVC) was assessed using a spread plate method [20] on a plate count agar and agar base (Oxoid CM0463 and 0055). The plates were then counted after an incubation time of 48 h at 30 • C.

Machine Learning
Since the single response of the resistive sensor is inherently non-selective, the responses at the five working temperatures were combined to create 5-dimensional points that could be processed and analyzed with multivariate statistical analysis techniques [21]. The 5D points were used both for visualization via principal component analysis (PCA) and for classification and quantification with a support vector machine (SVM). The samples used for PCA are those measured initially, to monitor the degradation of the samples over time. Subsequently, other samples were randomly measured in order to reach a sufficient number of data to be divided into two groups: two-thirds for the training group and one-third for the test group. The SVM was used as a classifier in two successive steps: a first classifier was used to identify whether the sample is fish or meat (marble trout or pork), and subsequently, two classifiers were used on the subgroups identified as fish and meat, in order to evaluate their degree of freshness. All SVM classifiers were always used with a linear kernel.

Nanowires Characterization
The SnO 2 nanowire forest was initially studied by scanning electron microscopy in order to investigate the morphology of the nanostructures. The nanowires that make up the forest, shown in Figure 1a, have diameters around 40-65 nm and are several microns long. Many of the nanowires shown are blurred due to the charging effect due to their high electrical resistance.
(Oxoid CM0463 and 0055). The plates were then counted after an incubation time of 48 h at 30 °C.

Machine Learning
Since the single response of the resistive sensor is inherently non-selective, the responses at the five working temperatures were combined to create 5-dimensional points that could be processed and analyzed with multivariate statistical analysis techniques [21]. The 5D points were used both for visualization via principal component analysis (PCA) and for classification and quantification with a support vector machine (SVM). The samples used for PCA are those measured initially, to monitor the degradation of the samples over time. Subsequently, other samples were randomly measured in order to reach a sufficient number of data to be divided into two groups: two-thirds for the training group and one-third for the test group. The SVM was used as a classifier in two successive steps: a first classifier was used to identify whether the sample is fish or meat (marble trout or pork), and subsequently, two classifiers were used on the subgroups identified as fish and meat, in order to evaluate their degree of freshness. All SVM classifiers were always used with a linear kernel.

Nanowires Characterization
The SnO2 nanowire forest was initially studied by scanning electron microscopy in order to investigate the morphology of the nanostructures. The nanowires that make up the forest, shown in Figure 1a, have diameters around 40-65 nm and are several microns long. Many of the nanowires shown are blurred due to the charging effect due to their high electrical resistance. The TEM image in Figure 1b shows the tip of a single nanowire on a carbon membrane. The nanowire is straight and with a constant diameter. The structure of the nanowires was investigated through X-ray diffraction. All peaks shown in the X-ray pattern of Figure 2   The TEM image in Figure 1b shows the tip of a single nanowire on a carbon membrane. The nanowire is straight and with a constant diameter. The structure of the nanowires was investigated through X-ray diffraction. All peaks shown in the X-ray pattern of Figure 2 (black, top) can be easily indexed as the tetragonal phase of SnO 2 , with lattice parameters of a = b = 4.742 and c = 3.186 Å, which are in good agreement with the values reported as reference (JCPDS n. 77-0450, red, bottom).
There are no phases other than the tetragonal one of SnO 2 , nor peaks due to impurities or amorphous contributions, confirming the good crystallinity of the nanowires. There are no phases other than the tetragonal one of SnO2, nor peaks due to impuri ties or amorphous contributions, confirming the good crystallinity of the nanowires.

Ammonia Sensing Performance
The sensing properties of the single nanowire sensor were initially tested by meas uring different concentrations of ammonia, as this volatile is part of the TVB-N, which i a known marker of meat and fish degradation [22]. Low concentrations were measured from 5 to 0.1 ppm. The measurements were carried out at five different temperatures from 200 to 360 °C, in order to subsequently combine the obtained responses and proces the data with multivariate statistical analysis. Figure 3a shows the current as a function o time as the different ammonia concentrations (indicated by the gray background) is in jected into the measurement chamber. As can be seen, as the ammonia is flowed onto th nanowire, the current rapidly increases and quickly returns to its base value as the am monia is evacuated.
As can be seen in Figure 3a, the sensor is very stable after the heat treatment carried out before the measurements. It can be seen in the figure that both the response and th recovery become faster as the working temperature of the sensor increases. Average re sponse times decrease from 48 to 8 s, while average recovery times decrease from 43 to s. Figure 3b shows the response values for the various ammonia concentrations at the fiv working temperatures. As can be seen, the response increases with increasing gas con centration with a slightly less than a linear trend in most cases. The response at the lowes temperature is the most linear, while the response to the highest temperature is the on that tends toward saturation. Figure 3c shows a three-dimensional diagram of the sensor with the SnO2 nanowire (in white) acting as a bridge between the two metal electrodes (in blue). Figure 3d instead shows a top view SEM image of the nanowire constituting th sensor. The behavior shown in Figure 3a, with the current increasing as ammonia is in jected, is typical of n-type semiconductors in response to reducing gases. Tin oxide is in fact a semiconductor in which the charge carriers are electrons, and it is very sensitive to the atmosphere that surrounds it [23], especially to reducing gases such as ammonia [24] When the sensor is exposed to air, the oxygen reacts on the surface of the SnO2 by draining electrons from the nanowire, thus decreasing the current flowing through it

Ammonia Sensing Performance
The sensing properties of the single nanowire sensor were initially tested by measuring different concentrations of ammonia, as this volatile is part of the TVB-N, which is a known marker of meat and fish degradation [22]. Low concentrations were measured, from 5 to 0.1 ppm. The measurements were carried out at five different temperatures, from 200 to 360 • C, in order to subsequently combine the obtained responses and process the data with multivariate statistical analysis. Figure 3a shows the current as a function of time as the different ammonia concentrations (indicated by the gray background) is injected into the measurement chamber. As can be seen, as the ammonia is flowed onto the nanowire, the current rapidly increases and quickly returns to its base value as the ammonia is evacuated.
As can be seen in Figure 3a, the sensor is very stable after the heat treatment carried out before the measurements. It can be seen in the figure that both the response and the recovery become faster as the working temperature of the sensor increases. Average response times decrease from 48 to 8 s, while average recovery times decrease from 43 to 6 s. Figure 3b shows the response values for the various ammonia concentrations at the five working temperatures. As can be seen, the response increases with increasing gas concentration with a slightly less than a linear trend in most cases. The response at the lowest temperature is the most linear, while the response to the highest temperature is the one that tends toward saturation. Figure 3c shows a three-dimensional diagram of the sensor, with the SnO 2 nanowire (in white) acting as a bridge between the two metal electrodes (in blue). Figure 3d instead shows a top view SEM image of the nanowire constituting the sensor. The behavior shown in Figure 3a, with the current increasing as ammonia is injected, is typical of n-type semiconductors in response to reducing gases. Tin oxide is in fact a semiconductor in which the charge carriers are electrons, and it is very sensitive to the atmosphere that surrounds it [23], especially to reducing gases such as ammonia [24]. When the sensor is exposed to air, the oxygen reacts on the surface of the SnO 2 by draining electrons from the nanowire, thus decreasing the current flowing through it. The ammonia molecules, on the other hand, react with the oxygen absorbed on the surface, releasing the electrons in the nanowire and thus increasing the current flowing through it [25,26] The last parameter calculated regarding the ammonia detection performance is the limit of detection, calculated according to the definition given in Section 2.4. The calculated value decreases with increasing temperature, from 70 ppb at 200 • C to 18 ppb at 360 • C. This very low value is important for the sensor to detect the low concentrations present in the early stages of meat and fish degradation.
face, releasing the electrons in the nanowire and thus increasing the current flowing through it [25,26].

NH3 + 3 O − (ads) → N+ 3 H2O + 3 e − (1)
The last parameter calculated regarding the ammonia detection performance is the limit of detection, calculated according to the definition given in Section 2.4. The calculated value decreases with increasing temperature, from 70 ppb at 200 °C to 18 ppb at 360 °C. This very low value is important for the sensor to detect the low concentrations present in the early stages of meat and fish degradation.

Measurements on Marble Trout and Pork Samples
The sensor response and the total viable count measured on marble trout samples stored at room temperature are plotted in Figure 4a. The response of the sensor at any working temperature increases over time, as does the microbial count. The total viable count increases its slope after about 10 hours and reaches the threshold value after about 23 h. This value, indicated by the dashed horizontal green line, is considered the consumability limit of the sample in the literature [9,27] and for health regulations [28].

Measurements on Marble Trout and Pork Samples
The sensor response and the total viable count measured on marble trout samples stored at room temperature are plotted in Figure 4a. The response of the sensor at any working temperature increases over time, as does the microbial count. The total viable count increases its slope after about 10 hours and reaches the threshold value after about 23 h. This value, indicated by the dashed horizontal green line, is considered the consumability limit of the sample in the literature [9,27] and for health regulations [28].  A similar behavior is observed in Figure 4b, which shows the sensor responses an the total viable count measured on marble trout samples stored in a refrigerator at 4 ° In this case, the curves rise more slowly, and the microbial count reaches the thresho value after about 66 h. In both cases, the response of the gas sensor at various temper tures follows the curve of the TVC quite closely. This good correlation, already demo strated elsewhere [29], shows that the response of the resistive sensor can be used as indirect measure of the microbial count and therefore of the state of degradation of t food sample. Figure 5a shows the sensor response and total viable count measured on pork sam ples stored at room temperature. Additionally, in this case, the curves increase over tim demonstrating the progressive degradation of the meat. The TVC graph increases t slope after about 10 hours and reaches the consumability threshold after about 40 h.  A similar behavior is observed in Figure 4b, which shows the sensor responses and the total viable count measured on marble trout samples stored in a refrigerator at 4 • C. In this case, the curves rise more slowly, and the microbial count reaches the threshold value after about 66 h. In both cases, the response of the gas sensor at various temperatures follows the curve of the TVC quite closely. This good correlation, already demonstrated elsewhere [29], shows that the response of the resistive sensor can be used as an indirect measure of the microbial count and therefore of the state of degradation of the food sample. Figure 5a shows the sensor response and total viable count measured on pork samples stored at room temperature. Additionally, in this case, the curves increase over time, demonstrating the progressive degradation of the meat. The TVC graph increases the slope after about 10 hours and reaches the consumability threshold after about 40 h. A similar behavior is observed in Figure 4b, which shows the sensor responses a the total viable count measured on marble trout samples stored in a refrigerator at 4 In this case, the curves rise more slowly, and the microbial count reaches the thresho value after about 66 h. In both cases, the response of the gas sensor at various tempe tures follows the curve of the TVC quite closely. This good correlation, already demo strated elsewhere [29], shows that the response of the resistive sensor can be used as indirect measure of the microbial count and therefore of the state of degradation of t food sample. Figure 5a shows the sensor response and total viable count measured on pork sa ples stored at room temperature. Additionally, in this case, the curves increase over tim demonstrating the progressive degradation of the meat. The TVC graph increases t slope after about 10 hours and reaches the consumability threshold after about 40 h.

Distinction between Meat and Fish
In the previous section, we saw that the response of the resistive gas sensor, at any working temperature, could be used as an indirect measure of the total viable count, both on marble trout and pork samples. Unfortunately, the sensor response lends itself to calibration for only one sample type and could not be used to distinguish different food samples. For this reason, the responses at five different temperatures were combined and processed through multivariate statistical analysis. Initially, we used principal component analysis to visualize the relationship between meat and fish points over time. The aim was to investigate whether the two foods had two different trends and observe whether the samples stored at different temperatures differed in any way. The results are shown in Figure 6, where the top samples are those measured initially (at the beginning of the plots in Figures 4 and 5), and then the points drop down as time passes.
OR PEER REVIEW 8 of 11

Distinction between Meat and Fish
In the previous section, we saw that the response of the resistive gas sensor, at any working temperature, could be used as an indirect measure of the total viable count, both on marble trout and pork samples. Unfortunately, the sensor response lends itself to calibration for only one sample type and could not be used to distinguish different food samples. For this reason, the responses at five different temperatures were combined and processed through multivariate statistical analysis. Initially, we used principal component analysis to visualize the relationship between meat and fish points over time. The aim was to investigate whether the two foods had two different trends and observe whether the samples stored at different temperatures differed in any way. The results are shown in Figure 6, where the top samples are those measured initially (at the beginning of the plots in Figures 4 and 5), and then the points drop down as time passes. The position of the points is given by the PCA of the 5D points obtained by combining the responses collected at various temperatures, while their color reflects the TVC measurement. Moving down the principal component 1 (vertically), the points become darker, indicating a higher TVC (legend on the right in the figure) and therefore greater degradation as time passes, as expected. The two groups of points, relating to fish and meat, are easily distinguishable, and rather separate from each other. This is a good indication that they are classifiable. Unfortunately, however, it is not possible to distinguish between samples stored in the refrigerator and those stored at room temperature. The position of the points is given by the PCA of the 5D points obtained by combining the responses collected at various temperatures, while their color reflects the TVC measurement. Moving down the principal component 1 (vertically), the points become darker, indicating a higher TVC (legend on the right in the figure) and therefore greater degradation as time passes, as expected. The two groups of points, relating to fish and meat, are easily distinguishable, and rather separate from each other. This is a good indication that they are classifiable. Unfortunately, however, it is not possible to distinguish between samples stored in the refrigerator and those stored at room temperature.
Based on these results, a support vector machine was then used to classify the fish and meat samples. This algorithm first uses a data set to map the five-dimensional space according to the classes and then compares the new data with the map to classify them. The results of this classification are shown in the confusion matrix in Table 1. For both meat and fish, the sensor correctly classified 20 out of 21 samples tested for 95.2% accuracy. The two misclassified points were both related to degraded food samples, with TVC greater than or close to 8.

Estimation of the Degree of Freshness of Food
Once the sensor distinguished the samples by type (marble trout or pork), the points relating to the two foods were processed with two other classifiers based on support vector machines, one for fish and one for meat. In this case, instead of using the "food type" label of the training dataset points (as the classifier used previously), the "degree of freshness" label was used, which was assigned according to the TVC value. The classification results for the pork samples are shown in the confusion matrix in Table 2. Table 2. Confusion matrix of classification regarding the state of freshness of pork samples. The background color represents the extent of the severity of a possible misclassification.

Pork
Estimated TVC (log cfu/g) <5 5-6 6-7 7-8 8-9 >9 True TVC (log cfu/g) The sensor classified the degree of freshness of pork samples very well, with an accuracy of 95.2%. Only one sample was classified in the wrong degree of freshness, which was called pork, while in reality, it was a sample of marble trout. Unfortunately, as can be seen from the background color of the misclassified sample cell, the error is significant, as the sample is considered fresh, while in reality, it is rather degraded. Evidently, the misclassification in the previous step has strong repercussions on the results of this classification.
The estimate of the degree of freshness of the marble trout samples is shown in Table 3. Table 3. Confusion matrix of classification regarding the state of freshness of marble trout samples. The background color represents the extent of the severity of a possible misclassification.

Marble Trout
Estimated TVC (log cfu/g) <5 5-6 6-7 7-8 8-9 > 9 True TVC (log cfu/g) It is immediately evident that the classification, in this case, is worse, as three samples are incorrectly classified, for an accuracy of 85.7%. One of the three misclassified samples is the one that was incorrectly classified in the previous step and is, therefore, in reality, a pork sample. While three misclassified samples may appear to be a considerable number, we have to consider different degrees of severity of the misclassifications. In fact, the only major error is that which estimates a degraded sample as fresh. In the other two cases, however, degraded samples were evaluated as even more degraded and therefore were minimal errors. The severity is highlighted in the table by the background color: a green background means that fresh samples are still considered fresh, and degraded samples are considered degraded, even if with different freshness classes (misclassification without consequences). A yellow background means that a fresh sample is considered degraded and would therefore lead to food waste. Finally, a red background color means that a degraded sample is considered fresh, which could lead to food poisoning. Given these considerations, we can state that the sensor makes 1 important error on the 21 samples of pork and 1 major error on the 21 samples of marble trout. In both cases, therefore, the system estimates the freshness of the food with an accuracy of 95.2%. If, on the other hand, we consider all types of errors, including those without repercussions, then the system estimates the freshness of pork and marble trout with an accuracy of 95.2 and 85.7%, respectively. It should be emphasized that these results were obtained from a single trout and a single piece of pork. We expect that testing samples from more than one animal of each type, the uncertainty of the measurement may increase. On the other hand, the greater number of samples would help train the support vector machine better, and this should improve performance. The balance between these two effects will be evaluated in future work. In any case, considering the small size and low cost of the device, this performance indicates that the single nanowire gas sensor may be a candidate as a fast and non-invasive method of estimating the freshness of meat and fish.

Conclusions
A single SnO 2 nanowire, used as a resistive sensor, allows the evaluation of the freshness of different foods. By combining the sensor responses at five different temperatures and processing them with multivariate statistical analysis (PCA) and machine learning (SVM) techniques, the sensor is able to distinguish between marble trout and pork samples and to estimate their state of freshness. The sensor recognized the type of sample (meat or fish) in 95.2% of cases. Furthermore, it recognized the degradation status in 90.5% of cases (85.7% of cases for trout and 95.2% of cases for pork). Considering that in several cases, the misclassification had no repercussions, as it considered the degraded samples even more degraded, the sensor overall recognized whether the sample was edible in 95.2% of cases. Considering the size (less than a square millimeter), the low cost, the speed, and the non-invasiveness, the gas sensor is proven to be ideal as a monitoring tool along the meat and fish production and distribution chain.