Target character recognition method and device and computer equipment
By interpolation amplification and feature extraction of computer-aided design drawings, combined with multi-class convolution kernels and reinforcement learning models, the problem of low character recognition accuracy in the drawings is solved, and high-precision character recognition effect is achieved.
Patent Information
- Application Number
- CN202411034219.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-12-03
AI Technical Summary
Character recognition accuracy in computer-aided design drawings is low, and traditional optical character recognition technology is difficult to understand complex formats and layouts, resulting in a decrease in recognition accuracy and cannot meet the high-precision needs of the engineering field.
By acquiring the original image to be recognized, interpolated and amplified and divided into sub-images, feature extraction and stitching are used for pre-trained edge feature extraction model, image adjustment is used to determine target characters, and edge optimization is optimized using multi-class convolution kernel and reinforcement learning model Features to improve recognition accuracy.
It improves the character recognition accuracy in computer-aided design drawings, realizes high-precision recognition of complex backgrounds and low-quality images, and meets the high-precision information needs in the engineering field.
Smart Images

Figure CN119068492A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and computer equipment for target character recognition. Background Art
[0002] Computer-aided design drawings have become an indispensable tool for designers and engineers. However, since the overall framework of computer-aided design drawings is large, while the characters in the drawings are very small, it is more difficult for people to identify and read them. This challenge is particularly evident when it is necessary to quickly retrieve or analyze drawing information. Although traditional optical character recognition technology performs well in processing ordinary text information, it encounters difficulties when facing computer-aided design drawings. Since the text in computer-aided design drawings is often surrounded by lines, symbols, annotations and other graphic elements, general optical character recognition software cannot reliably understand and extract this text information. The interference of these graphic elements causes the recognition accuracy to drop significantly, which cannot meet the needs of the engineering field for high-precision information recognition. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus and computer device for target character recognition, so as to at least solve the technical problem of low accuracy in character recognition in computer-aided design drawings in the related art.
[0004] According to one aspect of an embodiment of the present application, a target character recognition method is provided, including: acquiring an original image to be recognized; interpolating and amplifying the original image to obtain a target image, and dividing the target image into multiple sub-images; using a pre-trained edge feature extraction model to perform feature extraction on the original image and the multiple sub-images respectively to obtain a first feature map and a second feature map, and splicing the first feature map and the second feature map to obtain a target feature map; adjusting the original image according to the target feature map to obtain a target original image, and using the edge feature extraction model to perform feature extraction on the target original image to obtain a final feature map; determining the target character in the original image to be recognized according to the final feature map.
[0005] Optionally, the original image is interpolated and enlarged to obtain a target image, including: determining the position coordinates of the original image from the source image; finding two integer coordinate pixel points closest to the position coordinates from the beginning and end of the original image in the horizontal direction, respectively, to determine them as a first pixel point group; finding two integer coordinate pixel points closest to the position coordinates from the beginning and end of the original image in the vertical direction, respectively, to determine them as a second pixel point group; interpolating the pixel values between the first pixel point group using bilinear interpolation to obtain a first interpolation result; interpolating the pixel values between the second pixel point group using bilinear interpolation to obtain a second interpolation result; and enlarging the original image based on the first interpolation result and the second interpolation result to obtain the target image.
[0006] Optionally, after obtaining the target feature map, the method further includes: using a predetermined multi-class convolution kernel to perform feature mapping on the target feature map to obtain multiple feature maps, wherein the multi-class convolution kernel includes at least: edge detectors in different directions; fusing the multiple feature maps with the target feature map to obtain a feature map after feature enhancement; constructing an edge optimization model based on the feature map after feature enhancement; using the edge optimization model to determine the target tilt angle of the original image, and tilting the original image according to the target tilt angle to obtain the target original image.
[0007] Optionally, an edge optimization model is constructed based on the feature map after feature enhancement, including: acquiring a state space and an action space, wherein the state space includes: multiple states, and the multiple states represent multiple feature maps, and the action space includes: multiple actions, and the multiple actions represent the tilt angles of the original image; using the feature map after feature enhancement as the initial state, and selecting different types of actions to execute according to the initial state to obtain different evaluation index values, and the evaluation index values are used to represent the expected values of rewards that can be obtained by executing different actions for different types of states; updating the evaluation index values according to a preset formula until convergence to obtain the edge optimization model.
[0008] Optionally, the preset formula includes:
[0009] newQ S,A =Q S,A +α(R S,A +γ*maxQ ′ (s ′ ,a ′ )-Q S,A );
[0010] Where newQ S,ARepresents the new evaluation index value corresponding to different actions and states, Q S,A represents the current evaluation index value, α represents the learning efficiency, R S,A represents the rewards based on different actions and states, γ represents the discount factor, represents the current value of future rewards, and max Q ′ (s ′ ,a ′ ) indicates that in the new state s ′ Next and perform action a ′ The biggest reward.
[0011] Optionally, determining the target character according to the final feature map includes: dividing the multi-layer feature map in the final feature map into multiple groups of feature maps according to a preset number of layers; obtaining an output feature output by each group of feature maps, and fusing each output feature to obtain a fused output feature; and determining the target character based on the fused output feature.
[0012] Optionally, determining the target character based on the fused output feature includes: upsampling the target feature map to obtain an image containing a detection frame; and recognizing the image within the detection frame to obtain the target character.
[0013] According to another aspect of an embodiment of the present application, a target character recognition device is also provided, including: an acquisition module, used to acquire an original image to be recognized; an amplification module, used to interpolate and amplify the original image to obtain a target image, and divide the target image into multiple sub-images; a splicing module, used to use a pre-trained edge feature extraction model to respectively extract features from the original image and the multiple sub-images to obtain a first feature map and a second feature map, and splice the first feature map and the second feature map to obtain a target feature map; an adjustment module, used to adjust the original image according to the target feature map to obtain a target original image, and use the edge feature extraction model to extract features from the target original image to obtain a final feature map; a determination module, used to determine the target character in the original image to be recognized according to the final feature map.
[0014] According to another aspect of the embodiment of the present application, a computer device is also provided, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor is connected to the memory and is used to execute the above-mentioned target character recognition method.
[0015] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-mentioned target character recognition method by running the computer program.
[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including computer instructions, which implement the above-mentioned target character recognition method when executed by a processor.
[0017] In an embodiment of the present application, an original image to be identified is acquired; the original image is interpolated and amplified to obtain a target image, and the target image is divided into multiple sub-images; a pre-trained edge feature extraction model is used to perform feature extraction on the original image and the multiple sub-images to obtain a first feature map and a second feature map, and the first feature map and the second feature map are spliced to obtain a target feature map; the original image is adjusted according to the target feature map to obtain a target original image, and the edge feature extraction model is used to perform feature extraction on the target original image to obtain a final feature map; the target character in the original image to be identified is determined according to the final feature map, thereby achieving the purpose of further adjusting the input original image using the fused features to obtain the optimal image features, thereby achieving the technical effect of improving the accuracy of target character recognition, and thus solving the technical problem of low character recognition accuracy in computer-aided design drawings in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 is a hardware structure block diagram of a computer terminal for implementing a target character recognition method according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of a target character recognition method according to an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of a feature splicing process according to an embodiment of the present application;
[0022] Figure 4 is a schematic diagram of target feature map mapping according to an embodiment of the present application;
[0023] Figure 5 is a schematic diagram of an edge optimization model training process according to an embodiment of the present application;
[0024] Figure 6 is a flow chart of another target character recognition method according to an embodiment of the present application;
[0025] Figure 7 It is a structural diagram of a target character recognition device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] The information collected in the embodiments of the present application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or reject automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0029] The existing character recognition methods are limited to using optical character recognition technology to recognize characters in computer-aided design drawings. However, traditional recognition methods have difficulty understanding the complex format and layout of documents, especially when dealing with low-quality images, complex backgrounds or special fonts. There are many errors, which may include character recognition errors, word segmentation errors or format parsing errors, resulting in low recognition accuracy.
[0030] In order to solve the problems existing in the related art, the present application embodiment provides a target character recognition method, which can be run on Figure 1 In the computer terminal shown, the computer terminal is explained below.
[0031] The target character recognition method embodiment provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a target character recognition method. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions connected via a wired and / or wireless network. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0032] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0033] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the target character recognition method in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned target character recognition method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0034] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0035] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0036] It should be noted that, in some optional embodiments, the above Figure 1 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.
[0037] In the above-mentioned operating environment, an embodiment of the present application provides an embodiment of a target character recognition method. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] Figure 2 is a flow chart of a target character recognition method according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0039] Step S202, obtaining an original image to be identified;
[0040] In the above step S202, to obtain the original image, it is first necessary to determine the corresponding position of the original image in the source image, and to obtain it from the corresponding position. It should be noted that the original image includes but is not limited to a computer-aided design drawing.
[0041] Step S204: interpolate and enlarge the original image to obtain a target image, and divide the target image into a plurality of sub-images.
[0042] In the above step S204, the target image may be divided into a plurality of sub-images by interpolation segmentation. There are many interpolation methods, such as bilinear interpolation.
[0043] Step S206: Use a pre-trained edge feature extraction model to perform feature extraction on the original image and the multiple sub-images to obtain a first feature map and a second feature map, and splice the first feature map and the second feature map to obtain a target feature map.
[0044] Specific as Figure 3 As shown in the figure, a CAD (Computer-Aided Design) with a resolution of 224*224 is used to extract a feature map (first feature map) of 16*16*768 through an edge feature extraction model, and the original image (CAD image) is interpolated to obtain a target image (enlarged CAD image), and four 224*224 sub-images are obtained by segmentation, and the corresponding sub-image feature maps are merged into a feature map of 32*32*768 (second feature map), and then pooled and spliced with the first feature map to obtain a feature map of 16*16*1536 (target feature map). And this feature map has the same spatial shape as the single-size feature, but has a higher channel dimension.
[0045] It can be understood that the target image is segmented by interpolation.
[0046] Step S208, adjusting the original image according to the target feature map to obtain a target original image, and using the edge feature extraction model to extract features from the target original image to obtain a final feature map.
[0047] Step S210, determining the target character in the original image to be recognized according to the final feature map.
[0048] There are many ways to interpolate and enlarge the original image, such as nearest neighbor interpolation, bilinear interpolation and bicubic interpolation. In the embodiment of the present application, bilinear interpolation can be used, as shown below: determine the position coordinates of the original image from the source image; find the two integer coordinate pixel points closest to the position coordinates from the beginning and end of the original image in the horizontal direction, and determine them as the first pixel point group; find the two integer coordinate pixel points closest to the position coordinates from the beginning and end of the original image in the vertical direction, and determine them as the second pixel point group; use bilinear interpolation to interpolate the pixel values between the first pixel point group to obtain a first interpolation result; use bilinear interpolation to interpolate the pixel values between the second pixel point group to obtain a second interpolation result; enlarge the original image based on the first interpolation result and the second interpolation result to obtain the target image.
[0049] For example: First, we need to determine the corresponding position of the original image in the source image. The first and last positions in the horizontal direction are recorded as Q11 and Q12 respectively. Use bilinear interpolation to estimate the pixel value between Q11 and Q12. Repeat a similar process in the vertical direction, using the two interpolation results obtained in the previous step, and through linear interpolation in the above two directions, we get the final interpolation result of 2 times the target magnification of the original image.
[0050] In an optional manner, after obtaining the target feature map, the method further includes: using a predetermined multi-class convolution kernel to perform feature mapping on the target feature map to obtain multiple feature maps, wherein the multi-class convolution kernel includes at least: edge detectors in different directions; fusing the multiple feature maps with the target feature map to obtain a feature map after feature enhancement; constructing an edge optimization model based on the feature map after feature enhancement; using the edge optimization model to determine the target tilt angle of the original image, and tilting the original image according to the target tilt angle to obtain the target original image.
[0051] Figure 4 A method of performing feature mapping on a target feature map is shown, such as Figure 4 As shown, after the multi-dimensional features (target feature maps) are mapped using multi-class convolution kernels, feature fusion is performed to finally obtain edge enhanced features (feature maps after feature enhancement).
[0052] In some embodiments of the present application, an edge optimization model is constructed based on the feature map after feature enhancement, including: acquiring a state space and an action space, wherein the state space includes: multiple states, and the multiple states represent multiple feature maps, and the action space includes: multiple actions, and the multiple actions represent the tilt angles of the original image; using the feature map after feature enhancement as the initial state, and selecting different types of actions to execute according to the initial state to obtain different evaluation index values, and the evaluation index values are used to represent the expected values of rewards that can be obtained by executing different actions for different types of states; updating the evaluation index values according to a preset formula until convergence to obtain the edge optimization model.
[0053] Among them, the preset formula includes:
[0054] newQ S,A =Q S,A +α(R S,A +γ*maxQ ′ (s ′ ,a ′ )-Q S,A );
[0055] Where newQ S,A Represents the new evaluation index value corresponding to different actions and states, Q S,A represents the current evaluation index value, α represents the learning efficiency, R S,A represents the rewards based on different actions and states, γ represents the discount factor, represents the current value of future rewards, and max Q ′ (s ′ ,a ′ ) indicates that in the new state s ′ Next and perform action a ′ The biggest reward.
[0056] Take the original image tilting up or down 10 degrees as an action as an example, and use Q-Learing as the training algorithm. During the training process, try different actions and output a Q value (evaluation index value). Estimate the performance of the model at regular intervals and adjust the learning parameters or reward function as needed. Figure 5 The specific training process of an edge optimization model is shown, such as Figure 5 As shown, the feature map after feature enhancement is determined as the initial state, an action is selected based on the current state, and the Q value is updated sequentially until the Q value converges.
[0057] The specific steps of determining the target character according to the final feature map include: dividing the multi-layer feature map in the final feature map into multiple groups of feature maps according to a preset number of layers; obtaining an output feature output by each group of feature maps, and fusing each output feature to obtain a fused output feature; and determining the target character based on the fused output feature.
[0058] In some embodiments of the present application, determining the target character based on the fused output feature includes: upsampling the target feature map to obtain an image containing a detection frame; and recognizing the image within the detection frame to obtain the target character.
[0059] It should be noted that feature fusion and edge feature enhancement based on the features corresponding to multi-scale images can establish appropriate frame diagrams for all valid characters in the key areas of the input image, reduce the trust in irrelevant information, and have good robustness, laying a good foundation for subsequent recognition and storage.
[0060] The present application also provides another target character recognition method, such as Figure 6 As shown, including:
[0061] First, edge features are extracted from the original image (CAD image), and the original image and the interpolated sub-image are placed in VIT-L / 16 (an edge feature extraction model). After training and verification, the CAD image to be recognized is input, and the two sets of 16*16 pixel blocks are processed separately and then fused and spliced. Secondly, the spliced feature map is further mapped and fused with the original feature map using four different convolution kernels to obtain a boundary enhancement feature map. On this basis, a large environment is built to carry out reinforcement learning. Image data is used as input and sent to the reinforcement learning model after feature extraction. The feature extraction is performed after making a decision based on the feature map update strategy. After that, an output feature is extracted every 16 layers of the feature map with better effect, and each adjacent two layers of each output feature are fused together. Then, a top-down layer-by-layer fusion design is adopted. After upsampling, a CAD map with a bounding box is obtained, and the bounding box information is also saved in the file. Next, the CAD drawing obtained above is divided into small boxes containing various characters, which are input into the character recognition model. At the same time, a data matching library is established, and the image feature extraction network is used to extract image information at different levels. Finally, after the established database is stored, each small box that has been identified is returned to the original CAD drawing containing the box and output.
[0062] Figure 7 is a structural diagram of a target character recognition device according to an embodiment of the present application, such as Figure 7 As shown, the device comprises:
[0063] An acquisition module 70, used to acquire an original image to be identified;
[0064] An enlargement module 72, configured to interpolate and enlarge the original image to obtain a target image, and divide the target image into a plurality of sub-images;
[0065] A splicing module 74 is used to use a pre-trained edge feature extraction model to extract features from the original image and the multiple sub-images to obtain a first feature map and a second feature map, and splice the first feature map and the second feature map to obtain a target feature map;
[0066] An adjustment module 76, configured to adjust the original image according to the target feature map to obtain a target original image, and to extract features from the target original image using the edge feature extraction model to obtain a final feature map;
[0067] The determination module 78 is used to determine the target character in the original image to be recognized according to the final feature map.
[0068] The method comprises the following steps: obtaining an original image to be identified; performing interpolation and amplification on the original image to obtain a target image, and dividing the target image into multiple sub-images; using a pre-trained edge feature extraction model to respectively extract features from the original image and the multiple sub-images to obtain a first feature map and a second feature map, and splicing the first feature map and the second feature map to obtain a target feature map; adjusting the original image according to the target feature map to obtain a target original image, and performing feature extraction on the target original image using the edge feature extraction model to obtain a final feature map; determining the target character in the original image to be identified according to the final feature map, thereby achieving the purpose of further adjusting the input original image by using the fused features to obtain the optimal image features, thereby achieving the technical effect of improving the recognition accuracy of the target characters, and thereby solving the technical problem of low character recognition accuracy in computer-aided design drawings in the related art.
[0069] The enlargement module 72 in the above-mentioned target character recognition device includes: an enlargement submodule, which is used to interpolate and enlarge the original image to obtain a target image, including: determining the position coordinates of the original image from the source image; finding two integer coordinate pixel points closest to the position coordinates from the two ends of the original image in the horizontal direction, respectively, to determine as a first pixel point group; finding two integer coordinate pixel points closest to the position coordinates from the two ends of the original image in the vertical direction, respectively, to determine as a second pixel point group; interpolating the pixel values between the first pixel point group using a bilinear interpolation method to obtain a first interpolation result; interpolating the pixel values between the second pixel point group using a bilinear interpolation method to obtain a second interpolation result; enlarging the original image based on the first interpolation result and the second interpolation result to obtain the target image.
[0070] The adjustment module 76 includes: a target submodule, which is used for obtaining the target feature map. After the method further includes: using a predetermined multi-class convolution kernel to perform feature mapping on the target feature map to obtain multiple feature maps, wherein the multi-class convolution kernel includes at least: edge detectors in different directions; fusing the multiple feature maps with the target feature map to obtain a feature map after feature enhancement; constructing an edge optimization model based on the feature map after feature enhancement; using the edge optimization model to determine the target tilt angle of the original image, and tilting the original image according to the target tilt angle to obtain the target original image.
[0071] The target submodule includes: a construction unit for constructing an edge optimization model based on the feature map after feature enhancement, including: obtaining a state space and an action space, wherein the state space includes: multiple states, the multiple states represent multiple feature maps, and the action space includes: multiple actions, the multiple actions represent the tilt angle of the original image; using the feature map after feature enhancement as the initial state, and selecting different types of actions to perform according to the initial state to obtain different evaluation index values, the evaluation index values are used to represent the expected value of the reward that can be obtained by performing different actions for different types of states; updating the evaluation index values according to a preset formula until convergence, and obtaining the edge optimization model. The preset formula includes:
[0072] newQ S,A =Q S,A +α(R S,A +γ*maxQ ′ (s ′ ,a ′ )-Q S,A );
[0073] Where newQS,A Represents the new evaluation index value corresponding to different actions and states, Q S,A represents the current evaluation index value, α represents the learning efficiency, R S,A represents the rewards based on different actions and states, γ represents the discount factor, represents the current value of future rewards, and max Q ′ (s ′ ,a ′ ) indicates that in the new state s ′ Next and perform action a ′ The biggest reward.
[0074] The determination module 78 includes: a determination submodule, which is used to determine the target character according to the final feature map, including: dividing the multi-layer feature map in the final feature map into multiple groups of feature maps according to a preset number of layers; obtaining an output feature output by each group of feature maps, and fusing each output feature to obtain a fused output feature; and determining the target character based on the fused output feature.
[0075] The determination submodule includes: a determination unit, which is used to determine the target character based on the fusion output feature, including: upsampling the target feature map to obtain an image containing a detection frame; and recognizing the image in the detection frame to obtain the target character.
[0076] It should be noted that Figure 7 The target character recognition device shown is used to perform Figure 2 The target character recognition method shown in the figure, therefore the relevant explanations in the above target character recognition method are also applicable to the target character recognition device, and will not be repeated here.
[0077] An embodiment of the present application also provides a computer device, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor is connected to the memory and is used to execute the above-mentioned target character recognition method.
[0078] An embodiment of the present application further provides a non-volatile storage medium, which includes a stored computer program, wherein a device where the non-volatile storage medium is located executes the above-mentioned target character recognition method by running the computer program.
[0079] An embodiment of the present application also provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the target character recognition method in the present application are implemented.
[0080] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the target character recognition method in the present application.
[0081] The embodiment of the present application also provides a computer program, which, when executed by a processor, implements the steps of the target character recognition method in the present application.
[0082] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0083] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0084] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0085] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0086] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0087] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0088] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A target character recognition method, characterized in that: include: Obtaining an original image to be recognized; Interpolating and enlarging the original image to obtain a target image, and dividing the target image into a plurality of sub-images; Using a pre-trained edge feature extraction model to perform feature extraction on the original image and the multiple sub-images to obtain a first feature map and a second feature map, and splicing the first feature map and the second feature map to obtain a target feature map; The original image is adjusted according to the target feature map to obtain a target original image, and the edge feature extraction model is used to extract features from the target original image to obtain a final feature map; The target character in the original image to be recognized is determined according to the final feature map.
2. The method according to claim 1, characterized in that The original image is interpolated and enlarged to obtain a target image, comprising: Determine the position coordinates of the original image from the source image; Find two pixel points with integer coordinates closest to the position coordinates from the beginning and the end of the original image in the horizontal direction, and determine them as the first pixel point group; Find two pixel points with integer coordinates closest to the position coordinates from the beginning and the end of the original image in the vertical direction, and determine them as the second pixel point group; Interpolating the pixel values between the first pixel point groups using a bilinear interpolation method to obtain a first interpolation result; Interpolating the pixel values between the second pixel point groups by bilinear interpolation to obtain a second interpolation result; The original image is enlarged based on the first interpolation result and the second interpolation result to obtain the target image.
3. The method according to claim 1, characterized in that After obtaining the target feature map, the method further includes: Using a predetermined multi-class convolution kernel to perform feature mapping on the target feature map to obtain a plurality of feature maps, wherein the multi-class convolution kernel includes at least: edge detectors in different directions; Fusion of the plurality of feature maps with the target feature map to obtain a feature map after feature enhancement; Constructing an edge optimization model based on the feature map after feature enhancement; The target tilt angle of the original image is determined by using the edge optimization model, and the original image is tilted according to the target tilt angle to obtain the target original image.
4. The method according to claim 3, characterized in that: Building an edge optimization model based on the feature map after feature enhancement, including: Acquire a state space and an action space, wherein the state space includes: a plurality of states, the plurality of states represent a plurality of feature maps, and the action space includes: a plurality of actions, the plurality of actions represent the tilt angle of the original image; The feature map after feature enhancement is used as the initial state, and different types of actions are selected to be executed according to the initial state to obtain different evaluation index values, where the evaluation index values are used to represent the expected value of the reward that can be obtained by executing different actions for different types of states; The evaluation index value is updated according to a preset formula until convergence to obtain the edge optimization model.
5. The method according to claim 4, characterized in that The preset formula includes: newQ S,A =Q S,A +α(R S,A +γ*maxQ ′ (s ′ ,a ′ )-Q S,A ); Where newQ S,A Represents the new evaluation index value corresponding to different actions and states, Q S,A represents the current evaluation index value, α represents the learning efficiency, R S,A represents the rewards based on different actions and states, γ represents the discount factor, represents the current value of future rewards, and max Q ′ (s ′ ,a ′ ) indicates that in the new state s ′ Next and perform action a ′ The biggest reward.
6. The method according to claim 3, characterized in that: Determining the target character according to the final feature map includes: Dividing the multiple layers of feature maps in the final feature map into multiple groups of feature maps according to a preset number of layers; Obtain an output feature output by each set of feature maps, and fuse each output feature to obtain a fused output feature; The target character is determined based on the fused output feature.
7. The method according to claim 6, characterized in that Determining the target character based on the fused output feature includes: Upsampling the target feature map to obtain an image containing a detection frame; The image in the detection frame is recognized to obtain the target character.
8. A target character recognition device, characterized in that: include: An acquisition module, used for acquiring an original image to be recognized; An enlargement module, used for performing interpolation enlargement on the original image to obtain a target image, and dividing the target image into a plurality of sub-images; A splicing module, configured to use a pre-trained edge feature extraction model to perform feature extraction on the original image and the plurality of sub-images to obtain a first feature map and a second feature map, and splice the first feature map and the second feature map to obtain a target feature map; An adjustment module, used for adjusting the original image according to the target feature map to obtain a target original image, and extracting features from the target original image using the edge feature extraction model to obtain a final feature map; A determination module is used to determine the target character in the original image to be recognized according to the final feature map.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory is used to store program instructions; The processor is connected to the memory and is used to execute the target character recognition method described in any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the target character recognition method described in any one of claims 1 to 7 is implemented.
