Skip to content
pathavasaviPublic

About

Skillcraft Technology ML Internship Task 3, featuring regression, clustering, and SVM image classification models..

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

SkillCraft Technology Machine Learning Internship - Task 3

🐱🐶 Image Classification Using Support Vector Machine (SVM)

📌 Project Overview

This project implements a computer vision pipeline using a Support Vector Machine (SVM) to classify images into binary categories (Cats vs. Dogs). The model reads raw images, processes them into normalized numerical representations, and fits an optimal linear separating hyperplane to make predictions.

📊 Dataset Structure

The workflow is designed around the Cats-And-Dogs-Mini-Dataset on Kaggle, an optimized 23 MB collection ideal for efficient machine learning tasks.

  • Total Sample Count: 1,000 images
  • Class Balance: 500 images of cats (cats_set / Label: 0) & 500 images of dogs (dogs_set / Label: 1)

⚠️ Note: Raw image folders are excluded from this remote repository via .gitignore to adhere to clean code hosting size practices.

⚙️ Pipeline & Code Workflow

  1. Image Preprocessing: Uses opencv-python (cv2) to parse local image directories, convert images to grayscale (IMREAD_GRAYSCALE), and resize them uniformly to (100 \times 100) pixels.
  2. Feature Flattening: Flattens the 2D image matrices into 1D arrays ((10,000) individual feature inputs per image) packed into structured numpy arrays.
  3. Data Splitting: Uses a stratified 80/20 train-test split (train_test_split) to maintain perfect class balance across training and validation sets.
  4. Model Architecture: Initializes and trains a Scikit-Learn SVC algorithm configured with a linear kernel.
  5. Diagnostics: Performance is validated using accuracy_score and a comprehensive classification_report (measuring Precision, Recall, and F1-Score).

🛠️ Local Installation & Setup

1. Clone the Repository

git clone https://github.com
cd your-repository-name

2. Install Required Dependencies

Ensure you have Python installed, then run:

pip install numpy scikit-learn opencv-python notebook

3. Dataset Configuration

  1. Download the archive zip directly from the Kaggle Cats-And-Dogs-Mini-Dataset.
  2. Extract the archive into your preferred local directory, maintaining the structural subfolder format:
    📁 Your_Local_Dataset_Folder
    ├── 📁 cats_set
    └── 📁 dogs_set
    
  3. Update the data_dir string variable in your notebook to match your machine's exact directory path before executing the cells.

4. Execution

Launch your local Jupyter interface to run the script:

jupyter notebook Task3.ipynb

About

Skillcraft Technology ML Internship Task 3, featuring regression, clustering, and SVM image classification models..

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages