Views
No views yet
Conv1D -> ... -> Bidirectional LSTM -> Dense -> Dense (Sigmoid)(batch_size, 10, 46) — 46 network flow features, normalized1import tensorflow as tf
2import numpy as np
3from huggingface_hub import hf_hub_download
4
5# Download the model from Hugging Face
6MODEL_PATH = hf_hub_download("Codelord01/binary_model", "binary_model.keras")
7model = tf.keras.models.load_model(MODEL_PATH)
8model.summary()
9
10# Prepare a sample input: 1 sample, 10 timesteps, 46 features
11sample_data = np.random.rand(1, 10, 46).astype(np.float32)
12
13# Make a prediction
14prediction_prob = model.predict(sample_data)
15predicted_class = 1 if prediction_prob > 0.5 else 0
16
17print(f"Prediction Probability: {prediction_prob:.4f}")
18print("Malicious Traffic Detected" if predicted_class == 1 else "Benign Traffic")
19
20
21@mastersthesis{ababio2025multilayered,
22 title={A Multi-Layered Hybrid Deep Learning Framework for Cyber-Physical Intrusion Detection in Climate-Monitoring IoT Systems},
23 author={Awuni David Ababio},
24 year={2025},
25 school={Kwame Nkrumah University of Science and Technology}
26}