A character positioning model training method, training device, recognition method and recognition device

By calculating the brightness of the three primary colors and determining the threshold for binarization processing and image sample fusion training, combined with Radon transform to correct tilt, the problem of inaccurate number positioning caused by unevenness on the container surface was solved, and accurate number recognition under different lighting and scales was achieved.

CN116386059BActive Publication Date: 2025-12-05CHINA STATE RAILWAY GRP CO LTD +3
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310154480.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2025-12-05
Estimated Expiration
2043-02-22

AI Technical Summary

Technical Problem

In railway transportation, the uneven surface of containers makes the captured images susceptible to the influence of lighting, affecting the accuracy of number area positioning and thus affecting number recognition.

Method used

By acquiring image samples containing carriage numbers, calculating the brightness of the three primary colors, determining the threshold for binarization, fusing image samples, and using Radon transform to correct tilt, a text localization model is trained, including feature extraction, region candidate, pooling, and classification regression layers. The loss function is optimized to improve model performance.

Benefits of technology

The accuracy and adaptability of the text positioning model have been improved, enabling accurate identification of container numbers under different lighting and scale conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116386059B_ABST
    Figure CN116386059B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a character positioning model training method, a training device, a recognition method and a recognition device, which can overcome the influence of the concave-convex surface of the container, improve the performance of the character positioning model, and further improve the accuracy of the container number recognition. The character positioning model training method comprises the following steps: obtaining M carriage image samples containing a carriage number; determining a first threshold value based on the maximum brightness and the difference between the maximum brightness and any one of the remaining brightness sums, and determining a corresponding second threshold value based on each brightness sum in the remaining brightness sums; performing binaryzation processing on each carriage image sample based on the first threshold value to obtain a first binaryzation image, and performing binaryzation processing on each carriage image sample based on the second threshold value to obtain a second binaryzation image; obtaining M fusion image samples; and training an initial character positioning model based on the M fusion image samples as training samples to obtain a target character positioning model.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application relates to the field of carriage number recognition technology, and in particular to a text positioning model training method, training device, recognition method and recognition device. [Background Technology]

[0002] In existing technologies, a camera is used to capture images containing vehicle license plate numbers, and a text localization model is used to locate the captured images to determine the position of the number to be identified in the captured images, thereby facilitating the identification model to determine the license plate number in the captured images.

[0003] However, in the context of railway transportation, what needs to be identified are the numbers on the containers used to transport goods. Since the surface of the container is uneven, the captured images are easily affected by lighting. Therefore, when the captured images are input into the original model, there will be a problem of low accuracy in locating the number area, which will affect the subsequent number recognition.

[0004] It is evident that existing technologies cannot effectively handle the effects of surface unevenness on images. [Summary of the Invention]

[0005] This application provides a text positioning model training method, training device, recognition method, and recognition device, which can overcome the influence of unevenness on the surface of the container, improve the performance of the text positioning model, and thus improve the accuracy of container number recognition.

[0006] In a first aspect, embodiments of this application provide a text localization model training method, the method comprising:

[0007] Obtain M image samples containing carriage numbers, where M is a positive integer not less than 1;

[0008] For each of the M carriage image samples, calculate the sum of the brightness of each primary color among the three primary colors contained in each carriage image sample;

[0009] A first threshold is determined based on the difference between the largest sum of brightness and any sum of brightness among the remaining sums of brightness, and a corresponding second threshold is determined based on each sum of brightness among the remaining sums of brightness;

[0010] Based on the first threshold, each of the carriage image samples is binarized to obtain a first binarized image; and based on the second threshold, each of the carriage image samples is binarized to obtain a second binarized image.

[0011] The first binarized image and the second binarized image are fused to obtain M fused image samples;

[0012] The target text localization model is obtained by training the initial text localization model using the M fused image samples as training samples.

[0013] In this embodiment, the image samples collected for training can be considered to be affected by the unevenness of the container surface, resulting in significant differences in the collected images under different lighting conditions and containing many influencing factors. Therefore, before training the image samples, binarization processing is required. This binarization processing is based on the sum of the brightness of each of the three primary colors contained in each image sample. Multiple thresholds are determined by subtracting the maximum brightness from any of the remaining brightness sums and by calculating each brightness in the remaining brightness sum. Based on these multiple thresholds, the images are binarized to obtain multiple binarized images. These multiple binarized images are then fused to obtain fused image samples. In the fused image samples, the part of the number we are interested in is emphasized while other parts are ignored. The fused image samples are then fed into the training model so that the features learned during the training process are the features we are interested in, thereby training a high-performance text localization model.

