Image recognition method and device and electronic equipment

By preprocessing document images and processing target models, the problem of low recognition accuracy of traditional OCR systems in complex environments has been solved, improving the accuracy and robustness of document image recognition, and enhancing the efficiency of civil aviation services and user experience.

CN121768006APending Publication Date: 2026-03-31TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Traditional OCR systems lack the accuracy and robustness for recognizing document images in complex environments, leading to a decline in civil aviation service efficiency and user experience.

Method used

By receiving and preprocessing the initial image, including angle correction, contrast enhancement, and watermark removal, an image dataset with multi-scale scaling, rotation, and multi-intensity watermark removal is constructed. This dataset is then processed in conjunction with the target model, and finally, identity information correction is performed.

Benefits of technology

It improves the accuracy and robustness of document image recognition, thereby enhancing the efficiency of civil aviation services and the passenger experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121768006A_ABST
    Figure CN121768006A_ABST
Patent Text Reader

Abstract

The invention discloses an image recognition method and device and electronic equipment. Relates to the technical field of image processing, and comprises the following steps: receiving an initial image input by a target object, the initial image at least comprising identity information of the target object; preprocessing the initial image to obtain a target image; constructing a to-be-processed image data set according to the target image; and processing the to-be-processed image data set according to a target model corresponding to the type of the initial image to obtain an identification result. Through the method and the device, the problem of relatively low identification accuracy of the certificate image in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to an image recognition method and apparatus, and an electronic device. Background Technology

[0002] In the field of digital supervision in civil aviation, optical character recognition (OCR) technology has become an important tool in processes such as identity verification and information entry. However, traditional OCR systems have significant shortcomings in accuracy and robustness when processing document images, especially images taken in complex environments. When checking in, going through security, or enjoying specific discounts, civil aviation passengers often need to upload images of critical documents such as identification. These images often suffer from poor lighting conditions, cluttered backgrounds, tilted or inverted documents, watermarks and seals, and the inclusion of uncommon or non-standard characters, making it difficult for OCR systems to accurately and quickly extract and verify information. This impacts the efficiency of civil aviation services and the user experience.

[0003] There is currently no effective solution to the problem of low accuracy in document image recognition in related technologies. Summary of the Invention

[0004] The main objective of this application is to provide an image recognition method, apparatus, and electronic device to address the problem of low accuracy in document image recognition in related technologies.

[0005] To achieve the above objectives, according to one aspect of this application, an image recognition method is provided. The method includes: receiving an initial image input from a target object, wherein the initial image contains at least the identity information of the target object; preprocessing the initial image to obtain a target image; constructing an image dataset to be processed based on the target image; and processing the image dataset to be processed according to a target model corresponding to the type of the initial image to obtain a recognition result.

[0006] Further, preprocessing the initial image to obtain the target image includes: performing angle correction processing on the initial image to obtain a first image; performing contrast enhancement processing on the first image to obtain a second image; and removing the watermark from the second image to obtain the target image.

[0007] Further, constructing the image dataset to be processed based on the target image includes: scaling the target image at multiple scales to obtain multiple first images to be processed; rotating the target image to obtain multiple second images to be processed; removing watermarks from the second images at multiple intensities to obtain multiple third images to be processed; and obtaining the image dataset to be processed based on the multiple first images to be processed, the multiple second images to be processed, and the multiple third images to be processed.

[0008] Further, performing angle correction processing on the initial image to obtain the first image includes: performing edge detection based on the initial image to obtain target edge information; performing polygon approximation processing based on the target edge information to obtain multiple vertex coordinate information; constructing a perspective transformation matrix based on the multiple vertex coordinate information; and performing perspective transformation on the initial image based on the perspective transformation matrix to obtain the first image.

[0009] Further, performing contrast enhancement processing on the first image to obtain the second image includes: converting the first image to a target color space to obtain a converted first image; separating the luminance channel from the converted first image and performing contrast enhancement processing on the luminance channel; and obtaining the second image based on the enhanced luminance channel and the converted first image.

[0010] Further, removing the watermark from the second image to obtain the target image includes: converting the second image to a target color space to obtain the converted second image; constructing multiple red hue thresholds and generating multiple red masks based on the multiple red hue thresholds; fusing and dilating the multiple red masks to remove the watermark from the second image to obtain the target image.

[0011] Furthermore, after processing the image dataset to be processed according to the target model corresponding to the type of the initial image to obtain the recognition result, the method further includes: correcting the identity information in the recognition result to obtain corrected identity information; and processing the target business for the target object according to the corrected identity information.

[0012] Furthermore, the correction process for the identity information in the recognition result includes: detecting whether the number of identity identifier characters in the recognition result is a first preset number; if the number of identity identifier characters is not the first preset number, determining whether the number of missing characters in the identity identifier characters is a second preset number; if the number of missing characters is the second preset number, and the missing characters are not characters in preset positions, then performing completion processing on the identity identifier characters.

[0013] To achieve the above objectives, according to another aspect of this application, an image recognition apparatus is provided. The apparatus includes: a receiving unit for receiving an initial image input from a target object, wherein the initial image contains at least the identity information of the target object; a first processing unit for preprocessing the initial image to obtain a target image; a construction unit for constructing an image dataset to be processed based on the target image; and a second processing unit for processing the image dataset to be processed according to a target model corresponding to the type of the initial image to obtain a recognition result.

