Arabic Car License Recognition. A solution to the kaggle competition Machathon 3.0.

Overview

Transformers

Arabic licence plate recognition 🚗

  • Solution to the kaggle competition Machathon 3.0.
  • Ranked in the top 6️⃣ at the final evaluation phase.
  • Check our solution now on collab!
  • Check the solution presentation

Preprocessing Pipeline

The schematic of the processor

Approach

Step1: Preprocessing Enhancments on the image.

  • Most images had bad illumination and noise
    • Morphological operations to Maximize Contrast.
    • Gaussian Blur to remove Noise.
  • Thresholding on both Value and Saturation channels.

Step2: Extracting white plate using countours.

  • Get countours and sort based on Area.
  • Polygon Approximation For noisy countours.
  • Convex hull for Concave polygons.
  • 4-Point transformation For difficult camera angles.

Now have numbers in a countor and letters in another.

Step3: Separating characters from white plate using sliding windows.

Can't use countours to get symbols in white plate since Arabic Letter may consist of multiple charachters e.g ت this may consist of 2/3 countours.

Solution

  • Tuned 2 sliding windows, one for letters' white plate, the other for numbers.
    • Variable window width
    • Window height is the white plate height, since arabic characters may consist multiple parts
  • Selecting which window
    • Must have no black pixels on the sides
    • Must have a specific range of black pixels inside
    • For each group of windows the one with max black pixels is selected

Step4: Character Recognition.

  • Training 2 model since Arabic letters and numbers are similar e.g (أ,1) (5, ه)
    • one for classifing only arabic letters.
    • one for classifying arabic numbers.

Project Organization

Scripts applied on images

./Macathon/code/
├── extract_bbx_xml.ipynb                       : Takes directory of images and their bbx data stored in an xml files, and crop the bbxs from the images.
|                                                 The xml file contains licence label(name), xmin, ymin, xmax, ymax of the bbxs in an image.    
├── extract_bbx_txt.ipynb                       : Takes directory of images and their bbx data stored in a txt files, and crop the bbxs from the images.
|                                                 The txt file corresponding to one image may consist of multiple bbxs, each corresponds to a row of xmin,ymin,xmax,ymax for that bbx.
└── crop_right_noise.ipynb                      : Crops an image with some percentage and replace with the cropped image. 

Model versions

./Macathon/code/
└── model.ipynb                      : - The preprocessing and modeling stage, Contains:
                                          - Preprocessing Functions
                                          - Training both classifers
                                          - Prediction and generating the output csv file

Data Folder

./Macathon/data/
├── challenging_images.rar                      : Contains most challenging images collected from the train data. 
├── cropped_letters.zip                         : 28 Subfolders corresponding to the 28 letter in Arabic alphabet.
|                                                 Each subfolder holds images for the letter it's named after, cropped from the train data distribution.
├── cropped_numbers.zip                         : 10 Subfolders for the 10 numbers.
|                                                 Each subfolder holds images for the number it's named after, cropped from the train data distribution.
├── machathon-3.zip                             : The uploaded data found with the kaggle competition.
└── testLetters.zip                             : 200 images labeled from the test data distribution.
                                                  Each image has a corresponding xml file holding the bbxs locations in it.

Contributors

This masterpiece was designed, and implemented by

Hossam
Hossam Saeed
Mostafa wael
Mostafa Wael
Nada Elmasry
Nada Elmasry
Noran Hany
Noran Hany
You might also like...
10th place solution for Google Smartphone Decimeter Challenge at kaggle.
10th place solution for Google Smartphone Decimeter Challenge at kaggle.

Under refactoring 10th place solution for Google Smartphone Decimeter Challenge at kaggle. Google Smartphone Decimeter Challenge Global Navigation Sat

Kaggle G2Net Gravitational Wave Detection : 2nd place solution

Kaggle G2Net Gravitational Wave Detection : 2nd place solution

Kaggle Feedback Prize - Evaluating Student Writing 15th solution

Kaggle Feedback Prize - Evaluating Student Writing 15th solution First of all, I would like to thank the excellent notebooks and discussions from http

The 3rd place solution for competition
The 3rd place solution for competition

