0
votes

I'm quite new to neural network and I recently built neural network for number classification in vehicle license plate. It has 3 layers: 1 input layer for 16*24(382 neurons) number image with 150 dpi , 1 hidden layer(199 neurons) with sigmoid activation function, 1 softmax output layer(10 neurons) for each number 0 to 9.

I'm trying to expand my neural network to also classify letters in license plate. But I'm worried if I just simply add more classes into output, for example add 10 letters into classification so total 20 classes, it would be hard for neural network to separate feature from each class. And also, I think it might cause problem when input is one of number and neural network wrongly classifies as one of letter with biggest probability, even though sum of probabilities of all number output exceeds that.

So I wonder if it is possible to build hierarchical neural network in following manner:

There are 3 neural networks: 'Item', 'Number', 'Letter'

  1. 'Item' neural network classifies whether input is numbers or letters.

  2. If 'Item' neural network classifies input as numbers(letters), then input goes through 'Number'('Letter') neural network.

  3. Return final output from Number(Letter) neural network.

And learning mechanism for each network is below:

  1. 'Item' neural network learns all images of numbers and letters. So there are 2 output.
  2. 'Number'('Letter') neural network learns images of only numbers(letter).

Which method should I pick to have better classification? Just simply add 10 more classes or build hierarchical neural networks with method above?

2
+1 some typos but back to zero (this doesnt deserve -1), As its a very reasonable question to ask when working width neural nets, some people here might turn down any question without code, or proof of research, asking for advice is also complicated. But for NN its reasonable to do. But thinking of how it work is research as well - Peter

2 Answers

2
votes

I'd strongly recommend training only a single neural network with outputs for all the kinds of images you want to be able to detect (so one output node per letter you want to be able to recognize, and one output node for every digit you want to be able to recognize).

The main reason for this is because recognizing digits and recognizing letters is really kind of exactly the same task. Intuitively, you can understand a trained neural network with multiple layers as performing the recognition in multiple steps. In the hidden layer it may learn to detect various kinds of simple, primitive shapes (e.g. the hidden layer may learn to detect vertical lines, horizontal lines, diagonal lines, certain kinds of simple curved shapes, etc.). Then, in the weights between hidden and output layers, it may learn how to recognize combinations of multiple of these primitive shapes as a specific output class (e.g. a vertical and a horizontal line in roughly the correct locations may be recoginzed as a capital letter L).

Those "things" it learns in the hidden layer will be perfectly relevant for digits as well as letters (that vertical line which may indicate an L may also indicate a 1 when combined with other shapes). So, there are useful things to learn that are relevant for both ''tasks'', and it will probably be able to learn these things more easily if it can learn them all in the same network.

See also a this answer I gave to a related question in the past.

0
votes

I'm trying to expand my neural network to also classify letters in license plate. But i'm worried if i just simply add more classes into output, for example add 10 letters into classification so total 20 classes, it would be hard for neural network to separate feature from each class.

You're far from where it becomes problematic. ImageNet has 1000 classes and is commonly done in a single network. See the AlexNet paper. If you want to learn more about CNNs, have a look at chapter 2 of "Analysis and Optimization of Convolutional Neural Network Architectures". And when you're on it, see chapter 4 for hirarchical classification. You can read the summary for ... well, a summary of it.