Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewargeros/cds-5950-capstone
A Computer Vision project studying the efficiency of CosSim for Beer Style Image Classification
https://github.com/andrewargeros/cds-5950-capstone
computer-vision image-classification pytorch
Last synced: about 2 months ago
JSON representation
A Computer Vision project studying the efficiency of CosSim for Beer Style Image Classification
- Host: GitHub
- URL: https://github.com/andrewargeros/cds-5950-capstone
- Owner: andrewargeros
- License: gpl-3.0
- Created: 2022-03-08T06:20:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-13T16:52:08.000Z (over 2 years ago)
- Last Synced: 2023-03-10T04:57:04.898Z (almost 2 years ago)
- Topics: computer-vision, image-classification, pytorch
- Language: Python
- Homepage:
- Size: 54.6 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CDS 5950- Computer Vision Capstone Project
This reposistory contains code for my capstone project for the Computational Data Science major at Hamline University. The project is a series of computer vision algorithms that are used to classify images of beer by style. The project evaluates the efficacy and efficiency differences between Sharpened Cosine Similarity (CosSim) and Convolutions for image classification.
Presented 2022-05-11 for CDS-5950 CDS Capstone Project
Blog post: [Andrew's Blog](https://www.andrewargeros.com/post/image-classification-efficiency-for-beers)
Slides: [Google Slides](https://docs.google.com/presentation/d/11pv8FWtZZjexvYZk_VcibP7wIaCgcTK33KUbhU_STXc/edit?usp=sharing)
## Data
The data for this project come from [Untapped](https://untapped.com/) Top Beers by Style. This creates a download of roughly 129,000 images. Code to download the images can be found is the `/GetData` directory. NOTE: The data is not available for use in the project, as it is too large to be hosted on GitHub.
## Data Cleaning
To clean the images, I used CLIP to sort the images based on whether or not they contain an image of a glass of beer. The images that do not contain a beer are removed. The images that do contain a beer are then sorted based on the style of beer. The images are then sorted based on the style of beer, to then create train and test datasets.
## ModelsThe aim of this projet is to evaluate the efficiency of the two image classification algorithms. The models are Sharpened Cosine Similarity (CosSim), a Convolutional Neural Network, CoAtNet0 and the CoAtNet0 architecture replacing the 3 Convolutional layers with CosSim. The models were intentionally undertrained for the sake of brevity. Fully trained versions of the model architectures would have been much more computationally and financially expensive. These models would obviously have been much more accurate.
*Note: 6 Classes
|Model Name | Parameters | Training Time | Accuracy | Latency |
|------------------|------------|---------------|----------|---------|
| CNN | 7,656,632 | 03:17:22 | 49.14% | 0.09 |
| CosSim | 39,261 | 02:01:48 | 39.52% | 0.06 |
| CoAtNet | 16,054,392 | 04:46:13 | 58.88% | 0.12 |
| CoAtNet w/ CosSim| 13,107,902 | 06:27:27 | 48.26% | 0.09 |## Demo
Try out the differences between Convolutions and CosSim for yourself. Crack a beer and head to the [Demo](https://share.streamlit.io/andrewargeros/cds-5950-app/main/app.py) Streamlit app.