[0014] Further, the first processing unit includes: a first processing subunit for performing angle correction processing on the initial image to obtain a first image; a second processing subunit for performing contrast enhancement processing on the first image to obtain a second image; and a third processing subunit for performing watermark removal on the second image to obtain the target image.

[0015] Furthermore, the construction unit includes: a scaling subunit for scaling the target image at multiple scales to obtain multiple first images to be processed; a rotation subunit for rotating the target image to obtain multiple second images to be processed; a removal subunit for removing watermarks from the second images at multiple intensities to obtain multiple third images to be processed; and a determination subunit for obtaining the image dataset to be processed based on the multiple first images to be processed, the multiple second images to be processed, and the multiple third images to be processed.

[0016] Further, the first processing subunit includes: a detection module, used to perform edge detection based on the initial image to obtain target edge information; a first processing module, used to perform polygon approximation processing based on the target edge information to obtain multiple vertex coordinate information; a first construction module, used to construct a perspective transformation matrix based on the multiple vertex coordinate information; and a transformation module, used to perform perspective transformation on the initial image based on the perspective transformation matrix to obtain the first image.

[0017] Furthermore, the second processing subunit includes: a first conversion module, used to convert the first image to a target color space to obtain a converted first image; a separation module, used to separate the luminance channel from the converted first image and perform contrast enhancement processing on the luminance channel; and a determination module, used to obtain the second image based on the enhanced luminance channel and the converted first image.

[0018] Furthermore, the third processing subunit includes: a second conversion module, used to convert the second image to a target color space to obtain the converted second image; a second construction module, used to construct multiple red hue thresholds and generate multiple red masks based on the multiple red hue thresholds; and a second processing module, used to fuse and dilate the multiple red masks to remove the watermark from the second image to obtain the target image.

[0019] Furthermore, the device further includes: a third processing unit, configured to process the image dataset to be processed according to the target model corresponding to the type of the initial image, and after obtaining the recognition result, correct the identity information in the recognition result to obtain corrected identity information; and a fourth processing unit, configured to process the target business for the target object according to the corrected identity information.

[0020] Furthermore, the third processing unit includes: a detection subunit, used to detect whether the number of identity identifier characters in the recognition result is a first preset number; a judgment subunit, used to determine whether the number of missing characters in the identity identifier characters is a second preset number if the number of identity identifier characters is not the first preset number; and a fourth processing subunit, used to perform completion processing on the identity identifier characters if the number of missing characters is the second preset number and the missing characters are not characters in a preset position.

[0021] According to another aspect of the present invention, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes any of the above-described agent-based image recognition methods.

[0022] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein the storage medium stores a program, wherein the program controls the device where the storage medium is located to execute any of the above-described agent-based image recognition methods.

[0023] In this embodiment, the following steps are adopted: receiving an initial image input by a target object, wherein the initial image contains at least the identity information of the target object; preprocessing the initial image to obtain a target image; constructing an image dataset to be processed based on the target image; processing the image dataset to be processed according to the target model corresponding to the type of the initial image to obtain a recognition result, thereby solving the technical problem of low accuracy in document image recognition in related technologies.

[0024] In this solution, an initial image is received from the target object (such as an air passenger). This initial image may include key identity information such as name and ID number. Preprocessing operations are performed on the received initial image to improve image quality, including but not limited to adjusting the angle, enhancing contrast, and removing interfering watermarks. These steps help overcome recognition obstacles caused by changes in lighting, improper shooting angles, cluttered backgrounds, or watermark obstruction. Based on the preprocessed target image, an image dataset to be processed is constructed. Depending on the type of the initial image (such as an ID card, household registration booklet, etc.), a corresponding target model is selected for processing, ensuring that the model achieves optimal recognition results on specific types of documents. These steps address the accuracy issue of document image recognition in civil aviation digital supervision. Through angle correction, contrast enhancement, and watermark removal, the quality of the input image is significantly improved. Combined with the selection of the target model and efficient processing, high-precision recognition results are ensured even in complex shooting environments, thereby improving the efficiency of civil aviation services and the passenger experience. Attached Figure Description

[0025] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0026] Figure 1 A hardware structure block diagram of a computer terminal for implementing an image recognition method is shown.

[0027] Figure 2 This is a flowchart of an image recognition method provided according to an embodiment of this application;

[0028] Figure 3 This is a schematic diagram of the image recognition method provided according to the embodiments of this application. Figure 1 ;

[0029] Figure 4 This is a schematic diagram of the image recognition method provided according to the embodiments of this application. Figure 2 ;

[0030] Figure 5 This is a schematic diagram of the image recognition method provided according to the embodiments of this application. Figure 3 ;

[0031] Figure 6 This is a schematic diagram of the image recognition method provided according to the embodiments of this application. Figure 4 ;

[0032] Figure 7 This is a schematic diagram of an image recognition device provided according to an embodiment of this application;

[0033] Figure 8This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0034] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0036] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding access points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding access points to choose to agree to or refuse automated decision-making results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.

[0037] Example 1

