Method Article

Spam Classification with Support Vector Machines Using Van der Waerden Rank Score Attention

DOI:

10.3791/69082

October 31st, 2025

* These authors contributed equally

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This study proposes an innovative approach based on Support Vector Machine integrated with a Van der Waerden rank score-enhanced feature attention mechanism, aiming to address the challenges of high-dimensional sparse spam data and improve the classification performance of spam detection.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

As email usage expands, spam has become a critical challenge, threatening network security and reducing communication efficiency. Conventional detection methods face persistent limitations: traditional machine learning models often struggle with high-dimensional sparse data, while deep learning requires substantial computational resources.

This study introduces a Van der Waerden rank score feature attention-enhanced Support Vector Machine (VWR-Attn-SVM) to address these issues. The method applies Van der Waerden rank transformation to normalize text features, improving robustness against outliers and preserving ordinal relationships. An enhanced attention mechanism further optimizes feature selection through non-linear processing with regularization, highlighting the features most relevant to spam detection.

Experiments on the UCI Spambase and Indonesian Spam datasets show that VWR-Attn-SVM outperforms traditional classifiers in accuracy, precision, recall, F1-score, and AUC. By combining high performance with reduced computational cost, the method provides an efficient and interpretable solution for spam classification, with potential extension to other text-based platforms such as messaging and social media.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

In the contemporary digital era, characterized by the rapid evolution of the internet and digital technologies, email has remained an indispensable cornerstone in the domains of electronic transactions and corporate communication, despite the continuous emergence and innovation of instant messaging and social media platforms1. Its ability to transcend temporal and spatial boundaries endows it with unique advantages, allowing seamless communication across the globe at any time. However, this extensive adoption has given rise to a pressing and detrimental issue-the rampant spread of spam. Malicious actors have exploited email systems as vehicles to distribute vast quantities of unsolicited commercial advertisements, malicious software, and illegal content. According to research, from 2012 to 2023, the proportion of global spam in total email traffic skyrocketed by 7700%2,3. This inundation of spam not only severely disrupts users' normal email operations but also poses multifaceted threats. It undermines personal privacy by potentially exposing sensitive information, jeopardizes corporate security through the risk of data breaches and malware infections, and even destabilizes the economic order by facilitating fraudulent activities4,5. Effective spam classification reduces phishing-related financial losses by 40-60%6, highlighting the practical value of efficient, accurate filtering methods. Consequently, developing an efficient and accurate spam detection model has emerged as a crucial research area for ensuring network security and enhancing efficiency.

A substantial body of existing research on spam detection has centered around machine learning and deep learning methodologies. In the field of traditional machine learning, a diverse array of techniques has been explored and applied. Rule-based methods, such as decision trees7, have been utilized to make classification decisions based on predefined rules derived from data features. Boosting methods8,9,10,which aggregate multiple weak learners into a strong one, and rough set theory11, which deals with uncertainty and imprecision in data, have also shown potential. Additionally, statistical methods including logistic regression, K-nearest neighbors (KNN)12,13, Naive Bayes14,15,16, and SVM17,18,19 have been widely employed. These approaches commonly rely on traditional feature extraction methods like TF-IDF. While TF-IDF is effective in quantifying the importance of words in a document, it struggles to capture the intricate semantic relationships and contextual nuances inherent in email texts. Moreover, when confronted with high-dimensional and sparse data, which is typical in email feature spaces, these methods often encounter computational bottlenecks. Their limited robustness can lead to getting trapped in local optimal solutions during the training process, thereby severely restricting the classification accuracy and generalization ability of the models.

Deep learning, with its remarkable capacity for automatic feature extraction, has emerged as a powerful alternative in spam detection. Algorithms, such as Convolutional Neural Networks (CNN)20,21,22, Recurrent Neural Networks (RNN)23, and Long Short-Term Memory networks (LSTM)24,25, as well as more recent Transformer-based models such as Word2vec and BERT26,27, have made significant strides in improving classification performance. CNNs are adept at extracting local features from data, RNNs and LSTMs can handle sequential data well, capturing temporal dependencies in text, and Transformer-based models excel at mining complex semantic relationships and context information. Recent efficient NLP methods, such as TinyML-based text classifiers28, offer strong baselines for spam classification. TinyML models are optimized for edge devices with limited memory. We compare our method to these approaches in the Results section, highlighting trade-offs between accuracy, computational efficiency, and deployment flexibility. However, these deep learning models come with their own set of limitations. They typically require a large number of training parameters, resulting in high computational resource demands and extended training times. Deep learning models like BERT require 3-5x more memory and 10x longer training times than traditional SVMs29, making them less suitable for resource-constrained environments. This makes them less practical for deployment in resource-constrained environments, such as mobile devices or low-end servers. Moreover, their complex architectures often render them less interpretable, which can be a significant drawback in applications where understanding the decision-making process of the model is crucial.

