A Text Detection Method for Industrial Cargo Containers in a Lightweight Mobile State
Through the combination of Ghost-ResNet backbone network, bilinear eigenvector fusion module and DB semantic segmentation detection head, the speed and accuracy of industrial cargo box text detection in mobile states in factory environment are solved, and efficient text detection is achieved.
Patent Information
- Application Number
- CN202210381339.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-04-12
AI Technical Summary
In a factory environment, text detection faces challenges such as complex backgrounds, irregular text, text distortion and image quality uncertainty, making it difficult for the prior art to achieve fast and high-precision industrial cargo box text detection in a mobile state.
A lightweight text detection model based on Ghost-ResNet backbone network, bilinear eigenvector fusion module, feature pyramid enhancement and DB semantic segmentation detection head is adopted, and combined with an adaptive threshold segmentation algorithm, the detection speed and accuracy are improved.
High-precision and real-time industrial cargo box text detection is achieved in complex factory environments, improving transportation accuracy and laying the foundation for subsequent text recognition technology.
Smart Images

Figure CN114648755B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of scene text detection, and relates to a text detection method for industrial cargo boxes in a lightweight mobile state, which is used for quickly and accurately identifying and detecting the production and manufacturing process. A video stream is captured through sensors such as cameras, pictures are intercepted from the video stream, and then processed by a neural network to locate the area where the text is located in the picture. Background Art
[0002] With the rapid development of artificial intelligence technology, concepts such as intelligent manufacturing and the Internet of Things have been proposed one after another. In today's manufacturing factories, many production technologies have also shifted from manual labor to large-scale automation, and manual labor only needs to be responsible for operating the machines to complete the tasks. However, many production applications often rely on the technical support of text detection and recognition, such as truck license plate detection, cargo box text detection, etc.
[0003] Traditional text detection and recognition technologies first process image or video data, detect and mark the specific positions of the text in the image or video, and finally extract the text content for recognition. Different from traditional text detection technologies, text detection and recognition in a factory environment usually face the following challenges: First, the background of the factory environment is complex and the carriers of the text are diverse. The text can appear in various backgrounds, such as cargo boxes, signs, walls, etc. These factors bring great interference to the text detection and recognition process. Second, the text in the factory environment is irregular text, and it is easy to appear distorted, incomplete, and with different orientations. Third, the quality of factory environment images is uncertain. Even if the characters in the picture have similar appearances, a slight change in pixels will cause errors in text recognition. Therefore, text detection and recognition in a factory environment has become a challenging task.
[0004] The text detection and recognition task can be decomposed into a text detection task and a text recognition task. In a factory environment, since some scenes are in a fast-moving state, the text detection needs to reach a certain speed in order to be displayed smoothly. And for text recognition, more attention is paid to accuracy. Low-accuracy text recognition is likely to convey incorrect information and cause misunderstandings. Therefore, we need a sufficiently high accuracy for the text in the image to obtain the semantics it expresses. In recent years' research, thanks to the great achievements of deep learning in research fields such as object detection, text detection has also made great progress. At the same time, the emergence of lightweight networks has promoted a significant increase in the speed of text detection.
[0005] Under the above background conditions, applying text detection and recognition technology to industrial cargo box transportation has important significance, which is used to detect the existence of cargo box numbers in a complex environment, determine whether the cargo box is marked with a number, and improve the accuracy of transportation. And it lays a solid foundation for the next text recognition technology. Summary of the Invention
[0006] The first object of the present invention is to provide a text detection method for industrial cargo boxes in a lightweight moving state in view of the deficiencies of the prior art.
[0007] A text detection method for industrial cargo boxes in a lightweight moving state according to the present invention includes the following steps:
[0008] Step (1): For the image of the cargo box identification plate of the cargo box being carried in a moving state in the production and manufacturing process;
[0009] Step (2): Use the industrial cargo box text detection model based on bilinear feature vector fusion to detect the position of the text information on the cargo box identification plate for the above-mentioned cargo box identification plate image;
[0010] The industrial cargo box text detection model based on bilinear feature vector fusion includes a Ghost-ResNet backbone network, a bilinear feature vector fusion module, a feature pyramid enhancement and feature fusion module, and a DB semantic segmentation detection head;
[0011] This model first uses ResNet18 as the backbone network and replaces the basic residual blocks of ResNet18 with improved Ghost modules. Secondly, a two-branch structure is adopted. The first branch uses a feature pyramid enhancement module to extract high-level and low-level information of the image. The second branch uses the bilinear feature fusion vector module proposed in this paper to fuse feature vectors of different scales, enhancing the ability to express text features with variable scales. Then, the feature fusion module cascades all feature vectors. Finally, a DB semantic segmentation detection head is used to obtain the final result, where the loss functions DiceLoss and MaskLoss are modified. At the same time, an adaptive threshold segmentation algorithm is used to replace the fixed threshold in the inference stage, which can better adapt to the light changes in the factory environment.
[0012] (1) Ghost-ResNet backbone network
[0013] The Ghost-ResNet backbone network uses the existing ResNet network as the basic framework, replaces each basic residual block of the existing ResNet network with an improved Ghost module, and then adds a convolutional layer after the fully connected layer to finally obtain a feature map with equal channels; ms
[0014] The improved Ghost module embeds a feature enhancement layer Squeeze-and-Excitation into the existing Ghost module to recalibrate the features after the first part of the convolution in the existing Ghost module. That is, the feature map α is obtained through the first part of the convolution, and then the feature map α is subjected to Squeeze-and-Excitation feature enhancement, linear operation, and the second part of the convolution to obtain the feature map β. Finally, the feature map α and the feature map β are concatenated to obtain the final result, which improves the weight of important features and ensures the precision and real-time performance of the text detection network.
[0015] Preferably, the ResNet network uses ResNet18, which has good performance in feature extraction and small network computational complexity. Deep convolutional neural networks usually consist of a large number of convolutional operations, which require a large amount of computational power. Most methods use pointwise convolution to process cross-channel features and then depth convolution to process spatial information to reduce the network's computational complexity. Ordinary convolution operations will generate a large amount of redundant information.
[0016] (2) Bilinear Feature Vector Fusion Module
[0017] The factory environment is complex, and there is a large amount of text with different scales under different perspectives. Therefore, in order to fuse text features of different scales and enhance the expression ability of text features with variable scales, most object detections choose the attention fusion mechanism. However, the computational complexity of the attention fusion mechanism is generally large. To improve the detection speed, the present invention makes further improvements on the basis of the attention mechanism, that is, the bilinear feature vector fusion module.
[0018] The bilinear feature vector fusion module includes a pooling layer and a feature vector fusion module connected in series in sequence. The bilinear feature fusion vector module fuses feature vectors of different scales to enhance the expression ability of text features with variable scales.
[0019] The pooling layer is used to receive several feature maps with equal number of channels output by the Ghost-ResNet backbone network, and then unify the sizes of all feature maps. Each feature map includes m feature vectors.
[0020] The feature vector fusion module uses an improved LSTM network improved for the current factory environment, which abandons the long-term memory in the existing LSTM and only retains the short-term memory to improve the detection efficiency, and is used to fuse all the feature maps output by the pooling layer.
[0021] The specific operation of the improved LSTM network is as follows:
[0022]
[0023] F t = Conv([h t-1 , x t )
[0024] i t = σ(W i × [h t-1 , x t + b i )
[0025] C t = tanh(W C × [h t-1 , x t + b C )
[0026] where Conv is the convolutional layer, C t is the tanh function, σ is the sigmoid function, h t is the output of the improved LSTM network for the t-th feature vector x t in a certain feature map, W i , b i are the weight and bias of the sigmoid function respectively, W C , b C are the weight and bias of the sigmoid function respectively, m is the number of feature vectors, [h t-1 , x t represents the concatenation of h t-1 and x t ;
[0027] (2) Feature Pyramid Enhancement and Feature Fusion Module
[0028] The feature pyramid enhancement and feature fusion module includes a feature pyramid enhancement layer (FPEM) and a feature fusion layer (FFM) cascaded in sequence;
[0029] The feature pyramid enhancement layer (FPEM) receives the feature maps output by the Ghost-ResNet backbone network for cascading, generating different levels of features F 1 , F 2 … F m , and sends them to the feature fusion layer (FFM); achieving the fusion of semantic information of high and low levels and improving the accuracy of the network in detecting targets of different scales.
[0030] The feature fusion layer (FFM) receives the output of the bilinear feature vector fusion module and uses the upsampling operation to expand the feature vector into a feature map F with 128 channels and a size of the original Figure 1 / 4; then the feature F generated by the feature pyramid enhancement layer (FPEM)1 , F 2 …F m Perform hierarchical fusion, and then splice it with the feature map F to obtain a final feature map with 5×128 channels and a size of the original Figure 1 / 4;
[0031] The Feature Pyramid Enhancement Model (FPEM) can enhance features at different scales by fusing low-level and high-level information, and FPEM is a cascaded module. As the number of cascaded layers increases, features at different scales will be more fully fused, and the receptive field of the feature map will also increase. In addition, since FPEM is constructed by decomposable convolution, its computational cost is very small, only about 1 / 5 of FPN.
[0032] (4), DB semantic segmentation detection head
[0033] The DB semantic segmentation detection head is used to process the feature map output by the feature pyramid enhancement and feature fusion module to obtain the confidence, size, and position of the bounding box;
[0034] The DB semantic segmentation detection head includes a convolutional layer, an adaptive threshold DB algorithm layer, an intersection operation layer, and a dilation layer;
[0035] The convolutional layer obtains a probability map based on the feature map output by the feature pyramid enhancement and feature fusion module;
[0036] The adaptive threshold DB algorithm layer replaces the fixed threshold in the existing DB algorithm with an adaptive threshold;
[0037] In the inference stage, the adaptive threshold DB algorithm layer performs the following formula adaptive threshold calculation on the probability map by setting a nine-grid mask to obtain a threshold map;
[0038]
[0039]
[0040] where x and y are the coordinates in the probability map, f x,y is the pixel value at the coordinate (x, y), c is the threshold obtained by the adaptive threshold algorithm, p x+i,y+j is the pixel value at the coordinate (x + i, y + j) of the probability map, f' x,y is the pixel at the coordinate (x, y) in the threshold map;
[0041] The intersection operation layer performs an intersection operation on the probability map and the threshold map to obtain the bounding box;
[0042] The dilation layer dilates the bounding box with a dilation multiple of D'=(A'×r') / L', where A' is the area of the bounding box, L' is the perimeter of the bounding box, and r' is the dilation coefficient, which is set to 1.8;
[0043] The second object of the present invention is to provide a text detection system for industrial cargo boxes in a lightweight mobile state, including:
[0044] A cargo box identification sign image acquisition module that acquires the image of the cargo box identification sign of the moving cargo box in the production and manufacturing process;
[0045] A text detection module that uses the trained industrial cargo box text detection model based on bilinear feature vector fusion to identify the position of the text information on the cargo box identification sign from the cargo box identification sign image.
[0046] The third object of the present invention is to provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer is made to execute the method described above.
[0047] The fourth object of the present invention is to provide a computing device, including a memory and a processor. An executable code is stored in the memory, and when the processor executes the executable code, the method described above is implemented.
[0048] The beneficial effects of the present invention are as follows:
[0049] In order to train a new lightweight network framework and evaluate its advantages, the present invention creates a cargo box text dataset in a complex factory environment, which contains different types of cargo boxes and texts with different perspectives and shapes. Experiments show that in the actual factory environment, the new lightweight network framework RGFFD proposed by the present invention is superior to other network frameworks in terms of real-time performance and accuracy for the text on the cargo box.
[0050] The present invention proposes a new lightweight network architecture to solve the text detection of mobile devices in actual industrial scenarios and achieves considerable accuracy. A cargo box text dataset is made to train and evaluate the model, and finally it is deployed online. On the custom dataset, the model of the present invention exceeds the mainstream text detection methods in terms of recognition accuracy and generalization ability.
[0051] The present invention introduces an improved Ghost module, which has less network computation; the present invention adopts a bilinear feature vector fusion module, which only needs to go through simple linear operations to complete the fusion of feature vectors of different scales. Therefore, without affecting real-time performance, the detection accuracy of the network is increased; the present invention adopts the DB algorithm in the detection head, using a dynamic adaptive threshold instead of a fixed threshold, which can better gather the surrounding environmental features to improve the detection accuracy. Description of the Drawings
[0052] Figure 1 It is an architecture diagram of an industrial cargo box text detection model based on bilinear feature vector fusion;
[0053] Figure 2 It is an improved diagram of the Ghost module;
[0054] Figure 3 It is a structure diagram of Squeeze-and-Excitation;
[0055] Figure 4 It is a detailed diagram of the feature fusion module;
[0056] Figure 5 It is a detailed diagram of FFM;
[0057] Figure 6 It is a diagram of the DB algorithm. Specific implementation manner
[0058] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0059] A text detection method for industrial cargo boxes in a lightweight mobile state, characterized by including the following steps:
[0060] Step (1), for the image of the cargo box identification plate of the cargo box being carried in the mobile state in the production and manufacturing process;
[0061] Step (2), using an industrial cargo box text detection model based on bilinear feature vector fusion to detect the position of the text information on the cargo box identification plate for the above-mentioned cargo box identification plate image;
[0062] Such as Figure 1 The industrial cargo box text detection model based on bilinear feature vector fusion includes a Ghost-ResNet backbone network, a bilinear feature vector fusion module, a feature pyramid enhancement and feature fusion module, and a DB semantic segmentation detection head;
[0063] 1) Ghost-ResNet backbone network:
[0064] First, all the basic residual blocks in ResNet18 are replaced with improved Ghost modules, as shown in the backbone network of the appendix Figure 1 Finally, the output result of the network is subjected to 1×1 convolution to obtain a feature map with equal channels for all. Appendix Figure 2An improved method for the Ghost module is presented. This method first obtains the feature map α through partial convolution, then performs Squeeze-and-Excitation feature enhancement, linear operation, and partial convolution on the feature map α to obtain the feature map β. Finally, the feature map α and the feature map β are concatenated to obtain the final result. This method requires less network computation during feature enhancement. The partial convolution operation of the Ghost module only generates a feature map with a channel number of N / 2. Therefore, feature enhancement only needs to be performed on half of the feature maps. In a high-speed motion environment, the network needs to detect images at a rate of more than 20fps to clearly display the images. So this method can reduce the network computation and improve the network detection rate.
[0065] As shown in the Figure 3 appendix, the Squeeze-and-Excitation module adopts a feature recalibration strategy, automatically obtaining the importance of each feature channel through learning, and enhancing key features and suppressing non-key features according to the importance. There are three key technical parts: Squeeze, Excitation, and Reweight.
[0066] The Squeeze operation compresses features through the spatial dimension. Using global average pooling, each two-dimensional feature channel is transformed into a real number, and the output dimension is the same as the number of input feature channels. Its calculation formula is:
[0067]
[0068] where H and W represent the height and width of the feature map respectively, and u c (i,j) is the feature value at the coordinate (i,j) in each channel of the feature map.
[0069] The Excitation operation introduces the gate mechanism in the recurrent neural network. It forms a Bottleneck structure through two fully connected operations to model the correlation between channels. The first fully connected layer reduces the feature dimension to 1 / 16 of the input, and then after ReLu activation, it is restored to the original dimension through another fully connected layer. This operation can greatly reduce the number of parameters and the amount of computation. Its calculation formula is:
[0070] s c = F ex (z c , W) = σ(g(z c , W)) = σ(W2δ(W1z c ))
[0071] where z cThe output of Squeeze, W1 and W2 are weights, and δ is the ReLu operation.
[0072] The Reweight operation regards the weights of the output of Excitation as the importance of each feature channel after feature selection, and weights the previous features channel by channel through multiplication to complete the recalibration of the original features. The formula is:
[0073]
[0074] where u s is a channel in the feature map, and s c is the weight of the output of Excitation. Then, the network short - circuit operation of the residual module is performed.
[0075] 2) Bilinear Feature Vector Fusion Module:
[0076] The core component of the feature vector fusion module is the LSTM network. LSTM was first applied to text recognition and effectively solved the problem of long - term and short - term memory, as shown in the appendix Figure 4 . This module discards long - term memory. The feature maps output by the backbone network are sequentially divided into m feature vectors. The feature vectors and the output of the previous cycle are sequentially concatenated as inputs and input into the feature vector fusion module at different levels. Among them, the tanh network creates a vector C t that can be stored, and the sigmoid network layer outputs a value i t between 0 and 1 for each value in this vector, determining which state values to store. Finally, fusion is performed through simple pixel - by - pixel multiplication, and the final result is added pixel - by - pixel to the input vector passing through the convolutional layer to obtain the result. Through training, the output corresponding to the last feature vector can store all the important information of the feature vectors.
[0077] The bilinear feature vector fusion module is formulated as:
[0078]
[0079] F t = Conv([h t-1 , x t ),
[0080] i t = σ(W i ×[h t-1 , x t +b i ),
[0081] C t = tanh(W C ×[ht-1 , x t + b C )
[0082] Among them, Conv is the convolutional layer, C t is the tanh function, σ is the sigmoid function, h t is the output of this module, x t is the t-th feature vector, W i , W C , b i , b C are weights, and m is the number of feature vectors.
[0083] 3) Feature Pyramid and Feature Fusion Module:
[0084] Appendix Figure 5 shows the details of the Feature Pyramid Enhancement (FPEM) and Feature Fusion Module (FFM). First, the feature maps output by the backbone network are fed into the FPEM for cascading to generate different levels of features F 1 , F 2 … F m . Then, the output of the bilinear feature vector fusion module is upsampled to expand the number of channels of the feature vector to a feature map F with 128 channels and a size of the original Figure 1 / 4. Then, the features F 1 , F 2 … F m are fused layer by layer. Finally, the fused features are concatenated with the feature map F to obtain the final feature map with 5×128 channels and a size of the original Figure 1 / 4.
[0085] 4) DB Semantic Segmentation Detection Head:
[0086] In the inference stage, as shown in Appendix Figure 6 , this paper uses an adaptive threshold to replace the fixed threshold to obtain the threshold map. There are three steps to obtain the final text box: 1) The detection head inputs the probability map, whose value range is [0, 1]. DBNet sets a constant threshold (0.2) to obtain the threshold map. Instead of setting a fixed threshold to obtain the threshold map, this paper calculates the adaptive threshold of the probability map by setting a nine-grid mask. The adaptive threshold calculation formula is:
[0087]
[0088]
[0089] where x and y are the coordinates in the image, f x,y is the pixel value at the coordinate (x, y), c is the threshold obtained by the adaptive threshold algorithm, p x+i,y+jis the pixel value of the original image at coordinates (x + i, y + j), f' y,y is the threshold at coordinates (x, y). 2) Obtain the connected regions from the probability map and the threshold map; 3) Expand the text region, perform dilation, and the expansion multiple is D’=(A'×r') / L', where A' is the area of the bounding box, L' is the perimeter of the bounding box, and r' is the expansion coefficient, which is set to 1.8.
[0090] In the training stage, the probability map and the threshold map are used to obtain an additional binary map through a binarization operation. Among them, the area with a value of 1 represents the region with text, and the rest have a value of 0. The standard binarization operation:
[0091]
[0092] where B is the binary map, P is the probability map, T is the threshold map, and (i, j) are the corresponding coordinates in the map.
[0093] The total loss function L can be expressed as the weighted sum of the loss of the probability map, the loss of the binary map, and the loss of the threshold map:
[0094] L = L s + α×L b + β×L t
[0095] where L S is the loss value of the probability map, L b is the loss value of the binary map, and L t is the loss of the threshold map. Among them, α and β are hyperparameters, which are set to 5 and 10 respectively. Among them, L S and L b are respectively trained using the DiceLoss loss function.
[0096] DiceLoss is often used in medical image segmentation, and its purpose is to solve the problem of too small foreground ratio. Its calculation formula is:
[0097]
[0098] where pred is the predicted value, gt is the ground-truth, and the characteristic of the DiceLoss loss function is that it has a fast convergence speed and the convergence speed is better than classification loss functions such as cross-entropy. L t uses the Mask L1 Loss loss function for training, and calculates the L t loss function through a mask. Its calculation formula is:
[0099]
[0100] where L tThe loss is the mean absolute difference, and then a mask is added to perform L on the area specified by the mask. t Calculation of the loss function, where n is the total number of areas in the dilated image region that need to be calculated under the mask. Absolute value It is the distance difference between the predicted text box and the ground-truth.
Claims
1. A text detection method for industrial cargo boxes in a lightweight mobile state, characterized in that It includes the following steps: Step (1): Obtain the image of the container identification plate of the container being carried in a moving state during the production and manufacturing process; Step (2): Use an industrial container text detection model based on bilinear feature vector fusion to detect the position of the text information on the container identification plate in the above container identification plate image; The industrial container text detection model based on bilinear feature vector fusion includes a Ghost-ResNet backbone network, a bilinear feature vector fusion module, a feature pyramid enhancement and feature fusion module, and a DB semantic segmentation detection head; The Ghost-ResNet backbone network uses the existing ResNet network as the basic framework, replaces each basic residual block of the existing ResNet network with an improved Ghost module, and then adds a convolutional layer after the fully connected layer to finally obtain a feature map with equal channels; The improved Ghost module embeds a feature enhancement layer Squeeze-and-Excitation in the existing Ghost module to realize the recalibration of the features after the first part of the convolution in the existing Ghost module, that is, obtain the feature map α through the first part of the convolution, then perform Squeeze-and-Excitation feature enhancement, linear operation, and the second part of the convolution on the feature map α to obtain the feature map β, and finally splice the feature map α and the feature map β to obtain the final result; The bilinear feature vector fusion module includes a stratified pooling layer and a feature vector fusion module cascaded in sequence; The stratified pooling layer is used to receive several feature maps with equal channels output by the Ghost-ResNet backbone network and then unify the sizes of all feature maps; each feature map includes m feature vectors; The feature vector fusion module uses an improved LSTM network improved for the current factory environment, abandons the long-term memory in the existing LSTM, and only retains the short-term memory to improve the detection efficiency, and is used to fuse all the feature maps output by the stratified pooling layer; The specific operation of the improved LSTM network is as follows: F t = Conv([h t-1 , x t ) i t = σ(W i × [h t-1 , x t + b i ) C t = tanh(W C × [h t-1 , x t + b C ) where Conv is the convolution operation, C t is the tanh function, σ is the sigmoid function, h t is the output of the improved LSTM network for the t-th feature vector x t in a certain feature map, W i , b i are the weight and bias of the sigmoid function respectively, W C , b C are the weight and bias of the sigmoid function respectively, m is the number of feature vectors, [h t-1 , x t represents the concatenation of h t-1 and x t ; The feature pyramid enhancement and feature fusion module includes a feature pyramid enhancement layer FPEM and a feature fusion layer FFM cascaded in sequence; The feature pyramid enhancement layer FPEM receives and cascades the feature maps output by the Ghost-ResNet backbone network to generate features F at different levels 1 , F 2 … F m , and sends them to the feature fusion layer FFM; The feature fusion layer FFM receives the output of the bilinear feature vector fusion module, and uses the upsampling operation to expand the feature vector into a feature map F with 128 channels and a size of 1 / 4 of the original image; then the feature F 1 , F 2 … F m is fused layer by layer, and then concatenated with the feature map F to obtain a final feature map with 5×128 channels and a size of 1 / 4 of the original image; The DB semantic segmentation detection head is used to process the feature map output by the feature pyramid enhancement and feature fusion module to obtain a bounding box; The DB semantic segmentation detection head includes a convolutional layer, an adaptive threshold DB algorithm layer, an intersection operation layer, and a dilation layer; The convolutional layer obtains a probability map according to the feature map output by the feature pyramid enhancement and feature fusion module; The adaptive threshold DB algorithm layer replaces the fixed threshold in the existing DB algorithm with an adaptive threshold; In the inference stage, the adaptive threshold DB algorithm layer performs the following formula adaptive threshold calculation on the probability map by setting a nine-grid mask to obtain a threshold map; where x and y are the coordinates in the probability map, and f x,y is the pixel value at the coordinate (x, y), c is the threshold obtained by the adaptive threshold algorithm, and p x+i,y+j is the pixel value at the coordinate (x + i, y + j) in the probability map, and f' x,y is the pixel at the coordinate (x, y) in the threshold map; The intersection operation layer performs an intersection operation on the probability map and the threshold map to obtain a bounding box; The dilation layer dilates the bounding box, and the dilation multiple is D'=(A'×r') / L', where A' is the area of the bounding box, L' is the perimeter of the bounding box, and r' is the dilation coefficient; The feature enhancement layer Squeeze-and-Excitation includes Squeeze operation, Excitation operation, and Reweight operation; 1) Squeeze operation: Feature compression is performed through the spatial dimension. The global average pooling operation is used to turn each two-dimensional feature channel into a real number, and the output dimension is the same as the number of input feature channels. Its calculation formula is: where H and W respectively represent the height and width of the feature map, and u c (i, j) is the feature value at the coordinate (i, j) in each channel of the feature map; 2) Excitation operation: The gate mechanism in the recurrent neural network is introduced, and a Bottleneck structure is formed through two fully connected operations to model the correlation between channels. The first fully connected layer reduces the feature dimension to 1 / 16 of the input, and then after ReLu activation, it is restored to the original dimension through another fully connected layer. Its calculation formula is: s c = F ex (z c , W) = σ(g(z c , W)) = σ(W2δ(W1z c )) Among them, z c is the output of Squeeze, W1 and W2 are weights, and δ is the ReLu operation; 3) Reweight operation: The weights of the output of Excitation are regarded as the importance of each feature channel after feature selection, and the original features are recalibrated by multiplying and weighting each channel to the previous features. The formula is: Among them, u c is a channel in the feature map, and s c is the weight output by Excitation; then the network short-circuit operation of the residual module is performed.
2. The method according to claim 1, characterized in that In the training stage of the industrial cargo box text detection model based on bilinear feature vector fusion, the DB semantic segmentation detection head consists of a convolutional layer and an adaptive threshold DB algorithm layer; After the adaptive threshold DB algorithm layer, an additional binary map needs to be obtained by binarizing the probability map and the threshold map. Among them, the places with a value of 1 represent the areas with text, and the rest have a value of 0. The standard binarization operation: Among them, B is the binary map, P is the probability map, T is the threshold map, and (i,j) is the coordinate; In the training stage, the loss function L is expressed as the weighted sum of the loss of the probability map, the loss of the binary map, and the loss of the threshold map: L = L s + α × L b + β × L t Among them, L S is the loss value of the probability graph, and L b is the loss value of the binary graph, and L t is the loss of the threshold graph; both α and β are hyperparameters.
3. The method according to claim 2, characterized in that L S and L b Train using the DiceLoss loss function; Its calculation formula is: Among them, pred is the predicted value, and gt is the ground-truth; L t Training is carried out using the Mask L1 Loss function, and the calculation of the L t loss function is performed through a mask; its calculation formula is: Among them, L t The loss is the mean absolute difference, and then a mask is added to calculate the L t of the loss function for the area specified by the mask. n is the total number of calculations required for the dilated image area under the mask; the absolute value is the distance difference between the predicted bounding box and the ground-truth.
4. A text detection system for an industrial cargo box in a lightweight mobile state that implements the method described in claim 1, characterized in that It includes: A cargo box identification plate image acquisition module that acquires the cargo box identification plate image of the moving cargo box during the production and manufacturing process; A text detection module that uses the trained industrial cargo box text detection model based on bilinear feature vector fusion to identify the position of the text information on the cargo box identification plate image.
5. A computer-readable storage medium, on which a computer program is stored. When the computer program is executed in a computer, the computer is made to execute the method according to any one of claims 1-3.
6. A computing device, including a memory and a processor. An executable code is stored in the memory. When the processor executes the executable code, the method according to any one of claims 1-3 is implemented.
Citation Information
Patent Citations
Image Semantic Segmentation Method Based on Deep Full Convolutional Network and Conditional Random Field
AU2020103901A4
Adaptive threshold scene text detection method based on attention feature fusion
CN113516126A