help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
image-classification
/
notebooks
RSK World
image-classification
Image Classification Dataset - CNN Models + Transfer Learning + Deep Learning
notebooks
  • image_classification_tutorial.ipynb5 KB
image_classification_tutorial.ipynb
notebooks/image_classification_tutorial.ipynb
Raw Download
Find: Go to:
{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# 🖼️ Image Classification Dataset Tutorial\n",
        "\n",
        "---\n",
        "\n",
        "**Author:** Molla Samser  \n",
        "**Email:** help@rskworld.in  \n",
        "**Phone:** +91 93305 39277  \n",
        "**Website:** [https://rskworld.in](https://rskworld.in)  \n",
        "\n",
        "© 2025 RSK World. All rights reserved.\n",
        "\n",
        "---\n",
        "\n",
        "This notebook provides a comprehensive tutorial on using the Image Classification Dataset for training CNN models.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## 📦 1. Import Libraries\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "# Image Classification Dataset Tutorial\n",
        "# Author: Molla Samser | https://rskworld.in\n",
        "\n",
        "import os\n",
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "from PIL import Image\n",
        "import cv2\n",
        "\n",
        "# Deep Learning\n",
        "import tensorflow as tf\n",
        "from tensorflow import keras\n",
        "from tensorflow.keras import layers, models\n",
        "from tensorflow.keras.preprocessing.image import ImageDataGenerator\n",
        "\n",
        "# Metrics\n",
        "from sklearn.metrics import classification_report, confusion_matrix\n",
        "import seaborn as sns\n",
        "\n",
        "# Utilities\n",
        "from tqdm.notebook import tqdm\n",
        "\n",
        "print(f\"TensorFlow version: {tf.__version__}\")\n",
        "print(f\"GPU Available: {tf.config.list_physical_devices('GPU')}\")\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## 📂 2. Configure Dataset Paths\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "# Dataset Configuration\n",
        "# Author: Molla Samser | help@rskworld.in\n",
        "\n",
        "# Dataset paths\n",
        "DATASET_DIR = '../dataset'\n",
        "TRAIN_DIR = os.path.join(DATASET_DIR, 'train')\n",
        "VAL_DIR = os.path.join(DATASET_DIR, 'validation')\n",
        "TEST_DIR = os.path.join(DATASET_DIR, 'test')\n",
        "\n",
        "# Model parameters\n",
        "IMG_SIZE = (224, 224)\n",
        "BATCH_SIZE = 32\n",
        "EPOCHS = 50\n",
        "LEARNING_RATE = 0.001\n",
        "\n",
        "print(\"Configuration:\")\n",
        "print(f\"  Image Size: {IMG_SIZE}\")\n",
        "print(f\"  Batch Size: {BATCH_SIZE}\")\n",
        "print(f\"  Epochs: {EPOCHS}\")\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## 🧠 3. Build CNN Model\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "# Build CNN Model\n",
        "# Author: Molla Samser | help@rskworld.in\n",
        "\n",
        "def build_cnn_model(input_shape, num_classes):\n",
        "    \"\"\"Build a custom CNN architecture.\"\"\"\n",
        "    model = models.Sequential([\n",
        "        # Block 1\n",
        "        layers.Conv2D(32, (3, 3), activation='relu', input_shape=input_shape),\n",
        "        layers.BatchNormalization(),\n",
        "        layers.MaxPooling2D((2, 2)),\n",
        "        \n",
        "        # Block 2\n",
        "        layers.Conv2D(64, (3, 3), activation='relu'),\n",
        "        layers.BatchNormalization(),\n",
        "        layers.MaxPooling2D((2, 2)),\n",
        "        \n",
        "        # Block 3\n",
        "        layers.Conv2D(128, (3, 3), activation='relu'),\n",
        "        layers.BatchNormalization(),\n",
        "        layers.MaxPooling2D((2, 2)),\n",
        "        \n",
        "        # Classifier\n",
        "        layers.Flatten(),\n",
        "        layers.Dense(512, activation='relu'),\n",
        "        layers.Dropout(0.5),\n",
        "        layers.Dense(num_classes, activation='softmax')\n",
        "    ])\n",
        "    \n",
        "    return model\n",
        "\n",
        "print(\"CNN Model function ready!\")\n",
        "print(\"Author: Molla Samser | https://rskworld.in\")\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## 📞 Contact\n",
        "\n",
        "For any questions or support:\n",
        "\n",
        "- **Author:** Molla Samser\n",
        "- **Email:** help@rskworld.in\n",
        "- **Phone:** +91 93305 39277\n",
        "- **Website:** [https://rskworld.in](https://rskworld.in)\n",
        "\n",
        "---\n",
        "\n",
        "*© 2025 RSK World. All rights reserved.*\n"
      ]
    }
  ],
  "metadata": {
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 2
}
170 lines•5 KB
json

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer