CN114511694B - Image recognition method, device, electronic equipment and medium - Google Patents

Image recognition method, device, electronic equipment and medium Download PDF

Info

Publication number
CN114511694B
CN114511694B CN202210107793.1A CN202210107793A CN114511694B CN 114511694 B CN114511694 B CN 114511694B CN 202210107793 A CN202210107793 A CN 202210107793A CN 114511694 B CN114511694 B CN 114511694B
Authority
CN
China
Prior art keywords
detected
detection
area
box
bounding box
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210107793.1A
Other languages
Chinese (zh)
Other versions
CN114511694A (en
Inventor
朱雄威
孙逸鹏
姚锟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202210107793.1A priority Critical patent/CN114511694B/en
Publication of CN114511694A publication Critical patent/CN114511694A/en
Application granted granted Critical
Publication of CN114511694B publication Critical patent/CN114511694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Abstract

The disclosure provides an image recognition method, an image recognition device, electronic equipment and a medium, relates to the technical field of artificial intelligence, in particular to the technical field of deep learning and computer vision, and can be applied to scenes such as optical character recognition. The implementation scheme is as follows: performing target detection on an image to be detected, which comprises an object to be detected, to obtain a boundary detection frame and one or more area detection frames aiming at the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds one target area in the object to be detected; acquiring a minimum bounding box based on at least one region detection box in the one or more region detection boxes, wherein the minimum bounding box is a bounding box with the smallest area in a plurality of bounding boxes capable of bounding the at least one region detection box; determining the ratio of the area of the minimum bounding box to the area of the boundary detection box; and determining that the object to be detected is incomplete in response to the ratio exceeding a threshold.

Description

Image recognition method, device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of artificial intelligence, and more particularly, to the field of deep learning and computer vision, and may be applied to optical character recognition (Optical Character Recognition, OCR) and other scenarios, and in particular, to an image recognition method, apparatus, electronic device, computer-readable storage medium, and computer program product.
Background
Artificial intelligence is the discipline of studying the process of making a computer mimic certain mental processes and intelligent behaviors (e.g., learning, reasoning, thinking, planning, etc.) of a person, both hardware-level and software-level techniques. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning/deep learning technology, a big data processing technology, a knowledge graph technology and the like.
Image recognition is an image processing task in the field of artificial intelligence, and refers to a technology for processing, analyzing and understanding images by using a computer to recognize targets and objects in various different modes, and is a practical application for applying a deep learning algorithm.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, the problems mentioned in this section should not be considered as having been recognized in any prior art unless otherwise indicated.
Disclosure of Invention
The present disclosure provides an image recognition method, apparatus, electronic device, computer-readable storage medium, and computer program product.
According to an aspect of the present disclosure, an image recognition method is provided. The method comprises the following steps: performing target detection on an image to be detected, which comprises an object to be detected, to obtain a boundary detection frame and one or more area detection frames aiming at the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds one target area in the object to be detected; acquiring a minimum bounding box based on at least one region detection box in the one or more region detection boxes, wherein the minimum bounding box is a bounding box with the smallest area in a plurality of bounding boxes capable of bounding the at least one region detection box; determining the ratio of the area of the minimum bounding box to the area of the boundary detection box; and determining that the object to be detected is incomplete in response to the ratio exceeding a threshold.
According to another aspect of the present disclosure, an image recognition apparatus is provided. The device comprises: the target detection unit is configured to perform target detection on a to-be-detected image comprising an object to be detected, obtain a boundary detection frame and one or more area detection frames aiming at the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds one target area in the object to be detected; a minimum bounding box acquisition unit configured to acquire a minimum bounding box, which is a bounding box having a smallest area among a plurality of bounding boxes capable of bounding at least one region detection box, based on at least one region detection box of the one or more region detection boxes; an area ratio determining unit configured to determine a ratio of an area of the minimum bounding box to an area of the boundary detection box; and an integrity determination unit configured to determine that the object to be detected is incomplete in response to the ratio exceeding a threshold.
According to another aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method according to the above.
According to another aspect of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform a method according to the above.
According to another aspect of the present disclosure, there is also provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the above-described method.
According to one or more embodiments of the present disclosure, whether an image to be recognized is complete or not can be determined efficiently and at low cost.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The accompanying drawings illustrate exemplary embodiments and, together with the description, serve to explain exemplary implementations of the embodiments. The illustrated embodiments are for exemplary purposes only and do not limit the scope of the claims. Throughout the drawings, identical reference numerals designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, in accordance with an embodiment of the present disclosure;
FIG. 2 illustrates a flow chart of an image recognition method according to an embodiment of the present disclosure;
FIG. 3a illustrates a scene graph in which an image recognition method according to embodiments of the present disclosure may be implemented;
FIG. 3b illustrates a scene graph in which an image recognition method according to an embodiment of the present disclosure may be implemented;
FIG. 4a illustrates a scene graph in which an image recognition method according to embodiments of the present disclosure may be implemented;
FIG. 4b illustrates a scene graph in which an image recognition method according to an embodiment of the present disclosure may be implemented;
fig. 5 shows a block diagram of a structure of an image recognition apparatus according to an embodiment of the present disclosure;
fig. 6 shows a block diagram of a structure of an image recognition apparatus according to an embodiment of the present disclosure; and
Fig. 7 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, the use of the terms "first," "second," and the like to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of the elements, unless otherwise indicated, and such terms are merely used to distinguish one element from another element. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, they may also refer to different instances based on the description of the context.
The terminology used in the description of the various illustrated examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, the elements may be one or more if the number of the elements is not specifically limited. Furthermore, the term "and/or" as used in this disclosure encompasses any and all possible combinations of the listed items.
In the related art, when an image is identified, for example, due to the shooting angle, illumination, etc. of the image, the image to be identified may be incomplete, and in the subsequent identification process of the incomplete image, an image identification result with poor quality or even an error may be obtained. For example, in some Optical Character Recognition (OCR) scenarios, it is necessary to perform structural recognition on a card type image (such as a driver license, a bank card, a format ticket, etc.), if the card type image to be recognized is incomplete (such as damage to a card portion, incomplete shooting of a card when shooting a card, etc.), erroneous text recognition results may be caused, or text recognition may not be performed, affecting user experience.
The related technology is used for training the neural network model special for judging the image integrity, and the method is used for increasing the image integrity classification model on the basis of the original image recognition or text recognition neural network model, so that the efficiency is low, and the model training cost is increased.
Based on this, the present disclosure proposes an image recognition scheme. The minimum bounding box and the boundary detection box in the image to be identified are obtained, and the ratio of the minimum bounding box and the boundary detection box is compared with the threshold value, so that whether the image to be detected is complete or not is judged efficiently and at low cost.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented, in accordance with an embodiment of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In embodiments of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the image recognition method.
In some embodiments, server 120 may also provide other services or software applications that may include non-virtual environments and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof that are executable by one or more processors. A user operating client devices 101, 102, 103, 104, 105, and/or 106 may in turn utilize one or more client applications to interact with server 120 to utilize the services provided by these components. It should be appreciated that a variety of different system configurations are possible, which may differ from system 100. Accordingly, FIG. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The user may acquire an image to be detected using the client devices 101, 102, 103, 104, 105, and/or 106, and send the image to be detected to the server 120. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that the present disclosure may support any number of client devices.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and the like. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, linux, or Linux-like operating systems (e.g., GOOGLE Chrome OS); or include various mobile operating systems such as MICROSOFT Windows Mobile OS, iOS, windows Phone, android. Portable handheld devices may include cellular telephones, smart phones, tablet computers, personal Digital Assistants (PDAs), and the like. Wearable devices may include head mounted displays (such as smart glasses) and other devices. The gaming system may include various handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any type of network known to those skilled in the art that may support data communications using any of a number of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. For example only, the one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture that involves virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain virtual storage devices of the server). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above as well as any commercially available server operating systems. Server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
In some implementations, server 120 may include one or more applications, such as applications for services such as object detection and recognition, signal conversion, etc., based on data such as images, video, voice, text, digital signals, etc., to process task requests such as voice interactions, text classification, image recognition, or keypoint detection received from client devices 101, 102, 103, 104, 105, and/or 106. The server can train the neural network model by using training samples according to specific deep learning tasks, test each sub-network in the super-network module of the neural network model, and determine the structure and parameters of the neural network model for executing the deep learning tasks according to the test results of each sub-network. Various data may be used as training sample data for a deep learning task, such as image data, audio data, video data, or text data. After training of the neural network model is completed, the server 120 may also automatically search out the optimal model structure through a model search technique to perform a corresponding task.
In some implementations, the server 120 may be a server of a distributed system or a server that incorporates a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The cloud server is a host product in a cloud computing service system, so as to solve the defects of large management difficulty and weak service expansibility in the traditional physical host and virtual private server (VPS, virtual Private Server) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of databases 130 may be used to store information such as audio files and video files. Database 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. Database 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve the databases and data from the databases in response to the commands.
In some embodiments, one or more of databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key value stores, object stores, or conventional stores supported by the file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
Fig. 2 shows a flowchart of an image recognition method 200 according to an embodiment of the present disclosure.
As shown in fig. 2, the image recognition method 200 includes: step S210, performing target detection on an image to be detected, which comprises an object to be detected, and obtaining a boundary detection frame and one or more area detection frames for the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds one target area in the object to be detected; step S220, acquiring a minimum bounding box based on at least one area detection box in the one or more area detection boxes, wherein the minimum bounding box is a bounding box with the smallest area in a plurality of bounding boxes capable of bounding the at least one area detection box; step S230, determining the ratio of the area of the minimum bounding box to the area of the boundary detection box; and step S240, determining that the object to be detected is incomplete in response to the ratio exceeding a threshold.
By the method, the minimum bounding box and the boundary detection box in the image to be identified are obtained, wherein the minimum bounding box is a box with the smallest area capable of bounding at least one area detection box, and the at least one area detection box encloses the target area. The threshold value may be a fixed value, for example, a ratio of an area of the minimum bounding box to an area of the boundary detection box in the case of the image being complete. By comparing the ratio of the minimum bounding box to the detected boundary detection box with the above-mentioned threshold value, if the ratio exceeds the threshold value, it is indicated that the area of the detected boundary detection box is smaller than that in the case of the complete image, and therefore, it is possible to determine that the image to be recognized is incomplete. Therefore, whether the image to be detected is complete or not can be judged efficiently, and the recognition efficiency is improved without increasing the cost.
For images to be identified having different sizes and different target areas, a suitable threshold may be chosen. After selecting the proper threshold, for a plurality of images to be identified with the same size and the same target area, whether the images are complete or not can be judged rapidly in a large batch.
The boundary detection box and the one or more region detection boxes for the object to be detected may be obtained by, for example, a border detection model based on the EAST (Efficient and Accurate Scene Text) algorithm.
According to some embodiments, in step S210, performing object detection on an image to be detected including an object to be detected, acquiring a boundary detection box and one or more area detection boxes for the object to be detected may include: inputting the image to be detected into a text detection network model, and obtaining a boundary detection box and one or more area detection boxes which are output by the text detection network model. And, each of the one or more region detection frames respectively encloses a target text line in the object to be detected.
In the middle of OCR recognition of an image, for example, a text detection network model detects a target text line in the image, one or more region detection boxes surrounding the target text line can be generated. In addition, the text recognition network model may perform text recognition on the target text in the region detection box. Judging the integrity of the image by utilizing the result output by the text detection network model (namely, the intermediate result of the OCR recognition process, including the region detection frame), wherein in the existing OCR recognition process, no extra cost is added, no training of a neural network model special for judging the integrity of the image is required, and the overall efficiency of the OCR recognition process can be improved; this advantage is even more pronounced when OCR processing is performed on a large number of images.
Illustratively, the text detection network model may be a full convolution network (Fully Convolutional Networks, FCN), a region generation network (Region Proposal Networks, RPN), or the like. The text recognition network model may be a recurrent neural network (Recurrent Neural Networks, RNN). Upon detection using the text detection network model, a boundary detection box and a region detection box may be acquired for use in determining the integrity of the image in method 200.
Illustratively, the OCR recognition process may also employ an end-to-end recognition framework, i.e., the detection and recognition functions of text are integrated using a convolutional recurrent neural network (Convolutional Recurrent Neural Networks, CRNN), which may include a convolutional layer, a recurrent layer, and a transcribed layer. From the intermediate results of the end-to-end recognition framework, boundary detection boxes and region detection boxes can also be acquired for determining the integrity of the image in method 200.
According to some embodiments, the object to be detected may be the whole or part of the card, and the target area may be a line of user information text in the card. For example, the card may be an identification card, a driver's license, a bank card, a ticket with a fixed format, or the like. Typically, the objects to be detected of the card class have a fixed boundary size and a text composition in a fixed format. The user information text line in the card can be an identification card or a number, a name and the like in the driving card. For the objects to be detected of the card class, the target area (target text line) is usually a plurality of preset areas, and the ratio between the minimum bounding box bounding the areas and the boundary detection box of the card is usually fixed or only has small deviation under the condition that the card image is complete; however, in the case where the card image is incomplete, the ratio between the smallest bounding box bounding these areas and the boundary detection box of the card may exceed a normal value. Therefore, the method 200 can simply and efficiently judge whether the card is complete.
It should be noted that, the card in the present embodiment and the user information in the card come from the public data set.
According to some embodiments, the minimum bounding box may enclose each of the one or more region detection boxes. In some cases, there may be a blockage or reflection of light for a certain text line in the image to be identified, and thus, for those text lines that are blocked or reflected, the corresponding region detection box may not be successfully identified. Therefore, by surrounding each of the one or more region detection frames with the minimum surrounding frame, even if the corresponding region detection frame is not recognized for a certain text line, the accuracy of the obtained minimum surrounding frame can be ensured to the greatest extent, and whether the image is complete can be judged more accurately.
According to some embodiments, the shape of the one or more region detection frames may be rectangular, and the minimum bounding frame may be a rectangular minimum bounding frame. Typically, the acquired detection box for the target area (e.g., text line) is a rectangular box. By adopting the minimum bounding box of the rectangle to bounding the region detection frame, only the coordinates of the diagonal vertices of the region detection frame to be bounding can be determined, and the area of the minimum bounding box of the rectangle can be simply and quickly determined, so that the efficiency is improved.
According to some embodiments, the method 200 may further comprise: and sending prompt information in response to the fact that the object to be detected is incomplete. When the fact that the object to be detected in the image is incomplete is determined, the user can be prompted to adjust the image to be detected by timely sending prompt information, for example, the image to be detected is shot again, so that the shot image comprises the complete object to be detected, and the follow-up accuracy of the identification result of the image content is ensured. For example, when the card in the image to be identified is incomplete, the text content obtained by text identifying the card may have a larger difference from the real content, and by timely prompting the user to re-shoot the card, the text-identified content can be ensured to be more accurate.
Hereinafter, an image recognition method according to an embodiment of the present disclosure will be further described in connection with an OCR application scenario.
Fig. 3a and 3b illustrate scene diagrams in which an image recognition method according to an embodiment of the present disclosure may be implemented. Fig. 3a schematically shows an image comprising a complete card and fig. 3b schematically shows an image comprising an incomplete card. The true boundary of the card is included in fig. 3a and 3 b. Information such as name, number, date, etc. (all shown in the form of "XX") is recorded in the card, and in the card image, the area in which this information is recorded is the target area.
First, an image to be detected including a card may be subject to target detection, and a boundary detection frame 310 and a plurality of area detection frames 320-1, 320-2, 320-3 for the card may be acquired. Wherein the boundary detection box 310 indicates the boundary 330 of the detected card. And wherein each of the plurality of region detection boxes 320-1, 320-2, 320-3 respectively encloses a target region in the card.
Further, the minimum bounding box 340 (a dashed box outside the region detection box 320-2 in the drawing) may be acquired based on at least one region detection box 320-2 of the plurality of region detection boxes, wherein the minimum bounding box 340 is a bounding box having the smallest area among the plurality of bounding boxes capable of bounding the region detection box 320-2.
Further, a ratio of the area of the minimum bounding box 340 to the area of the boundary detection box 310 may be determined (e.g., 0.1 for the case shown in fig. 3 a; 0.15 for the case shown in fig. 3 b).
Further, the card shown in fig. 3b may be determined to be incomplete in response to the ratio 0.15 determined in fig. 3b exceeding a threshold (e.g., 0.11).
Fig. 4a and 4b illustrate scene diagrams in which an image recognition method according to an embodiment of the present disclosure may be implemented. Fig. 4a schematically shows an image comprising a complete card and fig. 4b schematically shows an image comprising an incomplete card. The true boundary of the card is included in fig. 4a and 4 b. Information such as name, number, date, etc. (all shown in the form of "XX") is recorded in the card, and in the card image, the area in which this information is recorded is the target area.
First, an image to be detected including a card may be subject to target detection, and a boundary detection box 410 and a plurality of area detection boxes 420-1, 420-3 for the card may be acquired. Wherein the boundary detection box 410 indicates the boundary 430 of the detected card. And wherein each of the plurality of region detection boxes 420-1, 420-3 respectively encloses a target region in the card.
It is noted that in the examples shown in fig. 4a and 4b, the target area corresponding to the "number" field in the card image is not identified as a corresponding area detection box, for example, due to the card image being occluded (e.g., smeared); and only the target areas corresponding to the non-occluded "name" and "date" fields are identified for the respective area detection boxes 420-1 and 420-3.
For this case, each of the plurality of area detection frames (area detection frames 420-1 and 420-3) is surrounded by a minimum bounding box 440. Even if the corresponding area detection frame is not recognized for the text line of the number field, the accuracy of the obtained minimum bounding box can be ensured, so that whether the image is complete or not can be judged more accurately.
It will be appreciated that there is a certain distance between the detection frame shown by the dotted line in fig. 3a, 3b, 4a, 4b and the card boundary shown by the solid line; and there is also a distance between the detection box shown by the dotted line and the minimum bounding box shown by the dotted line. This is only intended to clearly represent the illustration, in a practical scenario the detection box shown in dashed lines and the card border shown in solid lines may overlap at least partially; and the detection box shown in dashed lines may also overlap at least partially with the smallest bounding box shown in dashed lines, depending on the box detection algorithm applied.
Fig. 5 shows a block diagram of a structure of an image recognition apparatus 500 according to an embodiment of the present disclosure.
As shown in fig. 5, the image recognition apparatus 500 includes: a target detection unit 510, the target detection unit 510 being configured to perform target detection on a to-be-detected image including an object to be detected, obtain a boundary detection frame for the object to be detected and one or more area detection frames, wherein the boundary detection frame indicates a detected boundary of the object to be detected, and wherein each of the one or more area detection frames respectively encloses one target area in the object to be detected; a minimum bounding box acquisition unit 520, the minimum bounding box acquisition unit 520 being configured to acquire a minimum bounding box based on at least one of the one or more region detection boxes, wherein the minimum bounding box is a bounding box having a smallest area among a plurality of bounding boxes capable of bounding the at least one region detection box; an area ratio determining unit 530, the area ratio determining unit 530 being configured to determine a ratio of an area of the minimum bounding box to an area of the boundary detection box; and an integrity determination unit 540, the integrity determination unit 540 being configured to determine that the object to be detected is incomplete in response to the ratio exceeding a threshold.
According to some embodiments, the object detection unit 510 may be further configured to: inputting an image to be detected into a text detection network model, and obtaining a boundary detection frame and one or more area detection frames which are output by the text detection network model; and wherein each of the one or more region detection boxes encloses a respective one of the target text lines in the object to be detected.
According to some embodiments, the minimum bounding box may enclose each of the one or more region detection boxes.
According to some embodiments, the shape of the one or more region detection frames may be rectangular, and the minimum bounding frame may be a rectangular minimum bounding frame.
Fig. 6 shows a block diagram of a structure of an image recognition apparatus 600 according to an embodiment of the present disclosure.
As shown in fig. 6, the image recognition apparatus 600 includes the object detection unit 610 to the integrity determination unit 640, and the object detection unit 610 to the integrity determination unit 640 are similar to the object detection unit 510 to the integrity determination unit 540 of the image recognition apparatus 500 described above with respect to fig. 5, and are not described herein. The image recognition apparatus 600 may further include a prompt unit 650, the prompt unit 650 being configured to issue a prompt message in response to determining that the object to be detected is incomplete.
According to some embodiments, the object to be detected may be the whole or part of a card, and the target area is a line of user information text in the card.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
The present disclosure also provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the methods described above.
The present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform any of the methods described above.
The present disclosure also provides a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements any of the methods described above.
Referring to fig. 7, a block diagram of an electronic device 700 that may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the apparatus 700 includes a computing unit 701 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 may also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in device 700 are connected to I/O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the device 700, the input unit 706 may receive input numeric or character information and generate key signal inputs related to user settings and/or function control of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a trackpad, a trackball, a joystick, a microphone, and/or a remote control. The output unit 707 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. Storage unit 708 may include, but is not limited to, magnetic disks, optical disks. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, a modem, Network card, infrared communication device, wireless communication transceiver and/or chipset, e.g. bluetooth TM Devices, 802.11 devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 701 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 700 via ROM 702 and/or communication unit 709. One or more of the steps of the method 200 described above may be performed when a computer program is loaded into RAM 703 and executed by the computing unit 701. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the method 200 by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the foregoing methods, systems, and apparatus are merely exemplary embodiments or examples, and that the scope of the present invention is not limited by these embodiments or examples but only by the claims following the grant and their equivalents. Various elements of the embodiments or examples may be omitted or replaced with equivalent elements thereof. Furthermore, the steps may be performed in a different order than described in the present disclosure. Further, various elements of the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after the disclosure.

