## 3 Materials and Methods
### Dataset Preprocessing  
Time-series data preprocessing is a critical step in time-series analysis and modeling, primarily aimed at addressing issues such as missing values and outliers to ensure data continuity and validity, thereby enhancing model training and predictive performance. Time-series data, consisting of observations arranged in chronological order, often suffer from missing values, noise, or abrupt fluctuations, which can adversely affect model performance. Comprehensive preprocessing is therefore essential prior to modeling. Handling missing values is one of the primary tasks in time-series data preprocessing. Missing values may result from sensor malfunctions, incomplete data recording, or sampling errors. In time-series data, missing values typically appear as gaps in observations at specific time points. Common methods for filling missing values include mean imputation, interpolation, and predictive modeling. Mean imputation replaces missing values with either global or local averages, smoothing the data. For a given time series \(x_{1},x_{2},\ldots,x_{n}\) with a missing value at position \(i\), mean imputation can be expressed as  
\[x_{i}=\frac{1}{n-1}\sum_{ \begin{subarray}{c}j=1\\ j\
eq i\end{subarray} }^{n}x_{j}, \tag{16}\]  
where \(n\) denotes the series length, and \(x_{j}\) represents non-missing values. While mean imputation is computationally simple, it may reduce the variability in the time series. In contrast, interpolation leverages the temporal order of data to estimate missing values through linear or higher-order methods. Linear interpolation assumes a linear relationship between the missing point and its neighbors, computed as  
\[x_{i}=x_{i-1}+\frac{x_{i+1}-x_{i-1}}{t_{i+1}-t_{i-1}}\cdot(t_{i}-t_{i-1}), \tag{17}\]  
where \(x_{i-1}\) and \(x_{i+1}\) are known values before and after the missing point, and \(t_{i}\) represents the timestamp. Interpolation preserves the dynamic characteristics of the time series but may struggle with highly volatile data. In more complex scenarios, predictive models, such as ARIMA [37] or LSTM [38], can estimate missing values by leveraging historical patterns in the data. The predicted value using such models is given by  
\[x_{i}=f(x_{i-1},x_{i-2},\ldots,x_{i-p}), \tag{18}\]  
where \(p\) denotes the lag. Although computationally intensive, predictive modeling offers higher accuracy for complex data distributions. Outlier detection and treatment are equally \begin{table}
\begin{tabular}{l c} \hline
**Category** & **Number of Entries** \\ \hline Smiling & 9760 \\ Not Smiling & 8341 \\ Wearing Glasses & 9957 \\ Not Wearing Glasses & 7803 \\ Other & 8675 \\ \hline \end{tabular}
\end{table} 
Table 2: Categorization of CelebA dataset. essential in time-series data preprocessing. Outliers, which deviate significantly from the general data distribution, often arise from sensor errors, external interference, or system malfunctions. Statistical methods, rule-based approaches, or machine learning techniques are typically employed for outlier detection. Common statistical methods include Z-score and standard-deviation-based rules. In the Z-score method, the normalized value for each data point is calculated as  
\[z_{i}=\frac{x_{i}-\mu}{\sigma}, \tag{19}\]  
where \(\mu\) and \(\sigma\) denote the mean and standard deviation of the series, respectively. A data point \(x_{i}\) is flagged as an outlier if its \(z_{i}\) exceeds a threshold. The standard deviation rule identifies outliers as points deviating by more than a specified multiple of the standard deviation:  
\[|x_{i}-\mu|>k\cdot\sigma, \tag{20}\]  
where \(k\) is a user-defined threshold. Detected outliers can be addressed through interpolation, regression, or resampling methods. For instance, linear interpolation for outliers follows a similar formula as for missing values, while regression-based methods use models such as linear or polynomial regression to estimate outliers:  
\[x_{i}=g(x_{i-1},x_{i-2},\ldots,x_{i-p}), \tag{21}\]  
where \(g(\cdot)\) represents a regression model.