[PYTHON] Convolutional neural network experience

I'm studying deep learning for some reason. So far, I have written about the touch of deep learning at Qiita.

Simple neural network implementation using Chainer Simple neural network implementation using Chainer-Data preparation- Simple neural network implementation using Chainer-Model description- Simple neural network implementation using Chainer-optimization algorithm setting-

My goal is to create an app that reads images and classifies what they are, so I'm studying convolutional neural networks. Not to mention studying theory, I decided to experience what it means to actually let a machine learn images.

Take advantage of the wisdom of our predecessors

I once found this article and found it interesting. Can Osomatsu-san's six children be identified by deep learning? -Implementation-

This classifier uses a modified model based on ImageNet called the NIN model of chainer. The blog I was referring to Hi-king's http://hi-king.hatenablog.com/entry/2015/06/11/021144 When shi3z's http://d.hatena.ne.jp/shi3z/20150709/1436397615 is.

I wanted to run the sample ImageNet, so I decided to refer to these blogs. (Especially, I always read shi3z's blog !!!)

However, since the specifications of chainer change every time the version changes, it was necessary to be careful when referring to these articles more than a year ago. The stumbling points are summarized in here.

After that, you can learn by referring to the above two articles.

Execution environment

I will write the execution environment for reference. OS:Ubuntu14.04 GPU:GeForce GTX 750 Ti memory:8GB

Practice

State during learning

Screenshot from 2016-12-25 16:14:02.png

Learning ends when the error approaches 0.2. If the error is too low, it will be overfitting.

The epoch is the learning cycle. Learning progresses as the number of times increases. For example, here is the image I tried to recognize this time.

dalmatian.jpg

It is a pretty Dalmatian. Since there was Dalmatian in the image of ImageNet, I adopted Dalmatian this time.

ImageNet Dalmatian image Screenshot from 2016-12-25 16:25:30.png

There are also images of soccer balls that have similar characteristics (black and white spots) to Dalmatian, such as yin and yang.

Learning results

First of all, here is the result when learning only 1 epoch Screenshot from 2016-12-25 16:18:56.png

The probability of being an airplane is 43.1%.

おまえは何を言っているんだ.jpg

I'm still not smart.

But when this goes 28 epoch,

Screenshot from 2016-12-25 16:19:35.png

Dalmatian probability 99.9%

20c003f3.png

I've become smarter.

in conclusion

First of all, I was able to experience what it means to classify images into machines. As for future plans, -Learn your favorite images, not samples -Understanding the principles of convolutional neural networks I will study with the goal of.

reference

Can Osomatsu-san's six children be identified by deep learning? http://bohemia.hatenablog.com/entry/2015/11/22/174603

Image classification with chainer, a deep learning framework from PFN (neural network 1 with chainer) http://hi-king.hatenablog.com/entry/2015/06/11/021144

Deep learn and recognize your image set with Chainer's NIN http://d.hatena.ne.jp/shi3z/20150709/1436397615

Recommended Posts

Convolutional neural network experience
Implement Convolutional Neural Network
Parametric Neural Network
Try using TensorFlow-Part 2-Convolutional Neural Network (MNIST)
[Chainer] Document classification by convolutional neural network
Another style conversion method using Convolutional Neural Network
Implement Neural Network from 1
Model using convolutional neural network in natural language processing
Implementation of a convolutional neural network using only Numpy
Implement a 3-layer neural network
Neural network with Python (scikit-learn)
Neural network starting with Chainer
Neural network implementation in python
Pytorch Neural Network (CNN) Tutorial 1.3.1.
4. Circle parameters with neural network!
Neural network implementation (NumPy only)
TensorFlow Tutorial-Convolutional Neural Network (Translation)
[Deep learning] Image classification with convolutional neural network [DW day 4]
CNN Acceleration Series ~ FCNN: Introduction of Fourier Convolutional Neural Network ~
Simple neural network implementation using Chainer
Neural network with OpenCV 3 and Python 3
Implementation of a two-layer neural network 2
PRML Chapter 5 Neural Network Python Implementation
Simple classification model with neural network
I implemented a two-layer neural network
Simple neural network theory and implementation
Touch the object of the neural network
[Language processing 100 knocks 2020] Chapter 8: Neural network
network
Understand the number of input / output parameters of a convolutional neural network
Build a classifier with a handwriting recognition rate of 99.2% with a TensorFlow convolutional neural network
I made an image discrimination (cifar10) model using a convolutional neural network.
Survivor prediction using kaggle's titanic neural network [80.8%]
Compose with a neural network! Run Magenta
Predict time series data with neural network
Implementation of 3-layer neural network (no learning)
Persist the neural network built with PyBrain
Neural Network Console Challenge Winning Works List
Implementation of "blurred" neural network using Chainer
Simple neural network implementation using Chainer-Data preparation-
[PyTorch] Tutorial (Japanese version) ③ ~ NEURAL NETWORKS (Neural Network) ~
Python & Machine Learning Study Memo ③: Neural Network
Simple neural network implementation using Chainer-Model description-
2. Mean and standard deviation with neural network!