• Stars
    star
    132
  • Rank 264,894 (Top 6 %)
  • Language
    Jupyter Notebook
  • Created about 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

image classification with CIFAR10 dataset w/ Tensorflow

Image Classification with CIFAR-10 dataset

In this notebook, I am going to classify images from the CIFAR-10 dataset. The dataset consists of airplanes, dogs, cats, and other objects. You'll preprocess the images, then train a convolutional neural network on all the samples. The images need to be normalized and the labels need to be one-hot encoded. Some more interesting datasets can be found here

Some of the code and description of this notebook is borrowed by this repo provided by Udacity's Deep Learning Nanodegree program. This notebook has been reproduced decorated with richer descriptions after completing the Udacity's project.

Contents

1. Get the Data
2. Understanding the dataset
3. Hands-on experience implementing normalize and one-hot encoding function
4. Tensorflow Basics
5. Model Architecture and construction (Using different types of APIs (tf.nn, tf.layers, tf.contrib))
6. Training the model (how to feed and evaluate Tensorflow graph?)
7. Prediction

please open up the jupyter notebook to see the full descriptions

2. Understanding the dataset

The original a batch data is (10000 x 3072) dimensional tensor expressed in numpy array, where the number of columns, (10000), indicates the number of sample data. As stated in the CIFAR-10/CIFAR-100 dataset, the row vector, (3072) represents an color image of 32x32 pixels.

Since this project is going to use CNN for the classification tasks, the row vector, (3072), is not an appropriate form of image data to feed. In order to feed an image data into a CNN model, the dimension of the tensor representing an image data should be either (width x height x num_channel) or (num_channel x width x height).

It depends on your choice (check out the tensorflow conv2d). In this particular project, I am going to use the dimension of the first choice because the default choice in tensorflow's CNN operation is so.

The row vector (3072) has the exact same number of elements if you calculate 32*32*3==3072. In order to reshape the row vector, (3072), there are two steps required. The first step is involved with using reshape function in numpy, and the second step is involved with using transpose function in numpy as well.

Drawing

5. Model Architecture

Drawing

The entire model consists of 14 layers in total. In addition to layers below lists what techniques are applied to build the model.

  1. Convolution with 64 different filters in size of (3x3)
  2. Max Pooling by 2
  • ReLU activation function
  • Batch Normalization
  1. Convolution with 128 different filters in size of (3x3)
  2. Max Pooling by 2
  • ReLU activation function
  • Batch Normalization
  1. Convolution with 256 different filters in size of (3x3)
  2. Max Pooling by 2
  • ReLU activation function
  • Batch Normalization
  1. Convolution with 512 different filters in size of (3x3)
  2. Max Pooling by 2
  • ReLU activation function
  • Batch Normalization
  1. Flattening the 3-D output of the last convolutional operations.
  2. Fully Connected Layer with 128 units
  • Dropout
  • Batch Normalization
  1. Fully Connected Layer with 256 units
  • Dropout
  • Batch Normalization
  1. Fully Connected Layer with 512 units
  • Dropout
  • Batch Normalization
  1. Fully Connected Layer with 1024 units
  • Dropout
  • Batch Normalization
  1. Fully Connected Layer with 10 units (number of image classes)

the image below decribes how the conceptual convolving operation differs from the tensorflow implementation when you use [Channel x Width x Height] tensor format.

Drawing

6. Training the model

achieving over 75% accuracy in 10 epochs through 5 batches.

Drawing

7. Prediction

Drawing

More Repositories

1

LLM-As-Chatbot

LLM as a Chatbot Service
Python
3,210
star
2

Machine-Learning-Yearning-Korean-Translation

Korean translation of machine learning yearning book by Andrew Ng.
360
star
3

ml-deployment-k8s-tfserving

This project shows how to serve an TF based image classification model as a web service with TFServing, Docker, and Kubernetes(GKE).
Jupyter Notebook
118
star
4

mlops-hf-tf-vision-models

MLOps for Vision Models (TensorFlow) from 🤗 Transformers with TensorFlow Extended (TFX)
Jupyter Notebook
113
star
5

Soccer-Ball-Detection-YOLOv2

YOLOv2 trained against custom dataset
Jupyter Notebook
111
star
6

EN-FR-MLT-tensorflow

English-French Machine Language Translation in Tensorflow
HTML
108
star
7

keras-sd-serving

showing various ways to serve Keras based stable diffusion
Jupyter Notebook
107
star
8

fb-group-post-fetcher

HTML
91
star
9

hf-daily-paper-newsletter

Newsletter bot for 🤗 Daily Papers
HTML
89
star
10

semantic-segmentation-ml-pipeline

Jupyter Notebook
87
star
11

PingPong

manage histories of LLM applied applications
Python
82
star
12

gradio-chat

HuggingChat like UI in Gradio
Python
59
star
13

fastai-course-korean

korean translation + more examples for fastai course contents
Jupyter Notebook
50
star
14

image_search_with_natural_language

Application for searching images from natural language queries
Jupyter Notebook
42
star
15

DeepModels

TensorFlow Implementation of state-of-the-art models since 2012
Python
38
star
16

LLM-Pref-Mark-UI

