Giter Site home page Giter Site logo

umutkavakli / odometer-mileage-extraction Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 3.36 MB

Classifying analog and digital odometers followed by object detection algorithms to shrink regions of interest to extract odometer values with an OCR algorithm.

Jupyter Notebook 88.65% Python 11.35%
yolov8 opencv easyocr pytorch

odometer-mileage-extraction's Introduction

Odometer Detection & Mileage Extraction

In this project, I will use TRODO dataset to use different classification algorithms to categorize analog and digital odometers. Moreover, I will use object detection algorithms to shrink regions of interest to extract odometer values with an Optical Character Recognition (OCR) algorithm.

Dataset

The dataset consists of 2389 raw images with proper ground truth labels. the dimensions of the images have a distribution of different sizes. The most common sizes are 768x1024, 576x1024 and 1200x1600 with a frequency of 468, 389 and 317 respectively. Since machine learning models require fixed-size input, these different-sized images will be resized to the same shape as a pre- processing step.

The number of analogs is 759 while the number of digitals is 1391. Thus, digital values are more dominant when training models.

Image Classification

Before training my model, I applied some preprocessing steps. I resized the images to 256x256 because both machine learning models require fixed-size inputs and a larger number of parameters makes it difficult for the model to run fast. Then, I normalised the value of the images by dividing by 255, which is the largest value of a pixel. Also, the images are 3D arrays but K-NN, decision trees and fully connected neural networks require 1D vector inputs to be trained. Therefore, I flattened these arrays, except CNNs, by multiplying the dimensions, 256x256x3 = 196608 features, to feed the models. Since machine learning models do not know how to handle string values such as analog and digital, I converted these strings to 0 and 1 as labels, respectively. Finally, I split 90% (2150) and 10% (239) of my dataset into training and test sets.

  1. K-Nearest Neighbors (K-NN)
  2. Decision Trees
  3. CNN (Pretrained VGG16)

Object Detection

Object detection requires more effort because the algorithms have special data format so I needed to convert these values. Furthermore, I split 80% (1911), 10% (239) and 10% (239) of my dataset into training, validation and test sets to fine-tune hyperparameters and monitor the performance of the model. As a object detection algorithm, I preferred to use the YOLOv8 algorithm to obtain the best results.

Optical Character Recognition (OCR)

An OCR software extracts and reuses data from scanned documents, camera images and image-only PDFs. OCR software selects letters in the image, converts them into words and then converts words into sentences, thus providing access and editing of the original content. In my project, I used this technology to try to extract mileage from bounding boxes in odometer images. The tool I used for milage extraction is EacyOCR , which is one of the most popular, accurate and easy-to-use OCR tools. I adjusted this tool to extract only digits instead of alphanumeric values so the name of weekdays, ’km’ or other characters won’t be taken into account.

odometer-mileage-extraction's People

Contributors

umutkavakli avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

odometer-mileage-extraction's Issues

Guide to run this project in local machine

Hi @umutkavakli,
I'm trying to do mobile app which contains odometer miles extraction and i found your repo here, but I'm mobile developer so i don't know how to run your project in my local macbook, could you please help me to step by step how to setup environment after clone this repo and run it on local machine like macbook or window pc.
Thank you so much and have a nice day!

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.