Digit Recognizer By Convolutional Neural Network (CNN)

3y ago
34 Views
3 Downloads
1.77 MB
17 Pages
Last View : 2d ago
Last Download : 3m ago
Upload by : Giovanna Wyche
Transcription

Digit Recognizer by Convolutional Neural Network (CNN)Ding Li2018.06online store: costumejewelry1.com

MNIST database(Modified National Institute of Standards and Technology database)60,000 training images; 10,000 testing imagesKaggle Challenge42,000 training images; 28,000 testing imagesInputHandwritten DigitResultPredict784 (28*28) PixelsPixel color coding [0,255]Input ImagePixel ValueLabel[0,9]https://en.wikipedia.org/wiki/MNIST database2

Conv 13*3Conv 23*316 filters16 filters24*24*1626*26*16Input28*28Conv 33*3Conv 43*332 filters32 filters51212*12*16TrainableParameters:814,778Max pool 22*28*8*3210*10*32FlattenMax pool 12*24*4*32Dense 1ReluDense 2ReluDense 4512https://en.wikipedia.org/wiki/Convolutional neural networkLeNet - dLabel[0,9]10VGG 16https://en.wikipedia.org/wiki/Yann LeCun3

101001010010100*10-110-110-110 10 00 -110 10 010 -110 10 010 -11 100010001000 30Detected edge10 10 1000010 10 1000010 10 1000010 10 1000010 10 1000010 10 100001*0-110-110-1030 300030 300030 300030 300No lanation-convnets/4

*10-110-110-1111000-1-1-1Multiple convolutional filters (kernels) can capture different changes of neighborhood ion-kernels-with-online-demo5

38217911Max Pool924523Size: 2 x 2635612Pool after convolutional layer, reduce noise and data size.Local information are concentrated into higher level information.Besides max pool, there is also average pool.6

Inputx0, x1, x2OutputaParametersw0, w1, w2, b(to be optimized)𝑧 w 0 x0 w 1 x1 w 2 x2 ba f(z)activation functionNonlinearincrease certaintyononoffoffReLUf(z) max(0, d𝑓(𝑧) 11 𝑒 𝑧7

All the input from the previous layer arecombined at each 3]π‘Ž5[1]11111[1]11111π‘Ž0 𝑓(𝑀0,0 π‘₯0 𝑀1,0 π‘₯1 𝑀2,0 π‘₯2 𝑀3,0 π‘₯3 𝑏0 )π‘Ž1 𝑓(𝑀0,1 π‘₯0 𝑀1,1 π‘₯1 𝑀2,1 π‘₯2 𝑀3,1 π‘₯3 𝑏1 ) .All the local features extracted in previouslayers are fully connected with differentweights to construct global features.Complicated relationship between input canbe revealed by deep networks.Fully Connected at-is-deep-learning/8

[𝐿 1]π‘Ž0[𝐿 1]π‘Ž1[𝐿 2]π‘Ž2[𝐿 1]π‘Ž1023L-1 layer𝐿𝑀0,0𝐿𝐿 1𝑧0 𝑀0,0 π‘Ž0π‘¦ΰ·œ 00π‘¦ΰ·œ 11π‘¦ΰ·œ 22 . . 𝐿𝑀1023,0Linear combination of inputs from previous layer:𝐿𝐿 1 𝑀1,0 π‘Ž1𝐿𝐿 1 𝑀2,0 π‘Ž2L layer[𝐿 1]𝐿Softmax, normalize the result:π‘¦ΰ·œ 0 𝑒 𝑧0𝑒 𝑧0 𝑒 𝑧1 𝑒 𝑧2 𝑒 𝑧9Probability that π‘¦ΰ·œ 0π‘¦ΰ·œ 0 π‘¦ΰ·œ 1 π‘¦ΰ·œ 2 π‘¦ΰ·œ 9 1E.g. y 0Prediction:π‘¦ΰ·œ [ π‘¦ΰ·œ 0, π‘¦ΰ·œ 1, π‘¦ΰ·œ 2, π‘¦ΰ·œ 9 ]π‘¦ΰ·œ [ 𝟎. πŸ—, 0.02, 0.01, 0.02, 0.04]True value:y [ y0 , y 1 , y 2 , y 9 ]y [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]9ො 𝑦 𝑦𝑖 log(𝑦ෝ𝑖 )Loss function: 𝐿 𝑦,π‘¦ΰ·œ 9𝐿 𝑀1023,0 π‘Ž1023 𝑏0𝐿 𝑦,ො 𝑦 1 log 0.9 0.046𝑖 09L 0,ො 𝑦 1 log 1 0π‘Žπ‘‘ 𝑏𝑒𝑠𝑑 π‘šπ‘Žπ‘‘π‘β„Ž π‘¦ΰ·œ y, 𝐿 𝑦,1ොCost function: 𝐽(𝑀, 𝑏) π‘š Οƒπ‘š 𝐿 𝑦,π‘¦π‘‘π‘œπ‘‘π‘Žπ‘™ π‘™π‘œπ‘ π‘  π‘œπ‘“ π‘š π‘ π‘Žπ‘šπ‘π‘™π‘’π‘ πΊπ‘œπ‘Žπ‘™: π‘šπ‘–π‘›π‘–π‘šπ‘–π‘§π‘’ π‘‘β„Žπ‘’ π‘π‘œπ‘ π‘‘ π‘“π‘’π‘›π‘π‘‘π‘–π‘œπ‘›.A Friendly Introduction to Cross-Entropy Loss9

