---
# System prepended metadata

title: Untitled

---

**Group 22**

BT20CSE087 - NAMAN JAIN
BT20CSE088 - NARREDDY BALAIAHGARI SAI NIKHILESWARAREDDY
BT20CSE089 - NAVIN CHOUDHARY
BT20CSE090 - PADWAL SHIVAM DIWAL



**Horizontal and Vertical Text Detection and Recognition In Natural Scene Images** 

We have Used [IAM Dataset](https://fki.tic.heia-fr.ch/databases/iam-handwriting-database), which has variable length ground-truth targets. Each sample in the dataset is an image of some handwritten text, and its corresponding target is the string present in the image.

Our Model takes a natural scene image (which contains text on it) as input and output the text present in this image .




**Recurrent Neural Network(RNN) – Long Short Term Memory(LSTM)**

The Recurrent Neural Network works on the principle of saving the output of a layer and feeding this back to the input to help in predicting the outcome of the layer.
Here, the first layer is formed similar to the feed forward neural network with the product of the sum of the weights and the features. The recurrent neural network process starts once this is computed, this means that from one time step to the next each neuron will remember some information it had in the previous time-step.




**Model Architecture:**

![](https://i.imgur.com/jrigNPJ.png)





**Parameters:**

| HyperParameter | Value |
| -------------- | ----- |
| Epochs               |   10 (50 for better accuracy)   |
| Loss Function          |    Connectionist temporal classification(CTC) Loss   |
| Layer          |    Dense tensorflow layer  |
| Activation function between input and hidden layer          |    Relu   |
| Activation function between hidden and output layer          |    Softmax   |
| Optimizer              |   Adam Optimizer    |
| Learning-rate  |      0.001 |
| Total words of dataset  | 96456 |
| Total words for training network  | 86810 |
| Total words for validating network  | 4823 |
| Total words for testing network  | 4823 |




**Training:**

First we take a natural scene image as input before passing this to our model it will be processed using tensorflow during this the unwanted part(the part of image which doesnt contain text) will be sliced out we have achived this using contiurs feature in opencv now the sliced image(which contains text)will be given as input to N.N model (which contains RNN layers) and gives an output as text this text will be checked with the target and loss is computed using ctc loss function and this loss will be back propagated through our model in this way model is trained

**Steps in training**

Step 1: Importing the libraries
Step 2: Importing the data
Step 3: Splitting the data
Step 4: Constructing the input
Step 5: Building a model
Step 6: Building a better model
Step 7: Evaluating the model

**Results:**

![](https://i.imgur.com/0NUsmrS.png)

