An advanced machine learning system for detecting fake news using multiple ML models with a modern graphical user interface built with Python and Tkinter.
This application provides an intuitive desktop interface for analyzing news articles and determining their authenticity using multiple machine learning algorithms. The system combines the power of three different ML models to provide robust and reliable fake news detection.
- Multi-Model Analysis: Uses Naive Bayes, SVM, and Neural Network models
- ** Modern GUI**: Clean, professional interface with real-time analysis
- ** Interactive Visualizations**: Charts and graphs showing model predictions
- ** Confidence Scoring**: Detailed confidence levels for each prediction
- ** Analysis History**: Track and review previous analyses
- ** Real-time Processing**: Fast text analysis with threading support
- ** Ensemble Voting**: Combines multiple models for enhanced accuracy
- Type: Probabilistic classifier
- Strengths: Fast, simple, works well with small datasets
- Use Case: Baseline classification with strong independence assumptions
- Type: Linear/Non-linear classifier
- Strengths: Effective for text classification, handles high-dimensional data
- Use Case: Finding optimal hyperplane to separate fake and real news
- Type: Multi-layer perceptron
- Strengths: Can learn complex patterns, often provides best accuracy
- Use Case: Deep pattern recognition in text features
- Type: Meta-classifier
- Strengths: Combines strengths of all models
- Use Case: Final robust prediction using weighted voting
- GUI Framework: Tkinter with modern styling
- ML Libraries: scikit-learn
- Text Processing: TF-IDF Vectorization, Regex preprocessing
- Visualization: matplotlib, seaborn
- Data Handling: pandas, numpy
- Threading: For non-blocking UI operations
- Python 3.8 or higher
- Windows/Linux/macOS
- Minimum 4GB RAM
- 500MB free disk space
tkinter (usually comes with Python)
scikit-learn>=1.0.0
numpy>=1.21.0
pandas>=1.3.0
matplotlib>=3.5.0
seaborn>=0.11.0
git clone https://github.com/Hikmaholadele/Fake_news_detection_gui.git
cd fake_news_detection_guipip install -r requirements.txtOr install manually:
pip install scikit-learn numpy pandas matplotlib seabornpython fake_news_detector_app.pyfake_news_detection_with_gui/
β
βββ fake_news_detector_app.py # Main application file
βββ models/ # Pre-trained model files
β βββ *.pkl # Pickled model components
β βββ ...
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ assets/ # UI assets (optional)
βββ app_icon.ico # Application icon
Run the Python script to open the GUI interface.
- Type or paste the news article text in the input area
- The application accepts articles of any length
- Click the "π Analyze Text" button
- The system will process the text through all ML models
- Analysis Results Tab: Shows the final verdict and confidence level
- Visualizations Tab: Interactive charts comparing model predictions
- Model Details Tab: Information about each ML model
- All analyses are saved in the history panel
- Double-click any history item to reload and review
- ** APPEARS TO BE REAL NEWS**: High confidence in authenticity
- ** FAKE NEWS DETECTED**: High confidence in detecting misinformation
- High (80-100%): Very reliable prediction
- Medium (60-79%): Moderately reliable prediction
- Low (0-59%): Less reliable, manual verification recommended
Shows individual results from each model:
- Model: Name of the ML algorithm
- Prediction: REAL or FAKE classification
- Confidence: Certainty level of the prediction
The application comes with pre-trained models, but you can retrain with your own data:
- Prepare Dataset: CSV with 'text' and 'label' columns
- Feature Extraction: TF-IDF vectorization with 5000 features
- Model Training: Train Naive Bayes, SVM, and Neural Network
- Model Persistence: Save using pickle for loading in GUI
- Training Data: Model accuracy depends on training data quality
- Language: Optimized for English text
- Context: Cannot verify factual claims, only detects linguistic patterns
- Bias: May reflect biases present in training data
- Updates: Models should be retrained periodically with fresh data
Convert to standalone executable using PyInstaller:
# Install PyInstaller
pip install pyinstaller
# Create executable
pyinstaller --onefile --windowed --name "FakeNewsDetector" fake_news_detector_app.py
# With models folder
pyinstaller --onefile --windowed --name "FakeNewsDetector" --add-data "models;models" fake_news_detector_app.py- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
OLADELE HIKMAH - @Hikmah Oladele
- scikit-learn community for ML algorithms
- Tkinter for GUI framework
- matplotlib/seaborn for visualizations
- Open source community for inspiration and support
- Support for multiple languages
- Real-time news feed integration
- Web-based interface
- Advanced NLP techniques (BERT, transformers)
- Database integration for large-scale analysis
- API endpoint for external integration
- Mobile application version