[0038] According to an embodiment of this application, an embodiment of an image recognition method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0039] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing an image recognition method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0040] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0041] 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 image recognition method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned image recognition method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0042] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0043] The display may be a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0044] Under the aforementioned operating environment, this application provides the following: Figure 2 The image recognition method shown. Figure 2 This is a flowchart of an image recognition method according to Embodiment 1 of this application.

[0045] Step S201: Receive an initial image input from the target object, wherein the initial image contains at least the identity information of the target object.

[0046] Optionally, an initial image provided by the target object (e.g., a civil aviation passenger) may be received. The initial image may be a raw image without any processing, typically a picture directly submitted by the target object after being taken using a mobile phone, camera, or other image acquisition device. The image contains the target object's identity information.

[0047] For example, when checking in for a flight, passengers upload images of the front and back of their ID card via an app or online platform. In this step, the system receives the original image containing key information such as the passenger's name, ID number, and place of origin—the initial image.

[0048] Step S202: Preprocess the initial image to obtain the target image.

[0049] Optionally, the initial image received in step S201 can be optimized using image processing techniques to obtain a higher quality image. For example, the tilt angle of the document in the image can be corrected to ensure that the text is horizontal. The contrast of the image can also be enhanced, and the image can be converted into a black and white binary image to make the difference between the text and the background more obvious.

[0050] Step S203: Based on the target image, construct the image dataset to be processed.

[0051] Optionally, an image dataset to be processed is obtained based on the target image. For example, the target image is subjected to angle transformation, size change, etc., and then the multiple transformed images are determined as the image dataset to be processed.

[0052] Step S204: Process the image dataset to be processed according to the target model corresponding to the type of the initial image to obtain the recognition result.

[0053] Optionally, a target model matching the image type received in step S201 (such as ID card, household registration book, etc.) can be selected. Different types of documents may have different layouts, fonts, and information arrangements. Therefore, using a model specifically optimized for a particular document can significantly improve the accuracy and efficiency of recognition. For example, an OCR model with a detection threshold of 0.5 and a recognition threshold of 0.6 can be used for ID cards, an extended model supporting Traditional and Simplified Chinese, English, and Japanese can be used for multilingual materials, and a CNN-LSTM handwriting recognition network can be used for handwritten medical discharge certificates, etc.

[0054] The system parses the text data output by the target model and can classify it according to the structure of ID card information, such as extracting and structuring information like "Name: Zhang San" and "ID Number: 123456789012345678". Simultaneously, the system can also validate the output results, confirming the correct number of digits in the ID number, the reasonable format of the name, and the logical consistency of information such as place of origin.

[0055] In summary, the process involves receiving initial images from the target object (such as an air passenger), which may include crucial identity information such as name and ID number. Preprocessing operations are then performed on the received initial images to improve image quality, including but not limited to adjusting angles, enhancing contrast, and removing interfering watermarks. These steps help overcome recognition obstacles caused by changes in lighting, improper shooting angles, cluttered backgrounds, or watermark obstruction. Based on the preprocessed target images, a dataset of images to be processed is constructed. Depending on the type of the initial image (such as an ID card or household registration book), a corresponding target model is selected for processing, ensuring that the model achieves optimal recognition results on specific types of documents. These steps address the accuracy issue of document image recognition in civil aviation digital supervision. By employing angle correction, contrast enhancement, and watermark removal, the quality of the input images is significantly improved. The combination of target model selection and efficient processing ensures high-precision recognition results even in complex shooting environments, thereby improving the efficiency of civil aviation services and the passenger experience.

[0056] Optionally, in the image recognition method provided in this application embodiment, preprocessing the initial image to obtain the target image includes: performing angle correction processing on the initial image to obtain a first image; performing contrast enhancement processing on the first image to obtain a second image; and removing the watermark from the second image to obtain the target image.

[0057] In an optional embodiment, the initial image undergoes angle correction processing to correct any tilt or rotation of the document in the image, ensuring that the text information remains horizontal or vertical for easy recognition and reading, thus obtaining a first image. The first image then undergoes contrast enhancement processing, for example, by adjusting the brightness and darkness of the image to make the difference between the text and the background more pronounced. The second image undergoes watermark removal, i.e., removing any watermarks, stamps, or other interfering elements that may be present on the image to prevent them from negatively impacting text recognition.

[0058] Tilted or rotated images may make it difficult for the model to capture the correct text features. After correction, the model can recognize characters more efficiently and reduce recognition errors. Contrast enhancement processing optimizes the distribution of light and dark in the image, increases the contrast between text and background, and makes it easier for the model to distinguish text information from the background. Watermark removal effectively removes non-text information such as seals and anti-counterfeiting watermarks on documents, avoids interference from these elements on text recognition, and improves recognition accuracy.

[0059] Optionally, in the image recognition method provided in this application embodiment, constructing an image dataset to be processed based on the target image includes: scaling the target image at multiple scales to obtain multiple first images to be processed; rotating the target image to obtain multiple second images to be processed; removing watermarks of multiple intensities from the second images to obtain multiple third images to be processed; and obtaining the image dataset to be processed based on the multiple first images to be processed, the multiple second images to be processed, and the multiple third images to be processed.

