Skip to content

Instantly share code, notes, and snippets.

@islem-esi
Created February 14, 2021 22:39
Show Gist options
  • Save islem-esi/a55ed7dfcae2280f058d39573dc23aa7 to your computer and use it in GitHub Desktop.
Save islem-esi/a55ed7dfcae2280f058d39573dc23aa7 to your computer and use it in GitHub Desktop.
#Change the parameters to whatever suits you
batch_size = 512
epochs = 100
labels = [0 for _ in benign_images] + [1 for _ in malicious_images]
model.fit(benign_images+malicious_images, labels,
batch_size = batch_size,
epochs = epochs,
validation_split = 0.25,
shuffle = True)
@islem-esi
Copy link
Author

Check out my medium post: https://medium.com/analytics-vidhya/cnn-based-malware-detection-python-and-tensorflow-717f8de84ee , section EXE file to Image. Using the gist in that section you are supposed to extract images for both benign and malicious exe_files. The variable in that gist is called images, but once you extract images of an exe you should either put the images in benign_images (initially an empty list) or malicious_images (also initially an empty list).

@malkuwari99
Copy link

Hello Islem,

I try this code, but the benign_images and malicious_images aren't defined, and couldn't see the gist that you mention above. Can you please provide the full script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment