Giter Club home page Giter Club logo

dogs_vs._cats's Introduction

Dogs vs. Cats

A computation from Kaggle and a graduation project for machine learning engineer nanodegree on Udacity

本项目使用 Python 在 Jupyter Notebook 环境下开发,并用到了如下的库:

import os
import random
import cv2
from matplotlib import pyplot
import numpy
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D
from keras.applications.xception import Xception
from IPython.display import SVG
from keras.utils.vis_utils import model_to_dot
from keras.optimizers import Nadam
from keras.callbacks import EarlyStopping

其中, cv2 来自 OpenCV, 用于图片的读取、缩放等操作; keras 用于 CNN 深度学习模型的构建和训练。

用于训练 CNN 的数据集来自猫狗大战

在 AWS p2.xlarge 实例中(输出层微调)运行结果如下:

Train on 15000 samples, validate on 5000 samples
Epoch 1/10
15000/15000 [==============================] - 332s - loss: 0.1624 - acc: 0.9503 - val_loss: 0.8713 - val_acc: 0.7998
Epoch 2/10
15000/15000 [==============================] - 334s - loss: 0.0673 - acc: 0.9759 - val_loss: 1.1316 - val_acc: 0.7266
Epoch 3/10
15000/15000 [==============================] - 334s - loss: 0.0641 - acc: 0.9761 - val_loss: 0.0521 - val_acc: 0.9800
Epoch 4/10
15000/15000 [==============================] - 334s - loss: 0.0500 - acc: 0.9805 - val_loss: 0.0646 - val_acc: 0.9758
Epoch 5/10
15000/15000 [==============================] - 334s - loss: 0.0426 - acc: 0.9833 - val_loss: 0.0731 - val_acc: 0.9740
Epoch 6/10
15000/15000 [==============================] - 334s - loss: 0.0389 - acc: 0.9869 - val_loss: 0.0786 - val_acc: 0.9704
Epoch 7/10
15000/15000 [==============================] - 334s - loss: 0.0328 - acc: 0.9877 - val_loss: 0.0713 - val_acc: 0.9758

训练集与验证集均趋于稳定且非常接近,模型达到稳定。

dogs_vs._cats's People

Contributors

zli42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.