[0060] In an optional embodiment, the image dataset to be processed can be constructed using the following steps: An image scaling function is called to scale the target image. For example, different scaling factors, such as 0.5, 0.75, 1.0, 1.25, and 1.5, are set according to actual needs to generate images at reduced and enlarged ratios, respectively. The size of the scaled image is checked to ensure it does not exceed a preset maximum size limit (e.g., 200MB) to ensure image processing efficiency and storage security.

[0061] Considering the uncertainty of the shooting angle, rotating the target image can create image variants with multiple angles, ensuring that the model can recognize text information at different tilt angles and improving the accuracy and robustness of recognition. For example, using an image rotation algorithm, the target image can be rotated, such as by 180°±15°, ±30°, etc., to generate image variants with multiple rotation angles (i.e., the multiple second images to be processed mentioned above).

[0062] By performing watermark removal operations of varying intensities, cleaner image variants can be generated, avoiding interference from residual watermarks on text recognition.

[0063] The first image to be processed, the second image to be processed, and the third image to be processed are identified as the image dataset to be processed.

[0064] By employing the aforementioned preprocessing strategies of multi-scale scaling, rotation, and multi-intensity watermark removal, the robustness and adaptability of the model in processing various types of document images can be significantly enhanced. This diversified processing ensures that even when the original image quality is not ideal, or when there is a complex background or watermark interference, more suitable image variants for model recognition can be obtained by adjusting the image scale, angle, and removing watermarks, thereby significantly improving the accuracy and processing speed of text information recognition.

[0065] Optionally, in the image recognition method provided in this application embodiment, the process of performing angle correction processing on the initial image to obtain the first image includes: performing edge detection based on the initial image to obtain target edge information; performing polygon approximation processing based on the target edge information to obtain multiple vertex coordinate information; constructing a perspective transformation matrix based on the multiple vertex coordinate information; and performing perspective transformation on the initial image based on the perspective transformation matrix to obtain the first image.

[0066] In an optional embodiment, the initial image is processed using an edge detection algorithm, which effectively detects contour edges in the image and outputs target edge information. Based on the extracted target edge information, a contour detection algorithm is used to find all external contours. Then, by analyzing and sorting these contours, the contour with the largest area is selected as the main contour of the document. The largest contour is then approximated with a polygon to obtain the quadrilateral vertices (i.e., the coordinate information of the multiple vertices mentioned above). The size of the target rectangle is calculated based on the quadrilateral vertices, and a perspective transformation matrix is ​​constructed. The perspective transformation matrix is ​​applied to the initial image to perform a perspective transformation, outputting the corrected image, i.e., the first image mentioned above.

[0067] In an optional embodiment, the color ID card image can first be converted to a grayscale image to reduce color information interference and computational complexity. Then, Gaussian blurring is performed to smooth the image, reducing noise and making edge detection more accurate. Next, an edge detection algorithm is used to detect image edges and highlight the ID card outline. All external contours are searched in the edge image, sorted by area from largest to smallest, and the contour with the largest area is selected as the ID card contour. The selected contour is approximated as a polygon to obtain a quadrilateral contour; if it is a quadrilateral, the four vertices of the ID card are determined. The width and height of the ID card are calculated based on the vertex coordinates. The coordinates of the four vertices of the target image are defined, and the perspective transformation matrix is ​​calculated. Finally, the perspective transformation matrix is ​​used to perform a perspective transformation on the original image to obtain the corrected ID card image. If no suitable contour is found, appropriate error handling is performed.

[0068] The above steps can effectively correct the angle of the initial image, significantly improving the readability and recognition rate of text information in the image, especially for tilted ID card images caused by unstable hand holding or improper shooting angle.

[0069] Optionally, in the image recognition method provided in the embodiments of this application, performing contrast enhancement processing on the first image to obtain the second image includes: converting the first image to a target color space to obtain a converted first image; separating the luminance channel from the converted first image and performing contrast enhancement processing on the luminance channel; and obtaining the second image based on the enhanced luminance channel and the converted first image.

[0070] In an optional embodiment, the preprocessed first image is converted to the HSV (Hue, Saturation, Luminance) color space (i.e., the target color space mentioned above). This is because in the HSV space, luminance information is stored separately in the V channel, making it convenient to adjust only the luminance information without affecting the color information. The luminance channel V is separated from the converted HSV image and its contrast is enhanced. Contrast enhancement can be achieved by applying histogram equalization or using algorithms such as adaptive contrast enhancement. The enhanced luminance channel V is then recombine with the hue (H) and saturation (S) channels of the original HSV image and converted back to the BGR color space to obtain the second image. This step ensures that the color information of the image is preserved while enhancing the contrast, avoiding information loss.

[0071] Through the above steps, a second image with contrast enhancement can be obtained. The enhanced image not only retains the original color information, but also enhances the contrast between the text and the background, making it easier for the model to distinguish text regions and improve the accuracy and efficiency of recognition.

[0072] Optionally, in the image recognition method provided in this application embodiment, removing the watermark from the second image to obtain the target image includes: converting the second image to a target color space to obtain the converted second image; constructing multiple red hue thresholds and generating multiple red masks based on the multiple red hue thresholds; fusing and dilating the multiple red masks to remove the watermark from the second image to obtain the target image.