Claims (15)

1. An image recognition method, comprising:
performing target detection on an image to be detected, which comprises an object to be detected, to obtain a boundary detection frame and one or more area detection frames aiming at the object to be detected, wherein the boundary detection frame indicates the detected boundary of the object to be detected, and each area detection frame in the one or more area detection frames respectively surrounds one target area in the object to be detected;
Acquiring a minimum bounding box based on at least one region detection box in the one or more region detection boxes, wherein the minimum bounding box is a bounding box with the smallest area in a plurality of bounding boxes capable of bounding the at least one region detection box;
determining a ratio of an area of the minimum bounding box to an area of the boundary detection box; and
and determining that the object to be detected is incomplete in response to the ratio exceeding a threshold.
2. The method of claim 1, wherein object detection of an image to be detected comprising an object to be detected, obtaining a boundary detection box and one or more region detection boxes for the object to be detected comprises:
inputting the image to be detected into a text detection network model, and obtaining a boundary detection frame and one or more region detection frames output by the text detection network model; and is also provided with
Wherein each of the one or more region detection frames respectively encloses a target text line in the object to be detected.
3. The method of claim 1, wherein the minimum bounding box encloses each of the one or more region detection boxes.
4. The method of claim 1, wherein the one or more region detection boxes are rectangular in shape, and wherein the minimum bounding box is a rectangular minimum bounding box.
5. The method of any one of claims 1 to 4, further comprising:
and sending prompt information in response to determining that the object to be detected is incomplete.
6. The method of any of claims 1 to 4, wherein the object to be detected is a whole or part of a card, and wherein the target area is a line of user information text in the card.
7. An image recognition apparatus comprising:
a target detection unit configured to perform target detection on a to-be-detected image including an object to be detected, obtain a boundary detection frame for the object to be detected and one or more region detection frames, wherein the boundary detection frame indicates a detected boundary of the object to be detected, and wherein each region detection frame of the one or more region detection frames respectively surrounds one target region in the object to be detected;
a minimum bounding box acquisition unit configured to acquire a minimum bounding box based on at least one region detection box of the one or more region detection boxes, wherein the minimum bounding box is a bounding box having a smallest area among a plurality of bounding boxes capable of bounding the at least one region detection box;
An area ratio determining unit configured to determine a ratio of an area of the minimum bounding box to an area of the boundary detection box; and
an integrity determination unit configured to determine that the object to be detected is incomplete in response to the ratio exceeding a threshold.
8. The apparatus of claim 7, wherein the target detection unit is further configured to:
inputting the image to be detected into a text detection network model, and obtaining a boundary detection frame and one or more region detection frames output by the text detection network model; and is also provided with
Wherein each of the one or more region detection frames respectively encloses a target text line in the object to be detected.
9. The apparatus of claim 7, wherein the minimum bounding box encloses each of the one or more region detection boxes.
10. The apparatus of claim 7, wherein the one or more region detection boxes are rectangular in shape, and wherein the minimum bounding box is a rectangular minimum bounding box.
11. The apparatus of any of claims 7 to 10, further comprising:
And the prompt unit is configured to send out prompt information in response to the fact that the object to be detected is incomplete.
12. The apparatus according to any one of claims 7 to 10, wherein the object to be detected is a whole or part of a card, and wherein the target area is a line of user information text in the card.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the method comprises the steps of
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of any of claims 1-6.
CN202210107793.1A 2022-01-28 2022-01-28 Image recognition method, device, electronic equipment and medium Active CN114511694B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210107793.1A CN114511694B (en) 2022-01-28 2022-01-28 Image recognition method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210107793.1A CN114511694B (en) 2022-01-28 2022-01-28 Image recognition method, device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN114511694A CN114511694A (en) 2022-05-17
CN114511694B true CN114511694B (en) 2023-05-12

