【Pattern Recognition & Target Detection】——Pattern Recognition Technology & License Plate Detection Application

Table of contents

introduce

1. The main method of pattern recognition

1. Statistical pattern recognition

2. Recognition based on Hidden Markov Model

3. Fuzzy pattern recognition

4. Artificial neural network pattern recognition

Summarize

2. Application of Pattern Recognition

1. License plate positioning

2. License plate recognition

references:


introduce

When people observe things or phenomena, they often look for the differences between them and other things or phenomena, and group similar things or phenomena with different details according to a certain purpose such as character recognition, although the numbers written by each person The "8"s are all different, but all of the same class.

Pattern recognition is an important direction of AI, the purpose is to simulate human perception, also known as "machine perception", "intelligent perception" . It was developed in the 1940s with the emergence of electronic computers and merged with deep learning in the 21st century. In recent years, deep learning and big data have greatly promoted its development! Including voice and language recognition, text recognition, fingerprint recognition, sonar and seismic signal analysis, image analysis, chemical pattern recognition, etc.


1. The main method of pattern recognition

Abstracting the mining of data relationships into a classification problem is a pattern recognition problem . Pattern recognition is a process of automatic recognition of shapes, patterns, curves, numbers, character formats, graphics, etc., starting from a large amount of information and data, based on expert experience and existing cognition, using computer and mathematical reasoning methods !

1. Statistical pattern recognition

This is a relatively common and complete identification method, the main steps are as follows:

1. 数据预处理:收集和准备用于训练和测试的数据集,剔除噪声和冗余。
2. 特征提取:从原始数据中提取有代表性的特征向量,映射到特征空间。
3. 特征选择:根据算法需求或者降低维度的目标,选择最重要的特征。
4. 模型训练:使用统计方法(如贝叶斯分类器、支持向量机等)对提取的特征进行训练。
5. 模型评估:通过测试数据集评估模型的准确性和性能。
6. 模型优化:根据评估结果对模型进行调优,例如调整参数或改善特征提取过程。
The difficulty and key point is how to use a suitable classifier algorithm, which is commonly used now in the case of a normal distribution, ignoring the bias
A method for estimating distant values.

2. Recognition based on Hidden Markov Model

A Hidden Markov Model (HMM) is a statistical model used to describe a Markov process with hidden unknown parameters. It usually consists of two parts: ① an implicit Markov chain with a certain state that cannot be observed by naked eyes; ② a discrete general random process directly described by statistical analysis methods—generally the probability density function under normal distribution and Poisson distribution distributed. After a certain amount of statistical learning is used to determine an approximate state value, an approximate hidden Markov model is generated, and relevant data can be obtained for discrimination and classification only by extracting features and substituting them.

1. 定义状态集合:确定系统的状态集合,每个状态表示一个观测值的类别。
2. 定义观测集合:确定系统可能产生的观测值集合。
3. 确定初始概率分布:指定模型在开始时处于每个状态的概率。
4. 确定转移概率矩阵:指定模型在不同状态之间转移的概率。
5. 确定观测概率矩阵:指定模型在每个状态下观测到每个观测值的概率。
6. 解码算法:使用算法(如维特比算法)根据观测序列推断隐藏状态序列。

3. Fuzzy pattern recognition

Fuzzy pattern recognition is derived from fuzzy mathematics, and fuzzy set theory is established on this basis. A fuzzy set is a collection of concepts with fuzziness. After the extracted data is fuzzified, a suitable membership function and fuzzy rule set are established, and finally the result is solved.

1. 模糊化:将输入的模糊数据转化为隶属度函数,描述其在各个类别上的归属程度。
2. 规则定义:根据领域知识或经验,定义一组模糊规则,用于将模糊数据映射到具体的类别。
3. 推理机制:基于模糊规则,使用推理机制对输入进行推理,以确定输出的类别。
4. 去模糊化:将推理结果从模糊集合转化为具体的类别或数值。

This method greatly increases the success rate of discrimination, and the data will not be unrecognizable due to some special parameters. The disadvantage is that the range of fuzzy sets is determined by people's subjective experience, and different people have different conceptual models, so it needs to be combined with other identification methods. This theory is not sufficient at present.

4. Artificial neural network pattern recognition