[0073] In an optional embodiment, the second image is converted to the HSV color space, as the HSV space can better separate color information, making the detection of the red watermark more accurate. Since the red watermark is discontinuous and has different tonal ranges in different images, one or more red tonal threshold ranges need to be constructed, for example, two tonal intervals: one from 0° to 10° and the other from 170° to 180°. Red tonal thresholds are defined and used to create a red mask to identify and locate the watermark in the image. The watermark range can be adjusted via the level parameter to accommodate watermarks of different color depths and saturations.

[0074] The target red mask is obtained by merging the red masks of multiple color segments. An expansion operation is then performed on the target red mask to ensure complete coverage of the watermark area. Non-red backgrounds are extracted based on the inverse mask, and a watermark-free background image is constructed, ensuring the preservation of non-red areas. Finally, a fast traversal algorithm is used to inpaint the mask-indicated areas, blending the repaired areas with the background to output a watermark-free image.

[0075] In an optional embodiment, the user can interactively adjust the range of red in the HSV color space by adjusting the slider in the image tool window to select the degree of watermark removal, thereby improving the processing effect in operations such as image segmentation, removal of red watermarks, and extraction of red objects.

[0076] Optionally, in the image recognition method provided in this application embodiment, after processing the image dataset to be processed according to the target model corresponding to the type of the initial image to obtain the recognition result, the method further includes: correcting the identity information in the recognition result to obtain corrected identity information; and handling the target business for the target object according to the corrected identity information.

[0077] In an optional embodiment, the identity information in the recognition result is corrected to ensure the accuracy and integrity of the information. For example, for rare characters or misrecognized names, referring to a similar character library and context information, attempts are made to correct the recognition result. For example, replace "菅" with "营", "姮" with "姬", etc. to improve the accuracy of name recognition. For example, the recognized address information may be incomplete or incorrect due to typesetting errors, watermark interference, or text line break problems. The address information can be split and reorganized by level (province, city, district, street) referring to the standard address library, correct形近错误 such as "日卡则", and supplement the omitted parts to ensure the accuracy and standardization of the address information. Finally, the target service is processed for the target object based on the corrected identity information.

[0078] In an optional embodiment, to improve information security, sensitive fields such as names, ID numbers, and addresses are transmitted using SM4 encryption; only desensitized information (such as the ID number showing "510 1234", and the name showing "张 ") is retained in storage and logs, and the original image is not stored on disk.

[0079] The reliability of the recognition result is further improved through the correction process of the identity information.

[0080] Optionally, in the image recognition method provided in the embodiments of the present application, the correction process of the identity information in the recognition result includes: detecting whether the number of identity identification characters in the recognition result is a first preset number; if the number of identity identification characters is not the first preset number, determining whether the number of missing characters in the identity identification characters is a second preset number; if the number of missing characters is the second preset number and the missing characters are not characters at preset positions, then perform a complementation process on the identity identification characters.

[0081] In an optional embodiment, it is detected whether the number of identity identification characters in the recognition result is a first preset number. The standard length of the identity identification characters is 18 bits (including 17 digits and the last 1-bit check code, which may be a digit or the letter X). If the recognized character length is not equal to 18 bits, proceed to the next check.

[0082] If the number of identity identification characters is not the first preset number, then analyze the characters in the ID number to determine which positions of the characters are not recognized or misrecognized, and determine whether the number of missing characters is a second preset number (for example, 1 bit). When the number and position of the missing characters are determined, if the requirements of the second preset number are met and the missing position is not the first two positions, then perform a complementation process on the identity identification characters.

[0083] For example, after inputting a 17-character string, the backend immediately determines whether the first two characters fall within the set of 31 valid province codes. If they do not match, it directly returns an empty set. If they match, it enumerates 0-9 and X at the missing position (which can be fixed at the 18th position or iterates through the 3rd to 17th positions), calculates the check digit in real time according to the GB11643 check code formula, and generates a pool of 18 candidate numbers to complete the identity identification characters.

[0084] Identity information correction processing can effectively address the common problem of missing characters in image recognition, especially for critical information such as ID card numbers. Through length checks and targeted completion strategies, the integrity and reliability of the information are improved.

[0085] In an alternative embodiment, it can be achieved through, as follows: Figure 3 The schematic diagram shown illustrates the recognition of document images. It involves acquiring the image to be processed, preprocessing the image, then using a model to recognize the preprocessed image, and finally verifying the recognized information to obtain the final recognition result. The schematic diagram of image preprocessing is shown below. Figure 4 As shown, the image undergoes noise reduction and angle correction, followed by contrast enhancement and watermark removal. The input image's BGR color space is converted to HSV color space. Since the red watermark is discontinuous and has different tonal ranges in different images, multiple red ranges are defined, and the watermark range is adjusted using the `level` parameter to accommodate watermarks of varying shades and saturation. Two masks are created, merged to obtain a red mask, and dilation is applied to ensure complete coverage of the watermark area. Non-red areas are extracted, and image restoration is performed on the input image to remove the red watermark. Finally, the restored red areas are merged with the non-red areas to obtain the watermark-free image. A graphical watermark range selection is implemented: an image tool window with a slider is created. Users can interactively adjust the red range in the HSV color space by adjusting the slider to select the degree of watermark removal, improving processing efficiency in image segmentation, red watermark removal, and red object extraction. Image magnification is performed: the input image is resized according to a specified scaling factor and scaling direction. Check if the resized image exceeds the preset maximum size limit (default is 200MB). If it does, return to the original image. The scaling direction can be selected as 'both' (scale both width and height simultaneously), 'width' (scale only width), or 'height' (scale only height).

