Information determination method and device, computer readable storage medium and computer program product
By combining multiple algorithms and models, container images are segmented and recognized, solving the problem of low accuracy in container number recognition and achieving high-accuracy container number recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-03-13
AI Technical Summary
The accuracy of identifying container numbers in existing technologies is relatively low.
Multiple different algorithms are used to segment the target image. The target detection model and text recognition model are combined. The target instance segmentation algorithm and SAHI algorithm are used to segment the image. The pre-trained target detection model is used to identify the location of the container. Attention module and feature fusion technology are used to improve the location accuracy. Finally, the accurate container number information is obtained through text recognition model.
It significantly improved the accuracy of container number identification, reduced the probability of missed and false detections, and ensured the accurate identification of all container numbers.
Smart Images

Figure CN121661656A_ABST
Abstract
Description
Technical Field
[0001] This application relates to information determination technology in the field of computers, and more particularly to an information determination method, apparatus, computer-readable storage medium, and computer program product. Background Technology
[0002] In modern container ports, computer vision technology is typically used to identify container numbers. Specifically, object detection algorithms are first used to identify the area containing the container number from the input container image, and then a text recognition model is used to process the image of that area to obtain the container number. However, this method of identifying container numbers in related technologies has relatively poor accuracy. Summary of the Invention
[0003] To address the aforementioned technical problems, embodiments of this application provide an information determination method, device, computer-readable storage medium, and computer program product, which solve the problem of low accuracy in identifying container numbers in related technologies.
[0004] To achieve the above objectives, the technical solution of this application embodiment is implemented as follows: An information determination method, the method comprising: Acquire target images for multiple objects to be identified; wherein, each object to be identified is marked with its target identification information; The target image is divided using multiple different algorithms to obtain multiple sub-images corresponding to each algorithm; The target detection model is used to process multiple sub-images corresponding to each algorithm to obtain multiple positions of each target identification information in the target image; Based on the multiple locations, the target location of each target identification information in the target image is determined; The target image is processed based on the target location and target text recognition model to obtain the target identification information of each object to be identified.
[0005] In the above scheme, the step of using multiple different algorithms to segment the target image to obtain multiple sub-images corresponding to each algorithm includes: The target image is processed using a target instance segmentation algorithm to obtain multiple first sub-images; The target image is processed using a target slicing algorithm to obtain multiple second sub-images.
[0006] In the above scheme, the step of using a target detection model to process multiple sub-images corresponding to each algorithm to obtain multiple locations of each target identifier information in the target image includes: The target detection model is used to process the plurality of first sub-images to obtain a first region at a first position in the target image; wherein, the target detection model includes an attention module; the first region is the region where the target identification information is located in each first sub-image; The target detection model is used to process the multiple second sub-images to obtain the second region at the second position in the target image; wherein, the second region is the region where the identification information is located in each second sub-image; one target identification information corresponds to multiple identification information.
[0007] In the above scheme, determining the target location of each target identifier information in the target image based on the multiple locations includes: Determine the degree of overlap between each first region and a second region that matches each first region; The target location is determined based on the overlap value corresponding to each target identifier, the first location, and the second location.
[0008] In the above scheme, determining the target location based on the overlap value corresponding to each target identifier information, the first location, and the second location includes: For first target identification information whose overlap value is greater than or equal to a target threshold, the target position of the first target identification information in the target image is determined based on the first position of the first sub-region corresponding to the first target identification information in the target image and the second position of the second region matching the first sub-region in the target image; wherein, the first region includes the first sub-region.
[0009] The method in the above scheme further includes: For second target identification information whose overlap value is less than the target threshold, a third sub-image is determined from the target image based on the first position of the second sub-region corresponding to the second target identification information in the target image and the second position of the second region matching the second sub-region in the target image; wherein, the third sub-image has the second target identification information; the first region includes the second sub-region; The target detection model is used to process the third sub-image to obtain the target location of the second target identification information in the target image.
[0010] In the above scheme, the step of performing recognition processing on the target image based on the target location and target text recognition model to obtain target identification information for each object to be identified includes: The target image is segmented based on the target location to obtain a target sub-image corresponding to each target identification information; The target text recognition model is used to perform text recognition on each target sub-image to obtain the initial identification information of each object to be recognized. Each initial identification information is verified. If the initial identification information is successfully verified, the target identification information is determined to be the initial identification information; If the initial identification information verification fails, the target identification information is obtained by correcting the initial identification information using the target language processing model.
[0011] An information determining device, the device comprising: a processor, a memory, and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the information determination program in the memory to implement the steps of the information determination method described above.
[0012] A computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the information determination method described above.
[0013] A computer program product comprising a computer program that, when executed by a processor, implements the aforementioned information determination method.
[0014] The information determination method, device, computer-readable storage medium, and computer program product provided in this application embodiment can acquire target images for multiple objects to be identified; wherein, the objects to be identified are marked with target identification information; multiple different algorithms are used to divide the target image to obtain multiple sub-images corresponding to each algorithm; a target detection model is used to process the multiple sub-images corresponding to each algorithm to obtain multiple positions of each target identification information in the target image; based on the multiple positions, the target position of each target identification information in the target image is determined; based on the target position and a target text recognition model, the target image is recognized to obtain the target identification information of each object to be identified. Thus, multiple mutually exclusive methods can be used to identify the target image. Complementary image segmentation algorithms segment target objects from different dimensions to ensure that the target identification information of the object to be identified will be segmented into sub-images. This guarantees that the target detection model can identify the target identification information of all objects to be identified, thereby greatly reducing the probability of missed and false detections. Furthermore, by determining the target position of the target identification information at multiple locations in the target image, positional deviations caused by model bias can be eliminated. This significantly improves the accuracy of the determined position of the target identification information in the target object, thus ensuring accurate identification of all target identification information. This solves the problem of low accuracy in identifying container numbers in related technologies. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating an information determination method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating another information determination method provided in an embodiment of this application; Figure 3 This is an architecture diagram of the initial detection model in an information determination method provided in this application embodiment; Figure 4 This is an architecture diagram of a target instance segmentation algorithm in an information determination method provided in this application embodiment; Figure 5 This is a schematic diagram of a target segmentation algorithm in an information determination method provided in an embodiment of this application; Figure 6 This is a schematic diagram illustrating the determination of a third region in an information determination method provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an information determination device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an information determination device provided in an embodiment of this application. Detailed Implementation
[0016] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0017] It should be understood that the phrases "embodiments of this application" or "foreign embodiments" throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "embodiments of this application" or "in the foreign embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0018] Unless otherwise specified, any step in the embodiments of this application performed by the electronic device may be executed by the processor of the electronic device. It is also worth noting that the embodiments of this application do not limit the order in which the electronic device performs the following steps. Furthermore, the methods used to process data in different embodiments may be the same or different methods. It should also be noted that any step in the embodiments of this application can be executed independently by the electronic device; that is, when the electronic device performs any step in the following embodiments, it may not depend on the execution of other steps.
[0019] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0020] This application provides an information determination method, which can be applied to an information determination device. (Refer to...) Figure 1 As shown, the method may include the following steps: Step 101: Obtain target images for multiple objects to be identified.
[0021] The object to be identified is marked with the target identification information of the object to be identified.
[0022] In this embodiment of the application, the information determination device may refer to a server.
[0023] In this embodiment, the object to be identified may refer to a container; the target identification information may refer to the container number information printed on the container. It should be noted that one object to be identified corresponds to one target identification information, and the target identification information is different for different objects to be identified.
[0024] In this embodiment of the application, the target image contains container number information for multiple containers, and the multiple containers are usually stacked together.
[0025] In this embodiment of the application, target images of multiple containers (i.e. multiple objects to be identified) can be remotely captured by devices such as drones.
[0026] Step 102: Use multiple different algorithms to divide the target image to obtain multiple sub-images corresponding to each algorithm.
[0027] In one feasible way, such as Figure 2 As shown, after obtaining target images for multiple objects to be identified, two different algorithms can be used to segment the target images, resulting in multiple sub-images for each algorithm. These two different algorithms can include instance segmentation and Slicing Aided Hyper Inference (SAHI) algorithms.
[0028] It should be noted that the number of sub-images corresponding to each algorithm can be the same or different; no specific limitation is made here.
[0029] In the embodiments of this application, the instance segmentation algorithm and the SAHI algorithm run independently when segmenting images. The localization results of the identification information in the output sub-images are fused in subsequent stages to compensate for each other and offset their respective potential limitations.
[0030] Step 103: Use the target detection model to process the multiple sub-images corresponding to each algorithm to obtain the multiple positions of each target identification information in the target image.
[0031] In this embodiment, the target detection model can be a pre-trained model used to identify container numbers (i.e., target identification information). Specifically, multiple first sub-images obtained by the instance segmentation algorithm can be input into the target detection model as input parameters to obtain the first position of the first region containing the target identification information in each first sub-image in the target image. Then, multiple second sub-images obtained by the SAHI algorithm can be input into the target detection model as input parameters to obtain the second position of the second region containing the identification information in each second sub-image in the target image.
[0032] It should be noted that since the instance segmentation algorithm divides the image into units of containers (i.e. objects to be identified), each first sub-image contains one target identification information; while the SAHI algorithm divides the image according to a preset size, so one target identification information will be divided into multiple second sub-images, thus one target identification information corresponds to multiple identification information.
[0033] In this embodiment of the application, the multiple locations include multiple first locations and multiple second locations. The first location may include the two-dimensional coordinates of the upper left corner and the lower right corner of a first region, and the second location may include the two-dimensional coordinates of the upper left corner and the lower right corner of a second region.
[0034] In this embodiment of the application, the object detection model can be trained in the following manner: A1. Obtain the sample image for the sample object.
[0035] The sample images are labeled with sample label information of the sample objects.
[0036] In this embodiment of the application, the sample object may also refer to a container, specifically a container whose container number information is already known; the sample marking information may refer to the container number information. Multiple sample images are included.
[0037] It should be noted that one sample object corresponds to one sample image, and different sample objects correspond to different sample images.
[0038] A2. Determine the sample location of the sample label information in the sample image.
[0039] In this embodiment, an object detection model can be used to process each sample image to obtain the sample position of the sample region (i.e., the bounding box corresponding to the sample label information) in the sample image. The sample position may include the coordinates of the upper left and lower right corners of the sample region.
[0040] It should be noted that the object detection model can refer to the Region-based Convolutional Neural Networks (R-CNN) model, or other detection models; no specific limitation is made here.
[0041] A3. The initial detection model is trained based on the sample location to obtain the target detection model.
[0042] The initial detection model includes an attention module.
[0043] In this embodiment, the initial detection model can be a model based on the YOLOv8 framework. Its model architecture can be as follows: Figure 3 As shown, specifically, the initial detection model may include a backbone network, a neck network, and a head network. The backbone and head networks are the same as those in the existing YOLOv8 model. However, the initial detection model in this application is composed of a Generalized Feature Pyramid Network (GFPN). Compared to the Path Aggregation Feature Pyramid Network (PAFPN) in related technologies, GFPN can learn the weights of features at different levels through gating units, thereby dynamically determining which features should be enhanced or suppressed. Therefore, during target detection, it can automatically enhance the weights of shallow features, thus accurately identifying the target object.
[0044] Furthermore, in this application, an attention (Encoder Modulator Attention, EMA) module is added to GFPN, which can significantly improve the effect of feature fusion and thus improve the accuracy of the location of the obtained label information.
[0045] Step 104: Based on multiple locations, determine the target location of each target identification information in the target image.
[0046] In this embodiment of the application, a target region including each target identification information can be determined based on the multiple first positions and multiple second positions obtained in step 103, and the target image can be processed to obtain a sub-image for the target region. Then, a target detection model can be used to process the sub-image to identify the target position of the target identification information in the target image.
[0047] It should be noted that the target location can also be represented by coordinates, including the two-dimensional coordinates of the upper left corner and the lower right corner of the sub-region corresponding to the target identification information in the target region.
[0048] Step 105: Based on the target location and target text recognition model, the target image is processed to obtain the target identification information of each object to be identified.
[0049] In this embodiment of the application, the target image can be segmented according to the target location to extract target sub-images with target identification information from the target image, and a target text recognition model can be used to recognize each target sub-image to obtain the target identification information of each object to be identified, i.e., the container number information of each container.
[0050] It should be noted that, due to the different locations of the containers, the position of each target identification information in the target image is also different. That is, each target identification information corresponds to a different target sub-image, and one target identification information corresponds to only one target sub-image.
[0051] In the embodiments of this application, SAHI and instance segmentation models are used in parallel to segment the image in two different ways during image preprocessing. The segmented images are then fed into the target detection model. After detection, the detection boxes are merged using the fusion method proposed in this proposal, which can improve the accuracy of small target detection.
[0052] In other embodiments of this application, step 102 can be implemented in the following ways: Step 102a: Process the target image using a target instance segmentation algorithm to obtain multiple first sub-images.
[0053] In this embodiment of the application, the architecture of the target instance segmentation algorithm can be as follows: Figure 4 As shown, compared with the existing architectures in related technologies, the innovation of the instance segmentation architecture in this application lies in the presence of a Haar wavelet transform module and an Asymptotic Feature Pyramid Network (AFPN) module with a Content-Aware ReAssembly of Features (CARAFE) upsampling operator.
[0054] In one feasible approach, the target instance segmentation algorithm can be an algorithm based on the SOLOv2 architecture.
[0055] In this application embodiment, compared with the feature extraction through convolution kernel in related technologies, the method of downsampling and feature extraction through the Haar wavelet transform module in this application does not require pre-training, is fast and low cost. Furthermore, the feature fusion through the AFPN module with CARAFE upsampling operator in this application can solve the problem of poor retention of boundary information in existing instance segmentation algorithms, thereby improving the accuracy of the segmented sub-images.
[0056] In this embodiment, the target instance segmentation algorithm divides the target image into multiple first sub-images based on the objects to be identified (i.e., containers). It should be noted that each first sub-image contains only one object to be identified (i.e., a container). That is, the number of first sub-images corresponds to the number of objects to be identified; the number of objects to be identified is the same as the number of first sub-images.
[0057] Step 102b: Process the target image using the target slicing algorithm to obtain multiple second sub-images.
[0058] In this embodiment, the target slicing algorithm may refer to the SAHI algorithm. It should be noted that the slice size and slice overlap ratio of the SAHI algorithm are preset based on user requirements and historical data.
[0059] In the embodiments of this application, such as Figure 5 As shown, the SAHI algorithm can be used to segment the target image according to a preset slice size and slice overlap ratio to obtain multiple second sub-images (i.e., Figure 5 (P1, P2, P3, etc. in the text).
[0060] It should be noted that because the SAHI algorithm segments images according to a preset slice size, the container number information of a single container has a high probability of being segmented into multiple second sub-images. That is, the number of objects to be identified is not the same as the number of second sub-images; one object to be identified can correspond to multiple second sub-images.
[0061] In other embodiments of this application, step 103 can be implemented in the following ways: Step 103a: Use the target detection model to process multiple first sub-images to obtain the first position of the first region in the target image.
[0062] The object detection model includes an attention module; the first region is the region where the object identification information is located in each first sub-image.
[0063] In this embodiment, the target detection model may also refer to a model based on the YOLOv8 framework, which has a backbone network, a neck network, and a head network. The neck network is a GFPN network with an EMA module.
[0064] In this embodiment, the first region containing the identification information refers to the bounding box of the identification information. Since multiple first sub-images are obtained by image segmentation using a target instance segmentation algorithm, each first sub-image contains the target identification information of a target object to be identified. Specifically, each first sub-image can be input as an input parameter into the target detection model. Then, the backbone network in the target detection model can perform multi-stage compression processing on the input first sub-image, compressing the width and height of the first sub-image to half of its original value, thereby obtaining multiple feature maps. Further, a GFPN network with an EMA module can perform feature fusion and enhancement processing on the multiple feature maps. Furthermore, the head network in the target detection model can process the fused feature maps to output the first position of the bounding box of the identification information (i.e., the target identification information) in each first sub-image. Since the head network in the target detection model has four detection heads, the detection efficiency for small targets is significantly improved. Furthermore, the use of a GFPN network with an EMA for feature fusion in this application significantly improves the feature fusion effect, thereby enhancing the model's ability to perceive multi-scale targets.
[0065] It should be noted that the first position obtained by the object detection model after processing multiple first sub-images is the position in the target image, not the position in the first sub-image. The first position can include the two-dimensional coordinates of the top-left corner and the bottom-right corner of the first region.
[0066] Step 103b: Use the target detection model to process multiple second sub-images to obtain the second position of the second region in the target image.
[0067] The second region is the region where the identification information is located in each second sub-image; one target identification information corresponds to multiple identification information.
[0068] In this embodiment of the application, since the target identification information of an object to be identified is segmented into multiple second sub-images, that is, one first sub-image corresponds to multiple second sub-images, and the target identification information in one first sub-image corresponds to the identification information in multiple second sub-images, the position of one target identification information includes the position of the identification information in multiple second sub-images.
[0069] In this embodiment of the application, each second sub-image can be input as an input parameter into the target detection model. Then, the target detection model can process multiple second sub-images to obtain the second position of the second region where the identification information in each second sub-image is located.
[0070] It should be noted that the second position is also the position of the second region in the target image, and includes the two-dimensional coordinates of the upper left corner and the lower right corner of the second region.
[0071] In this embodiment of the application, since the first sub-image has a complete target identification information, while the second sub-image only has a partial target identification information, that is to say, the first region actually corresponds to multiple second regions.
[0072] In this embodiment of the application, by adding a fourth detection head to the YOLOv8 model and replacing the original PAFPN module with a GFPN module with an EMA attention mechanism, the small target detection capability of YOLOv8 can be significantly improved, thereby improving the accuracy of the location of the identified area.
[0073] In other embodiments of this application, step 104 can be implemented in the following ways: Step 104a: Determine the overlap value between each first region and the second region that matches each first region.
[0074] In this embodiment, the overlap value can refer to the Intersection over Union (IoU) value; the second region matching the first region can refer to a region that overlaps with the first region. It should be noted that one target identification information corresponds to one first region, but one target identification information corresponds to multiple second regions.
[0075] In this embodiment, since there are multiple first and second regions, a second region matching each region can be determined from among the multiple second regions, i.e., a second region with overlapping areas. Then, for each first region, the area S1 of the intersection region between the first region and the matching second region can be determined based on the first position of the first region and the second position of the matching second region, and the area S2 of the union region between the first region and the matching second region can be determined. Then, the intersection area S1 can be divided by the union area S2 to obtain the IoU value between the first region and the matching second region. The larger the overlap value, the higher the degree of overlap between the first region and the matching second region.
[0076] It should be noted that the formula for calculating the IoU value can be (the area of the intersection of the first region and the second region) / (the area of the union of the first region and the second region).
[0077] In the embodiments of this application, the overlap value essentially represents the overlap between a first region corresponding to a target identification information and multiple second regions. Furthermore, for a certain first region, there will be multiple matching second regions. That is, each target identification information will correspond to multiple overlap values, and there will be as many overlap values as there are second regions.
[0078] Step 104b: Determine the target location based on the overlap value, first position, and second position corresponding to each target identification information.
[0079] In this embodiment of the application, the overlap value (i.e., IoU value) corresponding to each target identification information can be compared with the target threshold, and the target position of the region where each target identification information is located in the target image can be determined based on the comparison result, the first position and the second position.
[0080] In other embodiments of this application, step 104b can be implemented in the following ways: Step 104b1: For the first target identification information with an overlap value greater than or equal to the target threshold, determine the target position of the first target identification information in the target image based on the first position of the first sub-region corresponding to the first target identification information in the target image and the second position of the second region matching the first sub-region in the target image.
[0081] The first region includes the first sub-region.
[0082] In this embodiment, an overlap value greater than or equal to a target threshold can mean that the overlap between the first region corresponding to the first target identification information and multiple second regions is high (basically overlapping). Furthermore, an overlap value greater than or equal to a target threshold can mean that multiple overlap values corresponding to the first target identification information are all greater than or equal to the target threshold. In this case, the first position of the first sub-region corresponding to the first target identification information in the target image can be directly taken as the target position. Alternatively, the first target coordinate can be determined from the first two-dimensional coordinate of the upper left corner of the first sub-region and the second two-dimensional coordinate of the upper left corner of the second region matching the first sub-region. Then, the second target coordinate can be determined from the third two-dimensional coordinate of the lower right corner of the first sub-region and the fourth two-dimensional coordinate of the lower right corner of each second region. The obtained first target coordinate and second target coordinate are the target position of the target region where the target identification information is located in the target image.
[0083] In one feasible approach, the minimum x-coordinate can be determined from the x-coordinate of the first two-dimensional coordinate and the x-coordinate of the second two-dimensional coordinate as the x-coordinate of the first target coordinate, and the maximum y-coordinate can be determined from the y-coordinate of the first two-dimensional coordinate and the y-coordinate of the second two-dimensional coordinate as the y-coordinate of the first target coordinate.
[0084] In one feasible approach, the largest x-coordinate can be determined from the x-coordinates of the third and fourth two-dimensional coordinates as the x-coordinate of the second target coordinate, and the smallest y-coordinate can be determined from the y-coordinates of the third and fourth two-dimensional coordinates as the y-coordinate of the second target coordinate.
[0085] It should be noted that one target identifier corresponds to one target location.
[0086] Step 104b2: For the second target identification information with an overlap value less than the target threshold, a third sub-image is determined from the target image based on the first position of the second sub-region corresponding to the second target identification information in the target image and the second position of the second region matching the second sub-region in the target image.
[0087] The third sub-image contains second target identification information; the first region includes the second sub-region.
[0088] In this embodiment of the application, an overlap value less than a target threshold can mean that the overlap between the first region corresponding to the second target identification information and multiple second regions is low. Furthermore, an overlap value less than a target threshold can mean that among the multiple overlap values corresponding to the second target identification information, there is an overlap value less than the target threshold. In this case, such as... Figure 6 As shown, a third region that completely includes the first and second regions can be generated. The third position of the third region is determined based on the first position of the second sub-region corresponding to the second target identification information and the second position of the second region that matches the second sub-region. Then, a sub-image for the third region, i.e., the third sub-image, can be determined from the target image based on the third position.
[0089] It should be noted that the newly generated third region can include complete target identification information, and a third region can contain only one target identification information.
[0090] In one feasible approach, the third position of the third region can also include the two-dimensional coordinates of the upper left corner and the lower right corner of the third region. Specifically, the first target coordinates and the second target coordinates can be determined first according to step 104b1. Then, the x-coordinate of the first target coordinate can be shifted two times to the left to obtain the x-coordinate of the upper left corner of the third region, and the y-coordinate of the first target coordinate can be shifted two times upward to obtain the y-coordinate of the upper left corner of the third region. At the same time, the x-coordinate of the second target coordinate can be shifted two times to the right to obtain the x-coordinate of the lower right corner of the third region, and the y-coordinate of the second target coordinate can be shifted two times downward to obtain the y-coordinate of the lower right corner of the third region.
[0091] For example: if the coordinates of the first target are (2,7) and the coordinates of the second target are (4,3), then the coordinates of the upper left corner of the third region can be (-2(2-2*2), 21(7+7*2)), and the coordinates of the lower right corner of the third region can be (12(4+4*2), -3(3-3*2)).
[0092] Step 104b3: Use the target detection model to process the third sub-image to obtain the target location of the second target identification information in the target image.
[0093] In this embodiment of the application, after obtaining the third sub-image, the third sub-image can be used as an input parameter to the target detection model. Then, the target detection model can process the third sub-image to obtain the target location of the target identification information in the third sub-image in the target image.
[0094] In other embodiments of this application, step 105 can be implemented in the following ways: Step 105a: Divide the target image based on the target location to obtain the target sub-image corresponding to each target identification information.
[0095] In this embodiment of the application, the target image can be divided according to the target position of each target identification information in the target image to obtain a sub-image corresponding to each target identification information, i.e., a target sub-image.
[0096] It should be noted that one target identification information corresponds to one target sub-image.
[0097] Step 105b: Use the target text recognition model to perform text recognition on each target sub-image to obtain the initial identification information of each object to be recognized.
[0098] In the embodiments of this application, the target text recognition model may refer to a Convolutional Recurrent Neural Network (CRNN) model, or a Scene Text Recognition with a Single Visual Model (SVTR) model, or other models, without specific limitations here.
[0099] In one feasible approach, if the target text recognition model is a CRNN model, then each target sub-image can be directly input into the CRNN model as an input parameter. The model can then automatically process each target sub-image to obtain the initial identification information of each object to be identified, i.e., the initial container number information of each container.
[0100] In another feasible approach, if the target text recognition model is an SVTR model, after each target sub-image is input into the SVTR model, the model will first calculate the aspect ratio of the target sub-image. Then, the model will determine whether the target sub-image contains horizontal or vertical container number information based on the aspect ratio. Furthermore, the model will process the horizontal and vertical container number information in different ways to identify the initial container number information.
[0101] Step 105c: Verify each initial identification information.
[0102] In the embodiments of this application, such as Figure 2 As shown, after obtaining the initial identification information (i.e., initial container number information) for each object to be identified, multiple verifications can be performed on the initial container number information according to the international standard container coding rules to verify whether the obtained initial identification information conforms to the international coding rules. Specifically, the length of the initial container number information can be verified first. If the length is equal to 11, the verification passes. Then, the first four digits of the initial container number information need to be verified alphabetically to determine whether the first four digits are all letters. If the first four digits are all letters, the middle six digits of the device identification code need to be verified numerically to determine whether the middle six digits are all numbers. If the verification passes, the last check code needs to be verified according to the rules.
[0103] In one feasible approach, the checksum of the last digit can be validated using a rule-based method: convert the first 10 characters to numbers: letters A=10, B=12, C=13, ..., Z=35 (skipping prohibited letters such as 11 and 22, while keeping the numbers unchanged), then multiply each character by a weight of 2. 0 ,2¹,2², ...,2 9 (From left to right) Further, after summing, take the modulo of 11. If the remainder is 10, the check digit should be 0. At this point, we can determine whether the last check digit is 0; otherwise, it is the remainder itself. At this point, we can determine whether the last check digit is the remainder itself.
[0104] In the embodiments of this application, step 105d or 105e can be performed after step 105c.
[0105] Step 105d: If the initial identification information verification is successful, the target identification information is determined to be the initial identification information.
[0106] In this embodiment of the application, if all verifications are passed, the initial identification information obtained before is identified as fully conforming to international coding rules, that is, the target identification information of the object to be identified is the initial identification information obtained before.
[0107] Step 105e: If the initial identification information verification fails, the target language processing model is used to correct the initial identification information to obtain the target identification information.
[0108] In the embodiments of this application, such as Figure 2 As shown, if any step in step 105c fails, for example, if the length is not 11 characters, or if the first four characters contain characters that are not letters, or if the middle six characters contain characters that are not numbers, then the initial identification information verification fails. In this case, it can be corrected by a language model such as a Boolean Control Network (BCN). That is, the initial identification information is input as an input parameter into a language model such as BCN, so that the BCN model can correct the initial identification information and output the corrected result, i.e., the target identification information.
[0109] It should be noted that the target language processing model needs to be pre-trained. Specifically, we can obtain multiple correctly identified sample bin numbers, a first sample abnormal bin number with an incorrect length, a second sample abnormal bin number where the middle four characters contain non-letters, a third sample abnormal bin number where the middle eleven characters contain non-digits, and a fourth sample abnormal bin number where the last checksum does not match. Then, we can train the initial language processing model based on the obtained sample bin number information, the first sample abnormal bin number information, and so on, to obtain the target language processing model.
[0110] In this embodiment of the application, after the initial container number information is initially identified, the initial container number information is verified, and the container numbers that fail the verification are input into the language model for correction. In this way, the overall recognition capability of the target identification information can be improved.
[0111] The information determination method provided in the embodiments of this application can segment the target object from different dimensions using a variety of complementary image segmentation algorithms to ensure that the target identification information of the object to be identified will definitely be segmented into the sub-image. This ensures that the target identification information of all objects to be identified can be identified by the target detection model, thereby greatly reducing the probability of missed and false detection of identification information. Furthermore, by determining the target position of the target identification information at multiple positions in the target image, positional deviations caused by model bias can be eliminated. This significantly improves the accuracy of the determined position of the target identification information in the target object, thereby ensuring that all target identification information can be accurately identified. This solves the problem of low accuracy in identifying container numbers in related technologies.
[0112] This application provides an information determining device, which can be applied to... Figure 1In the information determination method provided in the corresponding embodiment, refer to Figure 7 As shown, the device may include: an acquisition unit 21, a first processing unit 22, a second processing unit 23, a determination unit 24, and a third processing unit 25, wherein: The acquisition unit 21 is used to acquire target images of multiple objects to be identified; wherein the objects to be identified are marked with target identification information of the objects to be identified; The first processing unit 22 is used to divide the target image using multiple different algorithms to obtain multiple sub-images corresponding to each algorithm; The second processing unit 23 is used to process multiple sub-images corresponding to each algorithm using the target detection model to obtain multiple positions of each target identification information in the target image; The determining unit 24 is used to determine the target location of each target identification information in the target image based on multiple locations; The third processing unit 25 is used to perform recognition processing on the target image based on the target location and target text recognition model to obtain the target identification information of each object to be identified.
[0113] In other embodiments of this application, the first processing unit 22 is further configured to perform the following steps: The target image is processed using a target instance segmentation algorithm to obtain multiple first sub-images; The target image is processed using a target slicing algorithm to obtain multiple second sub-images.
[0114] In other embodiments of this application, the second processing unit 23 is further configured to perform the following steps: A target detection model is used to process multiple first sub-images to obtain the first position of the first region in the target image; wherein, the target detection model includes an attention module; the first region is the region where the target identification information is located in each first sub-image; A target detection model is used to process multiple second sub-images to obtain the second position of the second region in the target image; wherein, the second region is the region where the identification information is located in each second sub-image; one target identification information corresponds to multiple identification information.
[0115] In other embodiments of this application, the determining unit 24 is further configured to perform the following steps: Determine the degree of overlap between each first region and the second region that matches each first region; The target location is determined based on the overlap value, first position, and second position corresponding to each target identifier information.
[0116] In other embodiments of this application, the determining unit 24 is further configured to perform the following steps: For first target identification information with an overlap value greater than or equal to a target threshold, the target position of the first target identification information in the target image is determined based on the first position of the first sub-region corresponding to the first target identification information in the target image and the second position of the second region matching the first sub-region in the target image; wherein, the first region includes the first sub-region.
[0117] In other embodiments of this application, the determining unit 24 is further configured to perform the following steps: For second target identification information with an overlap value less than a target threshold, a third sub-image is determined from the target image based on the first position of the second sub-region corresponding to the second target identification information in the target image and the second position of the second region matching the second sub-region in the target image; wherein, the third sub-image has the second target identification information; the first region includes the second sub-region; The third sub-image is processed using a target detection model to obtain the target location of the second target identifier in the target image.
[0118] In other embodiments of this application, the third processing unit 25 is further configured to perform the following steps: The target image is segmented based on the target location to obtain the target sub-image corresponding to each target identification information; A target text recognition model is used to perform text recognition on each target sub-image to obtain the initial identification information of each object to be recognized. Each initial identification information is verified. If the initial identification information is successfully verified, the target identification information is determined to be the initial identification information; If the initial identification information fails to be verified, the target identification information is obtained by correcting the initial identification information using the target language processing model.
[0119] It should be noted that the specific implementation process of the steps performed by each unit in the embodiments of this application can be referred to Figure 1 The implementation process of the information determination method provided in the corresponding embodiments will not be described in detail here.
[0120] The information determination device provided in the embodiments of this application can segment the target object from different dimensions using a variety of complementary image segmentation algorithms to ensure that the target identification information of the object to be identified will be segmented into the sub-image. This ensures that the target identification information of all objects to be identified can be identified using the target detection model, thereby greatly reducing the probability of missed and false detections of identification information. Furthermore, by determining the target position of the target identification information at multiple positions in the target image, positional deviations caused by model bias can be eliminated. This significantly improves the accuracy of the determined position of the target identification information in the target object, thereby ensuring that all target identification information can be accurately identified. This solves the problem of low accuracy in identifying container numbers in related technologies.
[0121] This application provides an information determining device, which can be applied to... Figure 1 In the information determination method provided in the corresponding embodiment, refer to Figure 8 As shown, the device may include: a processor 31, a memory 32, and a communication bus 33; Communication bus 33 is used to realize the communication connection between processor 31 and memory 32; The processor 31 is used to execute the information determination program in the memory 32 to perform the following steps: Acquire target images for multiple objects to be identified; wherein each object to be identified is marked with its target identification information; The target image is divided using multiple different algorithms to obtain multiple sub-images corresponding to each algorithm; The target detection model is used to process multiple sub-images corresponding to each algorithm to obtain multiple locations of each target identification information in the target image; Based on multiple locations, determine the target location of each target identification information in the target image; The target image is processed based on the target location and target text recognition model to obtain the target identification information of each object to be identified.
[0122] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32, and may also implement the following steps: The target image is processed using a target instance segmentation algorithm to obtain multiple first sub-images; The target image is processed using a target slicing algorithm to obtain multiple second sub-images.
[0123] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32, and may also implement the following steps: A target detection model is used to process multiple first sub-images to obtain the first position of the first region in the target image; wherein, the target detection model includes an attention module; the first region is the region where the target identification information is located in each first sub-image; A target detection model is used to process multiple second sub-images to obtain the second position of the second region in the target image; wherein, the second region is the region where the identification information is located in each second sub-image; one target identification information corresponds to multiple identification information.
[0124] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32, and may also implement the following steps: Determine the degree of overlap between each first region and the second region that matches each first region; The target location is determined based on the overlap value, first position, and second position corresponding to each target identifier information.
[0125] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32, and may also implement the following steps: For first target identification information with an overlap value greater than or equal to a target threshold, the target position of the first target identification information in the target image is determined based on the first position of the first sub-region corresponding to the first target identification information in the target image and the second position of the second region matching the first sub-region in the target image; wherein, the first region includes the first sub-region.
[0126] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32, and may also implement the following steps: For second target identification information with an overlap value less than a target threshold, a third sub-image is determined from the target image based on the first position of the second sub-region corresponding to the second target identification information in the target image and the second position of the second region matching the second sub-region in the target image; wherein, the third sub-image has the second target identification information; the first region includes the second sub-region; The third sub-image is processed using a target detection model to obtain the target location of the second target identifier in the target image.
[0127] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32, and may also implement the following steps: The target image is segmented based on the target location to obtain the target sub-image corresponding to each target identification information; A target text recognition model is used to perform text recognition on each target sub-image to obtain the initial identification information of each object to be recognized. Each initial identification information is verified. If the initial identification information is successfully verified, the target identification information is determined to be the initial identification information; If the initial identification information fails to be verified, the target identification information is obtained by correcting the initial identification information using the target language processing model.
[0128] It should be noted that a detailed description of the steps performed by the processor can be found in [reference needed]. Figure 1 The information determination method provided in the corresponding embodiments will not be described again here.
[0129] The information determination device provided in the embodiments of this application can segment target objects from different dimensions using a variety of complementary image segmentation algorithms to ensure that the target identification information of the object to be identified will be segmented into sub-images. This ensures that the target identification information of all objects to be identified can be identified using the target detection model, thereby greatly reducing the probability of missed and false detections of identification information. Furthermore, by determining the target position of the target identification information at multiple positions in the target image, positional deviations caused by model bias can be eliminated. This significantly improves the accuracy of the determined position of the target identification information in the target object, thereby ensuring that all target identification information can be accurately identified. This solves the problem of low accuracy in identifying container numbers in related technologies.
[0130] Based on the foregoing embodiments, embodiments of this application provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement... Figure 1 The corresponding embodiments provide the steps of the information determination method.
[0131] Based on the foregoing embodiments, embodiments of this application provide a computer program product, including a computer program that can be executed by a processor 31 to perform... Figure 1 The corresponding embodiments provide the steps of the information determination method.
[0132] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for determining information, characterized in that, The method includes: Acquire target images for multiple objects to be identified; wherein, each object to be identified is marked with its target identification information; The target image is divided using multiple different algorithms to obtain multiple sub-images corresponding to each algorithm; The target detection model is used to process multiple sub-images corresponding to each algorithm to obtain multiple positions of each target identification information in the target image; Based on the multiple locations, the target location of each target identification information in the target image is determined; The target image is processed based on the target location and target text recognition model to obtain the target identification information of each object to be identified.
2. The method according to claim 1, characterized in that, The target image is segmented using multiple different algorithms to obtain multiple sub-images corresponding to each algorithm, including: The target image is processed using a target instance segmentation algorithm to obtain multiple first sub-images; The target image is processed using a target slicing algorithm to obtain multiple second sub-images.
3. The method according to claim 2, characterized in that, The method involves using a target detection model to process multiple sub-images corresponding to each algorithm, obtaining multiple locations of each target identifier information in the target image, including: The target detection model is used to process the plurality of first sub-images to obtain a first region at a first position in the target image; wherein, the target detection model includes an attention module; the first region is the region where the target identification information is located in each first sub-image; The target detection model is used to process the multiple second sub-images to obtain the second region at the second position in the target image; wherein, the second region is the region where the identification information is located in each second sub-image; one target identification information corresponds to multiple identification information.
4. The method according to claim 3, characterized in that, Determining the target location of each target identifier information in the target image based on the multiple locations includes: Determine the degree of overlap between each first region and a second region that matches each first region; The target location is determined based on the overlap value corresponding to each target identifier, the first location, and the second location.
5. The method according to claim 4, characterized in that, Determining the target location based on the overlap value corresponding to each target identifier information, the first location, and the second location includes: For first target identification information whose overlap value is greater than or equal to a target threshold, the target position of the first target identification information in the target image is determined based on the first position of the first sub-region corresponding to the first target identification information in the target image and the second position of the second region matching the first sub-region in the target image; wherein, the first region includes the first sub-region.
6. The method according to claim 5, characterized in that, The method further includes: For second target identification information whose overlap value is less than the target threshold, a third sub-image is determined from the target image based on the first position of the second sub-region corresponding to the second target identification information in the target image and the second position of the second region matching the second sub-region in the target image; wherein, the third sub-image has the second target identification information; the first region includes the second sub-region; The target detection model is used to process the third sub-image to obtain the target location of the second target identification information in the target image.
7. The method according to claim 1, characterized in that, The process of recognizing the target image based on the target location and target text recognition model to obtain target identification information for each object to be identified includes: The target image is segmented based on the target location to obtain a target sub-image corresponding to each target identification information; The target text recognition model is used to perform text recognition on each target sub-image to obtain the initial identification information of each object to be recognized. Each initial identification information is verified. If the initial identification information is successfully verified, the target identification information is determined to be the initial identification information; If the initial identification information verification fails, the target identification information is obtained by correcting the initial identification information using the target language processing model.
8. An information determining device, characterized in that, The device includes: a processor, a memory, and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute an information determination program in memory to implement the steps of the information determination method as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the information determination method as described in any one of claims 1-7.
10. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the information determination method according to any one of claims 1-7.