Against this backdrop, the overarching goal of this study is to develop an innovative approach that can overcome the limitations of existing methods and effectively address the challenges posed by the high-dimensional and sparse nature of spam data. The proposed Van der Waerden Rank Score Feature Attention-Enhanced SVM (VWR-Attn-SVM) represents a novel integration of techniques aimed at enhancing spam detection performance (Figure 1). The fundamental principle behind the VWR-Attn-SVM lies in its unique design that combines the strengths of multiple components.

Spam classification diagram; SVM method; TF-IDF feature analysis; classifier comparison process.
Figure 1: Overall flow chart of research on spam classification with VWR-Attn-SVM. This flowchart illustrates the workflow of spam classification based on the Van der Waerden rank score and feature attention-enhanced SVM, covering data preparation (loading, splitting, preprocessing), experimental preparation, verification of TF-IDF feature-label statistical correlations, attention-enhanced SVM-based spam detection, and multi-classifier comparison. Please click here to view a larger version of this figure.

The core Enhanced Feature Attention Mechanism processes individual email samples with a specific dimensionality. By applying the Van der Waerden rank transformation, it normalizes the email text features distorted by abnormal word frequencies into a standard normal distribution-like form. This transformation significantly enhances the model's robustness, enabling it to better handle the variability of email data. Van der Waerden rank scores were preferred over log-scaling and quantile transforms for three reasons: (1) Robust to spam feature outliers (e.g., extreme word frequencies), unlike log-scaling which amplifies low-frequency noise; (2) Preserve feature ordinal relationships (critical for spam indicator hierarchy like "free" vs. "win"), whereas quantile transforms flatten distributions; (3) Normalize to [0,1], easing attention mechanism integration and ensuring consistent weighting (Figure 2).

Data processing flowchart: Data loading, preprocessing, feature selection, model training, evaluation.
Figure 2: Experimental Flowchart. (A-C) Workflows for spam classification, covering data handling, feature selection, model training, evaluation, and comparison with/without Van der Waerden rank score transformation. Please click here to view a larger version of this figure.

Structurally, the mechanism features a two-layer fully connected network for non-linear feature transformation (Figure 2). The first layer, equipped with a LeakyReLU activation function, reduces the input dimensions while introducing non-linearity and incorporates a Dropout layer to mitigate overfitting. The second layer, using a Sigmoid function, outputs attention weights that can precisely quantify the importance of each feature. An L1/L2 regularization strategy is integrated into the model to optimize feature selection, where L1 regularization promotes sparsity, effectively screening out less relevant features, and L2 regularization prevents overfitting by constraining the magnitude of the weights. During the training phase, a multi-task learning framework is adopted, combining feature reconstruction loss and classification loss to optimize the model parameters. This allows the VWR-Attn-SVM to adapt precisely to the high-dimensional, sparse TF-IDF features of email texts, which are characteristic of the complex nature of email content.

Our method is optimized for text-based spam datasets ranging from several thousand to ten thousand (e.g., Spambase, Indonesian Spam dataset (Supplemental File 1)) and requires standard computational resources (Intel Core i7 processor, 16 GB RAM) for training; inference can be run on a standard laptop (Intel Core i5, 8 GB RAM) with sub-second latency. Key constraints include limited performance on non-text spam (e.g., image-embedded spam) and reliance on structured text features. Compared with existing alternative technologies, VWR-Attn-SVM has several remarkable advantages. Different from traditional machine learning methods, it does not solely rely on basic feature extraction but actively learns to weight features according to their importance through the enhanced attention mechanism, to better capture features more relevant to spam classification. In contrast to deep learning models, it achieves a favorable balance between performance and computational efficiency. It requires fewer computational resources and shorter training times, making it more suitable for a wide range of applications, especially those with limited resources. This innovative approach is applicable not only to the specific task of spam detection in email systems but also holds potential for extension to other text-based communication channels, such as instant messaging apps, social media platforms, and SMS services, where similar issues of unwanted and malicious content dissemination exist. Overall, the VWR-Attn-SVM represents a significant advancement in the field of spam detection, offering a more practical, efficient, and versatile solution to combat the persistent problem of spam in the digital communication landscape.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

