Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image multi-label training with Caffe backend #381

Merged
merged 8 commits into from Mar 9, 2018
Merged

Conversation

beniz
Copy link
Collaborator

@beniz beniz commented Feb 27, 2018

Multi-label + accuracy with SigmoidCrossEntropy.

This PR is by @fantes and myself, and brings the following:

  • Support for ImageDataLayer that takes a train and test lists of images and read them directly at training / testing time without requiring the building of an LMDB
  • Support for images with multiple labels: 1, 0 or -1 for ignoring the label in the accuracy and loss itself
  • API keywords multi_label and root_folder.

Example data file:

/path/to/img1.jpg 0 0 -1 1 1

At prediction, positive indices indicates predicted labels, negative values correspond to labels to be ignored.

Example:

  • service creation
curl -X PUT http://localhost:8080/services/miml -d '{"mllib":"caffe","description":"multilabel test","type":"supervised","model":{"repository":"path/to/model_dir/","templates":"../../templates/caffe/"},"parameters":{"input":{"db":false,"connector":"image","multi_label":true},"mllib":{"template":"resnet_50","nclasses":5,"finetuning":true},"output":{}}}'
  • training
curl -X POST http://localhost:8080/train -d '{"service":"miml","async":false,"parameters":{"input":{"db":false,"width":224,"height":224},"mllib":{"gpu":true,"solver":{"iterations":10000,"test_interval":500,"base_lr":0.001,"iter_size":4},"net":{"batch_size":8}},"output":{"measure":["acc"]}},"data":["/path/to/train.txt","/path/to/test.txt"]}'

@beniz beniz merged commit 41968a7 into master Mar 9, 2018
@beniz beniz deleted the caffe_multi_label branch April 22, 2020 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants