{"id":13583893,"url":"https://github.com/PrincySinghal/Document-classification-and-Data-extraction","last_synced_at":"2025-04-06T21:33:18.431Z","repository":{"id":184466556,"uuid":"613556615","full_name":"PrincySinghal/Document-classification-and-Data-extraction","owner":"PrincySinghal","description":"Splitting and classifying documents from a pdf or image consisting of 5 classes of documents like Aadhar card,Pan etc followed by  information retrieval from each document.","archived":false,"fork":false,"pushed_at":"2023-07-28T13:57:24.000Z","size":12220,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-06T00:39:31.307Z","etag":null,"topics":["cnn","deep-neural-networks","ocr","python","sequential-models"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrincySinghal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-13T20:01:49.000Z","updated_at":"2024-04-28T05:54:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfe0daae-2371-4df1-9d4e-71351f2b13f3","html_url":"https://github.com/PrincySinghal/Document-classification-and-Data-extraction","commit_stats":null,"previous_names":["princysinghal/document-classification-and-data-extraction"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrincySinghal%2FDocument-classification-and-Data-extraction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrincySinghal%2FDocument-classification-and-Data-extraction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrincySinghal%2FDocument-classification-and-Data-extraction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrincySinghal%2FDocument-classification-and-Data-extraction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrincySinghal","download_url":"https://codeload.github.com/PrincySinghal/Document-classification-and-Data-extraction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247556730,"owners_count":20958022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","deep-neural-networks","ocr","python","sequential-models"],"created_at":"2024-08-01T15:03:52.773Z","updated_at":"2025-04-06T21:33:17.756Z","avatar_url":"https://github.com/PrincySinghal.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"## Document-Classification-and-Data-Extraction\n\n\n   \n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n       \u003cli\u003e\n      \u003ca href=\"#salient-features\"\u003eSalient Features\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\n      \u003ca href=\"#description\"\u003eDescription\u003c/a\u003e\n      \u003cli\u003e\n      \u003ca href=\"#data-preprocessing\"\u003eData Preprocessing\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\n      \u003ca href=\"#Document Classification Model\"\u003eDocument Classification Model\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\n      \u003ca href=\"#results\"\u003eResults\u003c/a\u003e\n      \u003cli\u003e\n      \u003ca href=\"#Information extraction model\"\u003eInformation extraction model\u003c/a\u003e\n      \u003cli\u003e\n      \u003ca href=\"#team\"\u003eTeam\u003c/a\u003e\n    \u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About the project\nWe put out a model that can recognise the collection of papers contained in a pdf or image made up of numerous documents. To accomplish this, the input PDF is divided into individual pages. The CNN model is used to categorise each page into the appropriate document category. After that, each document's data is extracted using OCR (optical character recognition). This is being recommended for five documents: voter identification, driver's licence, PAN, and Aadhar.\nExcept for the front and back of the same document, the input pdf must include a single document on a single page.\nOur data classification model obtained 0.7342 accuracy on the training set and 0.7736 accuracy on the validation set, with gains of 0.6923 and losses of 0.8340.\n\n\n### Salient Features\nHyperparameter tuning, regularization(early stopping), document split \n### Tech stack used\n* models: CNN and OCR\n* Framework-Keras \n\n### Methodology\n\u003cimg width=\"500\" alt=\"image\" src=\"https://user-images.githubusercontent.com/87893594/224972918-d1e9f755-02e0-40c0-8725-ac5c4824d49a.png\"\u003e\n\n### Data Description \nWhen we began searching for an appropriate dataset, we observed that there is no publicly available dataset of identity documents as they hold sensitive and personal information. But we came across a dataset on Kaggle that consisted of six folders, i.e., Aadhar Card, PAN Card, Voter ID, single-page Gas Bill, Passport, and Driver's License.  We added a few more images to each folder. These were our own documents that we manually scanned, with the rest coming from Google Images.\nThus, these are the five documents we are classifying and extracting information from.\n\n\n\n### Data Preprocessing\nBefore model training, we applied horizontal and vertical data augmentation using random flips. This further increased the size and diversity of the dataset. The categorical values of the labels column were converted to numerical values using one-hot encoding.\n\n\n### Document Classification Model\n\u003cimg width=\"555\" alt=\"image\" src=\"https://user-images.githubusercontent.com/87893594/224973161-2513f1f7-0291-41ed-9b79-c14ef2578882.png\"\u003e\n\nVarious hyperparameters like the number of layers, neurons in each layer, number of filters, kernel size, value of p in dropout layers, number of epochs, batch size, etc. were changed until satisfactory training and validation accuracy was achieved.\n\n\u003cimg width=\"500\" alt=\"image\" src=\"https://user-images.githubusercontent.com/87893594/224972235-be7435d0-1f11-4c38-8ab6-6958fcb3bb83.png\"\u003e\n\n\u003cimg width=\"500\" alt=\"image\" src=\"https://user-images.githubusercontent.com/87893594/224972374-4244b1b6-418d-4364-8fea-77a05450ca19.png\"\u003e\n\n\n### The final Model and results\n\u003cimg width=\"500\" alt=\"image\" src=\"https://user-images.githubusercontent.com/87893594/224972133-8bf9642b-d16e-4880-b017-161c61d8f247.png\"\u003e\n\u003cimg width=\"500\" alt=\"image\" src=\"https://user-images.githubusercontent.com/87893594/224972187-cd7f5c48-95d7-42fa-a187-bfd84344e903.png\"\u003e\n\n\n### Information extraction model\nFollowing are the steps of OCR done on images:\n\n\u003cimg width=\"650\" alt=\"image\" src=\"https://user-images.githubusercontent.com/87893594/224973268-06a235f9-6657-4970-befc-78cf665bfb65.png\"\u003e\n\n\u003cimg width=\"650\" alt=\"image\" src=\"https://user-images.githubusercontent.com/87893594/224973311-0b5c26d3-46d4-4df8-96a3-c4287072637a.png\"\u003e\n\n\n\n### Team\n- Kanika Kanojia [GitHub](https://github.com)        [Linkedin](https://www.linkedin.com/in/kanika-kanojia-348620207/) \n- Deepali Thakur [GitHub](https://github.com/deepalii05) [Linkedin](https://www.linkedin.com/in/deepali-thakur/)\n- Princy Singhal [GitHub](https://github.com/PrincySinghal) [Linkedin](https://www.linkedin.com/in/princy-singhal-047414224/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPrincySinghal%2FDocument-classification-and-Data-extraction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPrincySinghal%2FDocument-classification-and-Data-extraction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPrincySinghal%2FDocument-classification-and-Data-extraction/lists"}