[Paper Review] Imbalanced Malware Images Classification: a CNN based Approach
This paper proposes a weighted softmax loss to address class imbalance in malware image classification and demonstrates its effectiveness by fine-tuning VGG-19 and validating across multiple CNNs.
Deep convolutional neural networks (CNNs) can be applied to malware binary detection via image classification. The performance, however, is degraded due to the imbalance of malware families (classes). To mitigate this issue, we propose a simple yet effective weighted softmax loss which can be employed as the final layer of deep CNNs. The original softmax loss is weighted, and the weight value can be determined according to class size. A scaling parameter is also included in computing the weight. Proper selection of this parameter is studied and an empirical option is suggested. The weighted loss aims at alleviating the impact of data imbalance in an end-to-end learning fashion. To validate the efficacy, we deploy the proposed weighted loss in a pre-trained deep CNN model and fine-tune it to achieve promising results on malware images classification. Extensive experiments also demonstrate that the new loss function can well fit other typical CNNs, yielding an improved classification performance.
Motivation & Objective
- Address the challenge of highly imbalanced malware image datasets in CNN-based classification.
- Introduce a weighted softmax loss where class weights depend on class size to balance learning.
- Demonstrate the approach by fine-tuning a pre-trained CNN (VGG-19) and validating on multiple models.
Proposed method
- Define a weighted softmax loss J0 = -(1/m) sum_i sum_j w_k 1(y(i)=j) log p_j^(i).
- Compute weights w_k = 1 + (S_max - S_k) / (beta * S_max) with beta controlling scaling (empirically beta=20).
- Fine-tune a pre-trained VGG-19 model with added dropout and batch normalization layers; append the weighted loss as the final layer.
- Evaluate using Top-1 validation error on a 25-class imbalanced malware image dataset; compare with and without weighted loss across several VGG variants.
- Use MatConvNet on an Nvidia TITAN X, with 60-layer final architecture including added layers.
Experimental results
Research questions
- RQ1Can a class-imbalanced-aware loss improve CNN performance on imbalanced malware image datasets?
- RQ2Does the proposed weighted softmax loss generalize across different CNN architectures beyond the tested model?
- RQ3What is the impact of the scaling parameter beta on training stability and accuracy?
- RQ4How does fine-tuning a pre-trained CNN with the weighted loss compare to using the original loss?
- RQ5What qualitative changes in feature representations occur with the weighted loss?
Key findings
- The weighted softmax loss improves Top-1 accuracy across models (e.g., VGG-19 from 97.32% to 98.63%).
- Across VGG family variants (VGG-19, VGG-F, VGG-M, VGG-S), weighted loss consistently improves test accuracy over original loss.
- Fine-tuned VGG-19 with weighted loss yields higher validation accuracy and more stable training curves.
- Beta = 20 provides smoother convergence and better final error than other tested values.
- Feature maps illustrate class-specific discriminative representations under the weighted loss.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.