1. Experimental preparation (Supplemental File 2 and Supplemental File 3)

  1. Data description: Load the open-source spam dataset from the UCI Machine Learning Repository for spam email detection30. Document that the dataset contains 4,601 instances with 57 continuous features and 1 class label, including 1,813 spam (39.4%) and 2,788 non-spam (60.6%) samples (Table 1).
  2. Library import
    1. Import the essential libraries (see the Table of Materials).
    2. Set a global random seed to 42 to ensure the reproducibility of results.
  3. Configure plotting settings: use Times New Roman for English text, resolve minus sign display issues, and set the font size to 16 for enhanced readability.

Table 1: Summary of dataset statistics and feature definitions. This table presents variables for spam classification, including word frequency (word_freq_WORD), character frequency (char_freq_CHAR), capital run length metrics, and the target class variable, with descriptions of each variable type and meaning. Please click here to download this Table.

2. Experiment to verify the statistical association between TF-IDF features and labels (Supplemental File 2 and Supplemental File 3)

  1. Data preprocessing
    1. Load the datasets (Supplemental File 1): first dataset: spambase.csv; second dataset: spam_indonesian.csv.
    2. Examine the distribution of spam and non-spam email labels and calculate the proportion of each category.
    3. Binarize these features using the mean as the threshold for the upcoming chi-square test.
      ​NOTE: Ensure that the spam file is in the correct working directory or provide the full file path when using the read command.
  2. Data test preprocessing (Supplemental File 2 and Supplemental File 3)
    1. Use sklearn.feature_selection.chi2 for the chi-square test on binarized TF-IDF features:
      Code call:
      from sklearn.feature_selection import chi2
      chi2_values, p_values = chi2(df_binary, df['spam'])
      significant_features_chi2 = [feature_cols[i] for i in np.where(p_values < 0.05)[0]]
      print(f"Number of significant features: {len(significant_features_chi2)}")
      Expected output: A subset of features (e.g., 35 out of 57) with statistical association to spam labels, including keywords like "free" or " remove".
    2. Conduct an implementation using sklearn.feature_selection.f_classif:
      Code call:
      from sklearn.feature_selection import f_classif
      f_values, f_p_values = f_classif(df[feature_cols], df['spam'])
      significant_features_f = [feature_cols[i] for i in np.where(f_p_values < 0.05)[0]]
      print(f"Retained features: {len(significant_features_f)}")
      NOTE: This typically retains 40-50 features (depends on dataset), overlapping partially with chi-square results.
      Before running statistical tests, verify the data format and parameters to guarantee accurate results.
  3. Visualization
    1. Select the top 20 features with the smallest p-values from the chi-square test results.
    2. Generate using seaborn.heatmap:
      Code call:
      import seaborn as sns
      top_indices = np.argsort(p_values)[:20]
      top_features = [feature_cols[i] for i in top$\_$indices]
      corr_matrix = df[top_features + ['spam']].corr()
      plt.figure(figsize=(12, 10))
      sns.heatmap(corr_matrix, annot=True, cmap='coolwarm')
      plt.show()
      NOTE: Expected pattern: Spam-related features cluster with the spam label in red (positive correlation).

