Medicine character label identification method based on improved multilayer perceptron

文档序号:1738164 发布日期:2019-12-20 浏览:6次 中文

阅读说明:本技术 一种基于改进多层感知机的药品字符标签的识别方法 (Medicine character label identification method based on improved multilayer perceptron ) 是由 吴健 于 2019-08-01 设计创作,主要内容包括:本发明涉及机器视觉学习领域,更具体地,涉及一种基于改进多层感知机的药品字符标签的识别方法。包括以下步骤:选取药瓶的字符标签,选取出字符标签中需要识别的区域;将待识别的区域以相片的形式进行预处理,定位目标区域;对目标区域进行划分,将目标区域中字符进行切割,将切割后的字符作为标签字符的数据集;构建多层感知机;将数据集输入到多层感知机中,得到最终的识别结果。本发明改进过的的多层感知机相比于传统的能防止陷入局部极小,寻得最优解。通过对多层感知机引入droupout以解决过拟合问题,引入使用动量的随机梯度下降以防止陷入局部极小的问题,引入ReLU解决梯度弥散的问题;相比于模板匹配法,有着较高的识别率和泛化能力。(The invention relates to the field of machine vision learning, in particular to a medicine character label identification method based on an improved multilayer perceptron. The method comprises the following steps: selecting a character label of the medicine bottle, and selecting an area needing to be identified in the character label; preprocessing an area to be identified in a photo form, and positioning a target area; dividing a target area, cutting characters in the target area, and taking the cut characters as a data set of label characters; constructing a multilayer perceptron; and inputting the data set into a multi-layer perceptron to obtain a final recognition result. Compared with the traditional method, the improved multilayer perceptron can prevent from being trapped into local minimum and find the optimal solution. The problem of overfitting is solved by introducing droupout to the multilayer perceptron, the problem of using random gradient decline of momentum to prevent local minimum is introduced, and the problem of gradient dispersion is solved by introducing ReLU; compared with a template matching method, the method has higher recognition rate and generalization capability.)

1. A medicine character label recognition method based on an improved multilayer perceptron is characterized by comprising the following steps:

step S1: selecting a character label of the medicine bottle, and selecting an area needing to be identified in the character label;

step S2: preprocessing an area to be identified in a photo form, and positioning a target area;

step S3: dividing a target area, cutting characters in the target area, and taking the cut characters as a data set of label characters;

step S4: constructing a multilayer perceptron, using the traditional multilayer perceptron as a basis, introducing droupout to the traditional multilayer perceptron to solve the overfitting problem, introducing random gradient descent using momentum to prevent the local minimum problem, and introducing ReLU to solve the gradient dispersion problem;

step S5: the data set in step S3 is input into a multi-layer perceptron for training and testing.

2. The method for recognizing the character label of the medicine based on the improved multilayer perceptron as claimed in claim 1, wherein the image preprocessing process in step S2 includes flipping, denoising, graying and binarization processing of the image.

3. The method for recognizing the character label of the medicine based on the improved multi-layer sensor as claimed in claim 1, wherein each character cut out in the step S3 is normalized, kept in the same size and format, and given the corresponding label.

4. The method for recognizing the character label of the medicine based on the improved multi-layer sensor as claimed in claim 1, wherein the probability of each node disappearing is the following structure introduced in step S4:

wherein, a is the current iteration frequency, and a is the current disappearance frequency of the node.

5. The method for recognizing the character label of the medicine based on the improved multi-layer perceptron as claimed in claim 1, wherein the ReLU introduced in step S4 solves the problem of diffusion, i.e. the activation function of the replacement perceptron is a non-linear function y ═ max (0, x).

6. The method for recognizing the character label of the medicine based on the improved multi-layer sensor as claimed in claim 1, wherein the step S4 introduces a random gradient drop of momentum, which is expressed as follows:

and (3) updating the calculation speed: v: ═ α v ∈ g

Calculating application updates: theta: ═ theta + v

The learning rate belongs to the field of learning, and the learning rate belongs to the field of learning.

7. The method as claimed in claim 6, wherein in step S5, the data set obtained in step S3 is divided into a training set, a verification set and a test set, the data in the training set is input into the multi-layered sensor for training, the training set updates parameters of the multi-layered sensor by back propagation, the verification set is input during training for fine adjustment of hyper-parameters of the multi-layered sensor, after the multi-layered sensor is trained, the test set is used to test the performance of the multi-layered sensor, and finally the multi-layered sensor with the best performance is selected for testing the drug label to verify the generalization ability of the drug label.