Family

ID=81552169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210107793.1A Active CN114511694B (en) 2022-01-28 2022-01-28 Image recognition method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114511694B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106251338A (en) * 2016-07-20 2016-12-21 北京旷视科技有限公司 Target integrity detection method and device
CN107330433A (en) * 2017-05-17 2017-11-07 北京捷通华声科技股份有限公司 Image processing method and device
CN108881775A (en) * 2018-05-30 2018-11-23 维沃移动通信有限公司 A kind of video communication method and mobile terminal
WO2019184604A1 (en) * 2018-03-27 2019-10-03 华为技术有限公司 Method and device for detecting target image
CN112489020A (en) * 2020-12-01 2021-03-12 济南博观智能科技有限公司 Image screening method and device, electronic equipment and storage medium
CN113256583A (en) * 2021-05-24 2021-08-13 北京百度网讯科技有限公司 Image quality detection method and apparatus, computer device, and medium
CN113313111A (en) * 2021-05-28 2021-08-27 北京百度网讯科技有限公司 Text recognition method, device, equipment and medium
CN113673500A (en) * 2021-08-20 2021-11-19 深圳前海微众银行股份有限公司 Certificate image recognition method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6744430B2 (en) * 2016-05-19 2020-08-19 シムビ ロボティクス, インコーポレイテッドSimbe Robotics, Inc. How to automatically generate a shelf allocation table that assigns products to a shelf structure in a store

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106251338A (en) * 2016-07-20 2016-12-21 北京旷视科技有限公司 Target integrity detection method and device
CN107330433A (en) * 2017-05-17 2017-11-07 北京捷通华声科技股份有限公司 Image processing method and device
WO2019184604A1 (en) * 2018-03-27 2019-10-03 华为技术有限公司 Method and device for detecting target image
CN108881775A (en) * 2018-05-30 2018-11-23 维沃移动通信有限公司 A kind of video communication method and mobile terminal
CN112489020A (en) * 2020-12-01 2021-03-12 济南博观智能科技有限公司 Image screening method and device, electronic equipment and storage medium
CN113256583A (en) * 2021-05-24 2021-08-13 北京百度网讯科技有限公司 Image quality detection method and apparatus, computer device, and medium
CN113313111A (en) * 2021-05-28 2021-08-27 北京百度网讯科技有限公司 Text recognition method, device, equipment and medium
CN113673500A (en) * 2021-08-20 2021-11-19 深圳前海微众银行股份有限公司 Certificate image recognition method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114511694A (en) 2022-05-17