The most popular pattern recognition method, which has outstanding performance in terms of accuracy and applicability. BP neural network is a multilayer feed-forward neural network trained according to the error backpropagation algorithm, and it is one of the most widely used neural network models. It belongs to supervised learning.

1. 确定网络结构:选择适当的神经网络类型(如前馈神经网络、卷积神经网络等)和层数,并确定每层的节点数和连接方式。
2. 数据预处理:收集和准备用于训练和测试的数据集,并进行标准化处理。
3. 初始化网络:初始化网络的权重和偏置参数。
4. 前向传播:将输入数据通过网络,逐层计算每个节点的输出值。
5. 反向传播:根据网络的输出结果和目标值,计算每个节点的误差,并通过梯度下降法更新网络参数。
6. 训练模型:重复进行前向传播和反向传播,调整网络参数,直到达到预定的停止条件。
7. 模型评估:使用测试数据集评估训练好的模型的性能和准确性。
Adding an appropriate amount of hidden layers to the BP neural network, the correct information will propagate forward along the "neurons", and the wrong information will be returned to the previous neuron.
"neurons", and correct the weights between the propagation nodes, and the discriminant function is dynamically updated, so that the recognition accuracy is very high. The disadvantage is
Building a suitable neural network requires a large amount of data and consumes a lot of resources.

Summarize

① Statistical pattern recognition is a method based on statistical theory and models, focusing on feature extraction and model training. It is suitable for various data types, but requires good feature engineering capabilities.
②The hidden Markov model-based recognition method focuses on describing the state changes behind the sequence data, which is suitable for modeling and recognition of time-series data. It can take into account temporal dependencies, but has relatively limited assumptions about initial states and transition probabilities.
③ Fuzzy pattern recognition can process input data with strong fuzziness through the process of fuzzification and defuzzification. It can deal with uncertainty and ambiguity, but the definition of rules needs the support of domain knowledge.
④Artificial neural network pattern recognition utilizes the powerful fitting ability of neural network to automatically learn feature representation and complex nonlinear relationships. It is suitable for various tasks, but requires a lot of data and computing resources for training.


Statistical pattern recognition and hidden Markov model-based recognition methods pay more attention to modeling and probabilistic inference , and are suitable for processing structured data and time series data . Fuzzy pattern recognition focuses on dealing with ambiguity and uncertainty , and requires domain knowledge for rule definition. Artificial neural network pattern recognition can flexibly adapt to different tasks and data types , and can achieve better performance through a large amount of training data, but requires high computing resources and time costs.


2. Application of Pattern Recognition

Medical analysis, face fingerprint recognition, speech recognition, transportation network, etc. all have its figure! The following is a flowchart of speech recognition:

 Taking license plate positioning and recognition as an example, the general process is as follows:

Positioning: ① first convert the license plate image to HSI color space; ② use traditional image processing methods to roughly locate the position of the license plate; ③ use the center of gravity method to perform tilt correction to finally determine the license plate area

Recognition: ① Then use different algorithms for character segmentation for Chinese and non-Chinese characters; ② Use the theory of pattern recognition to extract and select the features of the license plate area; ③ Classify and judge the license plate character recognition, and output the license plate number.

1. License plate positioning

The current license plate location mainly includes multi-feature location algorithms such as mathematical morphology, color segmentation, and image-based texture and shape features .

①Coarse positioning: Segment the area where the license plate is located in the image, including image binarization, image denoising, and analysis of connected sets to locate the license plate area.

First of all, the image needs to be converted from RGB to HSI space , and the corresponding threshold is set to obtain preliminary positioning; then the image is binarized, and noise and fine lines are removed by point scanning method - scanning pixels line by line, will not meet the set threshold Remove the white dot.

At this time, a connected set of parallelograms can be obtained, and this area can be cut out to obtain a roughly positioned license plate image.

② Tilt correction: The image may not be horizontal, which will affect the segmentation and recognition of license plate characters.

Firstly, analyze the coarse-positioned binary image and the coarse-positioned license plate image separately, and obtain the inclination K (obtained based on the idea of ​​the center of gravity ) :

a. Treat each white point pixel in a binary image as a mass point with a quality of 1, and use the center of gravity formula $x=\frac{\sum m_i x_i}{\sum m_i}y=\frac{\sum m_iy_i}{\sum m_i}$to obtain the center of gravity of the image.

