igit-Recognition-CNN-and-ANN-using-Mnist-with-GUI

所属分类:人工智能/神经网络/深度学习
开发工具:Java
文件大小:0KB
下载次数:0
上传日期:2019-07-15 21:47:44
上 传 者sh-1993
说明:  测试集ACC 97.98%,训练集ACC 100.00%,2个conv层,使用相同的16个滤波器,使用RELU和最大池,单层10个神经元,使用...,
(test set ACC 97.98%, train set ACC 100.00%, 2 conv layer with the same 16 filters using RELU and max pooling, single layer 10 neurons using Softmax as output in fully connected layer)

文件列表:
dataset/ (0, 2019-07-15)
dataset/standardOutput/ (0, 2019-07-15)
dataset/standardOutput/trueOutput.txt (138, 2019-07-15)
images/ (0, 2019-07-15)
images/ANN3and5epochAccuracy.png (249848, 2019-07-15)
images/CNN1epochAccuracy.png (303485, 2019-07-15)
images/CNN98%99%.png (151878, 2019-07-15)
images/LR0.05Epoch1and5Difference.png (126300, 2019-07-15)
images/LessThan50DatasetsWeightsChanges.png (497792, 2019-07-15)
images/false8.png (122347, 2019-07-15)
images/overfit.png (270519, 2019-07-15)
images/randomFalse.png (90902, 2019-07-15)
imagesUpdated/ (0, 2019-07-15)
imagesUpdated/MnistCNN100Acc.gif (9950754, 2019-07-15)
imagesUpdated/MnistCNNDrawing.gif (1131233, 2019-07-15)
src/ (0, 2019-07-15)
src/gui/ (0, 2019-07-15)
src/gui/ConvolutionPanel.java (5599, 2019-07-15)
src/gui/DrawingPanel.java (3847, 2019-07-15)
src/gui/MainFrame.java (11149, 2019-07-15)
src/gui/ProbabilityPanel.java (1574, 2019-07-15)
src/neuralNetwork/ (0, 2019-07-15)
src/neuralNetwork/Convolution.java (4828, 2019-07-15)
src/neuralNetwork/DataSet.java (2555, 2019-07-15)
src/neuralNetwork/Network.java (1071, 2019-07-15)
src/neuralNetwork/Neuron.java (1196, 2019-07-15)
src/neuralNetwork/Trainer.java (2063, 2019-07-15)
src/tool/ (0, 2019-07-15)
src/tool/DataInfo.java (1733, 2019-07-15)
src/tool/ReadFile.java (1910, 2019-07-15)

# Digit-Recognition-CNN-and-ANN-using-Mnist-with-GUI Training and testing using MNIST dataset (60000train set,1000test set) with 0.5% error (some drawings are out of 28*28, some drawings only half of them are scanned, or wrong labeling and so on) There are some MNIST datasets in internet, you could download yourself or download from these links: CSV: https://pjreddie.com/projects/mnist-in-csv/ TXT:https://drive.google.com/drive/folders/10MfF2F5M40NxEFLSpaHWCMo4y8yEMivI After download, move them to "/dataset", change the invoking method in Datainfo.java constructor according to your dataset format, in my case, I use the txt one. ``` trainSets = ReadFile.readFromSingleCsv("mnist_train.csv"); trainSets = ReadFile.readFromSingleTxt("mnist_digits_train.txt"); trainSets = ReadFile.readFromSingle???("mnist_digits_train.???"); ``` This program is based on Single layer Neural Network with 10 neurons using Softmax as output in both ANN and CNN mode. # Drawing with CNN Model ![image](https://github.com/timmmGZ/Digit-Recognition-CNN-and-ANN-using-Mnist-with-GUI/blob/master/imagesUpdated/MnistCNNDrawing.gif) # ANN accuray Random try--training only 10+ seconds(3-5 epoches), test set 92.61%, train set 93.06% (without using back propagation and keep best weights) ![image](https://raw.githubusercontent.com/timmmGZ/Digit-Recognition-CNN-and-ANN-using-Mnist-with-GUI/master/images/ANN3and5epochAccuracy.png) # CNN accuray-- train 7 mins to 100% Training with 16 random designed filters without using back propagation and keep best weights, around 35 epoches is enough to reach 99% acc for train set, but it need more time to reach 100%, I randomly try like below gif, it takes 285 epoches to reach 100% acc, and too ![image](https://github.com/timmmGZ/Digit-Recognition-CNN-and-ANN-using-Mnist-with-GUI/blob/master/imagesUpdated/MnistCNN100Acc.gif) # The changing of weights Following picture describe how weights change when it has only 2,5,10,20,30.....50 data sets respectively to be trained Blue=positive, White=0, Red=negative, you could realize how weights work especially obviously in the 4th row and 2nd column example when the dataset only includes number "1" and "4", you could also see the difference between ANN and CNNs' weights in the last row's example ![image](https://raw.githubusercontent.com/timmmGZ/Digit-Recognition-CNN-and-ANN-using-Mnist-with-GUI/master/images/LessThan50DatasetsWeightsChanges.png) Here is how weights change between 1st and 5th epoches for ANN ![image](https://raw.githubusercontent.com/timmmGZ/Digit-Recognition-CNN-and-ANN-using-Mnist-with-GUI/master/images/LR0.05Epoch1and5Difference.png) # False prediction (Overfitting) I made a function to show random false predictions of a selected number, try to use it after you try the model, and you will find out why the accuracy of a good model base on MNIST dataset should not be more than 99.5% as I mentioned in beginning, unless you accept wrong labeling the numbers(some are even not looking like numbers), as you notice neuron for number "8" has a large loss all the time, so I will show you some of the false prediction about "8", also check how it influence "9"'s prediction by overfitting ![image](https://raw.githubusercontent.com/timmmGZ/Digit-Recognition-CNN-and-ANN-using-Mnist-with-GUI/master/images/false8.png) Lets show a bit random numbers' false examples of train set(60000 data sets) ![image](https://raw.githubusercontent.com/timmmGZ/Digit-Recognition-CNN-and-ANN-using-Mnist-with-GUI/master/images/randomFalse.png)

近期下载者

相关文件


收藏者