Downloads · 30 days
0
reveng-grp-2025/ffnn_sorel20m
ffnn_sorel20m is a machine learning model from reveng-grp-2025. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A PyTorch implementation of a feed-forward neural network for binary malware classification, supporting CPU, CUDA, and Apple MPS acceleration.
Downloads · 30 days
0
Access
Public
Updated Jun 11, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py15.9 KB · 73%
From the Hugging Face model README
A PyTorch implementation of a feed-forward neural network for binary malware classification, supporting CPU, CUDA, and Apple MPS acceleration.
pip install -r requirements.txt
Your CSV file should have the following structure:
sha256: File hash identifierlabel: Binary label (0 = benign, 1 = malicious)feature_0, feature_1, ..., feature_N: Numerical features for machine learningrl_fs_t, rl_ls_const_positives: Additional metadata featuresExample:
sha256,label,rl_fs_t,rl_ls_const_positives,feature_0,feature_1,feature_2,...
abc123...,0,0.5,0.2,1.23,4.56,7.89,...
def456...,1,0.8,0.9,2.34,5.67,8.90,...
Validate your dataset:
python data_utils.py --action validate --input_path train.csv
Analyse your dataset:
python data_utils.py --action analyse --input_path train.csv
Basic training:
python malware_classifier.py --data_path train.csv
Training with options:
python malware_classifier.py \
--data_path train.csv \
--subsample_ratio 0.1 \
--batch_size 512 \
--epochs 100 \
--learning_rate 0.001 \
--output_dir ./outputs
--data_path: Path to CSV training data (default: train.csv)--subsample_ratio: Ratio to subsample dataset (0.0-1.0, optional)--batch_size: Training batch size (default: 512)--epochs: Number of training epochs (default: 100)--learning_rate: Learning rate (default: 0.001)--output_dir: Directory to save outputs (default: ./outputs)The neural network uses a feed-forward architecture with:
The implementation automatically selects the best available device:
Device selection is logged at runtime:
INFO - Using CUDA GPU: NVIDIA GeForce RTX 4090
INFO - Using Apple MPS
INFO - Using CPU
malware_classifier.pth: Trained model checkpointtraining_history.json: Training and validation metrics per epochlabel_distribution.png: Visualization of class distributionfeature_correlations.png: Top features correlated with labelsfeature_distributions.png: Distribution comparison by classdataset_statistics.csv: Summary statisticsThe training script provides detailed logging:
# 1. Validate the dataset
python data_utils.py --action validate --input_path sample_train.csv
# 2. Analyse the dataset
python data_utils.py --action analyse --input_path sample_train.csv
# 3. Train the model
python malware_classifier.py --data_path sample_train.csv --epochs 50