https://github.com/jakubvojvoda/bayes-classifier
Binary classification of images using Bayes classifier
https://github.com/jakubvojvoda/bayes-classifier
bayes-classifier bayesian-classifier bmp classification cpp cross-validation evaluation image-processing machine-learning
Last synced: 5 months ago
JSON representation
Binary classification of images using Bayes classifier
- Host: GitHub
- URL: https://github.com/jakubvojvoda/bayes-classifier
- Owner: JakubVojvoda
- License: lgpl-3.0
- Created: 2016-09-18T22:34:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-22T11:43:57.000Z (about 9 years ago)
- Last Synced: 2024-12-25T17:29:51.098Z (10 months ago)
- Topics: bayes-classifier, bayesian-classifier, bmp, classification, cpp, cross-validation, evaluation, image-processing, machine-learning
- Language: C++
- Size: 43 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bayes classifier
Binary classification of images using Bayes classifier### Usage
There are defined 3 usage cases1. Evaluate trained classifier on the test set
* `./bayes --evaluate --test p1.txt n1.txt --train p2.txt n2.txt --threshold NUM [...]`
2. Get table which contains precision and recall for possible threshold values (computed using cross-validation)
* `./bayes --analyze --train pos.txt neg.txt [--q 2^NUM] [--method BAYESIAN_RGB | --method BAYESIAN_R] [--subsample]`
3. Calculate a probability for image `img.bmp` (only .bmp format supported)
* `./bayes --predict --train pos.txt neg.txt --image img.bmp [--q 2^NUM] [--method BAYESIAN_RGB | --method BAYESIAN_R] [--subsample]`### Command line arguments
Run `./bayes VARIANT INPUT OPTIONAL` where* `VARIANT`
* `--evaluate`: evaluation of implemented method
* `--analyze`: show table of rates for training samples
* `--predict`: predict probability for sample using defined threshold* `INPUT`
* `--test positive.txt negative.txt`
* `--train positive.txt negative.txt`* `OPTIONAL`
* `--method`: possible values `BAYESIAN_R` or `BAYESIAN_RGB` (default is `BAYESIAN_RGB`)
* `--q NUM`: change size of histogram dimensions (default 16)
* `--subsample`: subsample images to descrease exec time (default not use)### Examples
* `./bayes --evaluate --threshold 0.37 --subsample`
* `./bayes --evaluate --train p1.txt n1.txt --test p2.txt n2.txt --threshold 0.34`
* `./bayes --analyze --train p.txt n.txt`
* `./bayes --train p1.txt n1.txt --test --image img.bmp`