当前位置:网站首页>CV learning notes - deep learning
CV learning notes - deep learning
2022-07-03 10:08:00 【Moresweet cat】
Deep learning
1. neural network
1. summary
Cited example : Mechanism of biological neural network
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-AInTSLwa-1639290184011)(./imgs/image-20211212115335280.png)]](/img/ae/5039857d77dacd95e0b34c677c8e6c.jpg)
The basic working principle of biological neural network :
There are multiple dendrites at the input of a neuron , It is mainly used to receive input information . Input information is processed by synapse , The letter to be entered
Interest accumulation , When the processed input information is greater than a specific threshold , It will transmit information through axons , At this time, it is called neuron
To be activated . contrary , When the processed input information is less than the threshold , Neurons are in a state of inhibition , It doesn't transmit like other neurons
Information . Or send a small message .
Artificial neural network :
Artificial neural network is divided into two stages :
- Receive from others n Signals from neurons , These input signals are matched with corresponding weights
The weighted sum is passed to the next stage .( Pre activation phase ) It's the sum - Pass the weighted result of pre activation to the activation function It's the f
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-D3HZgd1V-1639290184013)(./imgs/image-20211212115838916.png)]](/img/3c/17be54376fc389449e0e3dab06ad54.jpg)
The concepts of artificial neural network and biological neural network correspond :
| Biological neural networks | Artificial neural network |
|---|---|
| nucleus | Neuron |
| Dendrites | Input |
| axon | Output |
| synaptic | The weight |
Artificial neuron :
Input : x 1 , x 2 , x 3 x_1,x_2,x_3 x1,x2,x3
Output :output
simplified model : Agree that there are only two possibilities for each input (1 or 0)
- All inputs are 1, Indicates that the input conditions are all true , Output is 1
- All inputs are 0, Indicates that none of the input conditions is true , Output is 0
【 example 】 Judge whether watermelon is good or bad
Input :[ Color : dark green , roots : Curl up , Knock sound : Murmur ]
Output : Good melon (1)
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-G8idRLM6-1639290184013)(./imgs/image-20211212120934112.png)]](/img/60/e4c50e2e9f6f42486d9c98e3a45cb9.jpg)
neural network : It is formed by interconnected neurons , These neurons have weights and errors during network training
To update the deviation , The goal is to find an approximation of an unknown function . Its principle is influenced by the physiological structure of our brain —— Cross connected neurons inspire . But unlike a neuron in the brain that can connect to any neuron within a certain distance ,
Artificial neural networks have discrete layers 、 Direction of connectivity and data dissemination .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-kEwQDHo9-1639290184014)(./imgs/image-20211212121126020.png)]](/img/77/ed87dc9fa46b8c1989729239e4cdee.jpg)
2. Types of neural networks
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-e7vYBlCT-1639290184015)(./imgs/image-20211212121223368.png)]](/img/a8/4701d07aa1112f52839620d2508143.jpg)
3. Neuron
Neuron is the most basic unit of neural network , It originated from the human body , Imitate human neurons , Function is also related to the God of the human body
Jing Yuan is consistent , Get the input of the signal , After data processing , Then give a result as output or as the next neuron
Input .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-hiiMJbGa-1639290184016)(./imgs/image-20211212121510691.png)]](/img/c8/d46b0fc9a19b963eaf19a3e1f9919e.jpg)
4. Parameters in neural networks
Input : It's the eigenvector . The eigenvector represents the direction of change . Or say , Is the most representative of the characteristics of this thing
towards .
The weight ( A weight ): It's characteristic value . There are positive and negative , Strengthen or suppress , Same as eigenvalue . The absolute value of the weight , generation
The influence of input signal on neurons is shown in table .
The essence : When the vector is n Dimensional space time , That is, the input vector and the weight vector are n dimension , That is to say n Inputs 、 Weight time , Yes
h = ( x 1 , x 2 , . . . ) ( ω 1 , ω 2 , . . . ) T + b h=(x_1,x_2,...)(\omega_1,\omega_2,...)^T+b h=(x1,x2,...)(ω1,ω2,...)T+b
Neurons are when h Greater than 0 Time output 1,h Less than 0 Time output 0 Such a model , Its essence is to divide the feature space into two parts , Think that the two halves belong to two classes respectively .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-SNtVyfZP-1639290184017)(./imgs/image-20211212123438000.png)]](/img/2d/07f4332be5ef6a6006f9ea5dc1857c.jpg)
5. Multilayer neural network
Because neurons can only divide the feature space into two , In the face of complex problems , This method obviously cannot meet the demand , Therefore, a multilayer neural network is proposed .
Neural network is a kind of operation model , By a large number of nodes ( Neuron ) And the mutual connection between . The connection between each two nodes represents a weighted value for the signal passing through the connection , Call it weight , This is equivalent to the memory of the artificial neural network .
The output of the network depends on the connection mode of the network , The weight value is different from the excitation function . The network itself is usually an approximation to some algorithm or function in nature , It could also be an expression of a logical strategy .
Single layer neural network ( perceptron )
Multilayer neural network : Neural network is composed of multiple neurons , The result of the former neuron is the input of the latter neuron , Combined in turn . The neural network is generally divided into three layers , The first layer acts as the input layer , The last layer is the output layer , All in the middle are hidden layers .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-XFIs8kRh-1639290184017)(./imgs/image-20211212124026024.png)]](/img/d5/036a07c21126cb6c1e16b8c2e7e416.jpg)
Theoretical proof , Any multilayer network can be approximately represented by a three-layer network .
Generally, experience is used to determine how many nodes the hidden layer should have , In the process of testing, you can also constantly adjust the number of nodes to achieve the best results .
6. Feedforward neural networks
The artificial neural network model mainly considers the topology of network links 、 Neuron characteristics 、 Learn the rules, etc .
Feedforward neural networks : Feedforward neural networks (FNN) It is the first type of simple artificial neural network invented in the field of artificial intelligence . Inside it , Parameters propagate unidirectionally from the input layer through the hidden layer to the output layer . Unlike Recurrent Neural Networks , It will not form a directed ring inside . The following figure shows a simple feedforward neural network :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-N9MiB4zc-1639290184018)(./imgs/image-20211212124549670.png)]](/img/71/8002631ba648ebfd8db11decf35011.jpg)
FNN By an input layer 、 One ( Shallow networks ) Or more ( Deep networks , Therefore, it is called deep learning ) Hidden layer , And an output layer . Every layer ( Except for the output layer ) Connect with the next layer . This connection is FNN The key to architecture , It has two main characteristics : Weighted average and activation function .
Classification of Feedforward Neural Networks :
- ( monolayer ) perceptron
There is only a single-layer neural network , It is regarded as the simplest form of feedforward neural network , It is a binary linear classifier .
- Multilayer perceptron
It is an artificial neural network with forward structure , It can be seen as a directed graph , It consists of multiple node layers , Each layer is fully connected to the next layer . In addition to the input node , Each node is a neuron with nonlinear activation function ( Or processing unit ), It is the generalization of single-layer perceptron , It overcomes the weakness that the perceptron can not recognize the linear inseparable data .
7. Design Neural Networks
- Before using neural network training data , The number of layers of neural network must be determined , And the number of units per level
- When the feature vector is introduced into the input layer, it is usually standardized to 0-1 Between ( To speed up the learning process )
- Discrete variables can be encoded into the possible values of an eigenvalue corresponding to each input unit
such as : The eigenvalue A I could take three values ( a 0 , a 1 , a 2 ) (a_0,a_1,a_2) (a0,a1,a2), have access to 3 The input units represent A.
If A= a 0 a_0 a0, So on behalf of a 0 a_0 a0 The cell value of 1, Other take 0;1,0,0
If A= a 1 a_1 a1, So on behalf of a 1 a_1 a1 The cell value of 1, Other take 0, And so on 0,1,0 - Neural network can be used for classification (classification) problem , You can also solve regression (regression) problem
- For the classification problem , If it is 2 class , It can be represented by an output unit (0 and 1 Represent the 2 class ); If more than 2 class , Then every
A category is represented by an output unit Such as 001 - There are no clear rules to design how many hidden layers are best , It can be tested and improved according to the experimental test, error and accuracy .
- For the classification problem , If it is 2 class , It can be represented by an output unit (0 and 1 Represent the 2 class ); If more than 2 class , Then every
8. Perceptual knowledge of the hidden layer
For example, face recognition :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-vu500Pmg-1639290184019)(./imgs/image-20211212140841263.png)]](/img/74/bd1ecd4ca6292fa1df342e82437fd9.jpg)
Each of the above subnetworks , It can also be further decomposed into smaller problems , For example, the question of whether the upper left is an eye , Can be divided into
The solution is :
- Do you have eyeballs ?
- Do you have eyelashes ?
- Do you have iris ?
- …
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-FgbUcWOq-1639290184020)(./imgs/image-20211212141006509.png)]](/img/2e/5e826eaa515b740706c323d034b6b0.jpg)
This sub network can be further decomposed ,. Decompose layer after layer , Until the answer is simple enough to be answered on a single neuron .
2. Activation function
1. summary
The state of neurons : In the neural network , Neurons in active state are called active state , Neurons that are inactive are called inhibitory . Activation function endows neurons with the ability of self-learning and adaptation .
The function of activation : The function of activation function is to introduce nonlinear learning and processing ability into neural network . Activation function is a core unit of neural network design .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-ncqZioI3-1639290184021)(./imgs/image-20211212125111919.png)]](/img/21/4c81b683c05fc56ff0d8f08d64aaf2.jpg)
With sigmoid Activation function y = 1 1 + e − x y=\frac{1}{1+e^{-x}} y=1+e−x1 For example :
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-zDkDp4Oc-1639290184021)(./imgs/image-20211212125255988.png)]](/img/34/b72dda71b7fd1508ff199174ee7f62.jpg)
2. Commonly used activation functions
There are three conditions for activating a function
- nonlinear
- It's very small
- monotonous
- sigmoid function
y = l o g s i g ( x ) = 1 1 + e − x y=logsig(x)=\frac{1}{1+e^{-x}} y=logsig(x)=1+e−x1
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-FLvgDoyw-1639290184022)(./imgs/image-20211212125825978.png)]](/img/5e/03e4f3686e399ef1074c8c27e38c5f.jpg)
sigmoid There are two main disadvantages :
- Gradient saturated , Look at the picture , The gradient of values on both sides is 0;
- The average value of the results is not 0, This is what we don't want , Because this causes the input of neurons in the posterior layer to be true or false
0 Mean signal , This will have an impact on the gradient .
- tanh function
y = t a n s i g ( x ) = e x − e − x e x + e − x y=tansig(x)=\frac{e^x-e^{-x}}{e^x+e^{-x}} y=tansig(x)=ex+e−xex−e−x
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-IDyDjdMp-1639290184023)(./imgs/image-20211212125825978.png)]](/img/5e/03e4f3686e399ef1074c8c27e38c5f.jpg)
t a n h ( x ) = 2 σ ( 2 x ) − 1 tanh(x)=2\sigma(2x)-1 tanh(x)=2σ(2x)−1
- ReLU function ( Linear rectifier layer )
f ( x ) = m a x ( 0 , x ) f(x)=max(0,x) f(x)=max(0,x)
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-pxAev16c-1639290184024)(./imgs/image-20211212130126400.png)]](/img/7f/0f7cd07ddbfa2ab7624a8fb586f4fa.jpg)
3. Comparison of activation functions
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-PoT12YCn-1639290184024)(./imgs/image-20211212130334551.png)]](/img/71/f06f15c08c1aa41017dac29462df30.jpg)
4. Neurons are sparse
Unilateral inhibition :ReLU A function is actually a piecewise linear function , Change all negative values to 0, And the positive value remains the same , This operation is called unilateral inhibition .
Because of this unilateral inhibition , So that the neurons in the neural network also have Sparse activation .( Simulate the characteristics of the human brain , At the same time , There are only neurons in human brain 1%~4% To be activated , Most of them are in a state of inhibition )
When the model increases N After the layer , Theoretically ReLU The activation rate of neurons will decrease 2 Of N Times the power .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-uH0AUHLv-1639290184025)(./imgs/image-20211212130557795.png)]](/img/cb/246b307cd529b4ad69af1f51ad42a3.jpg)
3. Deep learning
machine learning & Artificial intelligence & Deep learning :
Machine learning is the core of artificial intelligence , A discipline that studies how to use machines to simulate human learning activities .
Deep learning ( Multilayer artificial neural network ) It's a branch of machine learning , The method of representational learning of data .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-NeYdwqf6-1639290184025)(./imgs/image-20211212115159593.png)]](/img/82/704551500af925a84eb1bdcf6a9803.jpg)
Deep neural network & Deep learning : The traditional neural network has developed to the case of multiple hidden layers , Neural networks with multiple hidden layers are called deep neural networks , The research of machine learning based on deep neural network is called deep learning . If you need to refine and differentiate , that , Deep neural network can be understood as the structure of traditional multilayer network 、 Optimization of methods .
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-j6MB2u1Y-1639290184026)(./imgs/image-20211212141240747.png)]](/img/ac/93018aeb89cb0bfb618c1c3f7c1389.jpg)
Deep learning , Multilayer artificial neural network
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-vidJZOeY-1639290184026)(./imgs/image-20211212141857069.png)]](/img/5c/7a88ffc5a27c94f5cf95725a2bf458.jpg)
Personal study notes , Just learn to communicate , Reprint please indicate the source !
边栏推荐
- 2.Elment Ui 日期选择器 格式化问题
- I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first
- Do you understand automatic packing and unpacking? What is the principle?
- Circular queue related design and implementation reference 1
- I think all friends should know that the basic law of learning is: from easy to difficult
- LeetCode - 900. RLE 迭代器
- Interruption system of 51 single chip microcomputer
- LeetCode - 460 LFU 缓存(设计 - 哈希表+双向链表 哈希表+平衡二叉树(TreeSet))*
- After clicking the Save button, you can only click it once
- Development of intelligent charging pile (I): overview of the overall design of the system
猜你喜欢