Similar Documents

Publication Publication Date Title
EP3869404A2 (en) Vehicle loss assessment method executed by mobile terminal, device, mobile terminal and medium
CN113256583A (en) Image quality detection method and apparatus, computer device, and medium
CN114494935B (en) Video information processing method and device, electronic equipment and medium
CN114495103B (en) Text recognition method and device, electronic equipment and medium
CN114511694B (en) Image recognition method, device, electronic equipment and medium
CN114140547B (en) Image generation method and device
US20230350940A1 (en) Object recommendation
CN115797660A (en) Image detection method, image detection device, electronic equipment and storage medium
CN114842476A (en) Watermark detection method and device and model training method and device
CN114429678A (en) Model training method and device, electronic device and medium
CN114677691B (en) Text recognition method, device, electronic equipment and storage medium
CN115170536B (en) Image detection method, training method and device of model
CN115512131B (en) Image detection method and training method of image detection model
CN114140852B (en) Image detection method and device
CN115100431B (en) Target detection method, neural network, training method, training device and training medium thereof
CN116070711B (en) Data processing method, device, electronic equipment and storage medium
CN115511779B (en) Image detection method, device, electronic equipment and storage medium
CN115620271B (en) Image processing and model training method and device
CN114821233B (en) Training method, device, equipment and medium of target detection model
CN114140851B (en) Image detection method and method for training image detection model
CN115131562B (en) Three-dimensional scene segmentation method, model training method, device and electronic equipment
CN117197483A (en) Method, apparatus, device and medium for detecting object in image
CN117351330A (en) Image processing method, training method, device and equipment of image processing model
CN117218499A (en) Training method of facial expression capturing model, facial expression driving method and device
CN114842073A (en) Image data amplification method, apparatus, device, medium, and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant