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

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

Info

Publication number
CN116884023A
CN116884023A CN202310528661.0A CN202310528661A CN116884023A CN 116884023 A CN116884023 A CN 116884023A CN 202310528661 A CN202310528661 A CN 202310528661A CN 116884023 A CN116884023 A CN 116884023A
Authority
CN
China
Prior art keywords
image
date
handwritten
handwriting
model
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.)
Pending
Application number
CN202310528661.0A
Other languages
Chinese (zh)
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.)
Guangdong Power Grid Co Ltd
Dongguan Power Supply Bureau of Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Power Grid Co Ltd
Dongguan Power Supply Bureau of Guangdong Power Grid 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 Guangdong Power Grid Co Ltd, Dongguan Power Supply Bureau of Guangdong Power Grid Co Ltd filed Critical Guangdong Power Grid Co Ltd
Priority to CN202310528661.0A priority Critical patent/CN116884023A/en
Publication of CN116884023A publication Critical patent/CN116884023A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/32Digital ink
    • G06V30/333Preprocessing; Feature extraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/32Digital ink
    • G06V30/36Matching; Classification

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Character Discrimination (AREA)

Abstract

The embodiment of the invention discloses an image identification method, an image identification device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a handwritten date image to be identified, wherein the handwritten date image to be identified contains image noise; inputting the hand-written date image to be identified into a hand-written date identification model trained in advance, and obtaining a date identification result of the hand-written date image to be identified. The technical scheme of the embodiment of the invention solves the technical problem of lower accuracy in the handwriting date recognition of the image of the handwriting date to be recognized containing the image noise in the prior art, and realizes the more accurate recognition of the handwriting date in the image of the handwriting date to be recognized containing the image noise, thereby improving the accuracy of handwriting date recognition.

Description

Image recognition method, device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to an image identification method, an image identification device, electronic equipment and a storage medium.
Background
Currently, handwriting date identification is often involved in auditing of grid construction archive images. In the related art, the handwriting date recognition method mainly includes an online handwriting date recognition method and an offline handwriting date recognition method. First, for the online handwriting date recognition method, a professional device (e.g., a touch screen) is required to capture and record stroke data to recognize the handwriting date, and there is a problem that the handwriting date of the history document cannot be recognized. Secondly, for the offline handwriting date recognition method, manual recognition is usually required by staff, and different noise such as blurring, distortion and illumination is introduced into the storage process of the history document, and the handwriting types in the history document are various, so that the condition of manual recognition errors is easy to occur, and the accuracy of offline handwriting date recognition is reduced.
Disclosure of Invention
The invention provides an image recognition method, an image recognition device, electronic equipment and a storage medium, which can be used for realizing more accurate recognition of a handwriting date in a handwriting date image to be recognized, wherein the handwriting date image contains image noise, so that the accuracy of handwriting date recognition is improved.
The handwriting date in the handwriting date image to be recognized is accurately recognized.
According to an aspect of the present invention, there is provided an image recognition method including:
acquiring a handwritten date image to be identified, wherein the handwritten date image to be identified contains image noise;
inputting the hand-written date image to be identified into a hand-written date identification model trained in advance, and obtaining a date identification result of the hand-written date image to be identified.
Optionally, the handwriting date recognition model includes a content feature extraction network, an image feature extraction network, and a date handwriting classification network; inputting the handwritten date image to be identified into a handwritten date identification model which is trained in advance to obtain a date identification result of the handwritten date image to be identified, wherein the method comprises the following steps of: inputting the handwritten date image to be identified into the content feature extraction network to obtain the content features of the handwritten date image to be identified; inputting the handwritten date image to be identified into the image feature extraction network to obtain the image features of the handwritten date image to be identified; performing feature stitching processing on the content features and the image features of the hand-written date image to be identified to obtain stitched features; and inputting the spliced features into the date handwriting classification network to obtain a date identification result of the handwritten date image to be identified.
Optionally, the method further comprises: obtaining a sample data set, wherein the sample data set comprises a handwritten date marked image, an unlabeled handwritten date image and a style migration handwritten date image corresponding to the handwritten date marked image; and performing model training on an initial network model based on the marked handwriting date image and the style migration handwriting date image to obtain the handwriting date recognition model.
Optionally, the method further comprises: and inputting the marked handwritten date image and the unmarked handwritten date image into a pre-trained image style migration model to obtain a style migration handwritten date image corresponding to the marked handwritten date image.
Optionally, performing model training on the image style migration model includes:
performing difference value calculation on the content characteristics of the marked handwritten date image and the content characteristics of the style migration handwritten date image to obtain a content loss function value of the image style migration model; performing difference value calculation on the style characteristics of the unlabeled handwritten date image and the style characteristics of the style migration handwritten date image to obtain a style loss function value of the image style migration model; performing difference value calculation on the handwriting characteristics of the unlabeled handwritten date image and the handwriting characteristics of the style migration handwritten date image to obtain a handwriting loss function value of the image style migration model; and adjusting the network parameters of the image style migration model according to the content loss function value, the style loss function value and the handwriting loss function value to obtain the image style migration model.
Optionally, the image style migration model includes a content encoder, a style encoder, a handwriting encoder, and a decoder; inputting the marked handwritten date image and the unmarked handwritten date image into a pre-trained image style migration model to obtain a style migration handwritten date image corresponding to the marked handwritten date image, wherein the method comprises the following steps of:
inputting the marked handwritten date image to the content encoder to obtain the content characteristics of the marked handwritten date image; inputting the unlabeled handwritten date image to the style encoder to obtain style characteristics of the unlabeled handwritten date image; inputting the unlabeled handwritten date image to the handwriting encoder to obtain handwriting characteristics of the unlabeled handwritten date image; and performing feature stitching processing on the content features of the marked handwritten date images, the style features of the non-marked handwritten date images and the handwriting features of the non-marked handwritten date images to obtain stitched features, and inputting the stitched features to the decoder to generate style migration handwritten date images.
Optionally, the handwriting encoder is a trained handwriting classification model, and the method further comprises: training the handwriting classification model, comprising:
inputting the marked handwritten date image into a pre-constructed handwriting classification model to obtain an actual handwriting classification result of the marked handwritten date image; comparing the actual handwriting classification result with the expected handwriting classification result of the marked handwritten date image to obtain a classification loss function value of the constructed handwriting classification model; and adjusting model parameters of the pre-constructed handwriting classification model based on the classification loss function value to obtain a trained handwriting classification model of the handwritten date.
According to another aspect of the present invention, there is provided an image recognition apparatus including:
the image acquisition module is used for acquiring a handwriting date image to be identified, wherein the handwriting date image to be identified contains image noise;
the date recognition module is used for inputting the handwritten date image to be recognized into a handwritten date recognition model which is trained in advance, and obtaining a date recognition result of the handwritten date image to be recognized.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the image recognition method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute the image recognition method according to any one of the embodiments of the present invention.
According to the technical scheme, the handwritten date image to be identified is obtained, wherein the handwritten date image to be identified contains image noise; inputting the hand-written date image to be identified into a hand-written date identification model trained in advance, and obtaining a date identification result of the hand-written date image to be identified. The technical scheme of the embodiment of the invention solves the technical problem of lower accuracy in the handwriting date recognition of the image of the handwriting date to be recognized containing the image noise in the prior art, and realizes the more accurate recognition of the handwriting date in the image of the handwriting date to be recognized containing the image noise, thereby improving the accuracy of handwriting date recognition.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an image recognition method according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of an image recognition device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It will be appreciated that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solution should comply with the corresponding legal regulations and the requirements of the relevant regulations.
Example 1
Fig. 1 is a flowchart of an image recognition method according to a first embodiment of the present invention, where the method may be performed by an image recognition device, and the image recognition device may be implemented in hardware and/or software, and the image recognition device may be configured in an electronic device such as a computer or a server.
As shown in fig. 1, the method of the present embodiment includes:
s110, acquiring a handwriting date image to be identified, wherein the handwriting date image to be identified contains image noise.
The image of the handwritten date to be recognized can be understood as an image which needs to be recognized of the handwritten date. In the embodiment of the invention, the image of the handwriting date to be identified can be understood as a history document image of the handwriting date to be identified. For example, the historic document image may be a grid construction archive image. That is, the handwritten date image to be recognized may be obtained based on the handwritten date to be recognized in the grid construction archive image. Image noise may be understood as unnecessary or redundant interference information present in the handwritten date image to be recognized. The image noise may include at least one of blur noise, distortion noise, illumination noise.
In the embodiment of the invention, the manner of obtaining the power grid construction archive image can be to label the handwriting date in the power grid construction archive image, and the labeled image is used as the handwriting date image to be identified; or, the handwritten date can be extracted from the power grid construction archive image, and the handwritten date image to be identified can be generated based on the extracted handwritten date; or, the analysis may be performed on the power grid construction archive image, so as to determine a target area of the handwriting date in the power grid construction archive image, and the segmentation processing may be further performed on the power grid construction archive image, so as to obtain an area image of the target area, and thus, an image of the handwriting date to be identified is obtained. The target area is understood to be the area of the handwritten date in the grid construction archive image.
In the embodiment of the present invention, there are various ways to obtain the image of the handwritten date to be recognized, which are not limited herein. For example, the handwritten date image to be recognized may be acquired from a database for storing handwritten date images to be recognized; alternatively, the handwritten date image to be recognized may be received that is transmitted by the device storing the handwritten date image to be recognized.
S120, inputting the handwritten date image to be identified into a handwritten date identification model which is trained in advance, and obtaining a date identification result of the handwritten date image to be identified.
The handwriting date recognition model may be understood as a model for handwriting date recognition of a handwriting date image to be recognized. In the embodiment of the invention, the date recognition result may be handwriting date data in the handwriting date image to be recognized. In the embodiment of the present invention, the specific font form of the date identification result may be set according to actual needs, and is not limited herein, for example, song style, clerical script, regular script, etc.
Specifically, after the image of the hand-written date to be identified containing the image noise is obtained, the image of the hand-written date to be identified containing the image noise may be input into the hand-written date identification model which is trained in advance. Thus, the output result of the handwriting date recognition model can be obtained, namely, the date recognition result corresponding to the handwriting date image to be recognized containing the image noise can be obtained.
In the embodiment of the invention, the handwriting date recognition model can comprise a content feature extraction network, an image feature extraction network and a date handwriting classification network; the content feature extraction network may be understood as a network for extracting content features of a handwritten date image to be identified in a handwritten date recognition model. The image feature extraction network may be understood as a network for image feature extraction of an image of a handwritten date to be identified. A date handwriting classification network may be understood as a network for classifying and identifying handwritten date handwriting in a handwritten date image to be identified.
On the basis of the foregoing embodiment, the inputting the to-be-identified handwritten date image into a pre-trained handwritten date recognition model to obtain a date recognition result of the to-be-identified handwritten date image may include: the handwritten date image to be identified can be input to the content feature extraction network, so that the content features of the handwritten date image to be identified can be obtained. The handwritten date image to be recognized may be input to the image feature extraction network, so that image features of the handwritten date image to be recognized may be obtained. And then the characteristic splicing processing can be carried out on the content characteristics and the image characteristics of the handwritten date image to be identified, so that the spliced characteristics can be obtained. After the spliced features are obtained, the spliced features can be input into the date handwriting classification network, so that a date recognition result of the handwritten date image to be recognized can be obtained.
On the basis of the above embodiment, the method further includes: a sample data set is obtained, wherein the sample data set comprises a handwritten date marked image, an unlabeled handwritten date image and a style migration handwritten date image corresponding to the handwritten date marked image. And further, model training can be performed on the initial network model based on the marked handwriting date image, the unmarked handwriting date image and the style migration handwriting date image, so as to obtain the handwriting date recognition model.
The handwritten date marked image may be an image obtained by marking the handwritten date in the history document image with image noise. The unlabeled handwritten date image may be a history document image that is in the presence of image noise and contains handwritten dates. The style migration handwritten date image may be an image obtained by performing a stylized process on a handwritten date in the handwritten date image. The initial network model may be a pre-built model for training based on annotated handwritten date images, unlabeled handwritten date images, and style-shifted handwritten date images, among others.
In the embodiment of the invention, the initial network model is trained by using the handwritten date marked image, the unlabeled handwritten date image and the style migration handwritten date image, wherein the aim of model training is that: the handwriting recognition model is obtained through supervised training by using the labeling data and the enhancement data, and the purpose of enhancing the data is to overcome the interference of image noise and improve the date recognition accuracy. Therefore, the model training of the initial network model by using the marked handwritten date image, the unmarked handwritten date image and the style migration handwritten date image has the advantage of being capable of effectively positioning and identifying the numbers in the handwritten date image, thereby achieving the technical effect of improving the identification accuracy of the handwritten date.
On the basis of the above embodiment, the method further includes: and performing model training on the image style migration model. In the embodiment of the invention, the style and the handwriting of unlabeled data can be learned by using the image style migration model, and then the labeled data is migrated to a new style and handwriting, so that the data enhancement is realized, and the style and the handwriting of the labeled data can be diversified.
In the embodiment of the invention, the model training of the image style migration model comprises the following steps: performing difference value calculation on the content characteristics of the marked handwritten date image and the content characteristics of the style migration handwritten date image to obtain a content loss function value of the image style migration model; performing difference value calculation on the style characteristics of the unlabeled handwritten date image and the style characteristics of the style migration handwritten date image to obtain a style loss function value of the image style migration model; performing difference value calculation on the handwriting characteristics of the unlabeled handwritten date image and the handwriting characteristics of the style migration handwritten date image to obtain a handwriting loss function value of the image style migration model; and adjusting the network parameters of the image style migration model according to the content loss function value, the style loss function value and the handwriting loss function value to obtain the image style migration model.
Wherein the content loss function value may be derived based on a difference between the content feature of the handwritten date image and the content feature of the style migration handwritten date image. The style loss function value may be derived based on a difference between a style characteristic of the unlabeled handwritten date image and a style characteristic of the style migration handwritten date image. The handwriting loss function value may be derived based on a difference between the handwriting feature of the unlabeled handwritten date image and the handwriting feature of the style-shifted handwritten date image.
In the embodiment of the present invention, performing difference calculation on the content features of the marked handwritten date image and the content features of the style migration handwritten date image to obtain a content loss function value of the image style migration model may include: and determining the content characteristics of the marked handwriting date image and the content characteristics of the style migration handwriting date image. And calculating the difference value between the content characteristics of the marked handwriting date image and the content characteristics of the style migration handwriting date image. And obtaining a difference value calculation result, namely obtaining the content loss function value of the image style migration model.
In the embodiment of the present invention, performing difference calculation on the style characteristics of the unlabeled handwritten date image and the style characteristics of the style migration handwritten date image to obtain a style loss function value of the image style migration model may include: and determining the style characteristics of the unlabeled handwritten date image and the style characteristics of the style migration handwritten date image. And further, the style characteristics of the unlabeled handwritten date image and the style characteristics of the style migration handwritten date image can be subjected to difference value calculation. And obtaining a difference value calculation result, namely obtaining the style loss function value of the image style migration model.
In the embodiment of the present invention, performing difference calculation on the handwriting feature of the unlabeled handwritten date image and the handwriting feature of the style migration handwritten date image to obtain a handwriting loss function value of the image style migration model may include: and determining the handwriting characteristics of the unlabeled handwritten date image and the handwriting characteristics of the style migration handwritten date image. And further, calculating the difference value between the handwriting characteristics of the unlabeled handwritten date image and the handwriting characteristics of the style migration handwritten date image. And obtaining a difference value calculation result, namely obtaining the handwriting loss function value of the image style migration model.
The image style migration model includes a content loss function, a style loss function, and a handwriting loss function. Wherein a content loss function may be used to determine a difference between the content characteristics of the annotated date image and the content characteristics of the style migration handwritten date image, i.e. a content loss function value. A style loss function may be used to determine a difference between the style characteristics of the unlabeled handwritten date image and the style characteristics of the style shifted handwritten date image, i.e. a style loss function value. The handwriting loss function may be used to determine a difference between the handwriting characteristics of the unlabeled handwritten date image and the handwriting characteristics of the style-shifted handwritten date image, i.e. the handwriting loss function value.
In the process of adjusting the network parameters of the image style migration model, when the content loss function, the style loss function and the handwriting loss function are all converged, the adjustment of the network parameters can be ended, so that the trained image style migration model can be obtained. This has the advantage that by performing countermeasure training using the content loss function, the style loss function, and the handwriting loss function, handwritten date image data having a variety of handwriting conditions such as blurring, warping, and illumination can be obtained.
On the basis of the above-described embodiment, the image style migration model may be understood as a model for learning handwriting of a handwritten date in a handwritten date image and performing stylized processing of the handwriting of the handwritten date in the handwritten date image. In the embodiment of the invention, the specific mode for obtaining the style migration handwritten date image can comprise the following steps: and inputting the marked handwriting date image and the unmarked handwriting date image into a pre-trained image style migration model, so that a style migration handwriting date image corresponding to the marked handwriting date image can be obtained.
In the embodiment of the invention, the handwritten date marked image and the unlabeled handwritten date image are input into the pre-constructed image style migration model, handwriting features of the handwritten date in the unlabeled handwritten date image can be learned, and the learned handwriting features are applied to the handwritten date in the handwritten date marked image, so that the technical effect of sample data enhancement is achieved.
Optionally, the image style migration model includes a content encoder, a style encoder, a handwriting encoder, and a decoder; wherein a content encoder may be understood as an encoder for content feature extraction of a handwritten date image. A style encoder may be understood as an encoder for style feature extraction of an image of an unlabeled handwritten date. A handwriting encoder may be understood as an encoder for handwriting feature extraction of an image of an unlabeled handwritten date. The decoder may be configured to generate a style-shifted handwritten date image corresponding to the annotated handwritten date image.
On this basis, the inputting the marked handwritten date image and the unmarked handwritten date image into a pre-trained image style migration model to obtain a style migration handwritten date image corresponding to the marked handwritten date image may include: the handwritten date image may be input to the content encoder such that content characteristics of the handwritten date image may be derived. The non-handwritten date image may be input to the style encoder such that style characteristics of the non-handwritten date image may be obtained. The non-handwritten date image may be input to the handwriting encoder, whereby handwriting characteristics of the non-handwritten date image may be obtained. And then the content characteristics of the marked handwritten date image, the style characteristics of the unmarked handwritten date image and the handwriting characteristics of the unmarked handwritten date image can be subjected to characteristic splicing processing. So that the spliced features can be obtained. After the spliced features are obtained, the spliced features can be input to the decoder, so that a style migration handwritten date image can be generated.
In the embodiment of the present invention, the handwriting encoder is a trained handwriting classification model, and the network of the handwriting classification model may be a VGG classification network. On the basis of the above embodiment, the sample data set includes a desired handwriting classification result corresponding to the noted handwritten date image; in the embodiment of the invention, the specific training mode of the handwriting classification model of the handwriting date can comprise the following steps: inputting the marked handwritten date image into a pre-constructed handwriting classification model to obtain an actual handwriting classification result of the marked handwritten date image; comparing the actual handwriting classification result with the expected handwriting classification result of the marked handwritten date image to obtain a classification loss function value of the constructed handwriting classification model; and adjusting model parameters of the pre-constructed handwriting classification model based on the classification loss function value to obtain a trained handwriting classification model of the handwritten date.
The actual handwriting classification result may be a model output result obtained by inputting the handwritten date image into a pre-constructed handwriting classification model. In the embodiment of the present invention, inputting the marked handwritten date image into a handwriting classification model constructed in advance to obtain an actual handwriting classification result of the marked handwritten date image may include: inputting the marked handwritten date image into a pre-constructed handwriting classification model to obtain handwriting characteristics of the marked handwritten date image, and determining an actual handwriting classification result of the marked handwritten date image based on the handwriting characteristics of the marked handwritten date image. Alternatively, the desired handwriting classification result may be a desired handwriting classification of a handwritten date in the handwritten date image.
In the embodiment of the invention, the handwriting encoder can be obtained through pre-training of a handwriting date handwriting classification model. Handwriting date and handwriting classification module: and extracting handwriting date image features by using the VGG classification network, and guiding the VGG classification network to learn handwriting features of handwriting date images through handwriting classification loss function training so as to accurately classify handwriting extracted images of different handwriting. After the pre-training is completed, the ability of the handwriting encoder to obtain extracted handwriting features may be determined.
According to the technical scheme, the handwritten date image to be identified is obtained, wherein the handwritten date image to be identified contains image noise; inputting the hand-written date image to be identified into a hand-written date identification model trained in advance, and obtaining a date identification result of the hand-written date image to be identified. The technical scheme of the embodiment of the invention solves the technical problem of lower accuracy in the handwriting date recognition of the image of the handwriting date to be recognized containing the image noise in the prior art, and realizes the more accurate recognition of the handwriting date in the image of the handwriting date to be recognized containing the image noise, thereby improving the accuracy of handwriting date recognition.
Example two
Fig. 2 is a schematic structural diagram of an image recognition device according to a second embodiment of the present invention. As shown in fig. 2, the apparatus includes: an image acquisition module 210 and a date identification module 220.
The image obtaining module 210 is configured to obtain a handwritten date image to be identified, where the handwritten date image to be identified includes image noise; the date recognition module 220 is configured to input the handwritten date image to be recognized into a handwritten date recognition model that is trained in advance, and obtain a date recognition result of the handwritten date image to be recognized.
According to the technical scheme, the image acquisition module is used for acquiring the image of the hand-written date to be identified, wherein the image of the hand-written date to be identified contains image noise. And inputting the handwritten date image to be identified into a pre-trained handwritten date identification model through a date identification module to obtain a date identification result of the handwritten date image to be identified. The technical scheme of the embodiment of the invention solves the technical problem of lower accuracy in the handwriting date recognition of the image of the handwriting date to be recognized containing the image noise in the prior art, and realizes the more accurate recognition of the handwriting date in the image of the handwriting date to be recognized containing the image noise, thereby improving the accuracy of handwriting date recognition.
Optionally, the handwriting date recognition model includes a content feature extraction network, an image feature extraction network, and a date handwriting classification network; the date identification module 220 is specifically configured to:
inputting the handwritten date image to be identified into the content feature extraction network to obtain the content features of the handwritten date image to be identified;
inputting the handwritten date image to be identified into the image feature extraction network to obtain the image features of the handwritten date image to be identified;
performing feature stitching processing on the content features and the image features of the hand-written date image to be identified to obtain stitched features;
and inputting the spliced features into the date handwriting classification network to obtain a date identification result of the handwritten date image to be identified.
Optionally, the apparatus further comprises a model training module, wherein the model training module is configured to:
obtaining a sample data set, wherein the sample data set comprises a handwritten date marked image, an unlabeled handwritten date image and a style migration handwritten date image corresponding to the handwritten date marked image;
and performing model training on an initial network model based on the marked handwriting date image, the unmarked handwriting date image and the style migration handwriting date image to obtain the handwriting date recognition model.
Optionally, the device further comprises a style migration handwriting date image obtaining module, wherein the style migration handwriting date image obtaining module is used for:
and inputting the marked handwritten date image and the unmarked handwritten date image into a pre-trained image style migration model to obtain a style migration handwritten date image corresponding to the marked handwritten date image.
Optionally, the device further comprises an image style migration model training module; the image style migration model training module is used for:
performing difference value calculation on the content characteristics of the marked handwritten date image and the content characteristics of the style migration handwritten date image to obtain a content loss function value of the image style migration model;
performing difference value calculation on the style characteristics of the unlabeled handwritten date image and the style characteristics of the style migration handwritten date image to obtain a style loss function value of the image style migration model;
performing difference value calculation on the handwriting characteristics of the unlabeled handwritten date image and the handwriting characteristics of the style migration handwritten date image to obtain a handwriting loss function value of the image style migration model;
And adjusting the network parameters of the image style migration model according to the content loss function value, the style loss function value and the handwriting loss function value to obtain the image style migration model.
Optionally, the image style migration model includes a content encoder, a style encoder, a handwriting encoder, and a decoder; the style migration handwriting date image obtaining module is used for:
inputting the marked handwritten date image to the content encoder to obtain the content characteristics of the marked handwritten date image;
inputting the unlabeled handwritten date image to the style encoder to obtain style characteristics of the unlabeled handwritten date image;
inputting the unlabeled handwritten date image to the handwriting encoder to obtain handwriting characteristics of the unlabeled handwritten date image;
and performing feature stitching processing on the content features of the marked handwritten date images, the style features of the non-marked handwritten date images and the handwriting features of the non-marked handwritten date images to obtain stitched features, and inputting the stitched features to the decoder to generate style migration handwritten date images.
Optionally, the handwriting encoder is a trained handwriting classification model of the handwritten date. The device also comprises a handwriting date handwriting classification model training module for:
inputting the marked handwritten date image into a pre-constructed handwriting classification model to obtain an actual handwriting classification result of the marked handwritten date image;
comparing the actual handwriting classification result with the expected handwriting classification result of the marked handwritten date image to obtain a classification loss function value of the constructed handwriting classification model;
and adjusting model parameters of the pre-constructed handwriting classification model based on the classification loss function value to obtain a trained handwriting classification model of the handwritten date.
The image recognition device provided by the embodiment of the invention can execute the image recognition method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the image recognition apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Example III
Fig. 3 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), 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 inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, such as the image recognition method.
In some embodiments, the image recognition method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the image recognition method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the image recognition method in any other suitable way (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.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program 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 the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. 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 an electronic device 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 a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. 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), blockchain networks, and the internet.
The computing system may include clients and servers. 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 can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
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 described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. An image recognition method, comprising:
acquiring a handwritten date image to be identified, wherein the handwritten date image to be identified contains image noise;
inputting the hand-written date image to be identified into a hand-written date identification model trained in advance, and obtaining a date identification result of the hand-written date image to be identified.
2. The method of claim 1, wherein the handwriting date recognition model comprises a content feature extraction network, an image feature extraction network, and a date handwriting classification network; inputting the handwritten date image to be identified into a handwritten date identification model which is trained in advance to obtain a date identification result of the handwritten date image to be identified, wherein the method comprises the following steps of:
Inputting the handwritten date image to be identified into the content feature extraction network to obtain the content features of the handwritten date image to be identified;
inputting the handwritten date image to be identified into the image feature extraction network to obtain the image features of the handwritten date image to be identified;
performing feature stitching processing on the content features and the image features of the hand-written date image to be identified to obtain stitched features;
and inputting the spliced features into the date handwriting classification network to obtain a date identification result of the handwritten date image to be identified.
3. The method according to claim 1, wherein the method further comprises:
obtaining a sample data set, wherein the sample data set comprises a handwritten date marked image, an unlabeled handwritten date image and a style migration handwritten date image corresponding to the handwritten date marked image;
and performing model training on an initial network model based on the marked handwriting date image and the style migration handwriting date image to obtain the handwriting date recognition model.
4. A method according to claim 3, characterized in that the method further comprises:
And inputting the marked handwritten date image and the unmarked handwritten date image into a pre-trained image style migration model to obtain a style migration handwritten date image corresponding to the marked handwritten date image.
5. The method of claim 4, wherein model training the image style migration model comprises:
performing difference value calculation on the content characteristics of the marked handwritten date image and the content characteristics of the style migration handwritten date image to obtain a content loss function value of the image style migration model;
performing difference value calculation on the style characteristics of the unlabeled handwritten date image and the style characteristics of the style migration handwritten date image to obtain a style loss function value of the image style migration model;
performing difference value calculation on the handwriting characteristics of the unlabeled handwritten date image and the handwriting characteristics of the style migration handwritten date image to obtain a handwriting loss function value of the image style migration model;
and adjusting the network parameters of the image style migration model according to the content loss function value, the style loss function value and the handwriting loss function value to obtain the image style migration model.
6. The method of claim 4, wherein the image style migration model comprises a content encoder, a style encoder, a handwriting encoder, and a decoder; inputting the marked handwritten date image and the unmarked handwritten date image into a pre-trained image style migration model to obtain a style migration handwritten date image corresponding to the marked handwritten date image, wherein the method comprises the following steps of:
inputting the marked handwritten date image to the content encoder to obtain the content characteristics of the marked handwritten date image;
inputting the unlabeled handwritten date image to the style encoder to obtain style characteristics of the unlabeled handwritten date image;
inputting the unlabeled handwritten date image to the handwriting encoder to obtain handwriting characteristics of the unlabeled handwritten date image;
and performing feature stitching processing on the content features of the marked handwritten date images, the style features of the non-marked handwritten date images and the handwriting features of the non-marked handwritten date images to obtain stitched features, and inputting the stitched features to the decoder to generate style migration handwritten date images.
7. The method of claim 6, wherein the handwriting encoder is a trained handwritten date handwriting classification model, the method further comprising: training the handwriting classification model of the handwritten date comprises the following steps:
inputting the marked handwritten date image into a pre-constructed handwriting classification model to obtain an actual handwriting classification result of the marked handwritten date image;
comparing the actual handwriting classification result with the expected handwriting classification result of the marked handwritten date image to obtain a classification loss function value of the constructed handwriting classification model;
and adjusting model parameters of the pre-constructed handwriting classification model based on the classification loss function value to obtain a trained handwriting classification model of the handwritten date.
8. An image recognition apparatus, comprising:
the image acquisition module is used for acquiring a handwriting date image to be identified, wherein the handwriting date image to be identified contains image noise;
the date recognition module is used for inputting the handwritten date image to be recognized into a handwritten date recognition model which is trained in advance, and obtaining a date recognition result of the handwritten date image to be recognized.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the image recognition method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the image recognition method of any one of claims 1-7.
CN202310528661.0A 2023-05-10 2023-05-10 Image recognition method, device, electronic equipment and storage medium Pending CN116884023A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310528661.0A CN116884023A (en) 2023-05-10 2023-05-10 Image recognition method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310528661.0A CN116884023A (en) 2023-05-10 2023-05-10 Image recognition method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116884023A true CN116884023A (en) 2023-10-13

