A collection of deep learning projects exploring computer vision and natural language processing (NLP) using PyTorch and advanced data pipelines. Includes a CNN model trained on CIFAR-10 for image classification and a sentiment analysis model built with the Sentiment140 Twitter dataset.
This repository contains two fully independent deep learning projects, each showcasing different areas of AI:
-
CNN for Image Classification (CIFAR-10)
- Builds and trains a Convolutional Neural Network (CNN) from scratch using PyTorch.
- Focuses on classifying images into 10 different categories.
- Uses custom data loading, augmentation, and model evaluation.
-
Twitter Sentiment Analysis
- Uses the Sentiment140 dataset (1.6M tweets) to classify tweets as Positive or Negative.
- Implements full NLP preprocessing pipeline: cleaning, tokenization, lemmatization.
- Applies deep learning for text sentiment classification and evaluates multiple metrics.
The CIFAR-10 dataset contains 60,000 32x32 color images divided into 10 classes, with 50,000 training and 10,000 test images.
The project loads CIFAR-10 batches, normalizes images, and implements data augmentation using torchvision.transforms.
The CNN was built from scratch in PyTorch and includes:
- Convolutional layers with ReLU activation
- MaxPooling for spatial downsampling
- Fully connected layers for classification
- Softmax output layer
Optimizer: Stochastic Gradient Descent (SGD) with CosineAnnealingLR scheduler.
- Custom
DataLoaderwith PyTorch - Data augmentation: random crops, flips, normalization
- Epoch tracking and loss visualization
- Confusion matrix and per-class accuracy
The project uses the Sentiment140 dataset downloaded via kagglehub.
It contains 1.6 million tweets, each labeled as:
Columns in the raw CSV:
target→ Sentiment label (0 or 4)ids→ Tweet IDdate→ Date of tweetflag→ Query flaguser→ Usernametext→ Tweet content
- Remove special characters, URLs, and mentions (@usernames)
- Convert text to lowercase
- Tokenization with NLTK
- Lemmatization and stemming
- Train/test split with StratifiedShuffleSplit
- Built using PyTorch with fully connected layers
- Binary classification (Positive vs Negative)
- Evaluation metrics: Track training/validation & Evaluate on the test set → use eval_on to measure final accuracy.
| Project | Accuracy |
|---|---|
| 🖼 CIFAR-10 CNN | 🎯 94.25% |
| 💬 Twitter Sentiment | 🎯 77% |
# Author Info
# LinkedIn: https://www.linkedin.com/in/profile-mariana-martins/
# GitHub: https://github.com/marianamartiyns
# Email: marianamartiyns@gmail.comNote
The notebooks comments are written in Portuguese, while variable names and code remain in English for clarity.