Python
37
star
17

AlexNet

AlexNet model from ILSVRC 2012
Jupyter Notebook
35
star
18

gpt2-ft-pipeline

GPT2 fine-tuning pipeline with KerasNLP, TensorFlow, and TensorFlow Extended
Jupyter Notebook
33
star
19

auto-paper-analysis

Jupyter Notebook
33
star
20

segformer-tf-transformers

This repository demonstrates how to use TensorFlow based SegFormer model in 🤗 transformers package.
Jupyter Notebook
31
star
21

LoRA-deployment

LoRA fine-tuned Stable Diffusion Deployment
Jupyter Notebook
31
star
22

CIFAR10-VGG19-Tensorflow

Jupyter Notebook
29
star
23

Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes

https://blog.tensorflow.org/2021/12/continuous-adaptation-for-machine.html
Jupyter Notebook
27
star
24

Object-Detection-YOLOv2-Darkflow

Jupyter Notebook
25
star
25

Model-Training-as-a-CI-CD-System

Demonstration of the Model Training as a CI/CD System in Vertex AI
Python
24
star
26

practical-time-series-analysis-korean

Jupyter Notebook
24
star
27

Continuous-Adaptation-with-VertexAI-AutoML-Pipeline

Jupyter Notebook
21
star
28

Vid2Persona

This project breathes life into video characters by using AI to describe their personality and then chat with you as them.
Jupyter Notebook
20
star
29

LLM-Serve

This repository provides a framework to serve LLM(Large Language Model) based applications such as Chatbot.
Python
17
star
30

complete-mlops-system-workflow

Jupyter Notebook
17
star
31

janus

generate synthetic data for LLM fine-tuning in arbitrary situations within systematic way
Jupyter Notebook
15
star
32

TFX-WandB

Jupyter Notebook
14
star
33

deep-diver

HTML
13
star
34

paperqa-ui

Python
12
star
35

LLM-Pool

Python
10
star
36

textual-inversion-pipeline

Python
9
star
37

LLMs-Colab

Python
9
star
38

llmops-pipeline

Jupyter Notebook
6
star
39

personal_newsletter_curation

HTML
5
star
40

portfolio_template

Java
5
star
41

never-leaving-vscode

5
star
42

VGG

VGG models from ILSVRC 2014
Python
4
star
43

pocket-ml-reference-korean

주머니속 머신러닝
Jupyter Notebook
4
star
44

segmentation_models

Segmentation models with pretrained backbones. Keras.
Python
4
star
45

hf-hub-utils

3
star
46

object-detection-test

object-detection-test
Jupyter Notebook
3
star
47

deploy-stable-diffusion-tfserving

This repo explores and demonstrates how to deploy stable diffusion model with TF Serving
3
star
48

fastai-course

CSS
3
star
49

Sampling-Distribution-on-Poker-Cards-

2
star
50

Data-Wrangling-on-OpenStreeMap

Jupyter Notebook
2
star
51

llama-keras

Jupyter Notebook
2
star
52

promptengineer

2
star
53

book-tracking-react

Book tracking web-app project in React. This project is one of the requirements to graduate from 'Front End Web Development Nanodegree' @Udacity.
JavaScript
2
star
54

Baseball_Data_Analysis

Exploratory Data Visualization Project on Baseball Data in Tableau
2
star
55

Responsive-Portfolio

HTML
2
star
56

Enron-Data-Analysis

Data Analysis and Machine Learning on Enron Data
HTML
2
star
57

Data-Analysis-on-RedWine

HTML
2
star
58

SD-TFTRT

Jupyter Notebook
2
star
59

rnn_simple

Python
2
star
60

Data-Analysis-on-Titanic

applying data analysis on titanic data sheet
Jupyter Notebook
2
star
61

Linear-Regression

implement simple version of "Linear Regression" using only Numpy
Jupyter Notebook
2
star
62

neighborhood-map-react

neighborhood-map-react
JavaScript
2
star
63

Logistic-Regression

simple neural network without hidden layer
Python
2
star
64

ml-fn-impls

practice implementing functions appearing in machine learning field
Python
2
star
65

tfx-gpu-docker

Dockerfile
1
star
66

YOLO-Impl-Tensorflow

Implementation of YOLO in Tensorflow
Python
1
star
67

calculator

1
star
68

deeplearningbook-korean-translation

experiments on translation of the book deeplearningbook
Jupyter Notebook
1
star
69

genai-apis

Python
1
star
70

paper-code-match

matching between paper and its codes in side-by-side layout
HTML
1
star
71

Python-Machine-Learning-Book-Practice

Python Machine Learning 책의 소스코드를 주피터 노트북이 아닌, 소스코드 형태로 작성 연습
Python
1
star
72

deeplearning-with-structured-data

Jupyter Notebook
1
star
73

test_img_clf

HTML
1
star
74

KaggleNotebook-Notes

Personal notes on some kaggle notebooks publicly available
1
star
75

gitmlops-test1

HTML
1
star
76

dstack-exp

Python
1
star
77

AIND-Planning

Python
1
star
78

llmtoolbox

hllama is a library which aims to provide a set of utility tools for large language models.
Python
1
star