𝐴[𝐿 2][𝐿 2]π‘Ž0[𝐿 2]π‘Ž1[𝐿 2]π‘Ž2π‘Š [𝐿 1]𝑏 [𝐿 1]𝐴[𝐿 1][𝐿 1]π‘Ž0[𝐿 1]π‘Ž1[𝐿 2]π‘Ž21. With the initial parameters W and b, predict the label π‘¦ΰ·œ withforward propagation, calculate the cost.π‘Š [𝐿] 𝑏 [𝐿]π‘¦ΰ·œ 0π‘¦ΰ·œ 101π‘¦ΰ·œ 2L-2 layer[𝐿 1]π‘Ž1023L-1 layer2 . . . . π‘¦ΰ·œ 9L layer[𝐿 2]π‘Ž1023πΊπ‘œπ‘Žπ‘™: π‘šπ‘–π‘›π‘–π‘šπ‘–π‘§π‘’ π‘‘β„Žπ‘’ π‘‘π‘–π‘“π‘“π‘’π‘Ÿπ‘’π‘›π‘π‘’ 𝑏𝑒𝑑𝑀𝑒𝑒𝑛 π‘π‘Ÿπ‘œπ‘—π‘’π‘π‘‘π‘’π‘‘ π‘¦ΰ·œ π‘Žπ‘›π‘‘ π‘‘π‘Ÿπ‘’π‘’ 𝑦.Forward PropagationBackpropagation2. π‘‚π‘π‘‘π‘–π‘šπ‘–π‘§π‘’ π‘‘β„Žπ‘’ π‘π‘Žπ‘Ÿπ‘Žπ‘šπ‘’π‘‘π‘’π‘Ÿπ‘  π‘œπ‘“ 𝐿 π‘™π‘Žπ‘¦π‘’π‘Ÿ, π‘Š [𝐿] & 𝑏 [𝐿] ,assuming inputs from L-1 layer, 𝐴[𝐿 1] do not change.3. πΆπ‘Žπ‘™π‘π‘’π‘™π‘Žπ‘‘π‘’ π‘‘β„Žπ‘’ π‘β„Žπ‘Žπ‘›π‘”π‘’ π‘œπ‘“ 𝐿– 1 π‘™π‘Žπ‘¦π‘’π‘Ÿ 𝑖𝑛𝑝𝑒𝑑 , 𝐴[𝐿 1] ,which is needed to minimize the cost funtion,assuming parameters π‘Š [𝐿] & 𝑏 [𝐿] do not change.4. π‘‚π‘π‘‘π‘–π‘šπ‘–π‘§π‘’ π‘‘β„Žπ‘’ π‘π‘Žπ‘Ÿπ‘Žπ‘šπ‘’π‘‘π‘’π‘Ÿπ‘  π‘œπ‘“ 𝐿– 1 π‘™π‘Žπ‘¦π‘’π‘Ÿ, π‘Š [𝐿 1] & 𝑏 [𝐿 1] ,π‘“π‘Ÿπ‘œπ‘š π‘‘β„Žπ‘’ π‘‘π‘’π‘ π‘–π‘Ÿπ‘’π‘‘ π‘β„Žπ‘Žπ‘›π‘”π‘’π‘  of 𝐴[𝐿 1] .95. Proceed like this all the way to the first layer,optimize the parameters W and b of all layers.6. Running forward propagation and backpropagation once is calledone epoch, run multiple epochs until cost is near minimum value.10

