How lehasas/malware-analysis-and-detection works
This repository is a research workflow for classifying malware from binary-derived images with two CNN variants. The documented path is binaries to grayscale images, dataset splitting, then model training or testing and generated results; hyperparameter experiments are a separate capability. The training entry point is documented but not excerpted, so its connections to loaders, models, and metrics are shown as unverified rather than asserted. Source excerpts establish image conversion, dataset loading, CNN definitions, and plotting behavior.
Main entry points: CNN_Malware_Train_Test.py Train test runner · metrics.py Metrics and plots · binary_to_image.py Binary converter · data_preprocessing.py Dataset splitter
Components 15
Data preparation
- Binary converter
scripts/binary_to_image.py - Dataset splitter
scripts/data_preprocessing.py
Model learning
- Image loaders
data_loaders.py - Train test runner
CNN_Malware_Train_Test.py - CNN model one
CNN_Models.py - CNN model two
CNN_Models.py
Evaluation and experiments
- Metrics and plots
metrics.py - Hyperparameter study
CNN_Malware_Hyperparameter_Study.ipynb
Data and results
- Malware samples
samples.7z - Class images
Images - Train val test
output - Training outputs
train_output - Test outputs
test_output
Other components
- Researcher
- Weights and Biases
Connections 17
- Researcher → Malware samples: provides samples
README.md - Malware samples → Binary converter: converts binaries
README.md - Binary converter → Class images: writes images
scripts/binary_to_image.py - Class images → Dataset splitter: splits images
README.md - Dataset splitter → Train val test: writes subsets
scripts/data_preprocessing.py - Train val test → Image loaders: loads images
data_loaders.py - Researcher → Train test runner: trains or tests
README.md - Train test runner → Image loaders: uses loaders
- Train test runner → CNN model one: uses model
- Train test runner → CNN model two: uses model
- Train test runner → Metrics and plots: reports metrics
- Train test runner → Training outputs: saves training results
README.md - Train test runner → Test outputs: saves test results
README.md - Metrics and plots → Test outputs: writes plots
metrics.py - Metrics and plots → Training outputs: reads losses
metrics.py - Researcher → Hyperparameter study: studies parameters
README.md - Hyperparameter study → Weights and Biases: uses platform
README.md