The 3rd place solution for competition "Lyft Motion Prediction for Autonomous Vehicles" at Kaggle Team behind this solution: Artsiom Sanakoyeu [Homepa

2nd solution of ICDAR 2021 Competition on Scientific Literature Parsing, Task B.
2nd solution of ICDAR 2021 Competition on Scientific Literature Parsing, Task B.

TableMASTER-mmocr Contents About The Project Method Description Dependency Getting Started Prerequisites Installation Usage Data preprocess Train Infe

1st Solution For ICDAR 2021 Competition on Mathematical Formula Detection
1st Solution For ICDAR 2021 Competition on Mathematical Formula Detection

This project releases our 1st place solution on ICDAR 2021 Competition on Mathematical Formula Detection. We implement our solution based on MMDetection, which is an open source object detection toolbox based on PyTorch.

Codebase for the solution that won first place and was awarded the most human-like agent in the 2021 NeurIPS Competition MineRL BASALT Challenge.

KAIROS MineRL BASALT Codebase for the solution that won first place and was awarded the most human-like agent in the 2021 NeurIPS Competition MineRL B

1st Solution For NeurIPS 2021 Competition on ML4CO Dual Task

KIDA: Knowledge Inheritance in Data Aggregation This project releases our 1st place solution on NeurIPS2021 ML4CO Dual Task. Slide and model weights a

Team nan solution repository for FPT data-centric competition. Data augmentation, Albumentation, Mosaic, Visualization, KNN application
Team nan solution repository for FPT data-centric competition. Data augmentation, Albumentation, Mosaic, Visualization, KNN application

FPT_data_centric_competition - Team nan solution repository for FPT data-centric competition. Data augmentation, Albumentation, Mosaic, Visualization, KNN application

Owner
Noran Hany
Noran Hany
Solution of Kaggle competition: Sartorius - Cell Instance Segmentation

Sartorius - Cell Instance Segmentation https://www.kaggle.com/c/sartorius-cell-instance-segmentation Environment setup Build docker image bash .dev_sc

null 68 Dec 9, 2022
This is the solution for 2nd rank in Kaggle competition: Feedback Prize - Evaluating Student Writing.

Feedback Prize - Evaluating Student Writing This is the solution for 2nd rank in Kaggle competition: Feedback Prize - Evaluating Student Writing. The

Udbhav Bamba 41 Dec 14, 2022
My published benchmark for a Kaggle Simulations Competition

Lux AI Working Title Bot Please refer to the Kaggle notebook for the comment section. The comment section contains my explanation on my code structure

Tong Hui Kang 29 Aug 22, 2022
Data visualization app for H&M competition in kaggle

handm_data_visualize_app Data visualization app by streamlit for H&M competition in kaggle. competition page: https://www.kaggle.com/competitions/h-an

Kyohei Uto 12 Apr 30, 2022
CCPD: a diverse and well-annotated dataset for license plate detection and recognition

CCPD (Chinese City Parking Dataset, ECCV) UPdate on 10/03/2019. CCPD Dataset is now updated. We are confident that images in subsets of CCPD is much m

detectRecog 1.8k Dec 30, 2022
Kaggle Lyft Motion Prediction for Autonomous Vehicles 4th place solution

Lyft Motion Prediction for Autonomous Vehicles Code for the 4th place solution of Lyft Motion Prediction for Autonomous Vehicles on Kaggle. Discussion

null 44 Jun 27, 2022
7th place solution of Human Protein Atlas - Single Cell Classification on Kaggle

kaggle-hpa-2021-7th-place-solution Code for 7th place solution of Human Protein Atlas - Single Cell Classification on Kaggle. A description of the met

null 8 Jul 9, 2021
Kaggle | 9th place (part of) solution for the Bristol-Myers Squibb – Molecular Translation challenge

Part of the 9th place solution for the Bristol-Myers Squibb – Molecular Translation challenge translating images containing chemical structures into I

Erdene-Ochir Tuguldur 22 Nov 30, 2022
My 1st place solution at Kaggle Hotel-ID 2021

1st place solution at Kaggle Hotel-ID My 1st place solution at Kaggle Hotel-ID to Combat Human Trafficking 2021. https://www.kaggle.com/c/hotel-id-202

Kohei Ozaki 18 Aug 19, 2022
Kaggle | 9th place single model solution for TGS Salt Identification Challenge

UNet for segmenting salt deposits from seismic images with PyTorch. General We, tugstugi and xuyuan, have participated in the Kaggle competition TGS S

Erdene-Ochir Tuguldur 276 Dec 20, 2022