top of page

Comparative Analysis of Text and Image Classification Techniques

This project examines various machine learning models for classifying text (restaurant and movie reviews) and images (CIFAR-10 dataset). It compares the accuracy of traditional models like Naïve Bayes and SVM with deep learning models like CNNs across different setups. The analysis highlights the best approaches for each type of data and discusses the implications of model complexity and dataset characteristics on performance.




 

This project explores and evaluates the performance of different machine learning and deep learning models on two primary tasks: text classification and image classification.


Text Classification


The task involves classifying 800 reviews into two categories: restaurant and movie reviews. The methodology includes preprocessing text data by building a TF-IDF matrix, lemmatizing words, and removing stop-words and punctuations. Several models were implemented:


  • Naïve Bayes

  • Logistic Regression

  • Random Forest (50 trees)

  • Support Vector Machine (SVM)

  • Artificial Neural Network (ANN) with a single hidden layer of 4 neurons


Each model was evaluated based on its accuracy to determine which model best handles text classification tasks. A detailed analysis was performed to assess whether simpler statistical models outperform complex models based on the dataset's nature.



 


Image Classification


Using the CIFAR-10 dataset, which includes 60,000 32x32 color images categorized into ten classes (e.g., airplane, automobile, bird), the project implements a convolutional neural network (CNN) that undergoes various enhancements:


  • Base CNN Model: Includes layers like Conv2D, MaxPooling2D, Dropout, and Dense layers.

  • Enhanced CNN Model: Adds additional convolutional layers and adjusts parameters to increase depth and complexity.


The models are trained with different epochs to observe the impact on performance, particularly focusing on how model accuracy evolves with training complexity and duration. The effectiveness of the CNN is compared to traditional models trained on flattened image vectors using Naïve Bayes and Random Forest, highlighting the superiority of CNNs for image data due to their ability to capture spatial hierarchies.



 


Outcome


The results indicate that while traditional models like Naïve Bayes perform exceptionally well on text data, CNNs are more suited for image classification, significantly outperforming simpler models. The project concludes by discussing the potential of deep learning models to excel in complex classification tasks when provided with adequate training data and computational resources, alongside the necessary hyperparameter tuning to optimize performance.

bottom of page