## 4 Experiment
### Experimental Set Up  
#### 4.1.1 Feature Fusion  
This experiment evaluated the proposed method from two aspects: classification accuracy and speed. For traffic classification accuracy, we use accuracy (\(ACC\)), precision (\(PR\)), recall (\(RC\)), and F1-score (\(F1\)) as metrics. Accuracy assesses the overall correctness of classification results, while precision and recall measure the model's ability to identify and cover the target category correctly. The F1-score, which combines precision and recall, provides a balanced evaluation of the model's classification performance. The formulas are as follows:  
\[Accuracy=\frac{TP+TN}{TP+TN+FP+FN}\]  
\[PR=\frac{TP}{TP+FP}\]  
\[RC=\frac{TP}{TP+FN}\]  
\[F1=\frac{2\ *\ PR\ *\ RC}{PR+RC}\]  
where \(TP\), \(TN\), \(FP\), \(FN\) represent true positives, true negatives, false positives, and false negatives, respectively.  
For multi-class classification tasks, all metrics are calculated using the weighted average method. Let \(n\) be the number of classes, \(w_{i}\) be the weight of the \(i\)-th class, \(TP_{i}\), \(FP_{i}\) and \(FN_{i}\) be the number of true positives, false positives, and false negatives of the \(i\)-th class, respectively.  
\[ACC_{weighted}=\frac{\sum_{i=1}^{n}w_{i}\times TP_{i}}{\sum_{i=1}^{n}w_{i} \times(TP_{i}+FP_{i}+FN_{i})}\]  
\[PR_{weighted}=\frac{\sum_{i=1}^{n}w_{i}\times TP_{i}}{\sum_{i=1}^{n}w_{i} \times(TP_{i}+FP_{i})}\]  
\[RC_{weighted}=\frac{\sum_{i=1}^{n}w_{i}\times TP_{i}}{\sum_{i=1}^{n}w_{i} \times(TP_{i}+FN_{i})}\]  
\[F1_{weighted}=2\times\frac{PR_{weighted}\times RC_{weighted}}{PR_{weighted}+ RC_{weighted}}\]  
In SwiftSession, traffic classification speed is measured by **method classification time**, which depends on the number of packets received before the result. Assuming \(i\) packets are received, the classification time \(T\) is as follows:  
\[T=T_{i}=t_{arrived}^{i}+t_{ef}^{i}+t_{si}^{i}+t_{d_{i}}\]  
where \(t_{arrived}^{i}\), \(t_{eff}^{i}\), \(t_{si}^{i}\), \(t_{d_{i}}\) represent time from the first packet's arrival to the \(i\)-\(th\) packet's arrival, feature extraction time after the \(i\)-\(th\) packet, inference time for the \(i\)-\(th\) packet, and decision time for the \(i\)-\(th\) classification, respectively (assuming \(t_{arrived}^{k}\) is greater than \(t_{arrived}^{k-1}+t_{ef}^{k}+t_{si}^{k}+t_{d_{k}}\), \(1<k\leq i\)).  
Since the number of packets varies in different SwiftSession sessions, we introduce the \"average arrival time\" metric to represent the average time of packet arrival when the final classification is made.  
For other methods, the classification time is as follows:  
\[T=t_{se}+t_{ef}+t_{si}\]  
where \(t_{se},\ t_{ef},\ t_{si}\) represents session duration between the first and the last packet when classification is possible, feature extraction time, and inference time based on features, respectively (In this study, session duration, which is much longer than \(t_{ef}+t_{si}\), is used as the traffic classification time for the comparison methods. Different methods use varying numbers of packets: **ETC-PS** uses 40, while **FineWP** and **FS-Net** use 32 session packets. The session duration for comparison is determined accordingly).