[0014] Optionally, for each of the M carriage image samples, the brightness and sum of the three primary colors contained in each carriage image sample are calculated. The method includes:

[0015] Histogram equalization is performed on each of the M carriage image samples.

[0016] In this embodiment, histogram equalization is used to concentrate the brightness in the image samples, thereby improving the clarity of the image samples and the accuracy of binarization, so as to train a high-performance text localization model.

[0017] Optionally, after performing histogram equalization on each of the M carriage image samples, the method includes:

[0018] The Radon transform is used to correct the tilt of each of the M carriage image samples after histogram equalization.

[0019] In this embodiment, Radon transform is used to correct the tilt of the image samples after histogram equalization, so that the numbers in the image samples that were originally tilted are corrected to vertical, which makes it easier to binarize the numbers in the image samples, thereby training a high-performance text localization model.

[0020] Optionally, before training the initial text localization model based on the M fused image samples as training samples to obtain the target text localization model, the method includes:

[0021] The M fused image samples are divided into N groups of equal quantity, where N is a positive integer not greater than M;

[0022] The N sets of fused image samples are set to different scales;

[0023] The target text localization model is obtained by training the initial text localization model using the M fused image samples as training samples, and then proceeding as follows:

[0024] The initial text localization model is trained using the N sets of fused image samples at different scales as training samples to obtain the target text localization model.

[0025] In this embodiment, the fused image samples used for training are divided into N groups, and the image samples in each group are used for training at different scales to improve the model's adaptability to images at different scales. This enables the text localization model to have good localization accuracy at different scales and fully meet the localization requirements of multi-scale container numbers.

[0026] Optionally, the initial text localization model includes a feature extraction layer, a region candidate network layer, a pooling layer, an adversarial network layer, and a classification and regression layer. The initial text localization model is trained using the N sets of fused image samples at different scales as training samples to obtain the target text localization model, which includes:

[0027] The N sets of fused image samples are input into the feature extraction layer to obtain the feature vector corresponding to each fused image sample in the N sets of fused image samples;

[0028] The feature vector corresponding to each fused image sample is input into the region candidate network layer, and the predicted localization region corresponding to each fused image sample is output.

[0029] The feature vector corresponding to each fused image sample and the predicted localization region corresponding to each fused image sample are input into the pooling layer, and the region feature map corresponding to each fused image sample is output.

[0030] The region feature map corresponding to each fused image sample is input into the adversarial network layer, affine transformation is performed, and the target feature map corresponding to each fused image sample is output.

[0031] The target feature map corresponding to each fused image sample is input into the classification and regression layer, and the predicted position value of the target text contained in each fused image sample is output.

[0032] Based on the baseline loss function between the predicted location value of the target text contained in each fused image sample and the location annotation value of the target text contained in the corresponding image sample, the feature extraction layer, the region candidate network layer, the pooling layer, the adversarial network layer and the classification and regression layer are trained.

[0033] Determine whether the benchmark loss function meets the preset requirements;

[0034] If the baseline loss function meets the preset requirements, determine the optimal parameters corresponding to the feature extraction layer, the region candidate network layer, the pooling layer, the adversarial network layer, and the classification and regression layer;

[0035] The target text localization model is obtained based on the initial localization model and the optimal parameters.

[0036] In this embodiment, the trained fused image samples are first input into the initial text localization model. The initial text localization model includes a feature extraction layer, a region candidate network layer, a pooling layer, an adversarial network layer, and a classification and regression layer. A baseline loss function is established between the predicted position value of the target text in the input fused image sample and the position annotation value of the target text based on the initial text localization model. By optimizing the baseline loss function, the parameters of each network layer of the initial text localization model can be adjusted to obtain the optimal parameters. Then, combined with the baseline loss function, a high-performance text localization model can be obtained.

[0037] Optionally, the height of each of the N groups of fused image samples is a random value in [480, 920], and the length is a random value less than 1200.

[0038] In this embodiment, the height of N sets of fused image samples can be set to a random value in [480, 920], corresponding to a length of less than 1200 random values. By training with samples of different scales, the accuracy of the text localization model for images of different scales can be improved.

[0039] Optionally, the feature extraction layer is a depth-separable network.

[0040] In this embodiment, the feature extraction layer is a depthwise separable network, which can reduce the network's computational parameters and improve the localization efficiency of the text localization model.

[0041] Secondly, embodiments of this application provide a text localization model training apparatus, the apparatus comprising: a processor and a storage medium, the storage medium including readable instructions, the readable instructions being executed by the processor of the steps of the method as described in any embodiment of the first aspect.

[0042] Thirdly, this application provides a number identification method, the method comprising:

[0043] Obtain image samples of the carriage to be identified;

[0044] Calculate the sum of the brightness of each primary color among the three primary colors contained in the image sample of the carriage to be identified;

[0045] A first threshold is determined based on the difference between the largest sum of brightness and any sum of brightness among the remaining sums of brightness, and a corresponding second threshold is determined based on each sum of brightness among the remaining sums of brightness;

[0046] The image sample of the carriage to be identified is binarized based on the first threshold to obtain a first binarized image, and the image sample of the carriage to be identified is binarized based on the second threshold to obtain a second binarized image.

[0047] The first binarized image and the second binarized image are fused to obtain a fused image sample to be identified;

[0048] The fused image sample to be identified is input into the target localization model to obtain the predicted value of the target text position corresponding to the fused image to be identified;

[0049] The predicted value of the target text position is input into the target recognition model to obtain the number recognition result corresponding to the fused image to be recognized.

[0050] In this embodiment, a carriage image sample to be identified is acquired and binarized. The binarized fused image sample to be identified is then input into a target localization model to obtain a predicted value of the target text position corresponding to the image to be identified. Finally, the predicted value of the target text position is input into a target recognition model to obtain the number recognition result corresponding to the image to be identified.

[0051] Fourthly, this application provides a number identification device, the device comprising:

[0052] A communicator for receiving images of the carriages to be identified:

[0053] The processor, coupled to the communicator, is configured to: calculate the sum of the brightness of each of the three primary colors contained in the image sample of the carriage to be identified;

[0054] A first threshold is determined based on the difference between the largest sum of brightness and any sum of brightness among the remaining sums of brightness, and a corresponding second threshold is determined based on each sum of brightness among the remaining sums of brightness;

[0055] The image sample of the carriage to be identified is binarized based on the first threshold to obtain a first binarized image, and the image sample of the carriage to be identified is binarized based on the second threshold to obtain a second binarized image.

[0056] The first binarized image and the second binarized image are fused to obtain a fused image sample to be identified;

[0057] The fused image sample to be identified is input into the target localization model to obtain the predicted value of the target text position corresponding to the fused image to be identified;

[0058] The predicted value of the target text position is input into the target recognition model to obtain the number recognition result corresponding to the fused image to be recognized. [Attached Image Description]

[0059] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0060] Figure 1 This application provides a flowchart illustrating a text localization model training method.

[0061] Figure 2 A flowchart illustrating another text localization model training method provided in this application embodiment;

[0062] Figure 3 A flowchart illustrating a number recognition method provided in an embodiment of this application;

[0063] Figure 4 This is a schematic diagram of the structure of a text localization model training device provided in an embodiment of this application;

[0064] Figure 5 This is a schematic diagram of the structure of a number recognition device provided in an embodiment of this application.

Detailed Implementation Methods

[0065] To better understand the technical solutions in this specification, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0066] It should be understood that the described embodiments are merely some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without inventive effort are within the scope of protection of this specification.

[0067] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0068] The applicant's research revealed that in related technologies, cameras are used to capture images containing vehicle license plate numbers, and text localization models are used to locate the numbers within the captured images, thus facilitating the identification model's determination of the license plate numbers. However, in railway transportation scenarios, the numbers to be identified are those on shipping containers. Due to the uneven surface of the containers, the captured images are easily affected by lighting conditions. Therefore, inputting these images into the existing model results in low accuracy in locating the number regions, thus impacting subsequent number recognition.

[0069] In view of this, this application provides a text localization model training method. In this method, the image samples collected for training can be considered to be affected by the unevenness of the container surface, resulting in significant differences in the collected images under different lighting conditions and containing many influencing factors. Therefore, before training the image samples, binarization processing is required. This binarization processing is based on the sum of the brightness of each of the three primary colors contained in each image sample. Multiple thresholds are determined by subtracting the maximum brightness from any of the remaining brightness sums and by calculating each brightness in the remaining brightness sum. Based on the multiple thresholds, the images are binarized to obtain multiple binarized images. The multiple binarized images are then fused to obtain fused image samples. In the obtained fused image samples, the part of the number we are interested in is emphasized while other parts are ignored. The fused image samples are then fed into the training model so that the features learned during the training process are the features we are interested in, thereby training a high-performance text localization model.

