Tensorflow2.0 introduction and practical study notes (5) functional api & functional & convolutional neural network

table of Contents

1 Functional API

2 Convolutional Neural Network

2.1 CNN basics

2.1.1 Work flow

2.1.2 What is convolution?

2.2 CNN architecture

2.2.3 Convolutional layer

2.2.4 Non-linear transformation layer (activation function)

2.2.5 Pooling layer

2.2.6 Fully connected layer

Overall structure

3 Actual combat

3.1 Data classification:

3.2 Build a model

3.3 Analysis of results


1 Functional API

 

2 Convolutional Neural Network

This article will focus on using Convolutional Neural Networks (CNN) in keras to process images.

CNN is indeed inspired by the biology of the visual cortex .
 
Simply put: the visual cortex has a small number of cells that are sensitive to certain parts of the visual area
sense.
For example: some neurons are only excited on vertical edges, and some are excited on horizontal or diagonal edges .
 

2.1 CNN basics

2.1.1 Work flow

 

An overview of CNN's work means you pick an image and let it go through a series of:

  • Convolutional layer,

  • Nonlinear layer
  • Pooling (downsampling) layer
  • Fully connected layer,
Finally get the output.
As mentioned before, the output can be the probability of a single category or a group of categories that best describes the content of the image
 

2.1.2 What is convolution?

 

Convolution refers to applying a convolution kernel to all points of a certain tensor , and generating a filtered tensor by sliding the convolution kernel on the input tensor .

 
Convolution completes the extraction of image features or information matching . When an image containing certain features passes through a convolution kernel, some convolution kernels are stimulated.
Live, output a specific signal.

2.2 CNN architecture

If none of these layers , the model is difficult and complex pattern matching, because the network will have too much information to fill , that is, those other layers function is to highlight important information, reduce noise .
 

2.2.3 Convolutional layer

  • ksize Convolution kernel size
  • strides The span of convolution kernel movement
  • padding edge padding

2.2.4 Non-linear transformation layer (activation function)

 

  • Relu
  • sigmiod
  • fishy

2.2.5 Pooling layer

2.2.6 Fully connected layer

Connecting the final output with all the features, we have to use all the features to make a decision for the final classification. Finally cooperate with softmax for classification

Overall structure

 

3 Actual combat

Take satellite network as an example

3.1 Data classification:


import pathlib # Much easier to use than Os

3.2 Build a model

3.3 Result analysis

Guess you like

Origin blog.csdn.net/qq_37457202/article/details/107902173