A Streamlit web app that uses a TensorFlow Lite model to classify images as either Real or Fake. This project helps detect deep fake images using deep learning pretrained model optimized for lightweight performance.
- Upload an image and detect whether it's Real or Fake.
- Displays the confidence score of the prediction.
- Lightweight and fast inference with TensorFlow Lite.
- Simple and user-friendly Streamlit interface.
- Clone the repository
git clone https://github.com/AhmedFoda54/Deep-Fake-Classification.git- Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate- Install the required packages
pip install -r requirements.txt- Run the Streamlit app:
streamlit run app/main.py- Open your browser and navigate to the URL provided in the terminal (usually
http://localhost:8501).
deepfake-classifier/
|--app/
|-- main.py # Main Streamlit application file
|-- model_utils.py # Helper Functions
|--model_convertion/
|-- convert_to_tflite.py # To convert the .h5/keras model to .tflite model
|--deepfake_classifier.tflite # TensorFlow Lite model file (downloaded automatically)
|-- requirements.txt # List of required Python packages
|-- README.md # Project documentation
- The model is hosted on Dropbox and automatically downloaded when you run the app.
- It uses a TensorFlow Lite format optimized for fast, efficient performance.
- Upload an Image: Click on the file uploader and select an image (
.jpg,.jpeg, or.png). - View the Image: The app displays the uploaded image.
- Click Predict: Press the "Predict" button to classify the image.
- View Results: The app will show whether the image is Real or Fake, along with a confidence score.
Make sure the following packages are installed (included in requirements.txt):
streamlittensorflownumpypillowgdownos
This project is licensed under the MIT License.
-
Heidari, A., Navimipour, N. J., Dag, H., & Unal, M. (2023). Deepfake detection using deep learning methods: A systematic and comprehensive review. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 14(2). https://doi.org/10.1002/widm.1520
-
Abir, W. H., et al. (2022). Detecting deepfake images using deep learning techniques and explainable AI methods. Intelligent Automation & Soft Computing, 35(2), 2151–2169. https://doi.org/10.32604/iasc.2023.029653
-
Salih, A. M., Raisi-Estabragh, Z., Galazzo, I. B., Radeva, P., Petersen, S. E., Lekadir, K., & Menegaz, G. (2024). A Perspective on Explainable Artificial Intelligence Methods: SHAP and LIME. arXiv. https://arxiv.org/abs/2305.02012