Coder Social home page Coder Social logo

gungorturan / vehicleclassification Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 209.51 MB

This project involves a deep learning model using Convolutional Neural Network (CNN) to predict whether a given vehicle image is a regular car or a truck.

Jupyter Notebook 100.00%

vehicleclassification's Introduction

Vehicle Classifier with Convolutional Neural Network (CNN)

Overview

This project utilizes a Convolutional Neural Network (CNN) to classify images of vehicles as either cars or trucks. The deep learning model is implemented using TensorFlow, and the dataset consists of images of cars and trucks. The project involves preprocessing the data, building and training the CNN model, evaluating its performance, and making predictions on new images.

Installation and Setup

  1. Install Dependencies:

    !pip install tensorflow opencv-python matplotlib
  2. Import Libraries and Remove Dodgy Images:

    import tensorflow as tf
    import os
    import cv2
    import imghdr
    import numpy as np
    from matplotlib import pyplot as plt

Data Preprocessing

  1. Remove Dodgy Images:

    Remove images with unsupported extensions from the dataset.

  2. Load Data:

    Use TensorFlow's image_dataset_from_directory to load the dataset. Visualize a sample batch of images.

  3. Scale Data:

    Scale pixel values of images to the range [0, 1].

  4. Split Data:

    Split the dataset into training, validation, and test sets.

Model Architecture

Build Deep Learning Model:

Construct a CNN model using the Sequential API. The model includes convolutional layers, max-pooling layers, and dense layers with ReLU activation. The output layer uses a sigmoid activation for binary classification.

Training

  1. Train:

    Train the model using the training set and validate on the validation set. Monitor training progress using TensorBoard logs.

  2. Plot Performance:

    Visualize the training and validation loss, as well as accuracy, over epochs.

Evaluation

Evaluate:

Evaluate the model on the test set using precision, recall, and binary accuracy metrics.

Testing

Test:

Test the model on a new image. Display the image, resize it, make a prediction, and print the predicted class.

Save the Model

Save the Model:

Save the trained model for future use.

Usage

To use this project, follow the steps outlined in the provided Python script. Ensure that the required dependencies are installed, and the dataset is structured according to the specified directory. The trained model can be saved and loaded for making predictions on new images.

Feel free to customize the model architecture, hyperparameters, or extend the dataset to improve performance.

For any issues or questions, please refer to the documentation or contact the project contributors.

Note: Please replace 'data' and 'test/car.jpeg' with the actual paths to your dataset and test image.

This README provides a concise overview of the project, and users can refer to the Python script for detailed implementation.

vehicleclassification's People

Contributors

gungorturan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.