{"id":26884800,"url":"https://github.com/hk151109/image-classification-using-svm","last_synced_at":"2025-10-12T22:13:21.728Z","repository":{"id":265478601,"uuid":"893376020","full_name":"hk151109/Image-Classification-Using-SVM","owner":"hk151109","description":"This repository contains the implementation of an image classification system using a Support Vector Machine (SVM). The goal of the project is to classify images of cats and dogs stored in two folders (train and test1). The classifier is trained on a labeled dataset and used to predict the category of unseen images from the test folder.","archived":false,"fork":false,"pushed_at":"2024-12-17T18:20:19.000Z","size":26387,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-17T12:15:53.307Z","etag":null,"topics":["imageclassification","internship","machine-learning","svm"],"latest_commit_sha":null,"homepage":"","language":"Python","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/hk151109.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-24T09:26:02.000Z","updated_at":"2024-12-17T18:21:03.000Z","dependencies_parsed_at":"2025-03-31T18:48:44.860Z","dependency_job_id":null,"html_url":"https://github.com/hk151109/Image-Classification-Using-SVM","commit_stats":null,"previous_names":["hk151109/prodigy_ml_03"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hk151109/Image-Classification-Using-SVM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hk151109%2FImage-Classification-Using-SVM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hk151109%2FImage-Classification-Using-SVM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hk151109%2FImage-Classification-Using-SVM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hk151109%2FImage-Classification-Using-SVM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hk151109","download_url":"https://codeload.github.com/hk151109/Image-Classification-Using-SVM/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hk151109%2FImage-Classification-Using-SVM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270735538,"owners_count":24636379,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["imageclassification","internship","machine-learning","svm"],"created_at":"2025-03-31T18:28:57.582Z","updated_at":"2025-10-12T22:13:21.667Z","avatar_url":"https://github.com/hk151109.png","language":"Python","readme":"# Image Classification Using SVM\n\n## Project Overview\n\nThis repository contains the implementation of an image classification system using a Support Vector Machine (SVM). The goal of the project is to classify images of cats and dogs stored in two folders (`train` and `test1`). The classifier is trained on a labeled dataset and used to predict the category of unseen images from the test folder.\n\n## Index\n\n- [Project Overview](#project-overview)\n- [Features](#features)\n- [File Structure](#file-structure)\n- [Steps to Run](#steps-to-run)\n- [Dependencies](#dependencies)\n- [Results](#results)\n- [Dataset](#dataset)\n- [License](#license)\n\n## Features\n\n### Data Preprocessing\n- Image resizing to a consistent size (64x64 pixels)\n- Flattening images to 1D arrays for model input\n- Scaling the pixel values using StandardScaler\n- Dimensionality reduction using PCA to improve classifier performance\n\n### Classification\n- Support Vector Machine (SVM) classifier with a linear kernel\n- Binary classification: \"cat\" or \"dog\"\n\n### Predictions\n- Classify all images in the `test1` folder\n- Store results in a CSV file with image number and predicted category\n- Option to predict a specific image from the test folder\n\n## File Structure\n\n```\nproject_root/\n│   image_classifications.csv\n│   cats\u0026dogs.py\n│\n├───test1\n│   ├── 1.jpg\n│   ├── 2.jpg\n│   └── ...\n└───train\n    ├───cat\n    │   ├── cat.0.jpg\n    │   ├── cat.1.jpg\n    │   └── ...\n    └───dog\n        ├── dog.0.jpg\n        ├── dog.1.jpg\n        └── ...\n\n```\n\n## Prerequisites\n\n### System Requirements\n- Python 3.7+\n- Minimum 4GB RAM\n- Sufficient disk space for dataset\n\n### Dependencies\nInstall the required libraries using pip:\n\n```bash\npip install opencv-python numpy scikit-learn pandas\n```\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/hk151109/Image-Classification-Using-SVM.git\n```\n\n2. Download the dataset from [Kaggle Dogs vs Cats Competition](https://www.kaggle.com/competitions/dogs-vs-cats/data)\n\n3. Organize your dataset:\n   - Place training images in the `train/` directory\n   - Place test images in the `test1/` directory\n\n## Usage\n\n### Training the Model\n```bash\npython cats\u0026dogs.py\n```\nThis script will:\n- Preprocess images\n- Train the SVM classifier\n- Save the trained model\n- Classify images in the test folder\n- Generate `image_classifications.csv`\n\n### Predicting a Specific Image\nAfter running the script, you can predict a specific image by entering its number when prompted.\n\n## Results\n\nThe `image_classifications.csv` will contain:\n- `image`: Image number\n- `category`: Predicted category (\"cat\" or \"dog\")\n\n## License\nMIT License - see LICENSE file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhk151109%2Fimage-classification-using-svm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhk151109%2Fimage-classification-using-svm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhk151109%2Fimage-classification-using-svm/lists"}