8. The method for recognizing the character label of the medicine based on the improved multilayer perceptron as claimed in claim 7, wherein the data set is represented by a ratio of 5: 1: 1 into a training set, a validation set and a test set.

Technical Field

The invention relates to the field of machine vision learning, in particular to a medicine character label identification method based on an improved multilayer perceptron.

Background

Machine vision, an emerging discipline, has been developed at a rapid rate for nearly 20 years, and the development stage of machine vision has been brought to practical application by experimental research, and is widely used industrially.

The medicine plays a role in lifting the weight in our daily life, is closely related to our life, and is related to the health of people and even the life health and safety. The national regulation indicates three contents of product batch number, production date and validity period on the medicine, and the three contents are one aspect of the safety of the medicine use and are generally identified by a group of Arabic numerals or a form of numerals plus letters plus Chinese characters. The national drug administration has increasingly strict requirements for the detection of pharmaceutical factories and drugs. Among them, visual inspection and analysis of drugs and drug packages are one of the important means for drug testing. The visual inspection is one of machine vision, and is used for identifying characters of the medicine label, so that the production efficiency can be improved, and the defective rate can be reduced. The existing medicine label identification is carried out by using a traditional template matching method, the limitation is very obvious, the identification accuracy is not high, the generalization capability is poor, and the traditional template matching method is the bottleneck of character label identification.

Disclosure of Invention

In order to solve the defects of low accuracy and poor generalization capability of machine vision on medicine label identification in the prior art, the invention provides a medicine character label identification method based on an improved multilayer perceptron.

A medicine character label recognition method based on an improved multilayer perceptron comprises the following steps:

step S1: selecting a character label of the medicine bottle, and selecting an area needing to be identified in the character label;

step S2: preprocessing an area to be identified in a photo form, and positioning a target area;

step S3: dividing a target area, cutting characters in the target area, and taking the cut characters as a data set of label characters;

step S4: constructing a multilayer perceptron, using the traditional multilayer perceptron as a basis, introducing droupout to the traditional multilayer perceptron to solve the overfitting problem, introducing random gradient descent using momentum to prevent the local minimum problem, and introducing ReLU to solve the gradient dispersion problem;

step S5: the data set in step S3 is input into a multi-layer perceptron for training and testing.

Preferably, the image preprocessing in step S2 includes flipping, denoising, graying, and binarizing the image.

Preferably, each character cut in step S3 needs to be normalized, kept in the same size and format, and given a corresponding label.

Preferably, the label character recognition method based on improved perceptron as claimed in claim 1, wherein in said step S4, introduced drosopout structure, probability of each node disappearing:

wherein, a is the current iteration frequency, and a is the current disappearance frequency of the node.

Preferably, the ReLU introduced in step S4 solves the problem of dispersion, i.e. the activation function of the replacement perceptron is a non-linear function y ═ max (0, x).

Preferably, the introduction introduced in step S4 uses a random gradient descent of momentum, which is formulated as follows:

and (3) updating the calculation speed: v: ═ α v ∈ g

Calculating application updates: theta: ═ theta + v

The learning rate belongs to the field of learning, and the learning rate belongs to the field of learning.

Preferably, in step S5, the data set obtained in step S3 is divided into a training set, a verification set, and a test set, data in the training set is input into the multi-layer sensor for training, the training set updates parameters of the multi-layer sensor by using back propagation, the verification set is input during training for fine adjustment of hyper-parameters of the multi-layer sensor, after training of the multi-layer sensor is completed, the test set is used to test the performance of the multi-layer sensor, and finally the multi-layer sensor with the best performance is selected to test the drug label and verify the generalization ability of the drug label.

Preferably, the data set is represented in a ratio of 5: 1: 1 into a training set, a validation set and a test set.

Compared with the prior art, the technical scheme of the invention has the beneficial effects that:

compared with the traditional method, the improved multilayer perceptron can prevent from being trapped into local minimum and find the optimal solution. The problem of overfitting is solved by introducing droupout to the multilayer perceptron, the problem of using random gradient decline of momentum to prevent local minimum is introduced, and the problem of gradient dispersion is solved by introducing ReLU; compared with a template matching method, the method has higher recognition rate and generalization capability.

Drawings

FIG. 1 is a flow chart of the steps of the present invention.

Fig. 2 shows the character to be recognized cut in example 2.

Detailed Description

The drawings are for illustrative purposes only and are not to be construed as limiting the patent;

for the purpose of better illustrating the embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product;

it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.

The technical solution of the present invention is further described below with reference to the accompanying drawings and examples.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于深度学习的椭圆识别方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!