so some context, I'm trying to develop an OCR (for fun) and for that reason I decided to first find text within a page, parse it in to letters within the text and from there try and classify the letters that were extracted one by one.
For the classification I'm trying to build a CNN based upon the following database: http://www.ee.surrey.ac.uk/CVSSP/demos/chars74k/
and the following CNN architecture:
# CNN architecture input = Input(shape=(32, 32, 1)) conv1 = Conv2D(32, (3, 3))(input) pool1 = MaxPooling2D(pool_size=(2, 2))(conv1) drop1 = Dropout(0.5)(pool1) conv2 = Conv2D(64, (3, 3))(drop1) pool2 = MaxPooling2D(pool_size=(2, 2))(conv2) drop2 = Dropout(0.5)(pool2) flatten = Flatten()(drop2) fully_connected = Dense(512, activation='relu')(flatten) output = Dense(62)(fully_connected) model = Model(inputs=input, outputs=output) model.compile(loss='sparse_categorical_crossentropy',optimizer='Adam', metrics=['accuracy']) print(model.summary()) model.fit(X, y, epochs=10 , validation_split=0.3)
However, all I seen to get no matter what I try (epochs, batch size, validation split) etc is 0 accuracy.... So assuming my database and labels are fine... what could be going wrong?