[0070] The technical solutions provided in the embodiments of this application are described below with reference to the accompanying drawings. Please refer to... Figure 1 This application provides a text localization model training method, the process of which is described as follows:

[0071] Step 101: Obtain M carriage image samples containing carriage numbers, where M is a positive integer not less than 1.

[0072] In this embodiment of the application, M image samples containing carriage numbers can be obtained, where M is a positive integer not less than 2. These M image samples can be images of different carriages or images containing railway train numbers; no particular limitation is made here.

[0073] Considering that the acquired image samples are images of container bodies, and that the surface of a container body is uneven, resulting in significant differences in brightness across the images taken under illumination, this embodiment of the application performs grayscale averaging based on the grayscale values ​​of the image samples to ensure that the captured image samples have uniform brightness, facilitating subsequent training processing.

[0074] As one possible implementation, histogram equalization is performed on each of the M carriage image samples to make the brightness of the image samples more concentrated, which facilitates subsequent learning processing.

[0075] In some embodiments, considering that the corresponding container may be in motion on the vehicle when the image sample of the carriage is captured, the corresponding number will be displayed in a tilted state in the image sample due to the movement of the container.

[0076] Therefore, in this embodiment, the tilted numbers in the image sample are corrected by projection transformation based on the image, so that all the numbers in the image sample are in a vertical state, which facilitates subsequent learning processing.

[0077] As one possible implementation, the Radon transform is used to correct the tilt of each of the M carriage image samples after histogram equalization, so that the numbers in the image samples are all vertical.

[0078] Step 102: For each of the M carriage image samples, calculate the sum of the brightness of each of the three primary colors contained in each carriage image sample.

[0079] Step 103: Determine a first threshold based on the difference between the maximum brightness sum and any brightness sum among the remaining brightness sums, and determine a corresponding second threshold based on each brightness sum among the remaining brightness sums.

[0080] Step 104: Binarize each carriage image sample based on the first threshold to obtain a first binarized image, and binarize each carriage image sample based on the second threshold to obtain a second binarized image.

[0081] Step 105: Perform fusion processing on the first binarized image and the second binarized image to obtain M fused image samples.

[0082] In this embodiment, all pixels in the acquired carriage image sample are composed of three primary colors: red, blue, and green. Therefore, the sum of the brightness of each primary color in each carriage image sample can be calculated. The color corresponding to the largest sum of brightness among the three primary colors can be considered the background color of the carriage in the current image sample. The difference between the sum of brightness of the background color and the sum of brightness of any of the remaining two colors is determined as a first threshold. The sum of brightness of each of the remaining two colors is used to determine a second threshold. Based on the first threshold, the corresponding image sample can be binarized to obtain a first binarized image. Based on the second threshold, the corresponding image sample can be binarized to obtain a second binarized image. The first binarized image is ANDed with two second binarized images to obtain a corresponding fused image sample. In this fused image, the grayscale value of the number portion is adjusted to 255 (white), and the grayscale value of the remaining portion is adjusted to 0 (black), which is beneficial for the subsequent training and learning of the localization model for the portion containing the number.

[0083] For example: the first threshold is 124, and the second thresholds are 110 and 133 respectively. Therefore, in the first binarized image obtained based on the first threshold, pixels with gray values ​​less than or equal to the first threshold of 124 are all adjusted to a gray value of 0, and pixels with gray values ​​greater than the first threshold of 124 are all adjusted to a gray value of 255. In the second binarized image obtained based on the second threshold, pixels with gray values ​​less than or equal to the second threshold of 110 are all adjusted to a gray value of 0, and pixels with gray values ​​greater than the second threshold of 110 are all adjusted to a gray value of 255. In the second binarized image obtained based on the second threshold, pixels with gray values ​​less than or equal to the second threshold of 133 are all adjusted to a gray value of 0, and pixels with gray values ​​greater than the second threshold of 133 are all adjusted to a gray value of 255. The three binarized images are fused together. In the final fused image, the gray values ​​of pixels with a gray value less than or equal to 133 are adjusted to 0, and the gray values ​​of pixels with a gray value greater than 133 are adjusted to 255, resulting in a black and white fused image sample.

