## 3 Results and Discussion
### Electronic Nose Detection
#### 3.1.4 Dimensionality Reduction Based on LDA Algorithm  
Linear Discriminant Analysis (LDA) is a statistical method employed for dimensionality reduction, aimed at enhancing the similarity of samples within the same class while maximizing the dissimilarity between samples from different classes. LDA accomplishes this by maximizing the ratio of class-to-class distances to class-within-class distances, thereby identifying the optimal projection direction that preserves classification information in a lower-dimensional space. In Figure 5, the LDA-processed data of the oysters is presented, with different colors indicating samples collected on different days. Notably, the distribution of sample points in the figure exhibits significant changes over time, which may generally reflect the evolving characteristics of oysters during various storage periods.  
Figure 5: Visualization of LDA algorithm for feature extraction of oyster samples. (**a**) Gas samples from oysters in a 4 \({}^{\circ}\)C environment. (**b**) Gas samples from oysters in a 12 \({}^{\circ}\)C environment. (**c**) Gas samples from oysters in a 20 \({}^{\circ}\)C environment. (**d**) Gas samples of oysters in an environment of 28 \({}^{\circ}\)C.  
Compared to PCA, LDA exhibits a relatively superior classification effect on the oyster data in a 4 \({}^{\circ}\)C environment. Within the storage time range of 72 to 192 h, both intra-class and interclass distances are very small, indicating that the gas production rate in oyster samples slowly changes within this time range.  
In the LDA scatter plot for the 12 \({}^{\circ}\)C environment, the intra-class distances increase from the first to the third day when viewed from right to left, aligning with the conclusions drawn using the PCA algorithm in the previous section.  
In the LDA scatter plot at 20 \({}^{\circ}\)C, both intra-class and interclass distances are relatively large at storage times of 0 and 12 h. At other storage times, both intra-class and interclass distances are relatively small.  
In the LDA scatter plot at 28 \({}^{\circ}\)C, the interclass distance are relatively small during the storage time of 0 and 48 h, indicating that the gas emission rate of oyster samples changes slowly within this time range. At other storage times, the distance within the group was relatively large, indicating that the gas emission rate of oyster samples changes significantly within this time range.  
The analysis of sensory sample records revealed that changes in the freshness of the oysters aligned with the conclusions derived from both Linear Discriminant Analysis (LDA) and Principal Component Analysis (PCA). By integrating these experimental findings, it was concluded that both LDA and PCA can serve as effective tools for evaluating the gas changes in oyster samples; however, the results obtained from LDA processing are found to be superior to those from PCA in this study. However, it is important to note that the choice between LDA and PCA depends on the specific dataset and application. While LDA may provide better classification performance in cases with well-separated classes and labeled data, PCA can be more appropriate when reducing dimensionality without specific class labels or when the primary goal is to preserve variance.