{"id":13444197,"url":"https://github.com/pochih/CBIR","last_synced_at":"2025-03-20T18:31:29.313Z","repository":{"id":50270905,"uuid":"109824764","full_name":"pochih/CBIR","owner":"pochih","description":"🏞  A content-based image retrieval (CBIR) system","archived":false,"fork":false,"pushed_at":"2022-07-07T18:07:55.000Z","size":3016,"stargazers_count":609,"open_issues_count":12,"forks_count":211,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-08-01T03:46:10.439Z","etag":null,"topics":["computer-vision","daisy","edges","feature-fusion","gabor","histogram","hog","image-retrieval","random-projection","resnet","vggnet"],"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/pochih.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}},"created_at":"2017-11-07T11:07:59.000Z","updated_at":"2024-07-24T09:18:36.000Z","dependencies_parsed_at":"2022-08-25T11:20:30.100Z","dependency_job_id":null,"html_url":"https://github.com/pochih/CBIR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pochih%2FCBIR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pochih%2FCBIR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pochih%2FCBIR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pochih%2FCBIR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pochih","download_url":"https://codeload.github.com/pochih/CBIR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221792892,"owners_count":16881289,"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":["computer-vision","daisy","edges","feature-fusion","gabor","histogram","hog","image-retrieval","random-projection","resnet","vggnet"],"created_at":"2024-07-31T03:02:21.603Z","updated_at":"2024-10-28T06:30:20.471Z","avatar_url":"https://github.com/pochih.png","language":"Python","readme":"[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source-150x25.png?v=103)](https://github.com/ellerbrock/open-source-badges/)\n\n## Intro \n__This repository contains a CBIR (content-based image retrieval) system__\n\n__Extract query image's feature, and retrieve similar ones from image database__\n\n\u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\"   src='https://github.com/pochih/CBIR/blob/img/CBIR.png' padding='5px' height=\"300px\"\u003e\u003c/img\u003e\n\u003ch6\u003e\u003ca href='https://winstonhsu.info/2017f-mmai/'\u003eImage src\u003c/a\u003e\u003c/h6\u003e\n\n\n## Part1: Feature Extraction\n\nIn this system, I implement several popular image features:\n- color-based\n  - [RGB histogram](https://github.com/pochih/CBIR/blob/master/src/color.py)\n- texture-based\n  - [gabor filter](https://github.com/pochih/CBIR/blob/master/src/gabor.py)\n- shape-based\n  - [daisy](https://github.com/pochih/CBIR/blob/master/src/daisy.py)\n  - [edge histogram](https://github.com/pochih/CBIR/blob/master/src/edge.py)\n  - [HOG (histogram of gradient)](https://github.com/pochih/CBIR/blob/master/src/HOG.py)\n- deep methods\n  - [VGG net](https://github.com/pochih/CBIR/blob/master/src/vggnet.py)\n  - [Residual net](https://github.com/pochih/CBIR/blob/master/src/resnet.py)\n\n##### *all features are modulized*\n\n### Feature Fusion\nSome features are not robust enough, and turn to feature fusion\n- [fusion.py](https://github.com/pochih/CBIR/blob/master/src/fusion.py)\n\n### Dimension Reduction\nThe curse of dimensionality told that vectors in high dimension will sometimes lose distance property\n- [Random Projection](https://github.com/pochih/CBIR/blob/master/src/random_projection.py)\n\n\n\n## Part2: Evaluation\n\nCBIR system retrieves images based on __feature similarity__\n\nRobustness of system is evaluated by MMAP (mean MAP), the evaluation formulas is refer to \u003ca href='http://web.stanford.edu/class/cs276/handouts/EvaluationNew-handout-1-per.pdf' target=\"_blank\"\u003ehere\u003c/a\u003e\n\n- image AP   : average of precision at each hit\n  - depth=K means the system will return top-K images\n  - a correct image in top-K is called a hit\n  - AP = (hit1.precision + hit2.precision + ... + hitH.precision) / H\n- class1 MAP = (class1.img1.AP + class1.img2.AP + ... + class1.imgM.AP) / M\n- MMAP       = (class1.MAP + class2.MAP + ... + classN.MAP) / N\n\nImplementation of evaluation can found at [evaluate.py](https://github.com/pochih/CBIR/blob/master/src/evaluate.py)\n\nMy database contains 25 classes, each class with 20 images, 500 images in total, depth=K will return top-K images from database\n\nMethod | color | daisy | edge | gabor | HOG | vgg19 | resnet152\n--- | --- | --- | --- |--- |--- |--- |---\nMean MAP (depth=10) | 0.614 | 0.468 | 0.301 | 0.346 | 0.450 | 0.914 | 0.944\n\n\n\n## Part3: Image Retrieval (return top 5 of each method)\nLet me show some results of the system\n\n### query1 - women dress\n#### query \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query1-women_dress/query1.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### color \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query1-women_dress/query1-color.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### daisy \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query1-women_dress/query1-daisy.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### edge \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query1-women_dress/query1-edge.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### gabor \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query1-women_dress/query1-gabor.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### HOG \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query1-women_dress/query1-hog.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### VGG19 \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query1-women_dress/query1-vgg.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### Resnet152 \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query1-women_dress/query1-res.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n\n### query2 - orange\n#### query \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query2-orange/query2.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### color \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query2-orange/query2-color.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### daisy \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query2-orange/query2-daisy.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### edge \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query2-orange/query2-edge.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### gabor \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query2-orange/query2-gabor.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### HOG \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query2-orange/query2-hog.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### VGG19 \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query2-orange/query2-vgg.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### Resnet152 \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query2-orange/query2-res.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n\n### query3 - NBA jersey\n#### query \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query3-nba_jersey/query3.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### color \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query3-nba_jersey/query3-color.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### daisy \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query3-nba_jersey/query3-daisy.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### edge \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query3-nba_jersey/query3-edge.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### gabor \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query3-nba_jersey/query3-gabor.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### HOG \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query3-nba_jersey/query3-hog.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### VGG19 \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query3-nba_jersey/query3-vgg.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### Resnet152 \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query3-nba_jersey/query3-res.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n\n### query4 - snack\n#### query \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query4-snack/query4.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### color \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query4-snack/query4-color.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### daisy \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query4-snack/query4-daisy.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### edge \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query4-snack/query4-edge.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### gabor \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query4-snack/query4-gabor.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### HOG \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query4-snack/query4-hog.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### VGG19 \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query4-snack/query4-vgg.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n#### Resnet152 \u003cimg align='center' style=\"border-color:gray;border-width:2px;border-style:dashed\" src='result/retrieval_result/query4-snack/query4-res.jpg' padding='5px' height=\"80px\"\u003e\u003c/img\u003e\n\n\n\n## Part4: Usage of Repository\nIf you are interesting with the results, and want to try your own images,\n\nPlease refer to [USAGE.md](https://github.com/pochih/CBIR/blob/master/USAGE.md)\n\nThe details are written inside.\n\n\n\n## Author\nPo-Chih Huang / [@pochih](http://pochih.github.io/)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpochih%2FCBIR","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpochih%2FCBIR","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpochih%2FCBIR/lists"}