[0086] In an alternative embodiment, it can be achieved through, as follows: Figure 5The schematic diagram shown implements model recognition, including two parts: a load scheduling agent and an OCR recognition model. The load scheduling agent preprocesses images in 9 different ways in advance. For different value cases of the images, functions such as image magnification, watermark processing (including removal and addition, etc.), and rotation angle adjustment are integrated. This includes the presentation of the original image, the removal of watermarks with different intensities, the combination of magnification and watermark removal, the combination of rotation, magnification, and watermark removal, etc. The load scheduling agent summarizes and analyzes the results returned by the model to implement a comprehensive and efficient integrated processing process. If the same text is recognized consistently at least 5 times, it is judged as valid; otherwise, it is marked with low confidence (<0.85); finally, it is structured and output according to the type of certificate. 10 items such as name and ID number are extracted from the ID card, 8 items such as the name of the household head are extracted from the household register, and 7 items such as the name of the patient are extracted from the medical retirement certificate, achieving efficient and robust text extraction.

[0087] In an optional embodiment, information correction and ID number completion can be achieved through the schematic diagram as Figure 6 shown: Based on the known 17-digit ID card number, find all possible valid 18-digit ID card number combinations. If the last digit of the known number is X, reverse-infer the missing digit; otherwise, traverse all possible missing positions, try all numbers from 0 to 9, and consider the case where the 18th digit is X. Processing of ID card possibilities: If the processing result shows that any digit of the ID card has multiple possible values, multiple possible ID card numbers will be generated based on these different values. For example, if there are three results (2, 3, 6) for the third digit of the ID card number and two results (1, 5) for the fifth digit, this solution will generate 3×2 different ID card number combinations according to the principle of permutation and combination. Processing of similar characters in names: For characters that cannot be recognized by the model, similar characters are processed. For example, similar characters such as "营" and "菅", "姬" and "姮" are matched to provide multiple possibilities for the name for the program to perform fuzzy matching to improve the accuracy of name recognition. Address matching processing: Import the standard address library, split the address in the ID card / household register by level as "province-city-district (county)-street (township)", complete the missing levels through the standard address library, and correct形近错误such as "日卡则". Synchronization of the province and city with the calling party: The processing of the province and city is synchronized with the program of the calling party to ensure information consistency.

[0088] The image recognition method provided by the embodiment of this application receives an initial image input by a target object, where the initial image at least includes the identity information of the target object; preprocesses the initial image to obtain a target image; constructs an image data set to be processed based on the target image; and processes the image data set to be processed according to the target model corresponding to the type of the initial image to obtain a recognition result, solving the technical problem of relatively low accuracy in recognizing certificate images in the related art.

[0089] In this solution, an initial image is received from the target object (such as an air passenger). This initial image may include key identity information such as name and ID number. Preprocessing operations are performed on the received initial image to improve image quality, including but not limited to adjusting the angle, enhancing contrast, and removing interfering watermarks. These steps help overcome recognition obstacles caused by changes in lighting, improper shooting angles, cluttered backgrounds, or watermark obstruction. Based on the preprocessed target image, an image dataset to be processed is constructed. Depending on the type of the initial image (such as an ID card, household registration booklet, etc.), a corresponding target model is selected for processing, ensuring that the model achieves optimal recognition results on specific types of documents. These steps address the accuracy issue of document image recognition in civil aviation digital supervision. Through angle correction, contrast enhancement, and watermark removal, the quality of the input image is significantly improved. Combined with the selection of the target model and efficient processing, high-precision recognition results are ensured even in complex shooting environments, thereby improving the efficiency of civil aviation services and the passenger experience.

[0090] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0091] Example 2

[0092] This application also provides an image recognition device. It should be noted that the image recognition device of this application can be used to execute the image recognition method provided in this application. The image recognition device provided in this application is described below.

[0093] According to embodiments of this application, an apparatus for implementing the above-described image recognition method is also provided, such as... Figure 7 As shown, the device includes: a receiving unit 701, a first processing unit 702, a building unit 703, and a second processing unit 704.

[0094] The receiving unit 701 is used to receive an initial image input from the target object, wherein the initial image contains at least the identity information of the target object; the first processing unit 702 is used to preprocess the initial image to obtain a target image; the construction unit 703 is used to construct an image dataset to be processed based on the target image; and the second processing unit 704 is used to process the image dataset to be processed according to the target model corresponding to the type of the initial image to obtain a recognition result.

[0095] The image recognition device provided in this application embodiment receives an initial image input by a target object through a receiving unit 701, wherein the initial image contains at least the identity information of the target object; a first processing unit 702 preprocesses the initial image to obtain a target image; a construction unit 703 constructs an image dataset to be processed based on the target image; and a second processing unit 704 processes the image dataset to be processed according to the target model corresponding to the type of the initial image to obtain a recognition result, thereby solving the technical problem of low accuracy in document image recognition in related technologies.