b. After obtaining the overall center of gravity of the binary image, the image is divided into left and right parts with the pixels of the center of gravity as the boundary, and the centers of gravity of the left and right parts are respectively obtained in the same way .

c. Use a vector to connect the two centers of gravity , and then calculate the inclination angle of this vector relative to the horizontal direction, that is, the inclination angle K. Based on this, the color image is awakened and corrected.

2. License plate recognition

Character recognition mainly includes template matching, Gabor transform, SVM, recognition algorithm based on deep learning

① Character segmentation: Segment the characters in the license plate area one by one, so as to be sent to the character recognition module for recognition.

a. Preprocessing algorithm: Due to the influence of light and other effects, the blue license plate has obvious differences in name, purity, saturation, etc., and the depth is different. Therefore, before grayscale, it is necessary to specify histogram to make all The blue background of the license plate and the white characters are distributed in the same gray level.

After the regulation, set a reasonable threshold based on prior experience and experimental tests, set the pixels smaller than the threshold to black, and set the treatment threshold to white to achieve gray scale .

b. Main algorithm: English letters and Arabic numerals are single-connected-set character sets , which can be divided by the method of connected sets ; Chinese characters are composed of multiple connected sets, so this method cannot be used, and a set rectangle obtained by a large number of experiments can be used The method of interception by length and width .

1、对于字母和数字,只要得到每一个字符连通域起点像素和终止像素 , 
就得到了包含整个单连通域的最小矩形区域。依此方法逐个切割矩形区域图像,
实现非中文字符的切割。
具体算法是逐列逐行扫描像素,当扫描到连续 m(3) 列有像素灰度级为 1 时,
将扫描到的第一个像素所在的列当作字符连通域的第一列,继续逐列扫描,
当发现连续 n(3) 列所有像素灰度级为 0 时,将首先出现全为 0 灰度级的列
当作字符连通域的结束列。这样我们就能够将车牌的第 2 到 7 个的字符逐步切割
输出该部分图像,完成非汉字字符分割。
2、对于汉字字符的切割,几乎所有省份的简称都包含有多个连通集,所以连通集取
矩形轮廓的方法将不再适用。采用将第二个字符框平缩放移的方法:在大量实验结果发现,
在取已经分割出来的第二个字符(即第一个非汉字字符)图像的矩形扩大 1.2 倍,
再将此矩形往左平移 1/7 整个车牌矩形的宽度,此时矩形所在的车牌的区域就是中文字符所在区域,
我们将此区域图像截取输出,完成车牌中文字符的切割。

② Character recognition

The general process of pattern recognition: from measurement space to feature space, and then mapped to pattern space .

For character recognition: first obtain the image features of the character to be recognized, and determine the pattern category of the character image according to the corresponding criteria - feature acquisition, feature selection, classification and judgment.

a. Collect character images of known character categories, and count their features, including their position features in two-dimensional space , histogram features, shape features, and features converted to frequency domain through Fourier transform . These features are extracted and learned, and the templates obtained are stored.

b. Using the same method to obtain various characteristics of the character image to be recognized, matching and comparing with the stored template , and judging the character category according to the comparison result.

注:根据向量间的距离(欧氏距离)衡量字符和模板的匹配程度。
建立模板库的具体过程是将每一类图像的每一张图片平均分成8份,
逐点扫描每一份图片区域,以一维向量的形式记录并保存下这份图像的像素信息,
从而每一张字符图像都有相应的8维向量形成的模板。将待识别的车牌字符图片
采取相同的方法,然后确定每个字符图片的8维向量值。我们求出这个字符的
8维向量值和所有模板字符图片的8 维向量值的n维欧式空间距离,将其中距离最小的N个
(5 个)模板字符图片保存下来。

references:

[1] Lin Hanran. Pattern Recognition Technology and Its Application in Image Processing [J]. Modern Industrial Economics and Informationization, 2023,13(02):161-163.DOI:10.16525/j.cnki.14- 1362/n.2023.02.059.

[2] Li Xiaotong. Intelligent license plate recognition system based on pattern recognition [J]. China Strategic Emerging Industries, 2018 (04): 155-156. DOI: 10.19474/j.cnki.10-1156/f.003243.

Guess you like

Origin blog.csdn.net/weixin_51658186/article/details/131513951