Files changed (3) hide show
  1. adversarially_trained_model.keras +2 -2
  2. app.py +3 -2
  3. requirements.txt +0 -0
adversarially_trained_model.keras CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1f376abeea93d25d15c2ae923320f11171f4b00c1b83b1ce4f9d910a6213fc30
3
- size 2738509
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc920a45ed6a7cc03343f678c72605e979b7e4d25eee8de114a1d760eba74b53
3
+ size 2781926
app.py CHANGED
@@ -1,15 +1,16 @@
1
  import gradio as gr
2
  import tensorflow as tf
3
  import numpy as np
4
- import pandas as pd
5
 
6
  # 1. Load your trained .keras model
7
  # This line loads your entire model from the .keras file.
8
  model = tf.keras.models.load_model("adversarially_trained_model.keras")
9
  print("output_shape:", model.output_shape) # e.g., (None, 5)
10
- CLASS_NAMES = ["normal", "dos", "probe", "r2l", "u2r"]
 
11
 
12
  def preprocess_single_record(record: dict, scaler, df_reference: pd.DataFrame) -> np.ndarray:
 
13
 
14
  # Convert input dict to DataFrame
15
  df_input = pd.DataFrame([record])
 
1
  import gradio as gr
2
  import tensorflow as tf
3
  import numpy as np
 
4
 
5
  # 1. Load your trained .keras model
6
  # This line loads your entire model from the .keras file.
7
  model = tf.keras.models.load_model("adversarially_trained_model.keras")
8
  print("output_shape:", model.output_shape) # e.g., (None, 5)
9
+ CLASS_NAMES = [f'class_{i}' for i in range(23)]# Class names based on the attack mapping from the notebook
10
+ print(CLASS_NAMES)
11
 
12
  def preprocess_single_record(record: dict, scaler, df_reference: pd.DataFrame) -> np.ndarray:
13
+ import pandas as pd
14
 
15
  # Convert input dict to DataFrame
16
  df_input = pd.DataFrame([record])
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