[0084] Step 106: Train the initial text localization model using M fused image samples as training samples to obtain the target text localization model.

[0085] In this embodiment of the application, the fused image sample after binarization is input into the initial text localization model for training to obtain the target text localization model.

[0086] In some embodiments, the fused image samples used for training are all of the same scale, resulting in a localization model that is less adaptable to images of different scales. Therefore, in this embodiment, fused training samples of different scales are used to train the model, so that the trained text localization model can have good localization accuracy at different scales.

[0087] As one possible implementation, the M fused image samples can be divided into N groups according to their quantity, and the N groups of fused image samples can be set to different scales. The initial text localization model can be trained based on the N groups of fused image samples at different scales to obtain a target text localization model that meets the localization requirements of multi-scale container numbers.

[0088] For example, the height of N sets of fused image samples can be a random value in the range [480, 920], corresponding to a random value with a length less than 1200. By training with samples of different scales, the accuracy of the text localization model for images of different scales can be improved. The random height value can be 480, 600, 750, 800, 850 or 920, without any special restrictions.

[0089] The following details how to obtain a target text localization model based on joint training. The initial text localization model includes a feature extraction layer, a region candidate network layer, a pooling layer, an adversarial network layer, and a classification and regression layer. Please refer to [link to documentation]. Figure 2 The training process is described as follows:

[0090] Step 201: Input N sets of fused image samples into the feature extraction layer to obtain the feature vector corresponding to each fused image sample in the N sets of fused image samples.

[0091] In this embodiment, N sets of fused image samples are input into the feature extraction layer. The feature extraction layer uses a depthwise separable network, which can reduce the computational parameters of the network and thus improve the localization efficiency of the text localization model.

[0092] Step 202: Input the feature vector corresponding to each fused image sample into the region candidate network layer, and output the predicted localization region corresponding to each fused image sample.

[0093] Step 203: Input the feature vector corresponding to each fused image sample and the predicted localization region corresponding to each fused image sample into the pooling layer, and output the region feature map corresponding to each fused image sample.

[0094] Step 204: Input the region feature map corresponding to each fused image sample into the adversarial network layer, perform affine transformation, and output the target feature map corresponding to each fused image sample.

[0095] Step 205: Input the target feature map corresponding to each fused image sample into the classification and regression layer, and output the predicted position value of the target text contained in each fused image sample.

[0096] Step 206: Based on the baseline loss function between the predicted position value of the target text contained in each fused image sample and the labeled position value of the target text contained in the corresponding image sample, train the feature extraction layer, region candidate network layer, pooling layer, adversarial network layer, and classification and regression layer.

[0097] In this embodiment, the target text position prediction value and the corresponding target text position annotation value of each fused image sample can be used to train the sample until the target text position prediction value and the target text position annotation value meet the preset requirements. The target text position prediction value can be the cross-entropy loss function or the mean squared error loss function. No special restrictions are imposed here.

[0098] Step 207: Determine whether the benchmark loss function meets the preset requirements.

[0099] In this embodiment, when the baseline loss function meets the preset requirements, the initial text localization model is considered to have high performance and meets the usage requirements. For example, a standard threshold can be set, and when the value of the joint loss function is less than the standard threshold, it is considered to meet the preset requirements.

[0100] Step 208: If the baseline loss function meets the preset requirements, determine the optimal parameters for the feature extraction layer, region candidate network layer, pooling layer, adversarial network layer, and classification and regression layer.

[0101] Step 209: Obtain the target text localization model based on the initial localization model and the optimal parameters.

[0102] In this embodiment, by optimizing the baseline loss function to meet the preset requirements, the initial text localization model obtained by the parameters of each network layer in the current model has a high accuracy in predicting the position of the fused image samples, thereby obtaining a high-performance target text localization model.

[0103] Please see Figure 3 Based on the same inventive concept, this application provides a number identification method, the process of which is described as follows:

[0104] Step 301: Obtain the image sample of the carriage to be identified.

[0105] Step 302: Calculate the brightness of each primary color in the three primary colors contained in the image sample of the carriage to be identified.

[0106] Step 303: Determine a first threshold based on the difference between the maximum brightness sum and any brightness sum among the remaining brightness sums, and determine a corresponding second threshold based on each brightness sum among the remaining brightness sums.

