## 2 Materials and Methods
### Performance Metrics  
To assess the performance of the deep learning-based cyber-attack detection system in the IoHT environment, several key performance metrics are employed to measure its effectiveness. These metrics include the following:  
Accuracy (ACC): Accuracy represents the ratio of correctly classified instances to the total number of instances and is a fundamental measure of overall system performance. It is calculated using the following equation:  
\[\text{ACC}=(\text{TP}+\text{TN})/(\text{TP}+\text{TN}+\text{FP}+\text{FN}), \tag{1}\]  
where:  
* True positives (TP) are the instances correctly classified as attacks.
* True negatives (TN) are the instances correctly classified as normal.
* False positives (FP) are the instances incorrectly classified as attacks.
* False negatives (FN) are the instances incorrectly classified as normal.  
Recall quantifies the system's ability to detect actual attacks correctly. It is computed as follows:  
\[\text{Recall}=\text{TP}/(\text{TP}+\text{FN}), \tag{2}\]  
Precision measures the accuracy of the system in classifying detected attacks. The following formula determines it:  
\[\text{Precision}=\text{TP}/(\text{TP}+\text{FP}), \tag{3}\]  
The F1-Score is the harmonic mean of precision and recall and provides a balanced measure of the system's performance:  
\[\text{F1-Score}=(2\times\text{Precision}\times\text{Recall})/(\text{Precision}+ \text{Recall}), \tag{4}\]  
Specificity is a critical metric in the context of classification problems, particularly in assessing the performance of a model in identifying negative cases for each category. Defined mathematically, specificity for a given class is expressed as:  
\[\text{Specificity}=\text{TN}/(\text{TN}+\text{FP}), \tag{5}\]  
The weighted average mean adjusts for class imbalances by assigning weights proportional to the class frequencies. The weighted average \(\overline{X}\) is computed as:  
\[\overline{X}=\frac{\sum_{i=1}^{n}W_{i}\cdot X_{i}}{\sum_{i=1}^{n}W_{i}}, \tag{6}\]  
where \(x_{i}\) represents t the performance metric, including accuracy, precision, and recall for each class \(i\), and \(W_{i}\) denotes the weight assigned to class \(i\). The weights \(W_{i}\) is typically determined based on class frequencies relevant to the classification task, ensuring that each class contributes proportionally to the overall performance assessment.  
\begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline Batch Size & 256 \\ Number of Epochs & 100 \\ Output Activation & Softmax \\ Loss Function & Categorical Cross Entropy \\ Optimizer & Adam \\ Learning Rate & 0.001 \\ Activation Function & ReLU \\ \hline \end{tabular}
\end{table}
Table 1: The model setup.  
Finally, we can compute the overall error rate for classification, which is related to accuracy.  
\[\text{Error Rate}=1-((\text{TP}+\text{TN})/(\text{TP}+\text{TN}+\text{FP}+\text{ FN})). \tag{7}\]  
These performance metrics are essential in evaluating the system's ability to detect cyber-attacks and assess their effectiveness in the IoHT environment. High accuracy, recall, precision, specificity, error rate, weighted average results, and F1-Score values indicate that the system can efficiently identify and classify attacks while minimizing false detections.