3. Attention-enhanced SVM classification for spam detection (Supplemental File 2 and Supplemental File 3)

  1. Data preprocessing
    1. Data loading: Split data using sklearn.model selection.train test split with fixed seed:
      Code call:
      from sklearn.model selection import train test split
      X train, X test, y train, y test = train test split(X, y, test size=0.3, random state=42)
    2. Standardization and class balancing: Implement via imblearn.over sampling.SMOTE (Synthetic Minority Over-sampling Technique (SMOTE)31):
      Code call:
      from imblearn.over sampling import SMOTE
      # Default: sampling strategy='auto', k neighbors=5
      smote=SMOTE(random state=42)
      X train smote, y train smote = smote.fit resample(X train, y train)
      Balances class distribution (e.g., from 85:15 to 50:50).
  2. Enhanced feature attention model architecture: Design a mechanism that learns feature importance weights via multi-layer nonlinear transformations. Assign higher attention weights to critical features to enhance their impact.
    1. Feature preprocessing (Optional)
      1. Apply Van der Waerden normal rank transformation to input features. Convert raw features into an approximate normal distribution to improve model robustness. Use the formula:
        Normal quantile transformation formula, equation for statistical data analysis.
        Where x represents the TF-IDF feature vector of a sample, R(x) is the rank of the feature value, d is the vector length (d=57), and φ-1 is the inverse cumulative distribution function of the standard normal distribution.
        NOTE:Use use_rank_transform (Boolean) parameter to control the enablement of the normal rank transformation for feature processing.
    2. Multi-layer nonlinear transformation: Learn a nonlinear representation of features through a two-layer fully connected network.
      1. First-layer transformation: Use the formula:
        Neural network layer equation: \( h_1 = \text{LeakyReLU}(W_1x + b_1) \), activation function.
        Where W1 static equilibrium ΣFx=0, MA=0 equation diagram; force balance; educational physics concept Rk×d and k=64 (hidden neurons).
        Implemented in Keras with LeakyReLU:
        Code call:
        from tensorflow.keras.layers import Dense
        self.dense1=Dense(units=64, # 256 for VWR-Attn-SVM
        activation='leaky relu', # Default negative slope=0.01
        kernel regularizer=regularizers.l1 l2(l1=0.0002, l2=0.0002))
        NOTE: Add a dropout layer with a dropout rate of 0.2 to prevent overfitting.
      2. Second-layer transformation: Apply the second layer transformation using Sigmoid to generate attention weights in the range [0,1]. Use the formula:
        Sigmoid activation formula diagram: a=Sigmoid(W2h1+b2) in neural network computation.
        Where W2 static equilibrium ΣFx=0, MA=0 equation diagram; force balance; educational physics concept Rd×k, and static equilibrium ΣFx=0, MA=0 equation diagram; force balance; educational physics concept Rk are the attention weights for each feature. Select Sigmoid instead of SoftMax to maintain the independence of the importance of multiple features.
        Apply Keras Sigmoid activation for attention weights:
        Code call:
        self.dense2 = Dense(input shape[-1], activation='sigmoid',
        ​kernel regularizer=regularizers.l1 l2(l1=0.0002, l2=0.0002))
    3. Feature weighting: Enhance important features by performing element-wise multiplication with attention weights. Use the formula:
      x-attended=x⊙a formula, attention mechanism, neural networks, tensor operation, educational use.
      Where static equilibrium diagram, ΣFx=0, ΣFy=0, torque balance, educational physics concept denotes element-wise multiplication.
  3. Training the enhanced feature attention model
    1. Multi-task objective optimization: Minimize a weighted loss function combining reconstruction loss and cross-entropy loss to train the model. Ensure that the attention mechanism retains critical information while focusing on classification-relevant features. Use the formula:
      Loss function formula: L=α·MSE+CE, combining mean squared error and cross-entropy with weights.
      Utilize mean squared error loss Mathematical formula MSE(x, x-attended) for statistical error analysis applications.
      for reconstructing input features and apply the cross-entropy loss Cross-entropy formula CE(y,ŷ), statistical analysis method, symbol for data classification.
       to the classification task.
      Implement custom multi-task loss in PyTorch: Custom loss in Keras with alpha=0.5:
      Code call:
      model.compile(optimizer='adam',loss={
      'enhanced_feature_attention':'mse','classification':
      'binary_crossentropy'},loss_weights={
      'enhanced_feature_attention': 0.5, 'classification': 0.5})
      alpha=0.5 balances feature reconstruction (MSE) and classification (cross-entropy), leading to stable convergence within 50-100 epochs.
      NOTE: Apply L1/L2 mixed regularization (Elastic Net, default strength 0.001) to both fully connected layers to enhance feature selection and generalization.
    2. Parameter settings: Set the weight coefficient α to control the relative importance of the two losses and use α = 0.5 in the code. Configure the batch size as 64, set the number of epochs as 200, and allocate 10% of the data for the validation set.
    3. Add callback functions.
      Keras callbacks with default parameters:
      Code call:
      from tensorflow.keras.callbacks import EarlyStopping, ReduceLROnPlateau
      callbacks = [EarlyStopping(monitor='val_loss', patience=5, mode='min', restore_best_weights
      ​=True), ReduceLROnPlateau(monitor='val_loss', factor=0.5, patience=5, min_lr=0.0005, verbose=1)]
      1. Incorporate the EarlyStopping callback to stop the training process when the validation loss does not improve for 5 consecutive epochs.
      2. Add the ReduceLROnPlateau callback to adaptively adjust the learning rate. Set the decay factor to 0.5 and the minimum learning rate to 0.0002.
    4. Generating attention-weight features: After training, extract the attention weights from the Enhanced Feature Attention layer. Generate weighted features for both the training and test sets. Feed these features into the SVM classifier.
  4. Model evaluation
    NOTE: A 70-30 train-test split balances training and evaluation. SMOTE addresses class imbalance, improving performance on imbalanced text data. MinMaxScaler stabilizes distance-based models. Units: 64 (Attn-SVM) and 128 (VWR-Attn-SVM) balance capacity; 128 accommodates Van-der-Waerden rank transformation complexity. Dropout (0.2) prevents overfitting, standard for small-to-medium datasets. L1/L2 regularization (0.0002-0.002): L1 induces sparsity; L2 limits weight magnitude. Equal loss weights (MSE: 0.5, cross-entropy: 0.5) balance reconstruction and classification learning. Epochs: 200 (Attn-SVM), 300 (VWR-Attn-SVM) with early stopping (patience=5) to avoid overfitting. Batch size 64 balances efficiency and stability. ReduceLROnPlateau (factor=0.5, patience=5-10) adjusts learning rates (min 0.0001-0.0005) for better convergence.
    1. Ablation study design and comparisons: Define the following models for comparison: Baseline SVM: Traditional SVM with Radial Basis Function (RBF) kernel ; Attn-SVM: SVM with enhanced feature attention mechanism; VWR-Attn-SVM: SVM combining Van der Waerden transformation and enhanced feature attention.
    2. Evaluation metrics (Table 2): Assess model performance using accuracy, precision, recall, F1-score, and AUC.
  5. Attention visualization and model interpretation
    1. Visualizing attention weights of key features
      Matplotlib barplot for top 15 features:
      Code call:
      import matplotlib.pyplot as plt
      top_indices = np.argsort(-avg_weights)[:15]
      top_features = [feature_names[i] for i in top_indices]
      top_weights = avg_weights[top_indices]
      plt.figure(figsize=(12, 8))
      plt.barh(top_features, top_weights, color='skyblue')
      plt.xlabel('Attention Weight')
      plt.title('Top Feature Attention Weights')
      ​plt.show()
    2. Comparing the impact of normal rank transformation: Compare model performance (accuracy, precision, recall, F1-score, AUC) with and without use_rank_transform enabled. Highlight key metric differences in a formatted table.
    3. Feature importance comparison: Analyze the consistency between important features identified by statistical tests (e.g., chi-square) and the attention mechanism.
      NOTE: If computational resources are limited, reduce the number of units (e.g., to 32) or epochs (e.g., to 100). Adjust l1_reg/l2_reg to balance model complexity (higher values enhance regularization).