[0107] Step 304: Binarize the image sample of the carriage to be identified based on the first threshold to obtain the first binarized image, and binarize the image sample of the carriage to be identified based on the second threshold to obtain the second binarized image.

[0108] Step 305: Perform fusion processing on the first binarized image and the second binarized image to obtain the fused image sample to be identified.

[0109] Step 306: Input the fused image sample to be identified into the target localization model to obtain the predicted value of the target text position corresponding to the fused image to be identified.

[0110] Step 307: Input the predicted value of the target text position into the target recognition model to obtain the number recognition result corresponding to the fused image to be recognized.

[0111] Please see Figure 4 Based on the same inventive concept, embodiments of this application also provide a text positioning model training device, which includes at least one processor 401. The processor 401 is used to execute a computer program stored in a memory to implement the functions provided in embodiments of this application. Figure 1 The diagram shows the steps of the text localization model training method.

[0112] Optionally, the processor 401 may be a central processing unit, a specific ASIC, or one or more integrated circuits used to control program execution.

[0113] Optionally, the device may further include a memory 402 connected to at least one processor 401. The memory 402 may include ROM, RAM, and disk storage. The memory 402 stores data required for the processor 401 to run, i.e., it stores instructions executable by at least one processor 401. The at least one processor 401 executes instructions stored in the memory 402 to perform tasks such as... Figure 1 The method is shown. The number of storage media 402 is one or more.

[0114] Please see Figure 5 Based on the same inventive concept, embodiments of this application also provide a number identification device, which includes:

[0115] Communicator 501 is used to receive image samples of the carriage to be identified:

[0116] The processor 502, coupled to the communicator 501, is used to: calculate the brightness of each primary color among the three primary colors contained in the image sample of the carriage to be identified;

[0117] A first threshold is determined based on the difference between the maximum sum of brightness and any sum of brightness among the remaining sums of brightness, and a corresponding second threshold is determined based on each sum of brightness among the remaining sums of brightness.

[0118] The image sample of the carriage to be identified is binarized based on a first threshold to obtain a first binarized image, and the image sample of the carriage to be identified is binarized based on a second threshold to obtain a second binarized image.

[0119] The first binarized image and the second binarized image are fused to obtain a fused image sample to be identified;

[0120] The fused image sample to be identified is input into the target localization model to obtain the predicted value of the target text position corresponding to the fused image to be identified;

[0121] The predicted value of the target text position is input into the target recognition model to obtain the number recognition result corresponding to the fused image to be recognized.

[0122] The above are merely preferred embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification shall be included within the scope of protection of this specification.

Claims

1. A method for training a text localization model, characterized in that, The method comprises: obtaining M carriage image samples containing carriage numbers, M being a positive integer not less than 1; for each of the M carriage image samples, calculating the brightness sum of each primary color in the three primary colors contained in each carriage image sample; determining a first threshold value based on the difference between the maximum brightness sum and any of the remaining brightness sums, the maximum brightness sum being the brightness sum of the carriage background color of the carriage image sample, and determining a corresponding second threshold value based on each of the remaining brightness sums; based on the first threshold value, performing binaryzation processing on each of the carriage image samples to obtain a first binaryzation image, and based on the second threshold value, performing binaryzation processing on each of the carriage image samples to obtain a corresponding second binaryzation image; performing fusion processing on the first binaryzation image and two second binaryzation images generated based on each carriage image sample to obtain M fusion image samples; training an initial text positioning model based on the M fusion image samples as training samples to obtain a target text positioning model.

2. The method of claim 1, wherein, Before calculating the brightness sum of each primary color in the three primary colors contained in each carriage image sample for each of the M carriage image samples, the method comprises: performing histogram equalization processing on each of the M carriage image samples.

3. The method of claim 2, wherein, After performing histogram equalization processing on each of the M carriage image samples, the method comprises: performing tilt correction on each of the M carriage image samples after histogram equalization processing using Radon transformation.

4. The method of claim 1, wherein, Before training an initial text positioning model based on the M fusion image samples as training samples to obtain a target text positioning model, the method comprises: dividing the M fusion image samples into N groups in equal quantities, N being a positive integer not greater than M; setting the N groups of fusion image samples as different scales; training an initial text positioning model based on the M fusion image samples as training samples to obtain a target text positioning model comprises: training the initial text positioning model based on the N groups of fusion image samples of different scales as training samples to obtain the target text positioning model.

