Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Computer Vision & NLP

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.

📋 Project Overview

This repository contains two fully independent deep learning projects, each showcasing different areas of AI:

  1. 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.
  2. 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.

🖼 Project 1: CIFAR-10 - CNN Image Classification

Dataset Overview

The CIFAR-10 dataset contains 60,000 32x32 color images divided into 10 classes, with 50,000 training and 10,000 test images.

image

The project loads CIFAR-10 batches, normalizes images, and implements data augmentation using torchvision.transforms.

Model Architecture

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.

Training Pipeline

  • Custom DataLoader with PyTorch
  • Data augmentation: random crops, flips, normalization
  • Epoch tracking and loss visualization
  • Confusion matrix and per-class accuracy

💬 Project 2: Twitter Sentiment Analysis

Dataset Overview

The project uses the Sentiment140 dataset downloaded via kagglehub. It contains 1.6 million tweets, each labeled as:

image

Columns in the raw CSV:

  • target → Sentiment label (0 or 4)
  • ids → Tweet ID
  • date → Date of tweet
  • flag → Query flag
  • user → Username
  • text → Tweet content

Preprocessing Steps

  • Remove special characters, URLs, and mentions (@usernames)
  • Convert text to lowercase
  • Tokenization with NLTK
  • Lemmatization and stemming
  • Train/test split with StratifiedShuffleSplit

Model Pipeline

  • 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.

📊 Results & Metrics

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.com

Note

The notebooks comments are written in Portuguese, while variable names and code remain in English for clarity.

About

A collection of deep learning projects focused on computer vision and natural language processing (NLP). Includes a CNN model trained on CIFAR-10 and a sentiment analysis project using Twitter data.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages