Messi vs Ronaldo Image Classifier
A playful AI project that trains a neural network to tell whether a soccer image shows Lionel Messi or Cristiano Ronaldo.
This is an AI-related image classification project built for a university assignment, with dataset analysis, model training, and notebook documentation.

Project overview
This project uses a neural network to learn from labeled soccer images and classify whether the picture belongs to Messi or Ronaldo. The notebook includes data exploration, preprocessing, training, and inference.
Key AI concepts
- Machine Learning (ML)
- Train the model using labeled data so it learns to classify images without explicit rules.
- Neural Networks (NN)
- Use connected layers of neurons to extract visual patterns from images.
- Deep Learning
- Build a multi-layer network that captures complex features like faces, poses, and jerseys.
- Supervised Learning
- Train on labeled Messi and Ronaldo images so the network learns the correct labels.
- Unsupervised Learning
- Optional analysis can include clustering image features to see how Messi and Ronaldo images group.
- Reinforcement Learning
- Not used directly here, but the project is part of a broader AI learning path.
Project structure
- data/: Contains the image dataset used for training and validation.
- models/: Stores saved model files and weights.
- messi_ronaldo.ipynb: Primary Jupyter Notebook with code and explanations.
Steps to complete the project
- Introduction
- Define the classification task and dataset.
- Explain why Messi and Ronaldo make a fun, human-friendly dataset.
- Dataset analysis
- Review class distribution for Messi vs Ronaldo.
- Display sample images from each class.
- Data preprocessing
- Resize and normalize images.
- Split data into training, validation, and test sets.
- Apply data augmentation to improve generalization.
- Model training
- Choose a neural network architecture.
- Define metrics like accuracy and loss.
- Run experiments with learning rate, batch size, and epochs.
- Inference
- Predict new images.
- Evaluate model performance on held-out data.
Documentation
The notebook contains friendly explanations for every step, including:
- dataset structure and sample images
- preprocessing pipeline
- model definition and training
- results visualization
- final conclusions

Getting started
- Clone the repository.
- Install dependencies.
- Open
messi_ronaldo.ipynb. - Run the notebook cells and follow the guided analysis.
Source code
View the Neural Network Classification source on GitHub
How to run
git clone https://github.com/tothantonio/neural-network-classification.git
cd neural-network-classification
pip install -r requirements.txt
jupyter notebook messi_ronaldo.ipynb
Conclusion
This project is a fun, beginner-friendly AI application that shows how neural networks can classify images of two famous football stars. It is a great way to learn real AI practices while keeping the project entertaining.