Family

ID=88259256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310528661.0A Pending CN116884023A (en) 2023-05-10 2023-05-10 Image recognition method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116884023A (en)

Similar Documents

Publication Publication Date Title
CN112580623B (en) Image generation method, model training method, related device and electronic equipment
WO2023015922A1 (en) Image recognition model training method and apparatus, device, and storage medium
CN111753744B (en) Method, apparatus, device and readable storage medium for bill image classification
CN113239807B (en) Method and device for training bill identification model and bill identification
CN114419035B (en) Product identification method, model training device and electronic equipment
CN113627439A (en) Text structuring method, processing device, electronic device and storage medium
CN114429633A (en) Text recognition method, model training method, device, electronic equipment and medium
US20230096921A1 (en) Image recognition method and apparatus, electronic device and readable storage medium
CN113221918A (en) Target detection method, and training method and device of target detection model
CN112839185B (en) Method, apparatus, device and medium for processing image
CN116309963B (en) Batch labeling method and device for images, electronic equipment and storage medium
JP2022536320A (en) Object identification method and device, electronic device and storage medium
CN112528610A (en) Data labeling method and device, electronic equipment and storage medium
CN116935368A (en) Deep learning model training method, text line detection method, device and equipment
CN111552829A (en) Method and apparatus for analyzing image material
CN115905016A (en) BIOS Setup search function test method and device, electronic equipment and storage medium
CN115934928A (en) Information extraction method, device, equipment and storage medium
CN114120305B (en) Training method of text classification model, and text content recognition method and device
CN114724144A (en) Text recognition method, model training method, device, equipment and medium
CN116884023A (en) Image recognition method, device, electronic equipment and storage medium
CN114764874A (en) Deep learning model training method, object recognition method and device
CN114187448A (en) Document image recognition method and device, electronic equipment and computer readable medium
CN114049686A (en) Signature recognition model training method and device and electronic equipment
CN113971810A (en) Document generation method, device, platform, electronic equipment and storage medium
CN114998906B (en) Text detection method, training method and device of model, electronic equipment and medium

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