Leetcode 300 最长上升子序列

Opencv note 21 frequency domain filtering

Opencv feature extraction - hog

For new students, if you have no contact with single-chip microcomputer, it is recommended to get started with 51 single-chip microcomputer

MySQL root user needs sudo login

51 MCU tmod and timer configuration

Leetcode bit operation

LeetCode - 1670 設計前中後隊列(設計 - 兩個雙端隊列)

Cases of OpenCV image enhancement

Oracle database SQL statement execution plan, statement tracking and optimization instance
随机推荐
Windows下MySQL的安装和删除
Dynamic layout management
LeetCode - 919. Full binary tree inserter (array)
The 4G module designed by the charging pile obtains NTP time through mqtt based on 4G network
Yocto Technology Sharing Phase 4: Custom add package support
51 MCU tmod and timer configuration
Swing transformer details-2
JS foundation - prototype prototype chain and macro task / micro task / event mechanism
Sending and interrupt receiving of STM32 serial port
The data read by pandas is saved to the MySQL database
Modelcheckpoint auto save model
JS基础-原型原型链和宏任务/微任务/事件机制
Opencv image rotation
2312、卖木头块 | 面试官与狂徒张三的那些事(leetcode,附思维导图 + 全部解法)
Leetcode - 933 number of recent requests
Cases of OpenCV image enhancement
Opencv Harris corner detection
QT setting suspension button
Timer and counter of 51 single chip microcomputer
My notes on the development of intelligent charging pile (III): overview of the overall design of the system software