[0096] In this solution, an initial image is received from the target object (such as an air passenger). This initial image may include key identity information such as name and ID number. Preprocessing operations are performed on the received initial image to improve image quality, including but not limited to adjusting the angle, enhancing contrast, and removing interfering watermarks. These steps help overcome recognition obstacles caused by changes in lighting, improper shooting angles, cluttered backgrounds, or watermark obstruction. Based on the preprocessed target image, an image dataset to be processed is constructed. Depending on the type of the initial image (such as an ID card, household registration booklet, etc.), a corresponding target model is selected for processing, ensuring that the model achieves optimal recognition results on specific types of documents. These steps address the accuracy issue of document image recognition in civil aviation digital supervision. Through angle correction, contrast enhancement, and watermark removal, the quality of the input image is significantly improved. Combined with the selection of the target model and efficient processing, high-precision recognition results are ensured even in complex shooting environments, thereby improving the efficiency of civil aviation services and the passenger experience.

[0097] Optionally, in the image recognition device provided in the embodiments of this application, the first processing unit includes: a first processing subunit, used to perform angle correction processing on the initial image to obtain a first image; a second processing subunit, used to perform contrast enhancement processing on the first image to obtain a second image; and a third processing subunit, used to remove watermarks from the second image to obtain a target image.

[0098] Optionally, in the image recognition apparatus provided in this application embodiment, the construction unit includes: a scaling subunit for scaling the target image at multiple scales to obtain multiple first images to be processed; a rotation subunit for rotating the target image to obtain multiple second images to be processed; a removal subunit for removing watermarks of multiple intensities from the second images to obtain multiple third images to be processed; and a determination subunit for obtaining an image dataset to be processed based on the multiple first images to be processed, the multiple second images to be processed, and the multiple third images to be processed.

[0099] Optionally, in the image recognition device provided in this application embodiment, the first processing subunit includes: a detection module, used to perform edge detection based on an initial image to obtain target edge information; a first processing module, used to perform polygon approximation processing based on the target edge information to obtain multiple vertex coordinate information; a first construction module, used to construct a perspective transformation matrix based on the multiple vertex coordinate information; and a transformation module, used to perform perspective transformation on the initial image based on the perspective transformation matrix to obtain a first image.

[0100] Optionally, in the image recognition device provided in the embodiments of this application, the second processing subunit includes: a first conversion module, used to convert the first image to a target color space to obtain a converted first image; a separation module, used to separate the luminance channel from the converted first image and perform contrast enhancement processing on the luminance channel; and a determination module, used to obtain a second image based on the enhanced luminance channel and the converted first image.

[0101] Optionally, in the image recognition device provided in this application embodiment, the third processing subunit includes: a second conversion module, used to convert the second image to a target color space to obtain the converted second image; a second construction module, used to construct multiple red hue thresholds and generate multiple red masks based on the multiple red hue thresholds; and a second processing module, used to fuse and dilate the red masks of the multiple color segments to remove the watermark in the second image and obtain the target image.

[0102] Optionally, in the image recognition device provided in the embodiments of this application, the device further includes: a third processing unit, used to process the image dataset to be processed according to the target model corresponding to the type of the initial image, and after obtaining the recognition result, to correct the identity information in the recognition result to obtain the corrected identity information; and a fourth processing unit, used to process the target business for the target object according to the corrected identity information.

[0103] Optionally, in the image recognition device provided in this application embodiment, the third processing unit includes: a detection subunit, used to detect whether the number of identity identification characters in the recognition result is a first preset number; a judgment subunit, used to determine whether the number of missing characters in the identity identification characters is a second preset number if the number of identity identification characters is not the first preset number; and a fourth processing subunit, used to perform completion processing on the identity identification characters if the number of missing characters is the second preset number and the missing characters are not characters at preset positions.

[0104] It should be noted that the receiving unit 701, the first processing unit 702, the constructing unit 703, and the second processing unit 704 mentioned above correspond to steps S201 to S204 in Embodiment 1. The four units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.

[0105] Example 3

[0106] Embodiments of this application may provide an electronic device. Figure 8 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 8 As shown, the electronic device may include: one or more ( Figure 8 (Only one is shown) processor 802, memory 804, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0107] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0108] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: receiving an initial image input from the target object, wherein the initial image contains at least the identity information of the target object; preprocessing the initial image to obtain a target image; constructing an image dataset to be processed based on the target image; and processing the image dataset to be processed according to the target model corresponding to the type of the initial image to obtain the recognition result.

[0109] The processor can access the information and application programs stored in the memory via the transmission device to perform the following steps: preprocessing the initial image to obtain the target image, including: performing angle correction processing on the initial image to obtain a first image; performing contrast enhancement processing on the first image to obtain a second image; and removing the watermark from the second image to obtain the target image.

[0110] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: constructing an image dataset to be processed based on the target image, including: scaling the target image at multiple scales to obtain multiple first images to be processed; rotating the target image to obtain multiple second images to be processed; removing watermarks of multiple intensities from the second images to obtain multiple third images to be processed; and obtaining the image dataset to be processed based on the multiple first images to be processed, the multiple second images to be processed, and the multiple third images to be processed.

[0111] The processor can call the information and application program stored in the memory through the transmission device to perform the following steps: performing angle correction processing on the initial image to obtain the first image includes: performing edge detection based on the initial image to obtain target edge information; performing polygon approximation processing based on the target edge information to obtain multiple vertex coordinate information; constructing a perspective transformation matrix based on the multiple vertex coordinate information; and performing perspective transformation on the initial image based on the perspective transformation matrix to obtain the first image.

