-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add fine-tuning documentation #76
Comments
@samuelstevens Suggested some example code from biobench:
|
My understanding of the three example above: These use only the visual part of the BioCLIP model and train SVM/ridge classifier/simpleshot based on the image embeddings. No text embeddings are used. |
Yep, that's correct. biobench is a method to evaluate vision-only models like the vision encoder from BioCLIP, or DINOv2, etc. |
Adds a notebook that trains a SVM that predicts species based on image embeddings created by BioCLIP. The SVM logic is based on https://github.com/samuelstevens/biobench by @samuelstevens. Part of issue #76.
Adds a notebook that trains a SVM that predicts species based on image embeddings created by BioCLIP. The SVM logic in init_svc() is copied from https://github.com/samuelstevens/biobench by @samuelstevens. Part of issue #76. Co-authored-by: Samuel Stevens <[email protected]> Co-authored-by: Copilot <[email protected]>
Adds a notebook that trains a SVM that predicts species based on image embeddings created by BioCLIP. The SVM logic in init_svc() is copied from https://github.com/samuelstevens/biobench by @samuelstevens. Part of issue #76. Co-authored-by: Samuel Stevens <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Hilmar Lapp <[email protected]>
Adds a notebook that trains a RidgeClassifier that predicts species based on image embeddings created by BioCLIP. The RidgeClassifier logic is simplified from init_svc() in https://github.com/samuelstevens/biobench by @samuelstevens. Part of issue #76. Co-authored-by: Samuel Stevens <[email protected]>
Adds a notebook that trains a RidgeClassifier that predicts species based on image embeddings created by BioCLIP. The RidgeClassifier logic is simplified from init_svc() in https://github.com/samuelstevens/biobench by @samuelstevens. Part of issue #76. Co-authored-by: Samuel Stevens <[email protected]>
Adds a notebook that trains a Simpleshot to predicts species based on image embeddings created by BioCLIP. The Simpleshot logic is based on from https://github.com/samuelstevens/biobench by @samuelstevens. Part of issue #76. Co-authored-by: Samuel Stevens <[email protected]>
Adds a notebook that trains a RidgeClassifier that predicts species based on image embeddings created by BioCLIP. The RidgeClassifier logic is simplified from init_svc() in https://github.com/samuelstevens/biobench by @samuelstevens. Part of issue #76. Co-authored-by: Samuel Stevens <[email protected]> Co-authored-by: Copilot <[email protected]>
@samuelstevens I want to add some documentation comparing the different approaches above. How would you suggest a user go about deciding between the three options? |
Maybe we should try and ask Copilot or ChatGPT, or as seems to be the latest rave, the most recent version of DeepSeek 😉 (Though only half joking) |
Adds a notebook that trains a Simpleshot to predicts species based on image embeddings created by BioCLIP. The Simpleshot logic is based on from https://github.com/samuelstevens/biobench by @samuelstevens. Part of issue #76. Co-authored-by: Samuel Stevens <[email protected]>
Yeah I actually think asking an LLM for a summary is a good idea. Fundamentally, BioCLIP embeddings are designed to be linearly separable. The SVM and ridge classifier are linear (unless you choose a nonlinear kernel in the SVM), while the KNN/Simpleshot is non-linear. Another point is that SVM and ridge classifier are parametric ML methods that explicitly learn parameters, while KNN is non-parametric. But in practice, all three will produce similar results, and I'm not sure that I have any recommendations on what methods are likely to produce the best results based on different tasks. BioBench would be a good way to test this but it's not set up to evaluate multiple ML methods on a given task right now---I am trying to write a short paper for CV4Animals about BioBench and some findings, but I won't get to that until February. If you're willing to wait, I am happy to share any insights I gain from that project. |
Perhaps @samuelstevens can double check what is true and what might be hallucinations, but I'd say pretty good on the face of it. |
Perhaps the best strengths of each are:
This table summarizes this well I think:
So if you have 3 classes with 5 examples each, I would expect SVMs > SimpleShot > Ridge Classifier. If you have 40 classes with 50 examples each, I would expect Ridge Classifier > SimpleShot, and I would expect SVMs to take too long to train reliably. Does that clarify things? |
Provide documentation on how users could fine-tune BioCLIP.
The text was updated successfully, but these errors were encountered: