File size: 6,316 Bytes
935f2fd
d0c624a
 
 
 
 
 
 
 
935f2fd
04f8a1f
 
 
 
 
 
 
 
 
 
 
510d0c9
 
f780acc
555ded1
935f2fd
d0c624a
 
 
 
 
 
 
 
a7e89e8
d0c624a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a7e89e8
 
d0c624a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
---
title: Deep Learning 1
emoji: πŸ“‰
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.12.0
app_file: app.py
pinned: false
license: mit
language:
- en
tags:
- sports
- soccer
- epl
- arsenal
- chelsea
- liverpool
- man city
- man united
metrics:
- accuracy
library_name: gradio
pipeline_tag: image-to-text
---

# Model Card

## Overview

- **Model name:** Top 5 EPL Teams' Emblem Identifier
- **Model description:** Identifies the emblem of the top 5 English Premier League (EPL) teams from images using a convolutional neural network (CNN).
- **Authors:** Alif Al Hasan
- **Repository link:** https://huggingface.co/spaces/alifalhasan/deep-learning-1/tree/main
- **License:** MIT
- **Contact information:** [email protected]

## Performance

- **Metrics:** Accuracy (100%)
- **Dataset:** Approximately 5,000 images of EPL team emblems, balanced across classes. Sources and preprocessing steps described in detail further below.

## Data

- **Training data:**
    - Size: 5,000 images
    - Class distribution: Balanced (1,000 images per class)
    - Sources: [English Premier League Logo Detection](https://www.kaggle.com/datasets/alexteboul/english-premier-league-logo-detection-20k-images)
    - Preprocessing: Resizing to 224x224 pixels, normalization
- **Potential biases:** Currently unknown biases in the dataset.

## Inference

- **Input:**
    - Format: JPEG or PNG images
    - Size: 224x224 pixels
    - Color space: RGB
- **Output:** Predicted class probabilities for each of the 5 EPL teams.
- **Inference Endpoint:** Try the model live and interact with it directly here: [https://huggingface.co/spaces/alifalhasan/deep-learning-1](https://huggingface.co/spaces/alifalhasan/deep-learning-1)
- **Usage instructions:** Simply upload an image of any of the EPL's top 5 team's emblem to get a prediction.

## Ethics

- **Potential biases:** The model may inherit biases from the training data, such as over- or under-representation of certain team emblems.
- **Mitigation strategies:** Further exploration of dataset biases and potential augmentation techniques to address them.
- **Ethical considerations:** 
    - Awareness of potential biases and limitations in the model's predictions.
    - Responsible use of the model, avoiding harmful generalizations or discrimination.
    - Respect for the rights and privacy of individuals and organizations associated with the EPL teams.

---


# Top 5 EPL Teams' Emblem Identifier
A simple and well designed web app to identify the emblem of the top 5 teams of **EPL(English Premier League)** namely **Arsenal, Chelsea, Liverpool, Manchester City** and **Manchester United**.


### Requirements
- [Python 3.11](https://python.org/)
- [NumPy](https://numpy.org/)
- [SciPy](https://scipy.org/)
- [Gradio](https://www.gradio.app/)
- [Tensorflow](https://tensorflow.org/)


### Table Of Contents
-  [Introduction](#introduction)
-  [Model Architecture](#model-architecture)
-  [Project Architecture](#project-architecture)
-  [How To Run](#how-to-run)
-  [License](#license)
-  [Contributor](#contributor)


### Introduction
A simple and well designed web app to identify the emblem of the top 5 teams of **EPL**. This model has been trained with a balanced dataset which contains almost **5k** images of the emblems of the teams.


### Model Architecture
The model utilizes a straightforward convolutional neural network (CNN) architecture, comprising the following layers:

1. **Convolutional Layer:**
   - 32 filters, each of size 3x3
   - ReLU activation function
   - Input shape: 224x224x3 (RGB images)
   - Extracts spatial features from input images.

2. **Max Pooling Layer:**
   - Pool size: 2x2
   - Reduces spatial dimensions for capturing more global features.

3. **Flattening Layer:**
   - Flattens the 2D feature maps into a 1D vector for input to dense layers.

4. **Dense Layer 1:**
   - 64 neurons
   - ReLU activation function

5. **Output Layer (Dense Layer 2):**
   - 5 neurons (matching the number of classes)
   - Softmax activation to produce probability scores for each class.

**Key Points:**
- Input image size: 224x224 pixels
- Optimizer: Adam with a learning rate of 0.001
- Loss function: Categorical crossentropy
- Performance metric: Accuracy

**Visual Representation:**
[Input image (224x224x3)] --> [Conv2D] --> [MaxPooling2D] --> [Flatten] --> [Dense 1] --> [Output Layer (Dense 2)] --> [Predicted class]


### Prject Architecture
```
β”œβ”€β”€  data
β”‚    └── arsenal  - images of arsenal's emblem.
β”‚    └── chelsea  - images of chelsea's emblem.
β”‚    └── liverpool  - images of liverpool's emblem.
β”‚    └── manchester-city  - images of manchester-city's emblem.
β”‚    └── manchester-united  - images of united's emblem.
β”‚
β”‚
β”œβ”€β”€  model  
β”‚    └── football_logo_model.h5  - generated model.
β”‚ 
β”‚
β”œβ”€β”€  src
β”‚    └── classify
β”‚        └── classify.py  - this module classifies the emblem from input image.
β”‚    └── train
β”‚        └── trainer.py  - this module trains the model.
β”‚
β”‚
β”œβ”€β”€  app.py - this module starts the app interface.
β”‚
β”‚
β”œβ”€β”€  LICENSE - license file of this project.
β”‚
β”‚
β”œβ”€β”€  README.md - readme file of this project.
β”‚
β”‚
β”œβ”€β”€  requirements.txt - list of required packages.
```

### How To Run
First, install dependencies   
```bash
# clone project   
git clone https://huggingface.co/spaces/alifalhasan/deep-learning-1

# install project   
cd deep-learning-1 
pip install -r requirements.txt
```

Next, download the dataset from [here](https://drive.google.com/file/d/1O5Mm-86AlUf5fUYf1NS8J_t22h7h_UbQ/view?usp=sharing). First unzip the folder. **dataset** folder contains **five** more folders. Copy them and paste into the **data** directory of this project folder.

Now train the model using this command:  
```bash
python src/train/trainer.py    
```

Finally, deploy the model using this command:  
```bash
python app.py    
```

### License
Distributed under the MIT License. See `LICENSE` for more information.


### Contributor
Alif Al Hasan - [@alifalhasan](https://huggingface.co/alifalhasan) - [email protected]

Project Link: [https://huggingface.co/spaces/alifalhasan/deep-learning-1](https://huggingface.co/spaces/alifalhasan/deep-learning-1)