[0112] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: performing contrast enhancement processing on the first image to obtain the second image includes: converting the first image to a target color space to obtain the converted first image; separating the luminance channel from the converted first image and performing contrast enhancement processing on the luminance channel; and obtaining the second image based on the enhanced luminance channel and the converted first image.

[0113] The processor can access the information and application stored in the memory via the transmission device to perform the following steps: removing the watermark from the second image to obtain the target image, including: converting the second image to the target color space to obtain the converted second image; constructing multiple red hue thresholds and generating multiple red masks based on the multiple red hue thresholds; fusing and dilating the multiple red masks to remove the watermark from the second image to obtain the target image.

[0114] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: after processing the image dataset to be processed according to the target model corresponding to the type of the initial image and obtaining the recognition result, the method further includes: correcting the identity information in the recognition result to obtain corrected identity information; and handling the target business for the target object according to the corrected identity information.

[0115] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: Correcting the identity information in the recognition result includes: detecting whether the number of identity identification characters in the recognition result is a first preset number; if the number of identity identification characters is not the first preset number, determining whether the number of missing characters in the identity identification characters is a second preset number; if the number of missing characters is the second preset number, and the missing characters are not characters in preset positions, then performing completion processing on the identity identification characters.

[0116] Those skilled in the art will understand that Figure 8 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 8 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 8 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 8 The different configurations shown.

[0117] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0118] Example 4

[0119] Embodiments of this application also provide a computer-readable storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the image recognition method provided in Embodiment 1.

[0120] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0121] This application also provides a computer program product, which, when executed on a data processing device, is a program adapted to perform the steps of an image recognition method.

[0122] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0123] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0124] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0125] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0126] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0127] If the integrated unit is implemented as 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 this 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0128] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. An image recognition method characterized by, The method comprises the following steps: receiving an initial image input by a target object, wherein the initial image at least contains identity information of the target object; preprocessing the initial image to obtain a target image; constructing an image data set to be processed according to the target image; processing the image data set to be processed according to a target model corresponding to the type of the initial image to obtain a recognition result.

2. The method of claim 1, wherein, The preprocessing of the initial image to obtain a target image comprises the following steps: performing angle correction processing on the initial image to obtain a first image; performing contrast enhancement processing on the first image to obtain a second image; performing watermark removal on the second image to obtain the target image.

3. The method of claim 2, wherein, The construction of the image data set to be processed according to the target image comprises the following steps: performing multi-scale scaling on the target image to obtain a plurality of first images to be processed; rotating the target image to obtain a plurality of second images to be processed; performing watermark removal on the second image at a plurality of intensities to obtain a plurality of third images to be processed; obtaining the image data set to be processed according to the plurality of first images to be processed, the plurality of second images to be processed and the plurality of third images to be processed.

4. The method of claim 2, wherein, The angle correction processing on the initial image to obtain a first image comprises the following steps: performing edge detection on the initial image to obtain target edge information; performing polygon approximation processing on the target edge information to obtain a plurality of vertex coordinate information; constructing a perspective transformation matrix according to the plurality of vertex coordinate information; performing perspective transformation on the initial image according to the perspective transformation matrix to obtain the first image.

5. The method of claim 2, wherein, The contrast enhancement processing on the first image to obtain a second image comprises the following steps: converting the first image to a target color space to obtain a converted first image; separating a luminance channel from the converted first image and performing contrast enhancement processing on the luminance channel; obtaining the second image according to the enhanced luminance channel and the converted first image.

6. The method of claim 2, wherein, The watermark removal on the second image to obtain the target image comprises the following steps: converting the second image to a target color space to obtain a converted second image; constructing a plurality of red hue threshold values and generating a plurality of red masks of color segments according to the plurality of red hue threshold values; fusing and dilating the plurality of red masks of color segments to remove the watermark in the second image to obtain the target image.

7. The method of claim 1, wherein, After processing the image data set to be processed according to the target model corresponding to the type of the initial image to obtain a recognition result, the method further comprises the following steps: correcting the identity information in the recognition result to obtain corrected identity information; handling a target service for the target object according to the corrected identity information.

8. The method of claim 7, wherein, The correction processing of the identity information in the recognition result comprises the following steps: detecting whether the number of identity characters in the recognition result is a first preset number; if the number of identity characters is not the first preset number, judging whether the number of missing characters in the identity characters is a second preset number; If the number of the missing characters is a second preset number, and the missing character is not a character in a preset position, the identity character is completed.

9. An image recognition apparatus characterized by comprising: Comprise: A receiving unit is configured to receive an initial image input by a target object, wherein the initial image contains at least identity information of the target object; A first processing unit is configured to pre-process the initial image to obtain a target image; A constructing unit is configured to construct an image dataset to be processed according to the target image; A second processing unit is configured to process the image dataset to be processed according to a target model corresponding to a type of the initial image to obtain a recognition result.

10. An electronic device, comprising: Comprise: A memory is configured to store an executable program; A processor is configured to run the program, wherein the program is configured to execute the image recognition method in any one of claims 1 to 8 when running.