# Use of Data Augmentation Techniques in Detection of
## 4 Detection of Antisocial Behavior Using Deep Learning Methods  
We chose a CNN [48] model for the experiments, as the architecture proved to achieve good results in NLP tasks [13; 49]. While maintaining performance, CNN architecture proved to be much less computationally intensive than LSTM networks. We expected that the effect of EDA augmentations should be very similar regardless of the used model. Both solved problems were binary classification tasks. Binary classification aims to classify data into one of two classes. In our case, we classified the data in the first dataset into toxic/nontoxic comments and, in the case of the fake news dataset, into fake/relevant news. Entire preprocessing, training, and evaluation were implemented in the Python language, including standard analytical stack (e.g., Pandas, Tensorflow, and scikit-learn packages).  
The main idea of the experiments was to find out the effect of EDA augmentation techniques to the classification results. We used a simple convolutional neural network model, shown in Figure 2. It consisted of two convolution layers, two pooling layers, one flatten layer, and one regularization dropout layer. We used the checkpoint method to prevent overfitting [50]. The hyperparameters of the CNN model are summarized in Table 3. During the experiments, we gradually added individual EDA augmentation techniques to the data and monitored its influence on the resulting metrics.  
We evaluated the models using standard classification metrics:  
\[\text{Precision}=\frac{\text{TP}}{\text{TP}+\text{FP}} \tag{1}\] \[\text{Recall}=\frac{\text{TP}}{\text{TP}+\text{FN}}\] (2) \[\text{F1 score}=\frac{2\times\text{Precision}\times\text{Recall}}{ \text{Precision}+\text{Recall}}\] (3) \[\text{Accuracy}=\frac{\text{TP}+\text{TN}}{\text{TP}+\text{FP}+ \text{TN}+\text{FN}}. \tag{4}\]  
\begin{table}
\begin{tabular}{l c c} \hline
**Data Augmentation** & **Neutral Comments** & **Toxic Comments** \\ \hline
**Original** & 1,328,643 & 115,256 \\ \hline
**Synonym replacement** & 1,328,643 & 230,512 \\
**Random insertion** & 1,328,643 & 230,512 \\
**Random swap** & 1,328,643 & 230,512 \\
**Random deletion** & 1,328,643 & 230,512 \\ \hline
**EDA** & 1,328,643 & 576,280 \\ \hline
**Test set** & 331,897 & 29,078 \\ \hline \end{tabular}
\end{table}
Table 1: Target class frequency in the original and EDA-extended toxic comments dataset.  
\begin{table}
\begin{tabular}{l c c} \hline
**Data Augmentation** & **Relevant News** & **Fake News** \\ \hline
**Original** & 5618 & 460 \\ \hline
**Synonym replacement** & 5618 & 920 \\
**Random insertion** & 5618 & 920 \\
**Random swap** & 5618 & 920 \\
**Random deletion** & 5618 & 920 \\ \hline
**EDA** & 5618 & 2300 \\ \hline
**Test set** & 1382 & 138 \\ \hline \end{tabular}
\end{table}
Table 2: Target class frequency in the original and EDA-extended fake news dataset.  
These metrics were computed using the coefficients derived from the confusion matrix (see Table 4), which expresses the number of correct and incorrect predictions made by the classification model compared to the ground truth values in the testing data. In the formulas, TP, FP, FN, and FP stand for true positive, false positive, false negative, and false positive rates associated with the class attribute. These metrics were used also to measure the classification model.  
\begin{table}
\begin{tabular}{|c|c|c|} \hline \multicolumn{2}{|c|}{**Hyperparameters**} & **Values** \\ \hline Batch size & 32 \\ Optimizer & Adam \\ Learning rate & 0.001 \\ Dropout rate & 0.20 \\ \hline \end{tabular}
\end{table}
Table 3: Hyperparameters of the CNN model.  
Figure 2: Architecture of CNN model.  
the model performance on the particular minor. To measure the overall model performance, we also used the AUC (area under curve). The AUC score computes the area under the ROC (receiver operating characteristic) curve and provides the aggregate measure of model performance across all possible classification thresholds.