5. The method of claim 4, wherein, The initial text positioning model comprises a feature extraction layer, a region candidate network layer, a pooling layer, an adversarial network layer, and a classification regression layer, and training the initial text positioning model based on the N groups of fusion image samples of different scales as training samples to obtain the target text positioning model comprises: inputting the N groups of fusion image samples into the feature extraction layer to obtain the feature vector corresponding to each fusion image sample in the N groups of fusion image samples; inputting the feature vector corresponding to each fusion image sample into the region candidate network layer to output the predicted positioning region corresponding to each fusion image sample; inputting the feature vector corresponding to each fusion image sample and the predicted positioning region corresponding to each fusion image sample into the pooling layer to output the region feature map corresponding to each fusion image sample; Input the region feature map corresponding to each fusion image sample into the adversarial network layer, perform affine transformation, and output the target feature map corresponding to each fusion image sample; Input the target feature map corresponding to each fusion image sample into the classification regression layer, and output the position prediction value of the target text contained in each fusion image sample; Train the feature extraction layer, the region candidate network layer, the pooling layer, the adversarial network layer, and the classification regression layer based on the benchmark loss function between the position prediction value of the target text contained in each fusion image sample and the position annotation value of the target text contained in the image sample; Determine whether the benchmark loss function meets the preset requirement; If the benchmark loss function meets the preset requirement, determine the optimal parameters corresponding to the feature extraction layer, the region candidate network layer, the pooling layer, the adversarial network layer, and the classification regression layer; Obtain the target text positioning model according to the initial text positioning model and the optimal parameters.

6. The method of claim 4, wherein, The height of each group of fusion image samples in the N groups of fusion image samples is a random value in [480, 920], and the length is a random value less than 1200.

7. The method of claim 5, wherein, The feature extraction layer is a depth separable network.

8. A character positioning model training apparatus, comprising: The device includes a processor and a storage medium, the storage medium includes readable instructions for being executed by the processor to perform the text positioning model training method of any one of claims 1-7.

9. A method of identifying a number, characterized by The method includes: Obtaining a to-be-recognized carriage image sample; Calculating the brightness sum of each primary color in the three primary colors contained in the to-be-recognized carriage image sample; Determining a first threshold value based on the difference between the maximum brightness sum and any brightness sum in the remaining brightness sums, and determining a corresponding second threshold value based on each brightness sum in the remaining brightness sums, the maximum brightness sum being the brightness sum of the carriage background color of the carriage image sample; Performing binarization processing on the to-be-recognized carriage image sample based on the first threshold value to obtain a first binarization image, and performing binarization processing on the to-be-recognized carriage image sample based on the second threshold value to obtain a corresponding second binarization image; Performing fusion processing on the first binarization image and the two second binarization images generated based on each carriage image sample to obtain a to-be-recognized fusion image sample; Inputting the to-be-recognized fusion image sample into a target positioning model to obtain a target text position prediction value corresponding to the to-be-recognized fusion image sample; Inputting the target text position prediction value into a target recognition model to obtain a number recognition result corresponding to the to-be-recognized fusion image.

10. A number recognition apparatus, characterized by comprising: The device includes: A communicator configured to receive a to-be-recognized carriage image sample; A processor coupled to the communicator and configured to calculate the brightness sum of each primary color in the three primary colors contained in the to-be-recognized carriage image sample for the to-be-recognized carriage image sample; determining a first threshold value based on a difference between a maximum brightness sum of the brightness sums and any one of the remaining brightness sums, and determining a corresponding second threshold value based on each of the remaining brightness sums, the maximum brightness sum being a brightness sum of a cabin background color of the cabin image sample; performing binarization processing on the to-be-recognized cabin image sample based on the first threshold value to obtain a first binarization image, and performing binarization processing on the to-be-recognized cabin image sample based on the second threshold value to obtain a corresponding second binarization image; performing fusion processing on the first binarization image and the two second binarization images generated based on each cabin image sample to obtain a to-be-recognized fusion image sample; inputting the to-be-recognized fusion image sample into a target positioning model to obtain a target character position prediction value corresponding to the to-be-recognized fusion image; inputting the target character position prediction value into a target recognition model to obtain a number recognition result corresponding to the to-be-recognized fusion image.

Citation Information

Patent Citations

  • Method and device for identifying batch codes of container to be detected

    CN111626982A

  • Rapid identification method for container and flat car loading combination identification

    CN114187583A