Skip to content

rskworld/image-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–ΌοΈ Image Classification Dataset

License: MIT Python TensorFlow PyTorch

Large image classification dataset with multiple categories for training CNN models, transfer learning, and image recognition tasks.

πŸ“‹ Overview

This dataset contains thousands of labeled images across multiple categories, organized for image classification tasks. Perfect for training CNN models, transfer learning, image recognition, and computer vision applications.

✨ Features

  • πŸ–ΌοΈ Multiple Image Categories - Diverse categories covering animals, vehicles, nature, objects, and more
  • 🏷️ Labeled Training Data - All images properly labeled and organized by category
  • πŸ“Š Test & Validation Sets - Pre-split into training (70%), validation (15%), and test (15%) sets
  • πŸ“ Various Image Sizes - Images in multiple resolutions for different model requirements
  • 🧠 Ready for CNN Training - Optimized format for Convolutional Neural Networks

πŸ“ Dataset Structure

image-classification/
β”œβ”€β”€ dataset/
β”‚   β”œβ”€β”€ train/              # 70% of data
β”‚   β”‚   β”œβ”€β”€ animals/
β”‚   β”‚   β”œβ”€β”€ vehicles/
β”‚   β”‚   β”œβ”€β”€ nature/
β”‚   β”‚   β”œβ”€β”€ food/
β”‚   β”‚   β”œβ”€β”€ buildings/
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ validation/         # 15% of data
β”‚   β”‚   β”œβ”€β”€ animals/
β”‚   β”‚   β”œβ”€β”€ vehicles/
β”‚   β”‚   └── ...
β”‚   └── test/               # 15% of data
β”‚       β”œβ”€β”€ animals/
β”‚       β”œβ”€β”€ vehicles/
β”‚       └── ...
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ data_loader.py
β”‚   β”œβ”€β”€ train_model.py
β”‚   β”œβ”€β”€ augmentation.py
β”‚   └── evaluate.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ LICENSE
└── README.md

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/yourusername/image-classification.git
cd image-classification

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Basic Usage

# Image Classification Dataset - rskworld.in
# Author: Molla Samser | Email: help@rskworld.in

import os
import numpy as np
from PIL import Image

def load_dataset(data_dir):
    """Load images from the dataset directory."""
    images = []
    labels = []
    categories = os.listdir(data_dir)
    
    for idx, category in enumerate(categories):
        category_path = os.path.join(data_dir, category)
        for img_name in os.listdir(category_path):
            img_path = os.path.join(category_path, img_name)
            img = Image.open(img_path).resize((224, 224))
            images.append(np.array(img))
            labels.append(idx)
    
    return np.array(images), np.array(labels)

# Load training data
X_train, y_train = load_dataset('dataset/train')
print(f"Training samples: {len(X_train)}")

πŸ› οΈ Technologies

Technology Description
PNG/JPG Image formats used in the dataset
NumPy Numerical computing for array operations
PIL/Pillow Python Imaging Library for image processing
OpenCV Computer vision library for advanced operations
TensorFlow Deep learning framework
PyTorch Deep learning framework

πŸ“Š Dataset Statistics

Category Training Validation Test
Animals 1,050 225 225
Vehicles 840 180 180
Nature 700 150 150
Food 560 120 120
Buildings 630 135 135
Fashion 490 105 105
Aircraft 420 90 90
Sports 560 120 120
Instruments 350 75 75
Electronics 490 105 105
Furniture 420 90 90
Plants 490 105 105
Total 7,000 1,500 1,500

🧠 Model Training Examples

TensorFlow/Keras

import tensorflow as tf
from tensorflow.keras import layers, models

# Build CNN Model
model = models.Sequential([
    layers.Conv2D(32, (3, 3), activation='relu', input_shape=(224, 224, 3)),
    layers.MaxPooling2D((2, 2)),
    layers.Conv2D(64, (3, 3), activation='relu'),
    layers.MaxPooling2D((2, 2)),
    layers.Conv2D(128, (3, 3), activation='relu'),
    layers.MaxPooling2D((2, 2)),
    layers.Flatten(),
    layers.Dense(256, activation='relu'),
    layers.Dropout(0.5),
    layers.Dense(num_classes, activation='softmax')
])

model.compile(
    optimizer='adam',
    loss='categorical_crossentropy',
    metrics=['accuracy']
)

PyTorch

import torch
import torch.nn as nn
from torchvision import transforms, datasets
from torch.utils.data import DataLoader

# Define transforms
transform = transforms.Compose([
    transforms.Resize((224, 224)),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406], 
                        std=[0.229, 0.224, 0.225])
])

# Load dataset
train_dataset = datasets.ImageFolder('dataset/train', transform=transform)
train_loader = DataLoader(train_dataset, batch_size=32, shuffle=True)

πŸ“ˆ Data Augmentation

The dataset includes augmentation scripts for expanding your training data:

from tensorflow.keras.preprocessing.image import ImageDataGenerator

augmentation = ImageDataGenerator(
    rotation_range=20,
    width_shift_range=0.2,
    height_shift_range=0.2,
    horizontal_flip=True,
    zoom_range=0.2,
    shear_range=0.2,
    fill_mode='nearest'
)

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘€ Author

Molla Samser

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

⭐ Show Your Support

Give a ⭐️ if this project helped you!

πŸ“ž Contact

For any inquiries or support, please reach out:


Made with ❀️ by RSK World

About

This dataset contains thousands of labeled images across multiple categories, organized for image classification tasks. Perfect for training CNN models, transfer learning, image recognition, and computer vision applications.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors