π¦ Malware Detector : TensorFlow Neural Network
Pre-trained models for the Malware Detector project a deep learning binary classifier that detects malware based on Linux process memory features, served via a Gradio web interface.
π§ Model Architecture
A 6-layer fully connected neural network built with TensorFlow/Keras:
Input (33 features)
β Dense(50, relu)
β Dense(50, relu)
β Dense(50, relu)
β Dense(50, relu)
β Dense(50, relu)
β Dense(50, relu)
β Dense(2, softmax) β Benign / Malware
Training config:
- Batch size: 100
- Max epochs: 10
- Early stopping: patience = 2
- Train/test split: 80/20 (stratified)
- Feature scaling: StandardScaler
π¦ Files
| File | Description |
|---|---|
malware_model.h5 |
Trained TensorFlow/Keras neural network |
scaler.pkl |
StandardScaler for feature normalization |
ποΈ Dataset
Source: Malware Detection Using Deep Learning Dataset
33 Linux process memory features including: millisecond, state, prio, vm_pgoff, task_size, map_count, total_vm, utime, stime, nvcsw, min_flt and more.
β οΈ Known limitation: Dataset has class imbalance toward Malware samples. Future improvement: apply SMOTE or class weighting during training.
π Usage
import tensorflow as tf
import joblib
import pandas as pd
# Load model and scaler
model = tf.keras.models.load_model('malware_model.h5')
scaler = joblib.load('scaler.pkl')
# Load and preprocess your data
df = pd.read_csv('your_data.csv')
df = df.drop(['hash', 'classification'], axis=1, errors='ignore')
X_scaled = scaler.transform(df)
# Predict
predictions = model.predict(X_scaled)
results = ['Benign' if r[0] > r[1] else 'Malware' for r in predictions]
print(results)
π Full Project
For the complete source code and Gradio interface: π github.com/Sakni-Tasnim/malware-detector-tensorflow
π€ Author
Sakni Tasnim Telecommunications & Computer Engineering Student
π GitHub β’ LinkedIn