I am trying adapt ANPR sample from https://matthewearl.github.io/2016/05/06/cnn-anpr/ to Keras. It is multi class classification problem. As I can understand I should use loss='sparse_categorical_crossentropy' for model and class_mode=’sparse’ for ImageDataGenerator. Unfortunately I can’t find documentations and samples about these Keras features. E.g. Keras says: "sparse" will be 1D integer labels. And it is all about class_mode=’sparse’ what I can find. Is integer label encoded with bit mask? Can I use bit mask with length above 32 or 64 bits? Can somebody clarify these features (loss='sparse_categorical_crossentropy' for model and class_mode=’sparse’ for generator)? Or may be I am wrong, and should I use something else for this task?

size of my data set : 512*16, last column is 21 classes, they are digits 1-21 (so maybe OneHotEncoding is not needed) note: number of samples (rows in my data) for each class is different. mostly 20 rows, but sometimes 17 or 31 rows my network has: first layer (input) has 15 neurons second layer (hidden) has 30 neurons last layer (output) has 21 neurons in last layer I used "softmax" based on this recommendatins fromhttps://github.com/fchollet/keras/issues/1013 "The softmax function transforms your hidden units into probability scores of the class labels you have; and thus is more suited to classification problems " I got error message when execute it in Keras in Anaconda in Ubuntu 16.04: alueError: Error when checking model target: expected dense_8 to have shape (None, 21) but got array with shape (512, 1)------------- keras code ----------from keras.models import Sequentialfrom keras.layers import Denseimport numpy

Fit the model

evaluate the model

I have following questions:1. can I use CNN, RNN for this multi class classification problem (I know DBN is YES. One thing about DBN, quite hard to find code example in anywhere, somebody claims DBN is old method back to 2006,then what is good method for multi class classification excep "ctegorical_crossentropy")? I ever used MLP,SVM, KNN,Random Forest for my above database, they are good (MLP , not DL algo).now I want to use Deep learning methods, I think if I use deep learning, accuracy would not easily drop even data table become big (population increases)

I suppose your dataset is to small for effective using with CNN, RNN. Also it is not clear nature of parameters. CNN, RNN can be effectively used when parameters have structure (e.g. time series, geometric distribution like pixels in image)