Realization of Vehicle License Plate Recognition System (4)--Character Recognition + Code Realization

Character recognition

One, the realization of the character recognition algorithm

License plate character recognition is the last step in license plate recognition, and it is also a key step to determine the success or failure of license plate recognition. Character recognition is the process of recognizing each license plate character obtained after license plate positioning, license plate correction and license plate character division. Character recognition uses BP feedback neural network to recognize characters. The BP feedback neural network is a neural network based on error back propagation. It is different from the traditional neural network. The traditional neural network uses numerical differentiation to calculate the gradient to minimize the loss function. Although the principle is simple and easy Realization, but the calculation is more time-consuming, and the BP neural network uses the method of error back propagation, which is more efficient than the numerical differentiation method. Therefore, this paper adopts a BP feedback neural network which is more efficient than the numerical differentiation method to recognize each license plate character.

1.1 Introduction to Neural Network Components

1.1.1 Activation function

The commonly used activation functions are ReLU and Softmax functions. This article uses ReLU function as the activation function of the hidden layer. There are two main advantages of using ReLU function as the activation function. The first is that the ReLU function is simple to calculate, which can improve the calculation speed of the model; The second is to calculate the partial derivative when backpropagating. If the passed value is large, the gradient of the Sigmoid function will become very small, making the model convergence very slow, and the use of the ReLU function can effectively solve the slow model convergence The problem. Use the Softmax function as the activation function of the output layer. The mathematical expression of the ReLU activation function is shown in formula (4-1), and the image is shown in Figure 4-1.

Insert picture description here
Insert picture description here

1.1.2 Loss function

The performance evaluation standard used in the learning of neural networks is called the loss function. This article uses the cross-entropy error loss function as an indicator to measure the performance of the neural network. The calculation formula of cross entropy error is as formula (4-2).
Insert picture description here
Insert picture description here

1.1.3 Neural network gradient

Insert picture description here

1.2 Neural network principle and training algorithm flow

Insert picture description here

1.2.1 Description of related symbols

Insert picture description here
Insert picture description here

1.2.2 Forward propagation process

Insert picture description here
Insert picture description here
Insert picture description here

1.2.3 Backpropagation process

Insert picture description here
Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here

1.2.4 Training algorithm flow

Insert picture description here
The training steps of the neural network are as follows:

  • 1. Initialize the weight parameters, bias parameters, and learning step length of the neural network.
  • 2. Read the training data, randomly select training samples and corresponding training tags.
  • 3. Calculate the output of the hidden layer and the output layer
  • 4. Calculate the value of the loss function and determine whether the maximum number of iterations has been reached
  • 5. Calculate the partial derivative of the loss function with respect to the weight parameter and the bias parameter
  • 6. Update weight parameters and bias parameters

Second, the realization of the license plate recognition algorithm

2.1 Description of development tools and data sets

Insert picture description here

2.2 Realization of character recognition network

Before the license plate recognition algorithm is carried out, a specific character recognition network needs to be trained first, which is the premise of the license plate recognition algorithm. In this paper, two recognition networks are trained to recognize Chinese characters, letters and numbers respectively. In deep learning, the data is generally divided into training data and test data for neural network learning and testing. The purpose of dividing into supervised data and test data is to be able to correctly evaluate the generalization ability of the neural network model. Generalization ability refers to the processing of unobserved data, that is, data that is not included in the scope of supervised data. According to the characteristics of the license plate, the license plate contains 7 characters. The first character is the abbreviation of each provincial administrative region, totaling 34; the second character is the city code, composed of AZ, in order not to be confused with 1 and 0, among them Excluding the letters I and O, a total of 24; the 3-7th characters are composed of numbers and letters, a total of 10 numbers and 24 English capital letters, a total of 34. As shown in Figure 5-2, the entire recognition network is divided into two recognition networks. The Chinese character recognition network is used to recognize the abbreviations of each provincial administrative region, and the alphanumeric recognition network is used to recognize the remaining capital English letters and Arabic numerals on the license plate.

2.2.1 Chinese character recognition network

Insert picture description here

2.2.2 Alphanumeric recognition network

Insert picture description here
It can be seen that the value of the loss function gradually decreases, and the training result of the recognition network is also very satisfactory. This is the performance of the BP neural network that is learning correctly from a large amount of data.

2.3 Identification algorithm process and experimental results

2.3.1 Identification algorithm flow and experimental results

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

2.3.2 Experimental analysis

Insert picture description here

Three, insufficient

Insert picture description here
The realization of the car license plate recognition system is my undergraduate thesis of my university. At that time, I did not touch the knowledge of neural network, so I used the BP neural network to recognize the picture. Of course, the result was very unsatisfactory. Please criticize and correct any errors in time. CNN is more suitable for image recognition, and the research direction during graduate school is deep learning, so in the next three years, I will continue to update the relevant knowledge of deep learning. Although the final experimental result is not ideal, it should be enough for the graduation thesis! The graduates who are about to graduate here go smoothly! !

Four, code implementation

Code implementation I directly upload the project I did at that time, you can refer to it if you need it. No points are required for downloading. One concern is my biggest motivation to update in time!

Guess you like

Origin blog.csdn.net/dongjinkun/article/details/109478729