A proportion of nodes in thelayer are randomly ignored foreach training sample.This technique can force the network to learn features in a distributed way and reduces the overfitting.Dropout applied after the two pool layers and first two full connected layers.11

After 1 hour, 30 epochs’ training,achieved 99.67% accuracy.Some images are even hard for human torecognize, more samples like these can help.12

Convolution Matrix, 16 filtersGenerated from trainingInputOutput13

More abstract14

lightLogicalsignalssignalsThe machine will combined the 1024 final values to judge the label [0,9].15

Can we understand machine’s β€˜mind’?16

Convolutional Neural Network is very powerful for analyzing visual image. The convolutional layers can capture the local features. The pooling layers can concentrate the local changes, as well as reduce the noise and data size. The full connected layers can combine all the local features to generate global features . The global features are combined to make the final judgement, here the probability of label [0,9]. Can human understand Artificial Neural Networks? Is there any similarity between brain and CNN to process the visual information? What is the meaning of local and global features generated by machines? Can human understand machines’ logic?Python code of the project at kaggle: ith-cnn-keras17

Convolutional Neural Network is very powerful for analyzing visual image. The convolutional layers can capture the local features. The pooling layers can concentrate the local changes, as well as reduce the noise and data size. The full connected layers can combine all the local features to generate global features .

Related Documents:

Add 3-digit and 1-digit numbers - crossing 10 Add two 4-digit numbers – no exchange 6 12/10/20 Mon Add and subtract 3-digit and 2-digit numbers - not crossing 100 Add 3-digit and 2-digit- cross 100 Tue Add 3-digit and 2-digit - cross 100 Add two 3-digits cross 10 or 100 Wed Add 2-digit and 3-digit numbers - crossing 10 or

Two 1-digit numbers: 0 to 9 2-digit number from a 2-digit number: no regrouping 2-digit number from a 2-digit number: regrouping Multiplication Multiplication facts: 0 to 9 2-digit number times 1-digit number: no regrouping 3-digit number times 1-digit number: regrouping Division Division facts: 0 to 9 2-digit

Learning a Deep Convolutional Network for Image Super-Resolution . a deep convolutional neural network (CNN) [15] that takes the low- . Convolutional Neural Networks. Convolutional neural networks (CNN) date back decades [15] and have recently shown an explosive popularity par-

2 Convolutional neural networks CNNs are hierarchical neural networks whose convolutional layers alternate with subsampling layers, reminiscent of sim-ple and complex cells in the primary visual cortex [Wiesel and Hubel, 1959]. CNNs vary in how convolutional and sub-sampling layers are realized and how the nets are trained. 2.1 Image processing .

Digit 1 M Trane mini split unit Digit 2 W Heat pump C Cooling only Digit 3 W Wall-mounted unit Digit 4 5 Threaded connection Digit 5, 6 Nominal cooling capacity 09 12 18 Digit 7 Design serial no. M Free split inverter indoor unit system (with electronic expansion valve) Digit 8 Power supply type M 220 240V/50Hz/1PH Digit 9 .

Video Super-Resolution With Convolutional Neural Networks Armin Kappeler, Seunghwan Yoo, Qiqin Dai, and Aggelos K. Katsaggelos, Fellow, IEEE Abstractβ€”Convolutional neural networks (CNN) are a special type of deep neural networks (DNN). They have so far been suc-cessfully applied to image super-resolution (SR) as well as other image .

Performance comparison of adaptive shrinkage convolution neural network and conven-tional convolutional network. Model AUC ACC F1-Score 3-layer convolutional neural network 97.26% 92.57% 94.76% 6-layer convolutional neural network 98.74% 95.15% 95.61% 3-layer adaptive shrinkage convolution neural network 99.23% 95.28% 96.29% 4.5.2.

Albert Woodfox and Herman Wallace were convicted of the murder in 1972 of prison guard Brent Miller. They were placed in isolation together with a third man, Robert King, who was accused of a different crime. Robert King was released in 2001 after serving 29 years in solitary. Herman Wallace and Albert Woodfox remain in solitary confinement in .