Primary_frame_CNN(dog_cat.py, dataset.py)  

A primary frame of Convolutional Neural Network with a clear designing process, mainly used for object classification.

image

A: dog and cat --- dog_cat.py

1. Load the training data

2. Define basic parameters

3. Construct networks

3.1 Construct layer: features, variables

3.2 Construct linkers: filters, weight and bias

3.3 Construct operation

3.4 Construct loss function

3.5 Construct optimizer function used for updating weight and bias

3.6 Construct evaluation function used for estimating the accuracy

4. Training

B: MNIST --- simple minist.py



Further reading  

R-CNN: Region based CNN

  • box-selecting method: EdgeBoxes, Selective Search, ect.

SPP: Spatial Pyramid Pooling

  • used for multi-scale input for CNN

Fast R-CNN  

  • RCNN + SPP

Faster R-CNN

  • add RPN (Region Proposal Network) for extracting candidate boxes

image



400 rows of classic CNN code(classic CNN 400 rows.py)  

Keys:

A: function for constructing Graph, training, testing, loading model and classifying

B: continue training

C: tf.name_scope, get_tensor_by_name, get_operation_by_name

D: graph and session, interactiveSession

E: tensorboard

F: model file formats: ckp, pb