MIGAN: Malware Image Synthesis Using GANs

Abhishek Singh, Debojyoti Dutta, Amit SahaAAAI 2019 · DOI

Introduction

In the rapidly evolving landscape of cybersecurity, deep learning has emerged as a powerful tool for threat detection. However, its effectiveness is often constrained by a "data desert"—the chronic shortage of large, labeled malware datasets. Privacy concerns, the sensitivity of malicious code, and the intensive manual labor required for labeling create significant barriers to research.

While researchers frequently convert malware binaries into grayscale images to leverage computer vision techniques, traditional data augmentation methods like flipping or rotating are ineffective. In malware, the specific sequence of bytes—the "structure"—is the defining characteristic of a family. Standard augmentation destroys this structure, rendering the data useless for training. MIGAN (Malware Image GAN) addresses this by synthesizing realistic, labeled malware images that preserve these critical structural idiosyncrasies.

Methodology

MIGAN builds upon the Auxiliary Classifier GAN (AC-GAN) framework, which consists of a generator creating images from class labels and a discriminator evaluating both realism and class accuracy. The core innovation of MIGAN is the integration of prior domain knowledge into the loss function via the Structural Similarity Index (SSIM).

Recognizing that malware within the same family shares high structural correlation, the authors added an SSIM term to the generator's objective function. The total loss minimizes a weighted combination of standard GAN loss, classification loss, and an SSIM loss defined as $1 - SSIM(X_{real}, X_{fake})$. This constraint forces the generator to produce samples that adhere to the repeating patterns and structural signatures characteristic of specific malware families.

Mean SSIM score during training for various malware families, comparing MIGAN (solid lines) to the AC-GAN baseline (dashed lines).

Experimental Setup

The model was evaluated using the Nataraj et al. (2011) dataset, a benchmark containing 9,458 images across 25 malware families. Malware binaries were converted to grayscale images by mapping each byte to an 8-bit integer (0-255) and reshaping the resulting vectors into 2D images with fixed dimensions.

Key Results

MIGAN demonstrated significant improvements over the standard AC-GAN baseline across multiple metrics:

  • Structural Fidelity: MIGAN achieved an average SSIM of 0.41, more than double the 0.17 achieved by AC-GAN. This confirms that the SSIM-aware loss successfully captures the rigid structural correlations of malware.
  • Image Realism: The Fréchet Inception Distance (FID), which measures the distance between real and synthetic distributions, was significantly lower for MIGAN (125.05) compared to AC-GAN (194.98).
  • Training Stability: As shown in the training curves, MIGAN exhibits steady improvement and convergence in SSIM scores across different families, whereas standard GANs often suffer from training instability on non-natural image data.
Comparison of Fréchet Inception Distance (FID) between AC-GAN and MIGAN across 25 malware categories; lower values indicate higher realism.

Conclusion and Future Work

MIGAN proves that incorporating domain-specific constraints like SSIM can drastically improve the quality of synthetic malware data. Beyond data augmentation, a trained MIGAN generator acts as a "compressed dataset," offering a safer and more efficient way to share sensitive malware information within the research community. Future research will explore extending these generative techniques to raw binaries and system logs, moving toward the generation of functional, executable malware for more robust security testing.

Summary updated

BibTeX
@inproceedings{singh2019migan,
  author = {Abhishek Singh and Debojyoti Dutta and Amit Saha},
  title = {{MIGAN: Malware Image Synthesis Using GANs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.330110033},
}
Figure