4. Comparison of multiple classifiers (Supplemental File 2 and Supplemental File 3)

  1. Define classifier dictionary. Create a dictionary of classifiers for comparison, including KNN, Logistic Regression, AdaBoost, Naive Bayes, and SVM with RBF kernel (default parameters).
  2. Initialize result DataFrames. Create four DataFrames to store evaluation metrics, with columns: Classifier, Accuracy, Precision, Recall, F1-Score, and AUC.
  3. Train and evaluate classifiers. For each classifier, perform the following steps.
    Example classifiers with parameters and seeds:
    Code call:
    from sklearn.linear_model import LogisticRegression
    from sklearn.svm import SVC
    lr = LogisticRegression(random_state=RANDOM_SEED, max_iter=1000)
    svm = GridSearchCV(SVC(random_state=RANDOM_SEED, probability=True),
    param_grid={'C': [0.001,0.01 1, 10,100,1000], 'gamma': [0.001,0.01 1, 10,100,1000],
    kernel': ['rbf', 'linear']}, cv=5, scoring='f1')
    ​NOTE: All models use random_state=42 for reproducibility.
    1. Train the classifier on scaled training data.
    2. Predict and compute probabilities on both training and test sets.
    3. Generate classification reports and store the metrics in the corresponding DataFrames.
  4. Integrate enhanced feature attention SVM results. Incorporate performance metrics from Attn-SVM and VWR-Attn-SVM (from Experiment 3) into the existing DataFrames.
  5. Print comparative results. Display evaluation tables for non-spam and spam emails in both training and test sets.
  6. Visualize results. Use sns.barplot to plot classifier performance metrics. Rotate x-axis labels by 45° for readability. Optimize the layout and display the plot using plt.show().
    Interpretation of sns.barplot outputs:
    Code call:
    import seaborn as sns
    sns.barplot(x='Classifier', y='F1-Score', data=results)

5. Comparison chart of multi-metric performance of different classifiers in training/test time and memory (Supplemental File 4)

  1. Data preprocessing: Load spambase.csv or spam_indonesian.csv; Split into 70% training/30% test sets; standardize features with MinMaxScaler.
  2. Model training: Train KNN, Logistic Regression, AdaBoost, Naive Bayes, SVM (with grid search), Attn-SVM, and VWR-Attn-SVM.
  3. Performance evaluation: Calculate Accuracy, Precision, Recall, F1-score, and AUC.
  4. Resource analysis: Record training time, test time, and memory usage.
  5. Visualization: Generate multi-metric performance charts and resource consumption charts.
    Key Params: Random seed=42; SVM grid (C:[0.01,0.1,1,10,100]; gamma:[0.01,0.1,1,10,100]; kernel:['rbf','linear']); attention models use 2-layer fully connected networks, L1/L2 regularization, and Dropout.
    Output: Performance tables, resource tables, multi-metric charts, time/memory charts, attention weight visualizations.

6. Experimental results of CNN, RNN, LSTM, or Transformers (Supplemental File 5)

  1. Preprocessing: Load spambase.csv or spam_indonesian.csv, apply SMOTE for class imbalance if needed, split into train/test (70/30).
  2. Training: Build CNN, RNN, LSTM, Transformer; Adam(0.001), binary cross-entropy, batch_size=32, epochs=10, early stopping (patience=5), and learning rate scheduling.
  3. Evaluation: Compute Accuracy, Precision, Recall, F1, AUC; record training/test time and memory usage.
  4. Visualization: Generate performance and resource comparison plots; save CSV results.
  5. Output: Performance metrics table, resource consumption table, comparison plots, CSV files.

7. Supplemental code instructions

  1. To run the code and replicate figures: Place spam.csv or spam_indonesian.csv in the same directory. Install dependencies via pip install numpy pandas matplotlib seaborn scikit-learn tensorflow imbalanced-learn psutil. Execute the script; it will automatically process data, train models, and generate/display all figures (heatmaps, performance plots) during execution.

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

To commence, as per the established experimental protocol, Figure 1 provides an overview of the overall flowchart of this study. Figure 2, sequentially depict the operation flowcharts of Experiments 2. Additionally, Table 1 primarily presents the word and character frequencies within the spam email dataset, spam.csv.

Regarding the model performance evaluation, five key metrics were employed: accuracy, precision, recal...

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This study verified the effectiveness of VWR-Attn-SVM based on the Spambase dataset, providing insights for addressing the high-dimensional and sparse nature of spam data. Experiments revealed that only a few features in spam data have a strong correlation with labels; traditional models treat all features equally, leading to poor performance, whereas the attention mechanism of this model can dynamically weight key features. After integrating the Van der Waerden (VWR) rank transformation, the model achieves faster loss c...

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors have no conflicts of interest to disclose.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

We thank the Fujian Alliance of Mathematics (Grant No. 2023SXLMMS10) and Natural Science Foundation of Fujian Province (2023J05083, 2022J011396, 2023J011434) for funding this work.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
Supplemental File 2: code_new.py; Supplemental File 3: code_indonesian.py.
numpyNumPy DevelopersLibrary for numerical computing in Python
pandaspandas Development TeamLibrary for data manipulation and analysis
matplotlibMatplotlib Developers Library for creating static, animated, and interactive visualizations
seabornMichael Waskom et al.Statistical data visualization library based on matplotlib
scikit-learnscikit-learn Developers TeamMachine learning library featuring various classification, regression, and clustering algorithms
tensorflowGoogleOpen-source machine learning framework, including Keras API for building neural networks
imblearnimbalanced-learn DevelopersLibrary for handling imbalanced datasets, including SMOTE for oversampling
warningsPython Standard LibraryModule for issuing warning messages
Supplemental File 4: code_compute_time.py
numpyNumPy DevelopersNumerical computing library for Python
pandaspandas Development TeamData manipulation and analysis library
matplotlibMatplotlib DevelopersVisualization library for creating plots and figures
seabornMichael Waskom et al.Statistical data visualization library built on matplotlib
scikit-learnscikit-learn Developers TeamMachine learning library with classification, regression, and preprocessing tools
tensorflowGoogleOpen-source machine learning framework with Keras API for neural networks
imblearnimbalanced-learn Developers TeamLibrary for handling imbalanced datasets (includes SMOTE)
warningsPython Standard LibraryModule for issuing warning messages
timePython Standard LibraryModule for time-related functions
psutilGiampaolo RodolaLibrary for retrieving system information and monitoring resource usage
osPython Standard LibraryModule for interacting with the operating system
Supplemental File 5: DNN.py.
pandaspandas Development TeamData manipulation and analysis library
numpyNumPy DevelopersNumerical computing library for Python
timePython Standard LibraryModule for time-related functions
psutilGiampaolo RodolaLibrary for system information retrieval and resource monitoring
matplotlibMatplotlib DevelopersVisualization library for creating plots and figures
scikit-learnscikit-learn Developers TeamMachine learning library with data preprocessing, model selection, and metrics tools
imblearnimbalanced-learn Developers TeamLibrary for handling imbalanced datasets (includes SMOTE)
tensorflowGoogleOpen-source machine learning framework with Keras API for building neural networks

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Ayo, F. E., Ogundele, L. A., Olakunle, S., Awotunde, J. B., Kasali, F. A. A hybrid correlation-based deep learning model for email spam classification using fuzzy inference system. Decis Anal J. 10, 100390(2024).
  2. Douzi, S., AlShahwan, F. A., Lemoudden, M., Ouahidi, B. Hybrid email spam detection model using artificial intelligence. Int J Mach Learn Comput. 10 (2), 316-322 (2020).
  3. Maqsood, U., et al. An intelligent framework based on deep learning for SMS and e-mail spam detection. Appl Comput Intell Soft Comput. 2023, 6648970(2023).
  4. Yang, Z., Nie, X., Xu, W., Guo, J. An approach to spam detection by naive Bayes ensemble based on decision induction. Proc IEEE Comput Soc. , 861-866 (2006).
  5. Nazirova, S., Alguliyev, R. Two approaches on implementation of CBR and CRM technologies to the spam filtering problem. J Inf Secur. 3 (1), 11-17 (2012).
  6. Consumer Sentinel Network Data Book. , Federal Trade Commission. (2022).
  7. DeSouza, M., Fitzgerald, J., Kemp, C., Truong, G. A decision tree-based spam filtering agent. , Available at: http://www.cs.mu.oz.au/481/2001_projects/gntr/index.html (2001).
  8. Boosting trees for anti-spam email filtering. Carreras, X., Marque, L. Proc RANLP-01, 4th Int Conf Recent Adv Nat Lang Process, , INCOMA Ltd. (2001).
  9. Androutsopoulos, I. Learning to filter unsolicited commercial e-mail. Int Proc Comput Sci Inf Tech. , (2025).
  10. XGBoost: a scalable tree boosting system. Chen, T., Guestrin, C. Proc 22nd ACM SIGKDD Int Conf Knowl Discov Data Min, , ACM. 785-794 (2016).
  11. Intelligent analysis, filtering, and rough set discussions of spam. Liu, Y., et al. Proc 12th Annu Conf Comput Netw Data Commun China Comput Fed, , (2002).
  12. Androutsopoulos, I., et al. Learning to filter spam e-mail: a comparison of a naive Bayesian and memory-based approach. Comput Sci. 97 (2), 1-13 (2000).
  13. Cai, J., et al. Fibrosis and inflammatory activity diagnosis of chronic hepatitis C based on extreme learning machine. Sci Rep. 15 (1), 11(2025).
  14. Zhou, Y., Li, Y., Xia, S. An improved KNN text classification algorithm based on clustering. J Comput. 4 (3), 230-237 (2009).
  15. Rapacz, S., Cholda, P., Natkaniec, M. A. Method for fast selection of machine-learning classifiers for spam filtering. Electronics. 10 (17), 2083(2021).
  16. Fu, S., Nizar, B. A. Soft computing model based on asymmetric Gaussian mixtures and Bayesian inference. Soft Comput. 24 (1), 4841-4853 (2020).
  17. Text categorization with support vector machines: learning with many relevant features. Joachims, T. Proc Eur Conf Mach Learn, , Springer. 137-142 (1998).
  18. Drucker, H., Wu, D., Vapnik, V. N. Support vector machines for spam categorization. IEEE Trans Neural Netw. 10 (5), 1048-1054 (2002).
  19. Yuan, Y., Fan, W., Pu, D. Spline function smooth support vector machine for classification. J Ind Manag Optim. 3 (3), 529-542 (2017).
  20. Cai, J., et al. A residual joint antenna network for joint transmit-receive antenna subset selection in MIMO systems. IEEE Trans Antennas Propag. , (2025).
  21. Zhu, S., et al. Singular pooling: a spectral pooling paradigm for second-trimester prenatal level II ultrasound standard fetal plane identification. IEEE Trans Circuits Syst Video Technol. , (2025).
  22. Zhu, S., et al. Contrast and gain-aware attention: a plug-and-play feature fusion attention module for torso region fetal plane identification. Ultrasound Med Biol. , (2025).
  23. Mikolov, T., Karafiat, M., Burget, L., Cernock, J., Khudanpur, S. Recurrent neural network based language model. Proc Interspeech, Int Speech Commun Assoc. , (2015).
  24. Hochreiter, S., Schmidhuber, J. Long short-term memory. Neural Comput. 9 (8), 1735-1780 (1997).
  25. Cai, J., et al. Developing deep LSTMs with later temporal attention for predicting COVID-19 severity, clinical outcome, and antibody level by screening serological indicators over time. IEEE J Biomed Health Inform. 28 (7), 4204-4215 (2024).
  26. Vaswani, A., et al. Attention is all you need. Adv Neural Inf Process Syst. , (2017).
  27. Xian, L. Application of an improved TF-IDF method in literary text classification. Adv Multimed. 2022, 9285324(2022).
  28. Alajlan, N., Ibrahim, D. M. TinyML: enabling inference of deep learning models on ultra-low-power IoT edge devices for AI applications. Micromachines. 13 (6), 851(2022).
  29. Devlin, J., Chang, M. W., Lee, K., Toutanova, K. BERT: pre-training of deep bidirectional transformers for language understanding. Proc North Am Chapter Assoc Comput Linguist. , (2019).
  30. Hopkins, M., Reeber, E., Forman, G., Suermondt, J. Spambase dataset. UCI Mach Learn Repos. , (1999).
  31. Chawla, N. V., Bowyer, K. W., Hall, L. O., Kegelmeyer, W. P. SMOTE: synthetic minority over-sampling technique. J Artif Intell Res. 16, 321-357 (2002).
  32. Cuk, A., et al. Tuning attention-based long short-term memory neural networks for Parkinson's disease detection using modified metaheuristics. Sci Rep. 14, 4309(2024).
  33. Mizdrakovic, V., et al. Forecasting bitcoin: decomposition-aided long short-term memory-based time series modeling and its explanation with Shapley values. Knowl Based Syst. 299 (5), 112026(2024).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Spam ClassificationSupport Vector MachinesVan Der WaerdenRank Score AttentionFeature SelectionText NormalizationOutlier RobustnessAttention MechanismHigh Dimensional DataText Based Platforms

Related Articles