This project aims to detect fake faces using a fine-tuned DenseNet121 model. The model is trained for binary classification (real vs. fake faces) using deep learning techniques.
- tensorflow
- keras
- numpy
- pandas
- matplotlib
- opencv-python
- scikit-learn
- streamlit
- Utilizes DenseNet121 for feature extraction.
- Fine-tuned model with additional layers for improved performance.
- Achieves 98.7% accuracy on the dataset.
- Implements data augmentation, dropout, and batch normalization for better generalization.
- Streamlit-based frontend for user-friendly interaction.
- Users can upload an image or provide an image URL to check if the face is real or fake.
- Clone this repository:
git clone https://github.com/resonancejb/Fake-image-detection-model.git
- Install dependencies:
pip install -r requirements.txt
- Run the Jupyter Notebook:
jupyter notebook notebooks/fake-face-detection-with-keras-accuracy-0-987.ipynb
- Train the model or use the pre-trained version in
models/. - Evaluate performance on test images.
- Run the Streamlit App:
streamlit run scripts/main.py
- Upload an image or enter an image URL in the web interface to check if it is real or fake.
The dataset consists of real and fake face images. It is recommended to preprocess and balance the dataset before training.
- Backbone: DenseNet121 (pre-trained on ImageNet)
- Additional Layers:
- Global Average Pooling
- Dropout (Regularization)
- Dense Layers with ReLU Activation
- Loss Function: Binary Crossentropy
- Optimizer: Adam
The model achieves 98.7% accuracy on the test dataset.
Here are some example results of real and fake face detection:
- Use ensemble learning for better generalization.
- Improve dataset quality and diversity.
- Implement adversarial training to detect more sophisticated fake images.
- Enhance the Streamlit UI for a better user experience.
This project is open-source under the MIT License.





