License plate recognition method, device, electronic equipment, and intelligent traffic equipment
The license plate recognition method through segmentation and feature fusion solves the problems of license plate recognition accuracy and delay in the existing technology, achieves high-precision and low-latency license plate recognition, and is suitable for a variety of license plate scenarios.
Patent Information
- Application Number
- CN202210602925.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-05-30
AI Technical Summary
Existing license plate recognition technology is difficult to achieve high-precision and low-latency license plate recognition due to factors such as image resolution, camera angle, weather, and lighting.
By obtaining the shallow feature map of the target image, segment it into regional feature blocks that correspond to the license plate characters one-to-one, perform feature extraction and fusion, use one-dimensional convolution layers and activation functions to generate single character features, and finally perform classification and recognition.
It improves the accuracy and fault tolerance rate of license plate recognition, reduces the complexity and time delay of the model, and is suitable for recognizing license plates with basically equal character spacing.
Smart Images

Figure CN114998883B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the fields of autonomous driving, intelligent transportation, computer vision, etc. Background Art
[0002] License plate recognition technology is one of the important components of intelligent transportation systems and has been widely used in many traffic scenarios, such as highway toll collection systems, electronic police capture, parking fee collection systems, etc. Due to many factors such as image resolution, camera perspective, weather, lighting, blur, etc., it is very challenging to provide a high-precision and low-latency license plate recognition method. Summary of the invention
[0003] The present disclosure provides a method, apparatus, device, storage medium and intelligent traffic equipment for license plate recognition.
[0004] According to a first aspect of the present disclosure, a license plate recognition method is provided, comprising:
[0005] Obtaining a first feature map of a target image;
[0006] Segmenting the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters one by one;
[0007] Extracting and fusing features of each of the regional feature blocks and adjacent regional feature blocks to obtain a second feature map corresponding to each of the regional feature blocks;
[0008] Classification is performed based on the second feature map corresponding to each of the regional feature blocks to obtain a recognition result for each of the license plate characters.
[0009] Optionally, acquiring a first feature map of the target image includes:
[0010] Acquire the target image;
[0011] Perform shallow feature extraction on the target image to obtain the first feature map.
[0012] Optionally, dividing the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters comprises:
[0013] The first feature map is equally divided into a plurality of regional feature blocks of the same size.
[0014] Optionally, the extracting and fusing features of each of the regional feature blocks and adjacent regional feature blocks to obtain a second feature map corresponding to each of the regional feature blocks includes:
[0015] Performing normalization processing on each of the regional feature blocks;
[0016] Performing convolution feature extraction on the normalized regional feature blocks to obtain neighborhood features corresponding to each of the regional feature blocks;
[0017] Performing feature fusion on each of the regional feature blocks and the neighborhood features corresponding to the adjacent regional feature blocks to obtain fusion information corresponding to each of the regional feature blocks;
[0018] Normalizing the fusion information corresponding to each of the regional feature blocks;
[0019] Performing convolution feature extraction on the normalized fusion information, and obtaining a single character feature corresponding to each of the regional feature blocks through an activation function;
[0020] The fusion information corresponding to each of the regional feature blocks is fused with the corresponding single character feature to obtain the corresponding second feature map.
[0021] Optionally, the classification based on the second feature map corresponding to each of the regional feature blocks to obtain the recognition result of each of the license plate characters includes:
[0022] Performing dimensionality reduction processing on the second feature map corresponding to each of the regional feature blocks and converting it into a one-dimensional vector;
[0023] The one-dimensional vector corresponding to each of the regional feature blocks is classified to obtain a recognition result of each of the license plate characters.
[0024] According to a second aspect of the present disclosure, there is provided a license plate recognition device, comprising:
[0025] An image acquisition module is configured to acquire a first feature map of a target image;
[0026] A feature segmentation module is configured to segment the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters one by one;
[0027] A feature extraction and fusion module is configured to extract and fuse features of each of the regional feature blocks with adjacent regional feature blocks to obtain a second feature map corresponding to each of the regional feature blocks;
[0028] The classification module is configured to perform classification based on the second feature map corresponding to each of the regional feature blocks to obtain a recognition result of each of the license plate characters.
[0029] Optionally, the image acquisition module includes:
[0030] an acquisition unit, configured to acquire the target image;
[0031] The shallow feature extraction unit is configured to perform shallow feature extraction on the target image to obtain the first feature map.
[0032] Optionally, the feature segmentation module segments the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters one by one, including:
[0033] The first feature map is equally divided into a plurality of regional feature blocks of the same size.
[0034] Optionally, the feature extraction and fusion module includes:
[0035] A first normalization unit is configured to perform normalization processing on each of the regional feature blocks;
[0036] A first feature extraction unit is configured to perform convolution feature extraction on the normalized regional feature blocks to obtain a neighborhood feature corresponding to each of the regional feature blocks;
[0037] A first fusion unit is configured to perform feature fusion on each of the regional feature blocks and the neighborhood features corresponding to the adjacent regional feature blocks to obtain fusion information corresponding to each of the regional feature blocks;
[0038] A second normalization unit is configured to perform normalization processing on the fusion information corresponding to each of the regional feature blocks;
[0039] A second feature extraction unit is configured to perform convolution feature extraction on the fused information after normalization, and obtain a single character feature corresponding to each of the regional feature blocks through an activation function;
[0040] The second fusion unit is configured to perform feature fusion on the fusion information corresponding to each of the regional feature blocks and the corresponding single character feature to obtain the corresponding second feature map.
[0041] Optionally, the classification module classifies each of the license plate characters based on the second feature map corresponding to each of the regional feature blocks to obtain a recognition result including:
[0042] Performing dimensionality reduction processing on the second feature map corresponding to each of the regional feature blocks and converting it into a one-dimensional vector;
[0043] Classification is performed based on the one-dimensional vector corresponding to each of the regional feature blocks to obtain a recognition result for each of the license plate characters.
[0044] According to a third aspect of the present disclosure, there is provided an intelligent transportation device, comprising:
[0045] A license plate recognition device as described in any one of the above technical solutions;
[0046] at least one image acquisition device, in communication with the license plate recognition device, configured to acquire a target image and provide it to the license plate recognition device; and
[0047] The execution device is configured to execute a task according to the recognition result output by the license plate recognition device.
[0048] According to a fourth aspect of the present disclosure, an electronic device is provided, the electronic device comprising:
[0049] at least one processor; and
[0050] A memory in communication with the at least one processor; wherein,
[0051] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the license plate recognition method.
[0052] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above-mentioned license plate recognition method.
[0053] According to a sixth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the above-mentioned license plate recognition method when executed by a processor.
[0054] The present invention provides a license plate recognition method, device, equipment, storage medium and intelligent traffic equipment, which improve the license plate recognition accuracy and reduce the model delay.
[0055] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0057] Figure 1 is a schematic diagram of the steps of the license plate recognition method according to the first embodiment of the present disclosure;
[0058] Figure 2 is a flow chart of a license plate recognition method according to the first embodiment of the present disclosure;
[0059] Figure 3 is a schematic diagram of the segmentation principle of the first feature map according to the first embodiment of the present disclosure;
[0060] Figure 4is a schematic diagram of an end-to-end license plate recognition method according to a first embodiment of the present disclosure;
[0061] Figure 5 It is a principle diagram of a split license plate recognition method in the prior art;
[0062] Figure 6 is a schematic diagram of the steps of extracting and fusing features of regional feature blocks according to the first embodiment of the present disclosure;
[0063] Figure 7 is a schematic diagram of the process of feature extraction and fusion according to the first embodiment of the present disclosure;
[0064] Figure 8 is a principle block diagram of a license plate recognition device according to a second embodiment of the present disclosure;
[0065] Fig. 9 is a principle block diagram of a feature extraction and fusion module according to the second embodiment of the present disclosure;
[0066] Fig.10 is a principle block diagram of an intelligent transportation device according to a third embodiment of the present disclosure;
[0067] Fig.11 It is a block diagram of an electronic device used to implement the license plate recognition method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0068] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0069] The first embodiment of the present disclosure provides a license plate recognition method, such as Figure 1 As shown, including:
[0070] Step S101, obtaining a first feature map of a target image;
[0071] Step S102, dividing the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters one by one;
[0072] Step S103, extracting and fusing features of each regional feature block with adjacent regional feature blocks to obtain a second feature map corresponding to each regional feature block;
[0073] Step S104, classifying based on the second feature map corresponding to each regional feature block to obtain the recognition result of each license plate character.
[0074] Specifically, Figure 2 As shown, step S101 first obtains the first feature map of the target image, and the target image includes a license plate. The first feature map is the basic visual feature obtained by extracting features from the target image, that is, the shallow feature. At present, the character spacing of many license plates at home and abroad is basically equal. For example, most domestic car license plates have a unified standard size. The license plate includes 7 or 8 characters in total, where each character is 45mm wide and 90mm high. The width of the spacer is 10mm. Except for the spacing between the second and third characters of 34mm, the spacing widths between other characters are all 12mm. Based on the characteristic that the spacing between license plate characters is basically equal, the present disclosure can directly divide the shallow features extracted from the target image into equal parts in step S102. For example, Figure 3 As shown, the target image includes 8 characters. The first feature map can be directly segmented into 8 regional feature blocks (hereinafter referred to as patches) of equal width through feature segmentation operation, so that each patch corresponds to one character.
[0075] Furthermore, since the spacing between characters may not be completely equal, for example, the spacing between the second and third characters of the domestic license plate mentioned above is larger than the spacing between other characters, the segmentation of the patch in the above step S102 may result in inaccurate segmentation, that is, some patches contain incomplete characters. If these incomplete patches are directly recognized, it will lead to character recognition errors. Therefore, in step S103, we extract and fuse features of each patch with adjacent patches. For the license plate character recognition task, recognizing a character only requires the neighborhood information of the character and the character area around the character. Extracting the neighborhood information of the surrounding area can increase the fault tolerance rate. Even if the patch segmentation in step S102 is inaccurate, it can also help model recognition and improve the accuracy of model recognition by accessing adjacent patches. Compared with the existing technology using recurrent neural networks, the present disclosure uses prior knowledge to roughly divide and extract shallow features, and then fuses the adjacent information of the shallow features, thereby using adjacent blocks to improve the fault tolerance rate of each character block in the license plate. The neural network disclosed in the present invention does not require a very deep network and a large number of parameters to extract features with a strong correspondence with the license plate characters, so the total time consumption of the algorithm is greatly reduced. At the same time, the license plate recognition method provided by the present invention is an end-to-end recognition method, such as Figure 4 As shown, the input model is the image, and the output is the recognition result. Compared with the traditional license plate recognition method, it is necessary to perform character segmentation before the recognition method ( Figure 5 As shown), the model of the present invention has lower complexity and lower latency.
[0076] After performing neighborhood information fusion and feature extraction on each patch in step S103, the second feature map corresponding to each patch is obtained. At this time, each second feature map incorporates the information of the surrounding area, so the character features contained in each second feature map are complete. Finally, step S104 classifies the second feature map corresponding to each patch to obtain the license plate characters corresponding to each patch, and then summarizes the recognition results to obtain all the license plate characters.
[0077] It should be noted that the above-mentioned technical solution of the present invention is not limited to the recognition and processing of domestic license plates, but can also be used to process license plates of other countries or regions. The license plate recognition method of the present invention is suitable for identifying all license plates with equal or basically equal character spacing. The core of the method is to segment the shallow features extracted from the license plate image based on the basically equal character spacing of the license plate (it is not required that the character spacing of the license plate is completely equal), and segment it into multiple patches of the same size. The number of patches is the same as the number of license plate characters. A simple segmentation method can form a strong correspondence between the patch and the license plate characters. Even if the patch segmentation is inaccurate, the features of the surrounding area can be fused before each patch is recognized, that is, the features of adjacent patches can be fused so that each patch can contain the complete features of its corresponding character. For example, assuming that the character corresponding to the first patch is "W", during patch segmentation, part of the edge features of "W" may be segmented into the next adjacent patch, that is, the second patch, due to inaccurate patch segmentation. This may lead to inaccurate recognition of the first patch. Therefore, it is necessary to fuse the edge features of the second patch adjacent to the first patch into the first patch so that the features of the character "W" contained in the first patch are complete.
[0078] As an optional implementation, in step S101, obtaining a first feature map of a target image includes: obtaining a target image; and performing shallow feature extraction on the target image to obtain a first feature map.
[0079] As an optional implementation, the neural network model uses a convolutional layer to perform shallow feature extraction on the target image to obtain basic visual features (this step is called convolutional stem in the art). Convolutional stem is a method involving patch operations in computer vision tasks, such as the MLP (Multilayer Perceptron) method, a commonly used step in the transformer method, which can effectively improve the robustness of the model, converge faster, and have higher accuracy.
[0080] As an optional implementation, Figure 6 As shown, step S103 extracts and fuses features of each regional feature block with adjacent regional feature blocks to obtain a second feature map corresponding to each regional feature block, specifically including:
[0081] Step S601, normalizing each regional feature block;
[0082] Step S602, performing convolution feature extraction on the normalized regional feature blocks to obtain neighborhood features corresponding to each regional feature block;
[0083] Step S603, performing feature fusion on each regional feature block and the neighborhood features corresponding to the adjacent regional feature blocks to obtain fusion information corresponding to each regional feature block;
[0084] Step S604, normalizing the fusion information corresponding to each regional feature block;
[0085] Step S605, performing convolution feature extraction on the normalized fusion information, and obtaining a single character feature corresponding to each regional feature block through an activation function;
[0086] Step S606: Fusing the fusion information corresponding to each regional feature block with the corresponding single character feature to obtain a corresponding second feature map.
[0087] Specifically, Figure 7 As shown in the figure, the neural network model uses a one-dimensional convolution layer to extract and fuse features for each input patch. The main function of the one-dimensional convolution layer is to fuse the features of the neighboring pixels of the patch in width. Because for the license plate character recognition task, recognizing a character only requires the features of the character and the information of the surrounding character area. The one-dimensional convolution layer can meet this requirement well. As mentioned earlier, the traditional method will lead to recognition errors due to inaccurate segmentation. Therefore, it is necessary to extract information about the area around each patch, which can increase the fault tolerance rate. Even if the patch segmentation is inaccurate, the one-dimensional convolution layer can be used to access the adjacent patches and obtain the neighborhood information around the patch to help the model recognize the characters corresponding to each patch. In addition, the one-dimensional convolution layer has a small amount of calculation and is more suitable for character recognition tasks. The traditional transformer uses the attention mechanism to perform character recognition tasks, which requires global information to interact, has a very large amount of calculation, and also includes some redundant information, making it more difficult for the model to converge.
[0088] In this embodiment, the extraction and fusion of the features of each patch and the features of the adjacent patches can be expressed by the following formula:
[0089] F(X) = X + conv1d(layerNorm(X))
[0090] Among them, X represents the first feature map of the input; conv1d represents the one-dimensional convolutional layer; layerNorm represents the normalization process;
[0091] Furthermore, the convolution feature extraction and fusion of the fusion information corresponding to each regional feature block can be expressed by the following formula:
[0092] G(Y)=Y+GELU(FC(layerNorm(Y)))
[0093] Where Y = F(X), F(X) represents the fusion information obtained by the first feature extraction and fusion; that is, the second feature extraction and fusion are performed on the result F(X) output after the first feature extraction and fusion. Where GELU represents the activation function, erf represents the error function; FC represents the fully connected layer. The second feature extraction uses the fully connected layer for convolution feature extraction. The convolution extraction process of FC can be expressed by the following formula:
[0094] WhereFC(X)=max(0,XW1+b1)W2+b2
[0095] Among them, W1 and W2 represent the weights of the fully connected layer; b1 and b2 represent the bias of the fully connected layer.
[0096] For example, Figure 7 As shown, the first feature corresponding to each patch Figure X The input feature extraction and fusion module is normalized by the first normalization layer 701 and processed by the one-dimensional convolution layer 702 to obtain the fusion information F(X). Next, F(X) is used as input, and the second normalization layer 703 is used to normalize F(X). The fully connected layer 704 performs convolution feature extraction and fusion, and outputs G(Y) after the activation function 705. In this embodiment, it is proposed to use a one-dimensional convolution layer to fuse spatial information. Compared with the global feature fusion using the self-attention module, the one-dimensional convolution layer is more suitable for character recognition tasks and has a smaller amount of calculation. For the recognition of a single character, only the information of the adjacent area, that is, the neighborhood information, needs to be considered, rather than the information of the entire input image. The one-dimensional convolution layer can extract the neighborhood information of each patch very well, while reducing the delay and removing some redundant global information, so that the model can converge faster and achieve higher accuracy. It should be noted that using a one-dimensional convolutional layer for feature extraction and fusion is only a preferred implementation method. The self-attention module can also be used for processing. Compared with the one-dimensional convolutional layer, the self-attention module has a larger amount of computation and will include some redundant information, so the model converges more slowly.
[0097] In this embodiment, the neural network model obtains the second feature map corresponding to each patch through two feature extractions and fusions, and reduces the delay as much as possible while ensuring the accuracy of the model. However, it should be noted that the number of feature extractions and fusions is not limited to two times, and the number can be adjusted according to actual needs. The more times the feature extractions and fusions are performed, the stronger the model capability is, and the accuracy is usually higher, but the delay will also increase accordingly.
[0098] As an optional implementation, in step S104, the recognition result of each license plate character obtained by classification based on the second feature map corresponding to each regional feature block includes:
[0099] Perform dimensionality reduction processing on the second feature map corresponding to each regional feature block and convert it into a one-dimensional vector;
[0100] The one-dimensional vector corresponding to each regional feature block is classified to obtain the recognition result of each license plate character.
[0101] In this embodiment, converting the second feature map into a one-dimensional vector helps to reduce the amount of calculation, thereby shortening the delay of the neural network model. In addition, in the license plate recognition method disclosed in the present invention, the method of dividing the shallow features of the license plate into patches through step S102 can effectively align the features and characters, so that each patch corresponds to a character, so that the second feature map of the patch can be directly classified using only the fully connected layer. Compared with the currently popular license plate recognition method based on deep learning, the license plate features do not correspond one-to-one with a single license plate character, so a decoding operation is required, which usually uses RNN (Recurrent Neural Networks) + CTC (Connectionist Temporal Classification) for decoding, wherein CTC mainly solves a problem: the problem of correspondence between the input sequence and the output sequence, such as the number and size of characters are different, and the output cannot correspond well to each character. The present disclosure does not require the time-consuming decoding operation in the prior art, the required neural network structure is simpler, and the recognition efficiency can be improved and the delay can be reduced.
[0102] The second embodiment of the present disclosure provides a license plate recognition device, such as Figure 8 As shown, including:
[0103] The image acquisition module 801 is configured to acquire a first feature map of a target image;
[0104] The feature segmentation module 802 is configured to segment the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters one by one;
[0105] The feature extraction and fusion module 803 is configured to extract and fuse features of each regional feature block with adjacent regional feature blocks to obtain a second feature map corresponding to each regional feature block;
[0106] The classification module 804 is configured to perform classification based on the second feature map corresponding to each regional feature block to obtain the recognition result of each license plate character.
[0107] Specifically, Figure 2 As shown, firstly, the image acquisition module 801 is used to acquire the first feature map of the target image. The target image includes a license plate. The first feature map is the basic visual feature obtained by extracting features from the target image, that is, the shallow feature. At present, the character spacing of many license plates at home and abroad is basically equal. For example, most domestic car license plates have a unified standard size. The license plate includes 7 or 8 characters in total, where each character is 45mm wide and 90mm high. The width of the spacer is 10mm. Except for the spacing between the second and third characters, which is 34mm, the spacing widths between other characters are all 12mm. Based on the characteristic that the spacing between license plate characters is basically equal, the feature segmentation module 802 can be used to directly divide the shallow features extracted from the target image into equal parts. For example, Figure 3 As shown, the target image includes 8 characters. The first feature map can be directly segmented into 8 regional feature blocks (hereinafter referred to as patches) of equal width through feature segmentation operation, so that each patch corresponds to one character.
[0108] Furthermore, since the spacing between characters may not be completely equal, for example, the spacing between the second and third characters of the domestic license plate mentioned above is larger than the spacing between other characters, the feature segmentation module 802 roughly divides the first feature map into blocks, which may cause inaccurate patch segmentation, that is, some patches contain incomplete characters. If these incomplete patches are directly recognized, character recognition errors will occur. Therefore, the feature extraction and fusion module 803 can be used to extract and fuse features from each patch with adjacent patches. For the license plate character recognition task, recognizing a character only requires the neighborhood information of the character and the character area around the character. Extracting the neighborhood information of the surrounding area can increase the fault tolerance rate. Even if the patch segmentation of the feature segmentation module 802 is inaccurate, the feature extraction and fusion module 803 can access the adjacent patches to help model recognition and improve the accuracy of model recognition.
[0109] Compared with the prior art using recurrent neural networks, the present invention uses prior knowledge to roughly divide and extract shallow features, and then fuses the shallow features with neighborhood information, thereby using neighborhood information to improve the error tolerance of each character block in the license plate. The neural network of the present invention does not require a very deep network and a large number of parameters to extract features with a strong correspondence with the license plate characters, so the total time consumption of the algorithm is greatly reduced. At the same time, the license plate recognition device provided by the present invention implements an end-to-end recognition method.
[0110] After the feature extraction and fusion module 803 performs neighborhood information fusion and feature extraction on each patch, the second feature map corresponding to each patch is obtained. At this time, each second feature map incorporates the information of the surrounding area, so the character features contained in each second feature map are complete. Finally, the classification module 804 classifies the second feature map corresponding to each patch to obtain the license plate characters corresponding to each patch, and then summarizes the recognition results to obtain all the license plate characters.
[0111] It should be noted that the above technical solution of the present disclosure is not limited to the recognition and processing of domestic license plates, but can also be used to process license plates of other countries or regions. The license plate recognition device of the present disclosure is suitable for recognizing license plates with equal or substantially equal character spacing. The core of the device is to segment the shallow features extracted from the license plate image based on the substantially equal character spacing of the license plate (it is not required that the character spacing of the license plate is completely equal), and segment it into multiple patches of the same size. The number of patches is the same as the number of license plate characters. A strong correspondence relationship can be formed between the patch and the license plate characters using a simple segmentation method. Even if the patch segmentation is inaccurate, the features of the surrounding area can be fused before each patch is recognized, that is, the features of adjacent patches are fused, so that each patch can contain the complete features of its corresponding character. For example, assuming that the character corresponding to the first patch is "W", when the patch is segmented, part of the edge features of "W" may be segmented into the next adjacent patch, that is, the second patch, due to inaccurate patch segmentation, which may lead to inaccurate recognition of the first patch. Therefore, it is necessary to merge the edge features of the second patch adjacent to the first patch into the first patch so that the features of the character "W" contained in the first patch are complete.
[0112] As an optional implementation, the image acquisition module 801 acquires the first feature map of the target image, including: an acquisition unit, configured to acquire the target image; and a shallow feature extraction unit, configured to perform shallow feature extraction on the target image to obtain the first feature map.
[0113] As an optional implementation, the shallow feature extraction unit uses the convolution layer of the neural network model to perform shallow feature extraction on the target image to obtain basic visual features.
[0114] As an optional implementation, Fig. 9 As shown, the feature extraction and fusion module 803 includes:
[0115] A first normalization unit 901 is configured to perform normalization processing on each regional feature block;
[0116] The first feature extraction unit 902 is configured to perform convolution feature extraction on the normalized regional feature blocks to obtain neighborhood features corresponding to each regional feature block;
[0117] The first fusion unit 903 is configured to perform feature fusion on each regional feature block and the neighborhood features corresponding to the adjacent regional feature blocks to obtain fusion information corresponding to each regional feature block;
[0118] A second normalization unit 904 is configured to perform normalization processing on the fusion information corresponding to each regional feature block;
[0119] The second feature extraction unit 905 is configured to perform convolution feature extraction on the fused information after normalization, and obtain a single character feature corresponding to each regional feature block through an activation function;
[0120] The second fusion unit 906 is configured to perform feature fusion on the fusion information corresponding to each regional feature block and the corresponding single character feature to obtain a corresponding second feature map.
[0121] Specifically, Figure 7 As shown in the figure, the neural network model uses a one-dimensional convolution layer to extract and fuse features for each input patch. The main function of the one-dimensional convolution layer is to fuse the features of the adjacent pixels in the width of the patch. Because for the character recognition task, we do not need global features. To recognize a character, we only need the features of the character and the information of the surrounding area. The one-dimensional convolution layer can meet this requirement well. As mentioned earlier, the traditional method will cause recognition errors due to inaccurate segmentation. Therefore, it is necessary to extract information about the area around each patch, which can increase the fault tolerance rate. Even if the patch segmentation is inaccurate, the one-dimensional convolution layer can be used to access the adjacent patches and obtain the neighborhood information around the patch to help the model recognize the characters corresponding to each patch. In addition, the one-dimensional convolution layer has a small amount of calculation and is more suitable for character recognition tasks. The traditional transformer uses the attention mechanism to perform character recognition tasks, which requires global information to interact, has a very large amount of calculation, and also includes some redundant information, making it more difficult for the model to converge.
[0122] In this embodiment, the feature extraction and fusion module 803 extracts and fuses the features of each patch and the features of the adjacent patches, which can be expressed by the following formula:
[0123] F(X) = X + conv1d(layerNorm(X))
[0124] Among them, X represents the first feature map of the input; conv1d represents the one-dimensional convolutional layer; layerNorm represents the normalization process;
[0125] Furthermore, the feature extraction and fusion module 803 performs convolution feature extraction and fusion on the fusion information corresponding to each regional feature block, which can be expressed by the following formula:
[0126] G(Y)=Y+GELU(FC(layerNorm(Y)))
[0127] Where Y = F(X), F(X) represents the fusion information obtained by the first feature extraction and fusion; that is, the second feature extraction and fusion are performed on the result F(X) output after the first feature extraction and fusion. Where GELU represents the activation function, erf represents the error function; FC represents the fully connected layer. The second feature extraction uses the fully connected layer for convolution feature extraction. The convolution extraction process of FC can be expressed by the following formula:
[0128] Where FC(X)=max(0,XW1+b1)W2+b2
[0129] Among them, W1 and W2 represent the weights of the fully connected layer; b1 and b2 represent the bias of the fully connected layer.
[0130] Specifically, Figure 7 As shown, the first feature corresponding to each patch Figure XThe input feature extraction and fusion module is normalized by the first normalization layer 701 and the one-dimensional convolution layer 702 is used to extract and fuse convolution features to obtain fusion information F(X). Next, F(X) is used as input, and F(X) is normalized by the second normalization layer 703. The fully connected layer 704 performs convolution feature extraction and fusion, and outputs G(Y) after the activation function 705. In this embodiment, it is proposed to use a one-dimensional convolution layer to fuse spatial information. Compared with the global feature fusion using the self-attention module, the one-dimensional convolution layer is more suitable for character recognition tasks and has a smaller amount of calculation. For the recognition of a single character, only the information of the adjacent area, that is, the neighborhood information, needs to be considered, rather than the information of the entire input image. The one-dimensional convolution layer can extract the neighborhood information of each patch very well, while reducing the delay and removing some redundant global information, so that the model can converge faster and achieve higher accuracy. It should be noted that using a one-dimensional convolutional layer for feature extraction and fusion is only a preferred implementation method. The self-attention module can also be used for processing. Compared with the one-dimensional convolutional layer, the self-attention module has a larger amount of calculation and will include some redundant information, so the model converges more slowly.
[0131] In this embodiment, the neural network model obtains the second feature map corresponding to each patch through two feature extractions and fusions, and minimizes the delay as much as possible while ensuring the accuracy of the model. However, it should be noted that the number of feature extractions and fusions is not limited to two times, and this parameter can be adjusted according to actual needs. The more times the feature extractions and fusions are performed, the stronger the model capability is, and the accuracy is usually higher, but the delay will also increase accordingly.
[0132] As an optional implementation, the classification module 804 performs classification based on the second feature map corresponding to each regional feature block to obtain the recognition result of each license plate character, including:
[0133] Perform dimensionality reduction processing on the second feature map corresponding to each regional feature block and convert it into a one-dimensional vector;
[0134] The one-dimensional vector corresponding to each regional feature block is classified to obtain the recognition result of each license plate character.
[0135] In this embodiment, converting the second feature map into a one-dimensional vector helps to reduce the amount of calculation, thereby shortening the latency of the neural network model. In addition, in the license plate recognition method disclosed in the present invention, the shallow features of the license plate are divided into patches by the feature segmentation module 802, which can effectively align the features and characters so that each patch corresponds to a character, so that the second feature map of the patch can be directly classified using only the fully connected layer. Compared with the currently popular license plate recognition method based on deep learning, the license plate features do not correspond one-to-one to a single license plate character, so a decoding operation is required, which usually uses RNN+CTC for decoding, wherein CTC mainly solves a problem: the problem of correspondence between the input sequence and the output sequence, such as the number and size of characters are different, and the output cannot correspond well to each character. The present disclosure does not require the time-consuming decoding operation in the prior art, the required neural network structure is simpler, and can improve the efficiency of recognition and reduce latency.
[0136] The third embodiment of the present disclosure provides an intelligent transportation device 1000, such as Fig.10 As shown, including:
[0137] The license plate recognition device 1001 described in any one of the second embodiments;
[0138] At least one image acquisition device 1002, which is in communication with the license plate recognition device 1001 and is configured to acquire a target image and provide it to the license plate recognition device 1001; and
[0139] The execution device 1003 is configured to execute a task according to the recognition result output by the license plate recognition device 1001 .
[0140] Specifically, the intelligent transportation equipment 1000 disclosed in the present invention may include application scenarios such as the Electronic Toll Collection (ETC) system, parking lot management system, and electronic police capture. The license plate recognition technology is combined with the electronic toll collection system (ETC) to identify vehicles, and passing vehicles do not need to stop when passing through the intersection, that is, it can realize automatic vehicle identity recognition and automatic charging. In the parking lot management system, in order to improve the efficiency of vehicle traffic at the entrance and exit, license plate recognition is used for vehicles that do not need to pay parking fees (such as monthly trucks and internal free-passing vehicles), and unmanned express lanes are built, which provide a card-free and non-stop entry and exit experience, which can improve the efficiency of parking lot management.
[0141] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0142] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0143] Fig.11 A schematic block diagram of an example electronic device 1100 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0144] like Fig.11 As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0145] A number of components in the device 1100 are connected to the I / O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0146] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1101 performs the various methods and processes described above, such as a license plate recognition method. For example, in some embodiments, the license plate recognition method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the license plate recognition method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform the license plate recognition method in any other appropriate manner (eg, by means of firmware).
[0147] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0148] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0149] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0150] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0151] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0152] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0153] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0154] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A license plate recognition method, comprising: Obtaining a first feature map of a target image; Segmenting the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters one by one; Extracting features from each of the regional feature blocks and the adjacent regional feature blocks and fusing them to obtain a second feature map corresponding to each of the regional feature blocks; extracting features from each of the regional feature blocks and the adjacent regional feature blocks and fusing them to obtain a second feature map corresponding to each of the regional feature blocks includes: normalizing each of the regional feature blocks; Perform one-dimensional convolution feature extraction on the normalized regional feature blocks to obtain neighborhood features corresponding to each of the regional feature blocks; perform feature fusion on each of the regional feature blocks and the neighborhood features corresponding to the adjacent regional feature blocks to obtain fusion information corresponding to each of the regional feature blocks; perform normalization on the fusion information corresponding to each of the regional feature blocks; perform fully connected convolution feature extraction on the normalized fusion information, and obtain a single character feature corresponding to each of the regional feature blocks through an activation function; perform feature fusion on the fusion information corresponding to each of the regional feature blocks and the corresponding single character feature to obtain the corresponding second feature map; Classification is performed based on the second feature map corresponding to each of the regional feature blocks to obtain a recognition result for each of the license plate characters.
2. The license plate recognition method according to claim 1, wherein: The acquiring of the first feature map of the target image comprises: Acquire the target image; Perform shallow feature extraction on the target image to obtain the first feature map.
3. The license plate recognition method according to claim 1, wherein: The step of dividing the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters comprises: The first feature map is equally divided into a plurality of regional feature blocks of the same size.
4. The license plate recognition method according to claim 1, wherein: The recognition result of each license plate character obtained by classifying the second feature map corresponding to each regional feature block includes: Performing dimensionality reduction processing on the second feature map corresponding to each of the regional feature blocks and converting it into a one-dimensional vector; The one-dimensional vector corresponding to each of the regional feature blocks is classified to obtain a recognition result of each of the license plate characters.
5. A license plate recognition device, comprising: An image acquisition module is configured to acquire a first feature map of a target image; A feature segmentation module is configured to segment the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters one by one; The feature extraction and fusion module is configured to extract and fuse features from each of the regional feature blocks and the adjacent regional feature blocks to obtain a second feature map corresponding to each of the regional feature blocks; the feature extraction and fusion module includes: a first normalization unit, configured to perform normalization processing on each of the regional feature blocks; a first feature extraction unit, configured to perform one-dimensional convolution feature extraction on the regional feature blocks after normalization processing to obtain neighborhood features corresponding to each of the regional feature blocks; a first fusion unit, configured to perform feature fusion on each of the regional feature blocks and the neighborhood features corresponding to the adjacent regional feature blocks to obtain fusion information corresponding to each of the regional feature blocks; a second normalization unit, configured to perform normalization processing on the fusion information corresponding to each of the regional feature blocks; a second feature extraction unit, configured to perform fully connected convolution feature extraction on the fusion information after normalization processing, and obtain a single character feature corresponding to each of the regional feature blocks through an activation function; a second fusion unit, configured to perform feature fusion on the fusion information corresponding to each of the regional feature blocks and the corresponding single character feature to obtain the corresponding second feature map; The classification module is configured to perform classification based on the second feature map corresponding to each of the regional feature blocks to obtain a recognition result of each of the license plate characters.
6. The license plate recognition device according to claim 5, wherein: The image acquisition module comprises: an acquisition unit, configured to acquire the target image; The shallow feature extraction unit is configured to perform shallow feature extraction on the target image to obtain the first feature map.
7. The license plate recognition device according to claim 5, wherein: The feature segmentation module segments the first feature map into a plurality of regional feature blocks corresponding to a plurality of license plate characters one by one, including: The first feature map is equally divided into a plurality of regional feature blocks of the same size.
8. The license plate recognition device according to claim 5, wherein: The classification module classifies each of the license plate characters based on the second feature map corresponding to each of the regional feature blocks to obtain a recognition result including: Performing dimensionality reduction processing on the second feature map corresponding to each of the regional feature blocks and converting it into a one-dimensional vector; Classification is performed based on the one-dimensional vector corresponding to each of the regional feature blocks to obtain a recognition result for each of the license plate characters.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the license plate recognition method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the license plate recognition method according to any one of claims 1-4.
11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for recognizing a license plate according to any one of claims 1 to 4 is implemented.
12. An intelligent traffic device, comprising: The license plate recognition device according to any one of claims 5 to 8; at least one image acquisition device, in communication with the license plate recognition device, configured to acquire a target image and provide it to the license plate recognition device; as well as The execution device is configured to execute a task according to the recognition result output by the license plate recognition device.
Citation Information
Patent Citations
Transform-based license plate character recognition method
CN113920494A
Model training method and device, equipment, medium and program product
CN114330543A
