WO2018156478A1 - Image recognition method and apparatus - Google Patents

Image recognition method and apparatus Download PDF

Info

Publication number
WO2018156478A1
WO2018156478A1 PCT/US2018/018692 US2018018692W WO2018156478A1 WO 2018156478 A1 WO2018156478 A1 WO 2018156478A1 US 2018018692 W US2018018692 W US 2018018692W WO 2018156478 A1 WO2018156478 A1 WO 2018156478A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
processing
spatial
spatial transformer
recognized
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.)
Ceased
Application number
PCT/US2018/018692
Other languages
French (fr)
Inventor
CHEN Kai
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2018156478A1 publication Critical patent/WO2018156478A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0609Qualifying participants for shopping transactions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/95Pattern authentication; Markers therefor; Forgery detection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/243Aligning, centring, orientation detection or correction of the image by compensating for image skew or non-uniform image deformations
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • G06V10/449Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
    • G06V10/451Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
    • G06V10/454Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/247Aligning, centring, orientation detection or correction of the image by affine transforms, e.g. correction due to perspective effects; Quadrilaterals, e.g. trapezoids
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/32Normalisation of the pattern dimensions

Definitions

  • the present invention relates to the field of image recognition technologies, and in particular, to an image recognition method and apparatus.
  • Real-person authentication aims to make sure that real persons and their identity cards match.
  • a person using an account can be identified conveniently and accurately according to authenticated account identity information.
  • identity card images uploaded by some users during real-person authentication are reproduced images. It is very likely that these users illegally acquire use data of identity cards of others.
  • Embodiments of the present invention provide an image recognition method and apparatus, so as to solve the problems in the prior art including the heavy workload of sample calibration caused by training of a huge number of samples carried out for each CNN, and poor image recognition effect caused by using of the multistage independent CNNs for processing.
  • An image recognition method comprising: inputting an acquired to-be-recognized image to a spatial transformer network model; carrying out image processing and spatial transformation processing on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and determining the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
  • the method before the step of inputting an acquired to-be-recognized image to a spatial transformer network model, the method further comprises: acquiring image samples and dividing the acquired image samples into a training set and a testing set according to a preset ratio; and constructing a spatial transformer network based on a convolutional neural network (CNN) and a spatial transformer module, carrying out a model training on the spatial transformer network based on the training set, and carrying out a model testing on the spatial transformer network having finished the model training based on the testing set.
  • CNN convolutional neural network
  • the step of constructing a spatial transformer network based on a CNN and a spatial transformer module comprises: embedding a learnable spatial transformer module in the CNN to construct a spatial transformer network, wherein the spatial transformer module comprises at least a positioning network, a grid generator, and a sampler, the positioning network comprising at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
  • the step of carrying out a model training on the spatial transformer network based on the training set comprises: dividing the image samples comprised in the training set into several batches based on the spatial transformer network, wherein one batch comprises G image samples, and G is a positive integer greater than or equal to 1; and sequentially performing the following operations for each batch comprised in the training set until it is judged that all recognition accuracy rates corresponding to Q successive batches are greater than a first preset threshold, determining that the model training carried out on the spatial transformer network is finished, and Q is a positive integer greater than or equal to 1; carrying out spatial transformation processing and image processing on each image sample comprised in one batch by using current configuration parameters and obtain a corresponding recognition result, wherein the configuration parameters at least comprise a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculating a recognition accuracy rate corresponding to the one batch based on recognition results of the image
  • the step of carrying out a model testing on the spatial transformer network having finished the model training based on the testing set comprises: carrying out image processing and spatial transformation processing on each image sample comprised in the testing set based on the spatial transformer network having finished the model training and obtaining a corresponding output result, wherein the output result comprises a reproduced image probability value and a non- reproduced image probability value corresponding to each image sample; and setting the first threshold based on the output result, thereby determining that the model testing on the spatial transformer network is finished.
  • the step of setting the first threshold based on the output result comprises: using a respectively reproducing probability value of each image sample comprised in the testing set as a set threshold, and determining a false positive rate (FPR) and a true positive rate (TPR) corresponding to each set threshold based on the reproduced image probability value and the non- reproduced image probability value corresponding to each image sample comprised in the output result; drawing a receiver operating characteristic (ROC) curve based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR as a Y-axis; and setting a reproduced image probability value corresponding to the FPR equaling to a second preset threshold as the first threshold based on the ROC curve.
  • ROC receiver operating characteristic
  • the step of carrying out image processing on the to-be-recognized image based on the spatial transformer network model comprises: carrying out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to- be-recognized image based on the spatial transformer network model.
  • the step of carrying out spatial transformation processing on the to-be- recognized image comprises: the spatial transformer network model comprising at least the CNN and the spatial transformer module, and the spatial transformer module comprising at least the positioning network, the grid generator, and the sampler; after any convolution processing is carried out on the to-be-recognized image by using the CNN, generating the transformation parameter set by using the positioning network; generating the sampling grids by using the grid generator according to the transformation parameter set; and carrying out sampling and spatial transformation processing on the to-be-recognized image by using the sampler according to the sampling grids, wherein the spatial transformation processing comprises at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
  • the present image recognition method comprises: receiving a to-be- recognized image uploaded by a user; carrying out image processing on the to-be-recognized image when an image processing instruction triggered by the user is received; carrying out spatial transformation processing on the to-be-recognized image when a spatial transformation instruction triggered by the user is received; and presenting to the user the to-be-recognized image after the image has gone through the image processing and the spatial transformation processing; calculating a reproduced image probability value corresponding to the to-be-recognized image according to a user instruction; and judging whether the reproduced image probability value corresponding to the to-be-recognized image is less than a preset first threshold; and if so, determining the to-be- recognized image as a non-reproduced image, and prompting the user that the recognition is successful; otherwise, determining the to-be-recognized image as a suspected reproduced image.
  • the method further comprises: presenting the suspected reproduced image to an administrator, and prompting the administrator to review the suspected reproduced image; and determining whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
  • the step of carrying out image processing on the to-be-recognized image comprises: carrying out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image.
  • the step of carrying out spatial transformation processing on the to-be- recognized image comprises: carrying out any one or a combination of the following operations on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
  • the present image processing apparatus comprises: an input unit, configured to input an acquired to-be-recognized image to a spatial transformer network model; a processing unit, configured to carry out image processing and spatial transformation processing on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and a determination unit, configured to determine the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be- recognized image is greater than or equal to a preset first threshold.
  • the input unit before an acquired to-be-recognized image is inputted to a spatial transformer network model, the input unit is further configured to: acquire image samples and divide the acquired image samples into a training set and a testing set according to a preset ratio; and construct a spatial transformer network based on a convolutional neural network (CNN) and a spatial transformer module; carry out a model training on the spatial transformer network based on the training set; and carry out a model testing on the spatial transformer network having finished the model training based on the testing set.
  • CNN convolutional neural network
  • the input unit when constructing a spatial transformer network based on a CNN and a spatial transformer module, is configured to: embed a learnable spatial transformer module in the CNN to construct a spatial transformer network, wherein the spatial transformer module comprises at least a positioning network, a grid generator, and a sampler, the positioning network comprising at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
  • the spatial transformer module comprises at least a positioning network, a grid generator, and a sampler, the positioning network comprising at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
  • the input unit when carrying out model training on the spatial transformer network based on the training set, is configured to: divide the image samples comprised in the training set into several batches based on the spatial transformer network, wherein one batch comprises G image samples, and G is a positive integer greater than or equal to 1; and sequentially perform the following operations for each batch comprised in the training set until it is judged that all recognition accuracy rates corresponding to Q successive batches are greater than a first preset threshold, determine that the model training carried out on the spatial transformer network is finished, and Q is a positive integer greater than or equal to 1; carry out spatial transformation processing and image processing on each image sample comprised in one batch by using current configuration parameters and obtain a corresponding recognition result, wherein the configuration parameters comprise at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculate a recognition accuracy rate corresponding to the one batch based on recognition results of the image samples
  • the input unit when carrying out a model testing on the spatial transformer network having finished the model training based on the testing set, is configured to: carry out image processing and spatial transformation processing on each image sample comprised in the testing set based on the spatial transformer network having finished the model training and obtain a corresponding output result, wherein the output result comprises a reproduced image probability value and a non-reproduced image probability value corresponding to each image sample; and set the first threshold based on the output result, thereby determining that the model testing on the spatial transformer network is finished.
  • the input unit when setting the first threshold based on the output result, is configured to: use a respective reproducing probability value of each image sample comprised in the testing set as a set threshold; and determine a false positive rate (FPR) and a true positive rate (TPR) corresponding to each set threshold based on the reproduced image probability value and the non- reproduced image probability value corresponding to each image sample comprised in the output result; draw a receiver operating characteristic (ROC) curve based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR as a Y- axis; and set a reproduced image probability value corresponding to the FPR equaling to a second preset threshold as the first threshold based on the ROC curve.
  • ROC receiver operating characteristic
  • the input unit when carrying out image processing on the to-be-recognized image based on the spatial transformer network model, is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image based on the spatial transformer network model.
  • the input unit when carrying out spatial transformation processing on the to-be- recognized image, is configured to: the spatial transformer network model comprising at least the CNN and the spatial transformer module, and the spatial transformer module comprising at least the positioning network, the grid generator, and the sampler; after any convolution processing is carried out on the to-be-recognized image by using the CNN, generate the transformation parameter set by using the positioning network; generate the sampling grids by using the grid generator according to the transformation parameter set; and carry out sampling and spatial transformation processing on the to-be-recognized image by using the sampler according to the sampling grids, wherein the spatial transformation processing comprises at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
  • the present image recognition apparatus comprises: a receiving unit, configured to receive a to-be-recognized image uploaded by a user; a processing unit, configured to carry out image processing on the to-be-recognized image when an image processing instruction triggered by the user is received; carry out spatial transformation processing on the to-be-recognized image when a spatial transformation instruction triggered by the user is received; and present to the user the to-be-recognized image after the image has gone through the image processing and the spatial transformation; a calculation unit, configured to calculate a reproduced image probability value corresponding to the to-be-recognized image according to a user instruction; and a judging unit, configured to judge whether the reproduced image probability value corresponding to the to- be-recognized image is less than a preset first threshold; and if so, determine the to-be-recognized image as a non-reproduced image, and prompt the user that the recognition is successful; otherwise, determine the
  • the judging unit is further configured to: present the suspected reproduced image to an administrator, and prompt the administrator to review the suspected reproduced image; and determine whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
  • the processing unit when carrying out image processing on the to-be-recognized image, is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image.
  • the processing unit when carrying out spatial transformation processing on the to-be- recognized image, is configured to: carry out any one or a combination of the following operations on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
  • the present invention has the following beneficial effects: in view of the above, in embodiments of the present invention, during image recognition based on a spatial transformer network model, an acquired to-be-recognized image is input to the spatial transformer network model, image processing and spatial transformation processing are carried out on the to-be- recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image, and the to-be-recognized image is determined as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
  • a spatial transformer network model can be established by carrying out model training and model testing for a spatial transformer network only once. In this way, the workload for calibrating image samples during training and testing is reduced, and training and testing efficiencies are improved. Further, the model training is carried out based on a one-level spatial transformer network, and configuration parameters obtained by the training form an optimal combination, thereby improving the recognition effect when an image is recognized by using the spatial transformer network model online.
  • FIG. 1 is a detailed flowchart of carrying out model training based on the established spatial transformer network according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a spatial transformer according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of carrying out spatial transformation on image samples based on a spatial transformer according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of converting three input neurons into two output neurons by carrying out dimensionality reduction processing using a fully connected layer according to an embodiment of the present invention
  • FIG. 5 is a detailed flowchart of carrying out model testing on a spatial transformer network based on the testing set according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of drawing an ROC curve according to 10 groups of different FPRs and TPRs according to an embodiment of the present invention, the ROC curve using the FPR as an X-axis and the TPR as a Y-axis;
  • FIG. 7 is a detailed flowchart of carrying out image recognition by using a spatial transformer network model online according to an embodiment of the present invention
  • FIG. 8 is a detailed flowchart of carrying out image recognition processing on a to-be- recognized image uploaded by a user in an actual business scenario according to an embodiment of the present invention
  • FIG. 9 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of another image processing apparatus according to an embodiment of the present invention.
  • a process of carrying out detection and judgment on an identity card image uploaded by a user includes: first carrying out rotation correction by using a first CNN on the identity card image uploaded by the user; then capturing an identity card region from the rotation corrected identity card image by using a second CNN; and finally carrying out classification and recognition on the captured identity card image by using a third CNN. That is, in the prior art, it is required to sequentially carry out CNN rotation angle processing once, CNN identity card region capturing processing once, and CNN classification processing once. In this way, three CNNs need to be established. A corresponding training model needs to be established for each CNN, and training of a huge number of samples is required, thus causing a heavy workload of sample calibration. Moreover, a lot of human and material resources need to be used for subsequent operations and maintenances on the established three CNNs. Further, in the prior art, the identity card images uploaded by the users are recognized by using multistage independent CNNs processing, and the recognition effect is poor.
  • a new image recognition method and apparatus are designed in accordance with embodiments of the present invention to solve the problems in the prior art including the heavy workload of sample calibration caused by training of a huge number of samples carried out for each CNN, and poor image recognition effect caused by using of the multistage independent CNNs for processing.
  • the method includes: inputting an acquired to-be-recognized image to a spatial transformer network model; carrying out image processing and spatial transformation processing on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and determining the to-be- recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
  • a learnable spatial transformer module is introduced into the existing convolutional neural network, to establish a spatial transformer network.
  • the spatial transformer network can actively carry out spatial transformation processing on image data inputted to the spatial transformer network.
  • the spatial transformer module includes a positioning network, a grid generator, and a sampler.
  • the convolutional neural network includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer.
  • the positioning network in the spatial transformer also includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer.
  • the spatial transformer module in the spatial transformer network may be inserted behind any convolutional layer.
  • Step 100 Image samples are acquired, and the acquired image samples are divided into a training set and a testing set according to a preset ratio.
  • image samples are very important step and also a burdensome task for the spatial transformer network.
  • the image samples may be confirmed reproduced identity card images and confirmed non-reproduced identity card images. It goes without saying that the image samples may also be other types of images, e.g., confirmed animal images and confirmed plant images, confirmed images with texts and confirmed images without texts, and so on.
  • images of the front and the back of an identity card are used as image samples, the images being submitted by a registered user of an e-commerce platform when carrying out real-person authentication.
  • the so-called reproduced image sample refers to a picture on a computer screen, a picture on a mobile phone screen, a copy of a picture, or the like reproduced by using a terminal. Therefore, the reproduced image sample includes at least a reproduced image of a computer screen, a reproduced image of a mobile phone screen, and a reproduced image of a copy. Assuming that in an acquired image sample set, half of the image samples are confirmed reproduced image sample and the other half are confirmed non-reproduced image samples.
  • the acquired image sample set is divided into a training set and a testing set according to a preset ratio.
  • the image samples included in the training set are used for subsequent model training.
  • the image samples included in the testing set are used for subsequent model testing.
  • Step 110 A spatial transformer network is constructed based on a CNN and a spatial transformer module.
  • a network structure of the spatial transformer network used in embodiments of the present invention includes at least the CNN and the spatial transformer module. That is, a learnable spatial transformer module is introduced into the CNN.
  • a network structure of the CNN includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer. The last layer is the fully connected layer.
  • the spatial transformer network is formed by embedding a spatial transformer module behind any convolutional layer in a CNN.
  • the spatial transformer network can actively carry out a spatial transformation operation on image data input to the network.
  • the spatial transformer module includes at least a positioning network, a grid generator, and a sampler.
  • a network structure of the positioning network in the spatial transformer network also includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer.
  • the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
  • FIG. 2 illustrates a schematic structural diagram of the spatial transformer, in an embodiment of the invention.
  • UGR H W C an input image characteristic chart, for example, an original image or an image characteristic chart outputted by a convolutional layer of the CNN, wherein W is the width of the image characteristic chart; H is the height of the image characteristic chart; C is the number of channels; V is an output image characteristic chart after spatial transformation is carried out on U by using the spatial transformer module; and M is between U and V is the spatial transformer.
  • the spatial transformer includes at least a positioning network, a gird generator, and a sampler.
  • the positioning network in the spatial transformer module may be configured to generate a transformation parameter ⁇
  • the grid generator in the spatial transformer may be configured to utilize the parameter ⁇ generated by the positioning network and V; that is, calculate to obtain a position of each point in V corresponding to U by using the parameter ⁇ ; and obtain V by sampling from U.
  • a specific calculation formula is shown as follows:
  • the sampler in the spatial transformer may obtain V from U by sampling.
  • the spatial transformer network includes the CNN and the spatial transformer.
  • the spatial transformer further includes the positioning network, the grid generator, and the sampler.
  • the CNN includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer.
  • the positioning network in the spatial transformer network also includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer.
  • con[N,w,sl,p] is used to denote a convolutional layer, wherein N is the number of channels, w*w is the size of a convolution kernel, si is a step length corresponding to each channel, and p is a padding value.
  • the convolutional layer may be used for extracting image characteristics of an input image. Convolution is a commonly used method of image processing. Each pixel in an output image of the convolutional layer is a weighted average of pixels in a small region of the input image, wherein a weight is defined by a function, and the function is referred to as a convolution kernel.
  • the convolution kernel is a function, and each parameter in the convolution kernel is equivalent to a weight parameter connected to corresponding local pixels.
  • the parameters in the convolution kernel are multiplied with the corresponding local pixel values, and then added with an offset parameter, to obtain a convolution result.
  • a specific calculation formula is shown as follows: ' n / , wherein / denotes the ' ⁇ ,h characteristic result chart, relu(x) — max (0, ) ?
  • W fc denotes a parameter of the ,h convolution kernel, - ⁇ denotes a characteristic of an upper layer, and b k is the offset parameter.
  • max[s2] is used to denote a pooling layer having a step length of s2.
  • the input characteristic chart is compressed, such that the characteristic chart becomes smaller, the complexity in network computing is reduced, and major characteristics of the input characteristic chart are extracted. Therefore, it is necessary to carry out pooling processing on the characteristic chart output by the convolutional layer, to reduce the degree of overfitting of the training parameters and the training model of the spatial transformer network.
  • Commonly used pooling methods include max pooling and average pooling.
  • the max pooling is selecting the maximum value in a pooling window to serve as a pooled value.
  • the average pooling is selecting an average value in a pooling region to serve as a pooled value.
  • the max pooling is used in an embodiment of the present invention.
  • fc[R] is used to denote a fully connected layer including R output units. Nodes of any two adjacent fully connected layers are connected to each other.
  • the number of input neurons (i.e., the characteristic chart) of any fully connected layer may be identical to or different from the number of output neurons. If the any fully connected layer is not the last fully connected layer, the input neurons and output neurons of the any fully connected layer are the characteristic chart.
  • FIG. 4 a schematic diagram of converting three input neurons into two output neurons by carrying out dimensionality reduction processing using a fully connected layer according to an embodiment of the present invention. A specific conversion formula is shown as follows:
  • the last fully connected layer in the spatial transformer network includes only two output nodes. Output values of the two output nodes are respectively a probability used for indicating that an image sample is a reproduced identity card image and a probability used for indicating that an image sample is a non-reproduced identity card image.
  • the positioning network in the spatial transformer module is set to a "conv[32,5,l,2] - max[2] - conv[32,5, l,2] - fc[32] - fc[32] - fc[12]" structure. That is, the first layer is a convolutional layer conv[32,5,l,2], the second layer is a pooling layer max[2], the third layer is a convolutional layer conv[32,5,l,2], the fourth layer is a fully connected layer fc[32], the fifth layer is a fully connected layer fc[32], and the sixth layer is a fully connected layer fc[12].
  • the CNN in the network is set to "conv[48,5, l,2] - max[2] - conv[64,5, l,2] - conv[128,5, l,2] - max[2] - conv[ 160,5, 1,2] - conv[192,5,l,2] - max[2] - conv[ 192,5, 1,2] - conv[192,5,l,2] - max[2] - conv[ 192,5, 1,2] - conv[192,5,l,2] - max[2] - conv[ 192,5, 1,2] - fc[3072] - fc[2]".
  • the first layer is a convolutional layer conv[48,5,l,2]
  • the second layer is a pooling layer max[2]
  • the third layer is a convolutional layer conv[64,5, l,2]
  • the fourth layer is a convolutional layer conv[128,5, l,2]
  • the fifth layer is a pooling layer max[2]
  • the sixth layer is a convolutional layer conv[160,5, l,2]
  • the seventh layer is a convolutional layer conv[192,5,l,2]
  • the eighth layer is a pooling layer max[2]
  • the ninth layer is a convolutional layer conv[ 192,5, 1,2]
  • the tenth layer is a convolutional layer conv[192,5,l,2]
  • the eleventh layer is a pooling layer max[2]
  • the twelfth layer is a convolutional layer conv[192,5,l,2]
  • the thirteenth layer is a fully
  • a softmax classifier is connected behind the last fully connected layer in the spatial transformer network, and a loss function thereof is shown as follows:
  • m is the number of training samples
  • x j is an output of the j ,h node in the fully connected layer
  • y"> is a tag class of the i ,h sample, when y"> equals to j
  • is a parameter of the network
  • J is a loss function value.
  • Step 120 Model training is carried out on the spatial transformer network based on the training set.
  • the so-called model training carried out on the spatial transformer network is actively carrying out recognition and judgment on input image samples and adjusting parameters correspondingly according to a recognition accuracy rate during automatic learning of the spatial transformer network based on the training set, such that a recognition result for a subsequently input image sample is more accurate.
  • the spatial transformer network model is trained by using a stochastic gradient descent (SGD) method.
  • SGD stochastic gradient descent
  • the image samples included in the training set are divided into several batches based on the spatial transformer network, wherein one batch includes G image samples, and G is a positive integer greater than or equal to 1.
  • Each image sample is a confirmed reproduced identity card image or a confirmed non-reproduced identity card image.
  • the following operations are performed sequentially for each batch included in the training set by using the spatial transformer network: carrying out spatial transformation processing and image processing on each image sample included in one batch by using current configuration parameters and obtaining a corresponding recognition result, wherein the configuration parameters include at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculating a recognition accuracy rate corresponding to the one batch based on recognition results of image samples included in the one batch; and judging whether the recognition accuracy rate corresponding to the one batch is greater than a first preset threshold; if so, keeping the current configuration parameters unchanged; otherwise, adjusting the current configuration parameters, and using the adjusted configuration parameters as current configuration parameters used for a next batch.
  • the configuration parameters include at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module;
  • the image processing may certainly include, but is not limited to, appropriate image sharpening processing and the like carried out on the image to the edge, contour, and details of the image clearer.
  • the spatial transformation processing may include, but is not limited to, any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
  • the model training carried out on the spatial transformer network can be determined as finished, and Q is a positive integer greater than or equal to 1.
  • the current configuration parameters are preset initial configuration parameters for the first batch in the training set; preferably, initial configuration parameters are randomly generated by the spatial transformer network.
  • the current configuration parameters are configuration parameters used for a previous batch; or adjusted configuration parameters obtained after adjustment is carried out on the basis of the configuration parameters used for a previous batch.
  • the last fully connected layer in the spatial transformer network includes two output nodes.
  • Output values of the two output nodes are respectively a probability indicating that an image sample is a reproduced identity card image and a probability indicating that an image sample is a non-reproduced identity card image.
  • an output probability indicating that the image sample is a reproduced identity card image is greater than or equal to 0.95 and an output probability indicating that the image sample is a non-reproduced identity card image is less than or equal to 0.05
  • the recognition is determined as correct.
  • a sum of the probability indicating that the image sample is a reproduced identity card image and the probability indicating that the image sample is a non- reproduced identity card image is l .
  • 0.95 and 0.05 are used merely as examples; and other thresholds may certainly be set in actual embodiments according to operation and maintenance experiences, which will not be described in detail here.
  • each image sample included in the first batch of image sample sub-set (briefly referred to as the first batch) in the training set may be recognized respectively based on preset initial configuration parameters, and a recognition accuracy rate corresponding to the first batch is obtained through calculation.
  • the preset initial configuration parameters are configuration parameters set based on the spatial transformer network.
  • the configuration parameters include at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used in the spatial transformer.
  • initial parameters are set for 256 image samples included in the first batch in the training set; the characteristics of the 256 image samples included in the first batch are extracted respectively; and the 256 image samples included in the first batch are recognized respectively by using the spatial transformer network to obtain a recognition result of each of the image samples.
  • a recognition accuracy rate corresponding to the first batch is calculated based on the recognition results.
  • each image sample included in the second batch of image sample subset (briefly referred to as the second batch) is recognized respectively.
  • the recognition accuracy rate corresponding to the first batch is greater than the first preset threshold
  • the image samples included in the second batch are recognized by using the initial configuration parameters preset for the first batch; and a recognition accuracy rate corresponding to the second batch is obtained.
  • configuration parameter adjustment is carried out on the initial configuration parameters preset for the first batch, so as to obtain the adjusted configuration parameters; and the image samples included in the second batch are recognized by using the adjusted configuration parameters to obtain a recognition accuracy rate corresponding to the second batch.
  • model training carried out on the spatial transformer network when it is judged that all recognition accuracy rates of Q successive batches are greater than the first preset threshold after the spatial transformer network uses a set of configuration parameters, and Q is a positive integer greater than or equal to 1, the model training carried out on the spatial transformer network is determined as finished. In this case, it is determined to carry out subsequent model testing procedures by using configuration parameters finally set in the spatial transformer network.
  • model testing may be carried out on the spatial transformer network based on the testing set.
  • a first threshold corresponding to a false positive rate (FPR) of reproduced identity card image equal to a second preset threshold (e.g., 1%) is determined according to an output result corresponding to each image sample included in the testing set.
  • the first threshold is a value of the probability indicating that the image sample is a reproduced identity card image in the output result.
  • each image sample included in the testing set corresponds to one output result.
  • the output result includes a probability indicating that the image sample is a reproduced identity card image and a probability indicating that the image sample is a non-reproduced identity card image.
  • Values of the probability indicating that the image sample is a reproduced identity card image in different output results correspond to different FPRs.
  • a value of the probability, indicating that the image sample is a reproduced identity card image, corresponding to the FPR equaling to the second preset threshold (e.g., 1%) is determined as the first threshold.
  • a receiver operating characteristic (ROC) curve is drawn according to the output results corresponding to the image samples included in the testing set.
  • a value of the probability, indicating that the image sample is a reproduced identity card image, corresponding to the FPR equaling to 1% is determined as the first threshold according to the ROC curve.
  • Step 500 Spatial transformation processing and image processing are carried out on each image sample included in the testing set based on the spatial transformer network having finished the model training, so as to obtain a corresponding output result, wherein the output result includes a reproduced image probability value and a non-reproduced image probability value corresponding to each image sample.
  • the image samples included in the testing set are used as original images for model testing carried out on the spatial transformer network, and each image sample included in the testing set is acquired respectively. Moreover, when the model training carried out on the spatial transformer network is finished, the acquired each image sample included in the testing set is recognized respectively by using configuration parameters that are set finally in the spatial transformer network.
  • the spatial transformer network is set as follows: the first layer is a convolutional layer 1, the second layer is a spatial transformer module, the third layer is a convolutional layer 2, the fourth layer is a pooling layer 1, and the fifth layer is a fully connected layer 1. Then, a specific procedure of carrying out image recognition on any original image x based on the spatial transformer network is described as follows:
  • the convolutional layer 1 uses the original image x as an input image, carries out sharpening processing on the original image x, and uses the original image x after the sharpening processing is carried out as an output image xl .
  • the spatial transformer uses the output image xl as an input image, carries out a spatial transformation operation (e.g., rotating clockwise by 60 degrees and/or translating leftward by 2 cm, and so on) on the output image xl, and uses the rotated and/or translated output image xl as an output image x2.
  • a spatial transformation operation e.g., rotating clockwise by 60 degrees and/or translating leftward by 2 cm, and so on
  • the convolutional layer 2 uses the output image x2 as an input image, carries out fuzzy processing on the output image x2, and uses the output image x2 after the fuzzy processing is carried out as an output image x3.
  • the pooling layer 1 uses the output image x3 as an input image, carries out compression processing on the output image x3 by using max pooling, and uses the compressed output image x3 as an output image x4.
  • the last layer of the spatial transformer network is the fully connected layer 1.
  • the fully connected layer 1 uses the output image x4 as an input image, and carries out classification processing on the output image x4 based on a characteristic chart of the output image x4.
  • a first threshold is set based on the output result, thereby determining that the model testing carried out on the spatial transformer network is finished.
  • an ROC curve is drawn according to the output results corresponding to the image samples included in the testing set.
  • a respective reproducing probability value of each image sample included in the testing set is used as a set threshold; an FPR and a true positive rate (TPR) corresponding to each set threshold are determined based on the reproduced image probability value and the non-reproduced image probability value corresponding to each image sample included in the output result.
  • An ROC curve is drawn based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR aY- axis.
  • each image sample included in the testing set corresponds to a probability used for indicating that the image sample is a reproduced identity card image and a probability used for indicating that the image sample is a non- reproduced identity card image.
  • a sum of the probability used for indicating that the image sample is a reproduced identity card image and the probability used for indicating that the image sample is a non-reproduced identity card image is 1.
  • different values of the probability used for indicating that the image sample is a reproduced identity card image correspond to different FPRs and TPRs.
  • ten values of the probability, used for indicating that the image sample is a reproduced identity card image, corresponding to the ten image samples included in the testing set may be used as set thresholds respectively.
  • An FPR and a TPR corresponding to each set threshold are determined based on a probability value used for indicating that the image sample is a reproduced identity card image and a probability value used for indicating that the image sample is a non-reproduced identity card image corresponding to each of the ten image samples included in the testing set. Please refer to FIG.
  • FIG. 6 illustrating a schematic diagram of drawing an ROC curve based on 10 groups of different FPRs and TPRs according to an embodiment of the present invention; the ROC curve using the FPR as an X- axis and the TPR as a Y-axis.
  • a reproduced image probability value corresponding to the FPR equaling to a second preset threshold is set to a first threshold based on the ROC curve.
  • the first threshold is set to 0.05.
  • 0.05 is merely used as an example; and other first thresholds may certainly be set in actual embodiments according to operation and maintenance experiences, which will not be described in detail here.
  • the model training carried out on the established spatial transformer network based on the training set is finished and the model testing carried out on the spatial transformer network based on the testing set is finished, it is determined that establishment of the spatial transformer network model is finished, and a threshold (e.g., T) when the spatial transformer network model is used actually is determined.
  • a threshold e.g., T
  • T a threshold
  • a magnitude relationship between a value T' of a probability and T is judged, the probability being obtained after recognition processing is carried out on an input image by the spatial transformer network model and used for indicating that an image sample is a reproduced identity card image.
  • a corresponding subsequent operation is carried out according to the magnitude relationship between T' and T.
  • FIG. 7 illustrating a detailed procedure of carrying out image recognition by using a spatial transformer network model online according to an embodiment of the present embodiments is described as follows:
  • an acquired to-be-recognized image is input to a spatial transformer network model.
  • a spatial transformer network model is obtained.
  • the spatial transformer network model can carry out image recognition on a to-be-recognized image input to the model.
  • Step 710 Image processing and spatial transformation processing are carried out on the to-be- recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image.
  • the spatial transformer network model includes at least a CNN and a spatial transformer.
  • the spatial transformer includes at least a positioning network, a grid generator, and a sampler. At least once convolution processing, at least once pooling processing, and at least once full connection processing are carried out on the to-be-recognized image based on the spatial transformer network model.
  • the spatial transformer network model includes the CNN and the spatial transformer module, and the spatial transformer includes at least a positioning network 1, a grid generator 1, and a sampler 1.
  • the CNN is set to include a convolutional layer 1, a convolutional layer 2, a pooling layer 1, and a fully connected layer 1. Then, twice convolution processing, once pooling processing, and once full connection processing are carried out on the identity card image of Li input to the spatial transformer network model.
  • the spatial transformer is set behind any convolutional layer in the CNN included in the spatial transformer network model. Then, after any convolution processing is carried out on the to-be-recognized image by using the CNN, a transformation parameter set is generated by using the positioning network, sampling grids are generated by using the grid generator according to the transformation parameter set, and sampling and spatial transformation processing are carried out on the to-be-recognized image by using the sampler according to the sampling grids.
  • the spatial transformation processing includes at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
  • Step 720 The to-be-recognized image is determined as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
  • the spatial transformer network model uses the original image y as an input image, and carries out corresponding sharpening processing, spatial transformation processing (e.g., rotating anticlockwise by 30 degrees and/or translating leftward by 3 cm, and so on), fuzzy processing, and compression processing on the original image y.
  • the last layer (fully connected layer) of the spatial transformer network model carries out classification processing.
  • the last layer, i.e., the fully connected layer includes two output nodes.
  • the two output nodes are respectively a value T' of a probability used for indicating that the original image y is a reproduced identity card image, and a value of a probability used for indicating that the original image y is a non-reproduced identity card image. Further, the value T' of the probability, used for indicating that the original image y is a reproduced identity card image, obtained after recognition processing is carried out on the original image y by using the spatial transformer network model is compared with the first threshold T determined during model testing carried out on the spatial transformer network. If T' ⁇ T, the original image y is determined as a non-reproduced identity card image, that is, a normal image. If T' ⁇ T, the original image y is determined as a reproduced identity card image.
  • the original image y is determined as a suspected reproduced identity card image, and the procedure proceeds to a manual reviewing stage.
  • the manual reviewing state if it is judged that the original image y is a reproduced identity card image, the original image y is determined as a reproduced identity card image.
  • the manual reviewing stage if it is judged that the original image y is a non-reproduced identity card image, the original image y is determined as a non-reproduced identity card image.
  • Step 800 A to-be-recognized image uploaded by a user is received.
  • Zhang carries out real-person authentication on an e-commerce platform, and then, Zhang needs to upload an identity card image thereof to the e-commerce platform to carry out real-person authentication.
  • the e-commerce platform receives the identity card image uploaded by Zhang.
  • Step 810 Image processing is carried out on the to-be-recognized image when an image processing instruction triggered by the user is received, spatial transformation processing is carried out on the to-be-recognized image when a spatial transformation instruction triggered by the user is received, and the to-be-recognized image after the image processing and the spatial transformation processing are carried out is presented to the user.
  • At least once convolution processing, at least once pooling processing, and at least once full connection processing are carried out on the to-be-recognized image.
  • the sharpened to-be-recognized image having clearer edge, contour, and details of the image may be obtained.
  • Zhang uploads the identity card image thereof to the e-commerce platform
  • the e-commerce platform may present, to Zhang by using a terminal, whether image processing (e.g., convolution processing, pooling processing, and fully connected processing) is carried out on the identity card image.
  • image processing e.g., convolution processing, pooling processing, and fully connected processing
  • the e-commerce platform carries out sharpening processing and compression processing on the identity card image.
  • any one or a combination of the following operations is carried out on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
  • the corrected to-be- recognized image may be obtained.
  • Zhang uploads the identity card image thereof to the e-commerce platform. Then the e-commerce platform may present, to Zhang by using the terminal, whether rotation processing and/or translation processing is carried out on the identity card image.
  • the e-commerce platform rotates the identity card image clockwise by 60 degrees and then translates the identity card image leftward by 2 cm, to obtain the rotated and translated identity card image.
  • the to-be-recognized image after the sharpening processing, rotation processing, and translation processing are carried out is presented to the user by using the terminal.
  • Step 820 a reproduced image probability value corresponding to the to-be- recognized image is calculated according to a user instruction.
  • the e-commerce platform presents, to Zhang by using the terminal, the identity card image of Zhang after the image processing and spatial transformation processing are carried out, and prompts Zhang whether to calculate a reproduced image probability value corresponding to the identity card image.
  • the e-commerce platform calculates the reproducing probability value corresponding to the identity card image when receiving the instruction for calculating the reproduced image probability value corresponding to the identity card image triggered by Zhang.
  • Step 830 it is judged whether the reproduced image probability value corresponding to the to-be-recognized image is less than a preset first threshold; and if so, the to-be- recognized image is determined as a non-reproduced image, and the user is prompted that the recognition is successful; otherwise, the to-be-recognized image is determined as a suspected reproduced image.
  • the suspected reproduced image is presented to an administrator; and the administrator is prompted to review the suspected reproduced image. It is determined whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
  • a computing device After receiving an identity card image uploaded by a user for carrying out real- person authentication, a computing device carries out image recognition by using the identity card image as an original input image, to judge whether the identity card image uploaded by the user is a reproduced identity card image, thereby performing a real-person authentication operation.
  • the computing device when receiving an instruction for carrying out sharpening processing on the identity card image triggered by the user, the computing device carries out corresponding sharpening processing on the identity card image.
  • the computing device After the sharpening processing is carried out on the identity card image, according to an instruction for carrying out spatial transformation processing (e.g., processing such as rotation and translation) on the identity card image triggered by the user, the computing device carries out corresponding rotation and/or translation processing on the identity card image after the sharpening processing is carried out. Then, the computing device carries out corresponding fuzzy processing on the identity card image after the spatial transformation processing is carried out. Next, the computing device carries out corresponding compression processing on the identity card image after the fuzzy processing is carried out. Finally, the computing device carries out corresponding classification processing on the identity card image after the compression processing is carried out, to obtain a probability value corresponding to the identity card image and used for indicating that the identity card image is a reproduced image.
  • spatial transformation processing e.g., processing such as rotation and translation
  • the identity card image uploaded by the user is determined as a non-reproduced image, and the user is prompted that the real-person authentication is successful.
  • the identity card image uploaded by the user is determined as a suspected reproduced image, and the suspected reproduced identity card image is transferred to a administrator for subsequent manual reviewing. In the manual reviewing stage, if the administrator judges the identity card image uploaded by the user as a reproduced identity card image, the user is prompted that the real-person authentication is failed, and it is necessary to upload a new identity card image.
  • an image recognition apparatus includes at least an input unit 90, a processing unit 91, and a determination unit 92.
  • the input unit 90 is configured to input an acquired to-be-recognized image to a spatial transformer network model.
  • the processing unit 91 is configured to carry out image processing and spatial transformation processing on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image.
  • the determination unit 92 is configured to determine the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
  • the input unit 90 before an acquired to-be-recognized image is input to a spatial transformer network model, the input unit 90 is further configured to: acquire image samples, and divide the acquired image samples into a training set and a testing set according to a preset ratio; and construct a spatial transformer network based on a convolutional neural network (CNN) and a spatial transformer module, carry out a model training on the spatial transformer network based on the training set, and carry out a model testing on the spatial transformer network with the model training finished based on the testing set.
  • CNN convolutional neural network
  • the input unit 90 is configured to: embed a learnable spatial transformer in the CNN to construct the spatial transformer network, wherein the spatial transformer includes at least a positioning network, a grid generator, and a sampler, the positioning network including at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
  • the input unit 90 when carrying out a model training on the spatial transformer network based on the training set, is configured to: divide the image samples included in the training set into several batches based on the spatial transformer network, wherein one batch includes G image samples, and G is a positive integer greater than or equal to 1; and sequentially perform the following operations for each batch included in the training set until it is judged that all recognition accuracy rates corresponding to Q successive batches are greater than a first preset threshold; determine that the model training carried out on the spatial transformer network is finished, and Q is a positive integer greater than or equal to 1; carry out spatial transformation processing and image processing on each image sample comprised in one batch by using current configuration parameters and obtain a corresponding recognition result, wherein the configuration parameters comprise at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculate a recognition accuracy rate corresponding to the one batch based on recognition results of the image samples
  • the input unit 90 when model testing is carried out on the spatial transformer network having finished the model training based on the testing set, the input unit 90 is configured to: carry out image processing and spatial transformation processing on each image sample included in the testing set based on the spatial transformer network having finished the model training, so as to obtain a corresponding output result, wherein the output result includes a reproduced image probability value and a non-reproduced image probability value corresponding to each image sample; and set the first threshold based on the output result, thereby determining that the model testing carried out on the spatial transformer network is finished.
  • the input unit 90 when the first threshold is set based on the output result, is configured to: use a respective reproducing probability value of each image sample included in the testing set as a set threshold; and determine a false positive rate (FPR) and a true positive rate (TPR) corresponding to each set threshold based on the reproduced image probability value and the non-reproduced image probability value corresponding to each image sample included in the output result; draw a receiver operating characteristic (ROC) curve based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR as a Y- axis; and set a reproduced image probability value corresponding to the FPR equaling to a second preset threshold as the first threshold based on the ROC curve.
  • ROC receiver operating characteristic
  • the input unit 90 when carrying out image processing on the to-be-recognized image based on the spatial transformer network model, is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image based on the spatial transformer network model.
  • the input unit 90 when carrying out spatial transformation processing on the to-be- recognized image, is configured to: the spatial transformer network model including at least the CNN and the spatial transformer module, and the spatial transformer module including at least the positioning network, the grid generator, and the sampler; after any convolution processing is carried out on the to-be-recognized image by using the CNN, generate the transformation parameter set by using the positioning network; generate the sampling grids by using the grid generator according to the transformation parameter set; and carry out sampling and spatial transformation processing on the to-be-recognized image by using the sampler according to the sampling grids, wherein the spatial transformation processing includes at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
  • an image recognition apparatus includes at least a receiving unit 100, a processing unit 110, a calculation unit 120, and a judging unit 130.
  • the receiving unit 100 is configured to receive a to-be-recognized image uploaded by a user.
  • the processing unit 110 is configured to carry out image processing on the to-be-recognized image when an image processing instruction triggered by the user is received; carry out spatial transformation processing on the to-be-recognized image when a spatial transformation instruction triggered by the user is received; and present to the user the to-be-recognized image after the image has gone through the image processing and the spatial transformation processing.
  • the calculation unit 120 is configured to calculate a reproduced image probability value corresponding to the to-be-recognized image according to a user instruction.
  • the judging unit 130 is configured to judge whether the reproduced image probability value corresponding to the to-be-recognized image is less than a preset first threshold; and if so, determine the to-be-recognized image as a non-reproduced image, and prompt the user that the recognition is successful; otherwise, determine the to-be-recognized image as a suspected reproduced image.
  • the judging unit 130 is further configured to: present the suspected reproduced image to an administrator, and prompt the administrator to review the suspected reproduced image; and determine whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
  • the processing unit 110 when image processing is carried out on the to-be-recognized image, the processing unit 110 is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image.
  • the processing unit 110 when spatial transformation processing is carried out on the to-be- recognized image, the processing unit 110 is configured to: carry out any one or a combination of the following operations on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
  • an acquired to-be-recognized image is inputted to the spatial transformer network model; image processing and spatial transformation processing are carried out on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and the to-be-recognized image is determined as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
  • a spatial transformer network model can be established by carrying out model training and model testing on a spatial transformer network only once. In this way, the workload for calibrating image samples during training and testing is reduced, and training and testing efficiencies are improved. Further, the model training is carried out based on a one-level spatial transformer network, and configuration parameters obtained by the training form an optimal combination, thereby improving the recognition effect when an image is recognized by using the spatial transformer network model online.
  • embodiments of the present invention may be provided as a method, a system, or a computer program product. Therefore, the present invention may be implemented as a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may be in the form of a computer program product implemented on one or more computer usable storage media (including, but not limited to, a magnetic disk memory, a CD-ROM, an optical memory and the like) including computer usable program codes.
  • a computer usable storage media including, but not limited to, a magnetic disk memory, a CD-ROM, an optical memory and the like
  • These computer program instructions may be provided for a general-purpose computer, a special-purpose computer, an embedded processor, or a processor of any other programmable data processing device to generate a machine, so that the instructions executed by a computer or a processor of any other programmable data processing device generate an apparatus for implementing a specified function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
  • These computer program instructions may also be stored in a computer readable memory that can instruct the computer or any other programmable data processing device to work in a particular manner, such that the instructions stored in the computer readable memory generate an artifact that includes an instruction apparatus.
  • the instruction apparatus implements a specified function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams as disclosed herein.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Biomedical Technology (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Finance (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Accounting & Taxation (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Image Analysis (AREA)

Abstract

An image recognition method and apparatus. The method comprises: carrying out image processing and spatial transformation processing on a to-be-recognized image based on a spatial transformer network model, so as to obtain a reproduced image probability value corresponding to the to-be- recognized image; and determining the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold. By means this method, a spatial transformer network model can be established by merely carrying out one model training and model testing on a spatial transformer network. The method reduces the workload for calibrating image samples during training and testing and further enhances training and testing efficiencies. Further, the model training is carried out based on a one-level spatial transformer network, and configuration parameters obtained from the training form an optimal combination, thereby improving the recognition function when using the spatial transformer network model to recognize an image online.

Description

IMAGE RECOGNITION METHOD AND APPARATUS
CROSS REFERENCE TO RELATED APPLICATIONS
[001 ] This application claims priority to China Patent Application No. 201710097375.8, filed on February 22, 2017, which is incorporated herein by reference in its entirety.
TECHNICAL FIELD
[002] The present invention relates to the field of image recognition technologies, and in particular, to an image recognition method and apparatus.
BACKGROUND
[003] With the development of Internet economy, e-commerce platforms provide users great convenience in shopping and transaction. In the e-commerce ecology, "money" is involved in almost every step, and this somehow gives rise to the following phenomenon: lawbreakers carry out illegal and irregular actions such as cheating and releasing information of prohibited goods on e- commerce platforms by using fake identities. It is thus desirable to construct a honest and credible system for society by using "real-person authentication" to promote a healthy ecological environment on the Internet.
[004] Real-person authentication aims to make sure that real persons and their identity cards match. A person using an account can be identified conveniently and accurately according to authenticated account identity information. During the implementation of real-person authentication, it has been found that identity card images uploaded by some users during real-person authentication are reproduced images. It is very likely that these users illegally acquire use data of identity cards of others. During a real-person authentication process, it is therefore necessary to carry out recognition and classification on identity card images uploaded by users, and to judge whether the identity card images uploaded by the users are reproduced images.
[005] In the prior art, during a real-person authentication process, it is necessary to carry out detection and judgment processing on user-uploaded identity card images by using multistage independent convolutional neural networks (CNNs). [006] However, in the prior art, a corresponding training model needs to be established for each CNN, and training of a huge number of samples is required, thus causing a heavy workload of sample calibration. Moreover, a lot of human and material resources need to be used for subsequent operations and maintenances on the established multiple CNNs. Further, in the prior art, the identity card images uploaded by the users are recognized by using multistage independent CNNs processing, and the recognition effect is poor.
[007] In view of the above, it is necessary and desirable to design a new image recognition method and apparatus to solve the problems and overcome disadvantages found in the prior art.
SUMMARY
[008] Embodiments of the present invention provide an image recognition method and apparatus, so as to solve the problems in the prior art including the heavy workload of sample calibration caused by training of a huge number of samples carried out for each CNN, and poor image recognition effect caused by using of the multistage independent CNNs for processing.
[009] Specific technical solutions provided in embodiments of the present invention are as follows: An image recognition method, comprising: inputting an acquired to-be-recognized image to a spatial transformer network model; carrying out image processing and spatial transformation processing on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and determining the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
[010] In an embodiment, before the step of inputting an acquired to-be-recognized image to a spatial transformer network model, the method further comprises: acquiring image samples and dividing the acquired image samples into a training set and a testing set according to a preset ratio; and constructing a spatial transformer network based on a convolutional neural network (CNN) and a spatial transformer module, carrying out a model training on the spatial transformer network based on the training set, and carrying out a model testing on the spatial transformer network having finished the model training based on the testing set. [011] In an embodiment, the step of constructing a spatial transformer network based on a CNN and a spatial transformer module comprises: embedding a learnable spatial transformer module in the CNN to construct a spatial transformer network, wherein the spatial transformer module comprises at least a positioning network, a grid generator, and a sampler, the positioning network comprising at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
[012] In an embodiment, the step of carrying out a model training on the spatial transformer network based on the training set comprises: dividing the image samples comprised in the training set into several batches based on the spatial transformer network, wherein one batch comprises G image samples, and G is a positive integer greater than or equal to 1; and sequentially performing the following operations for each batch comprised in the training set until it is judged that all recognition accuracy rates corresponding to Q successive batches are greater than a first preset threshold, determining that the model training carried out on the spatial transformer network is finished, and Q is a positive integer greater than or equal to 1; carrying out spatial transformation processing and image processing on each image sample comprised in one batch by using current configuration parameters and obtain a corresponding recognition result, wherein the configuration parameters at least comprise a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculating a recognition accuracy rate corresponding to the one batch based on recognition results of the image samples comprised in the one batch; and determining whether the recognition accuracy rate corresponding to the one batch is greater than the first preset threshold; and if so, keeping the current configuration parameters unchanged; otherwise, adjusting the current configuration parameters, and using the adjusted configuration parameters as current configuration parameters used for a next batch.
[013] In an embodiment, the step of carrying out a model testing on the spatial transformer network having finished the model training based on the testing set comprises: carrying out image processing and spatial transformation processing on each image sample comprised in the testing set based on the spatial transformer network having finished the model training and obtaining a corresponding output result, wherein the output result comprises a reproduced image probability value and a non- reproduced image probability value corresponding to each image sample; and setting the first threshold based on the output result, thereby determining that the model testing on the spatial transformer network is finished.
[014] In an embodiment, the step of setting the first threshold based on the output result comprises: using a respectively reproducing probability value of each image sample comprised in the testing set as a set threshold, and determining a false positive rate (FPR) and a true positive rate (TPR) corresponding to each set threshold based on the reproduced image probability value and the non- reproduced image probability value corresponding to each image sample comprised in the output result; drawing a receiver operating characteristic (ROC) curve based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR as a Y-axis; and setting a reproduced image probability value corresponding to the FPR equaling to a second preset threshold as the first threshold based on the ROC curve.
[015] In an embodiment, the step of carrying out image processing on the to-be-recognized image based on the spatial transformer network model comprises: carrying out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to- be-recognized image based on the spatial transformer network model.
[016] In an embodiment, the step of carrying out spatial transformation processing on the to-be- recognized image comprises: the spatial transformer network model comprising at least the CNN and the spatial transformer module, and the spatial transformer module comprising at least the positioning network, the grid generator, and the sampler; after any convolution processing is carried out on the to-be-recognized image by using the CNN, generating the transformation parameter set by using the positioning network; generating the sampling grids by using the grid generator according to the transformation parameter set; and carrying out sampling and spatial transformation processing on the to-be-recognized image by using the sampler according to the sampling grids, wherein the spatial transformation processing comprises at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
[017] In an embodiment, the present image recognition method, comprises: receiving a to-be- recognized image uploaded by a user; carrying out image processing on the to-be-recognized image when an image processing instruction triggered by the user is received; carrying out spatial transformation processing on the to-be-recognized image when a spatial transformation instruction triggered by the user is received; and presenting to the user the to-be-recognized image after the image has gone through the image processing and the spatial transformation processing; calculating a reproduced image probability value corresponding to the to-be-recognized image according to a user instruction; and judging whether the reproduced image probability value corresponding to the to-be-recognized image is less than a preset first threshold; and if so, determining the to-be- recognized image as a non-reproduced image, and prompting the user that the recognition is successful; otherwise, determining the to-be-recognized image as a suspected reproduced image.
[018] In an embodiment, after the step of determining the to-be-recognized image as a suspected reproduced image, the method further comprises: presenting the suspected reproduced image to an administrator, and prompting the administrator to review the suspected reproduced image; and determining whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
[019] In an embodiment, the step of carrying out image processing on the to-be-recognized image comprises: carrying out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image.
[020] In an embodiment, the step of carrying out spatial transformation processing on the to-be- recognized image comprises: carrying out any one or a combination of the following operations on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
[021] In another embodiment, the present image processing apparatus comprises: an input unit, configured to input an acquired to-be-recognized image to a spatial transformer network model; a processing unit, configured to carry out image processing and spatial transformation processing on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and a determination unit, configured to determine the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be- recognized image is greater than or equal to a preset first threshold. [022] In an embodiment, before an acquired to-be-recognized image is inputted to a spatial transformer network model, the input unit is further configured to: acquire image samples and divide the acquired image samples into a training set and a testing set according to a preset ratio; and construct a spatial transformer network based on a convolutional neural network (CNN) and a spatial transformer module; carry out a model training on the spatial transformer network based on the training set; and carry out a model testing on the spatial transformer network having finished the model training based on the testing set.
[023] In an embodiment, when constructing a spatial transformer network based on a CNN and a spatial transformer module, the input unit is configured to: embed a learnable spatial transformer module in the CNN to construct a spatial transformer network, wherein the spatial transformer module comprises at least a positioning network, a grid generator, and a sampler, the positioning network comprising at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
[024] In an embodiment, when carrying out model training on the spatial transformer network based on the training set, the input unit is configured to: divide the image samples comprised in the training set into several batches based on the spatial transformer network, wherein one batch comprises G image samples, and G is a positive integer greater than or equal to 1; and sequentially perform the following operations for each batch comprised in the training set until it is judged that all recognition accuracy rates corresponding to Q successive batches are greater than a first preset threshold, determine that the model training carried out on the spatial transformer network is finished, and Q is a positive integer greater than or equal to 1; carry out spatial transformation processing and image processing on each image sample comprised in one batch by using current configuration parameters and obtain a corresponding recognition result, wherein the configuration parameters comprise at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculate a recognition accuracy rate corresponding to the one batch based on recognition results of the image samples comprised in the one batch; and judge whether the recognition accuracy rate corresponding to the one batch is greater than the first preset threshold; and if so, keep the current configuration parameters unchanged; otherwise, adjust the current configuration parameters, and use the adjusted configuration parameters as current configuration parameters used for a next batch.
[025] In an embodiment, when carrying out a model testing on the spatial transformer network having finished the model training based on the testing set, the input unit is configured to: carry out image processing and spatial transformation processing on each image sample comprised in the testing set based on the spatial transformer network having finished the model training and obtain a corresponding output result, wherein the output result comprises a reproduced image probability value and a non-reproduced image probability value corresponding to each image sample; and set the first threshold based on the output result, thereby determining that the model testing on the spatial transformer network is finished.
[026] In an embodiment, when setting the first threshold based on the output result, the input unit is configured to: use a respective reproducing probability value of each image sample comprised in the testing set as a set threshold; and determine a false positive rate (FPR) and a true positive rate (TPR) corresponding to each set threshold based on the reproduced image probability value and the non- reproduced image probability value corresponding to each image sample comprised in the output result; draw a receiver operating characteristic (ROC) curve based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR as a Y- axis; and set a reproduced image probability value corresponding to the FPR equaling to a second preset threshold as the first threshold based on the ROC curve.
[027] In an embodiment, when carrying out image processing on the to-be-recognized image based on the spatial transformer network model, the input unit is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image based on the spatial transformer network model.
[028] In an embodiment, when carrying out spatial transformation processing on the to-be- recognized image, the input unit is configured to: the spatial transformer network model comprising at least the CNN and the spatial transformer module, and the spatial transformer module comprising at least the positioning network, the grid generator, and the sampler; after any convolution processing is carried out on the to-be-recognized image by using the CNN, generate the transformation parameter set by using the positioning network; generate the sampling grids by using the grid generator according to the transformation parameter set; and carry out sampling and spatial transformation processing on the to-be-recognized image by using the sampler according to the sampling grids, wherein the spatial transformation processing comprises at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
[029] In another embodiment, the present image recognition apparatus comprises: a receiving unit, configured to receive a to-be-recognized image uploaded by a user; a processing unit, configured to carry out image processing on the to-be-recognized image when an image processing instruction triggered by the user is received; carry out spatial transformation processing on the to-be-recognized image when a spatial transformation instruction triggered by the user is received; and present to the user the to-be-recognized image after the image has gone through the image processing and the spatial transformation; a calculation unit, configured to calculate a reproduced image probability value corresponding to the to-be-recognized image according to a user instruction; and a judging unit, configured to judge whether the reproduced image probability value corresponding to the to- be-recognized image is less than a preset first threshold; and if so, determine the to-be-recognized image as a non-reproduced image, and prompt the user that the recognition is successful; otherwise, determine the to-be-recognized image as a suspected reproduced image.
[030] In an embodiment, after the to-be-recognized image is determined as a suspected reproduced image, the judging unit is further configured to: present the suspected reproduced image to an administrator, and prompt the administrator to review the suspected reproduced image; and determine whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
[031] In an embodiment, when carrying out image processing on the to-be-recognized image, the processing unit is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image.
[032] In an embodiment, when carrying out spatial transformation processing on the to-be- recognized image, the processing unit is configured to: carry out any one or a combination of the following operations on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
[033] The present invention has the following beneficial effects: in view of the above, in embodiments of the present invention, during image recognition based on a spatial transformer network model, an acquired to-be-recognized image is input to the spatial transformer network model, image processing and spatial transformation processing are carried out on the to-be- recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image, and the to-be-recognized image is determined as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold. By means of the image recognition method, a spatial transformer network model can be established by carrying out model training and model testing for a spatial transformer network only once. In this way, the workload for calibrating image samples during training and testing is reduced, and training and testing efficiencies are improved. Further, the model training is carried out based on a one-level spatial transformer network, and configuration parameters obtained by the training form an optimal combination, thereby improving the recognition effect when an image is recognized by using the spatial transformer network model online.
BRIEF DESCRIPTION OF THE DRAWINGS
[034] FIG. 1 is a detailed flowchart of carrying out model training based on the established spatial transformer network according to an embodiment of the present invention;
[035] FIG. 2 is a schematic structural diagram of a spatial transformer according to an embodiment of the present invention;
[036] FIG. 3 is a schematic diagram of carrying out spatial transformation on image samples based on a spatial transformer according to an embodiment of the present invention;
[037] FIG. 4 is a schematic diagram of converting three input neurons into two output neurons by carrying out dimensionality reduction processing using a fully connected layer according to an embodiment of the present invention;
[038] FIG. 5 is a detailed flowchart of carrying out model testing on a spatial transformer network based on the testing set according to an embodiment of the present invention; [039] FIG. 6 is a schematic diagram of drawing an ROC curve according to 10 groups of different FPRs and TPRs according to an embodiment of the present invention, the ROC curve using the FPR as an X-axis and the TPR as a Y-axis;
[040] FIG. 7 is a detailed flowchart of carrying out image recognition by using a spatial transformer network model online according to an embodiment of the present invention;
[041] FIG. 8 is a detailed flowchart of carrying out image recognition processing on a to-be- recognized image uploaded by a user in an actual business scenario according to an embodiment of the present invention;
[042] FIG. 9 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention; and
[043] FIG. 10 is a schematic structural diagram of another image processing apparatus according to an embodiment of the present invention.
DETAILED DESCRIPTION
[044] In the prior art, during a real-person authentication process, a process of carrying out detection and judgment on an identity card image uploaded by a user includes: first carrying out rotation correction by using a first CNN on the identity card image uploaded by the user; then capturing an identity card region from the rotation corrected identity card image by using a second CNN; and finally carrying out classification and recognition on the captured identity card image by using a third CNN. That is, in the prior art, it is required to sequentially carry out CNN rotation angle processing once, CNN identity card region capturing processing once, and CNN classification processing once. In this way, three CNNs need to be established. A corresponding training model needs to be established for each CNN, and training of a huge number of samples is required, thus causing a heavy workload of sample calibration. Moreover, a lot of human and material resources need to be used for subsequent operations and maintenances on the established three CNNs. Further, in the prior art, the identity card images uploaded by the users are recognized by using multistage independent CNNs processing, and the recognition effect is poor.
[045] A new image recognition method and apparatus are designed in accordance with embodiments of the present invention to solve the problems in the prior art including the heavy workload of sample calibration caused by training of a huge number of samples carried out for each CNN, and poor image recognition effect caused by using of the multistage independent CNNs for processing. The method includes: inputting an acquired to-be-recognized image to a spatial transformer network model; carrying out image processing and spatial transformation processing on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and determining the to-be- recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
[046] The technical solutions in embodiments of the present invention will be described clearly and completely in the following with reference to the accompanying drawings in embodiments of the present invention. As can be appreciated, the described embodiments are merely a part of, rather than all embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on embodiments in the present invention efforts fall within the protection scope of the present invention.
[047] The present invention will be described in detail through embodiments in the following. It should be noted that the present invention is not limited to the following embodiments.
[048] In embodiments of the present invention, before image recognition is carried out, existing convolutional neural networks (CNNs) need to be improved. That is, a learnable spatial transformer module is introduced into the existing convolutional neural network, to establish a spatial transformer network. In this way, the spatial transformer network can actively carry out spatial transformation processing on image data inputted to the spatial transformer network. The spatial transformer module includes a positioning network, a grid generator, and a sampler. The convolutional neural network includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer. The positioning network in the spatial transformer also includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer. The spatial transformer module in the spatial transformer network may be inserted behind any convolutional layer. [049] Please refer to FIG. 1. A detailed procedure of carrying out model training based on the established spatial transformer network according to an embodiment of the present invention is described as follows:
[050] Step 100: Image samples are acquired, and the acquired image samples are divided into a training set and a testing set according to a preset ratio.
[051] In an embodiment, collection of image samples is a very important step and also a burdensome task for the spatial transformer network. The image samples may be confirmed reproduced identity card images and confirmed non-reproduced identity card images. It goes without saying that the image samples may also be other types of images, e.g., confirmed animal images and confirmed plant images, confirmed images with texts and confirmed images without texts, and so on.
[052] In an embodiment of the present invention, images of the front and the back of an identity card are used as image samples, the images being submitted by a registered user of an e-commerce platform when carrying out real-person authentication.
[053] In an embodiment, the so-called reproduced image sample refers to a picture on a computer screen, a picture on a mobile phone screen, a copy of a picture, or the like reproduced by using a terminal. Therefore, the reproduced image sample includes at least a reproduced image of a computer screen, a reproduced image of a mobile phone screen, and a reproduced image of a copy. Assuming that in an acquired image sample set, half of the image samples are confirmed reproduced image sample and the other half are confirmed non-reproduced image samples. The acquired image sample set is divided into a training set and a testing set according to a preset ratio. The image samples included in the training set are used for subsequent model training. The image samples included in the testing set are used for subsequent model testing.
[054] For example, assuming that in an embodiment of the present invention, one hundred thousand confirmed reproduced identity card images and one hundred thousand confirmed non-reproduced identity card images are collected in the acquired image sample set. Then, the one hundred thousand confirmed reproduced identity card images and the one hundred thousand confirmed non- reproduced identity card images may be divided into a training set and a testing set according to a ration, i.e., 10: 1. [055] Step 110: A spatial transformer network is constructed based on a CNN and a spatial transformer module.
[056] A network structure of the spatial transformer network used in embodiments of the present invention includes at least the CNN and the spatial transformer module. That is, a learnable spatial transformer module is introduced into the CNN. A network structure of the CNN includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer. The last layer is the fully connected layer. The spatial transformer network is formed by embedding a spatial transformer module behind any convolutional layer in a CNN. The spatial transformer network can actively carry out a spatial transformation operation on image data input to the network. The spatial transformer module includes at least a positioning network, a grid generator, and a sampler. A network structure of the positioning network in the spatial transformer network also includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer. The positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
[057] FIG. 2 illustrates a schematic structural diagram of the spatial transformer, in an embodiment of the invention. If UGRH W C, an input image characteristic chart, for example, an original image or an image characteristic chart outputted by a convolutional layer of the CNN, wherein W is the width of the image characteristic chart; H is the height of the image characteristic chart; C is the number of channels; V is an output image characteristic chart after spatial transformation is carried out on U by using the spatial transformer module; and M is between U and V is the spatial transformer. The spatial transformer includes at least a positioning network, a gird generator, and a sampler.
[058] The positioning network in the spatial transformer module may be configured to generate a transformation parameter Θ Preferably, the parameter Θ includes six parameters of affine transformation such as a translation transformation parameter, a scale transformation parameter, a rotation transformation parameter, and a shear transformation parameter, wherein the parameter Θ may be denoted as Θ = -'f/oc(-U) ' . [059] Please refer to FIG. 3. The grid generator in the spatial transformer may be configured to utilize the parameter Θ generated by the positioning network and V; that is, calculate to obtain a position of each point in V corresponding to U by using the parameter Θ ; and obtain V by sampling from U. A specific calculation formula is shown as follows:
wherein (
Figure imgf000016_0001
position of a point in V.
[060] After the sampling grids are generated, the sampler in the spatial transformer may obtain V from U by sampling.
[061] The spatial transformer network includes the CNN and the spatial transformer. The spatial transformer further includes the positioning network, the grid generator, and the sampler. The CNN includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer. The positioning network in the spatial transformer network also includes at least one convolutional layer, at least one pooling layer, and at least one fully connected layer.
[062] In an embodiment of the present invention, con[N,w,sl,p] is used to denote a convolutional layer, wherein N is the number of channels, w*w is the size of a convolution kernel, si is a step length corresponding to each channel, and p is a padding value. The convolutional layer may be used for extracting image characteristics of an input image. Convolution is a commonly used method of image processing. Each pixel in an output image of the convolutional layer is a weighted average of pixels in a small region of the input image, wherein a weight is defined by a function, and the function is referred to as a convolution kernel. The convolution kernel is a function, and each parameter in the convolution kernel is equivalent to a weight parameter connected to corresponding local pixels. The parameters in the convolution kernel are multiplied with the corresponding local pixel values, and then added with an offset parameter, to obtain a convolution result. A specific calculation formula is shown as follows: ' n / , wherein / denotes the ' · ,h characteristic result chart, relu(x) — max (0, )? W fcdenotes a parameter of the ,h convolution kernel, -^denotes a characteristic of an upper layer, and bk is the offset parameter.
[063] In an embodiment of the present invention, max[s2] is used to denote a pooling layer having a step length of s2. The input characteristic chart is compressed, such that the characteristic chart becomes smaller, the complexity in network computing is reduced, and major characteristics of the input characteristic chart are extracted. Therefore, it is necessary to carry out pooling processing on the characteristic chart output by the convolutional layer, to reduce the degree of overfitting of the training parameters and the training model of the spatial transformer network. Commonly used pooling methods include max pooling and average pooling. The max pooling is selecting the maximum value in a pooling window to serve as a pooled value. The average pooling is selecting an average value in a pooling region to serve as a pooled value. The max pooling is used in an embodiment of the present invention.
[064] In an embodiment of the present invention, fc[R] is used to denote a fully connected layer including R output units. Nodes of any two adjacent fully connected layers are connected to each other. The number of input neurons (i.e., the characteristic chart) of any fully connected layer may be identical to or different from the number of output neurons. If the any fully connected layer is not the last fully connected layer, the input neurons and output neurons of the any fully connected layer are the characteristic chart. For example, please refer to FIG. 4, a schematic diagram of converting three input neurons into two output neurons by carrying out dimensionality reduction processing using a fully connected layer according to an embodiment of the present invention. A specific conversion formula is shown as follows:
CO, X2, X3) * ( F.1, 72)
Figure imgf000017_0001
wherein XI, X2 and X3 are input neurons of the any fully connected layer; Yl and Y2 are output neurons of the any fully connected layer, Y1=(X1 *W1 1+X2*W21+X3 *W31), Y2=(X1 *W12+X2*W22+X3 *W32); and W is a weight of XI, X2 and X3 in Yl and Y2. In an embodiment of the present invention, the last fully connected layer in the spatial transformer network includes only two output nodes. Output values of the two output nodes are respectively a probability used for indicating that an image sample is a reproduced identity card image and a probability used for indicating that an image sample is a non-reproduced identity card image.
[065] In an embodiment of the present invention, the positioning network in the spatial transformer module is set to a "conv[32,5,l,2] - max[2] - conv[32,5, l,2] - fc[32] - fc[32] - fc[12]" structure. That is, the first layer is a convolutional layer conv[32,5,l,2], the second layer is a pooling layer max[2], the third layer is a convolutional layer conv[32,5,l,2], the fourth layer is a fully connected layer fc[32], the fifth layer is a fully connected layer fc[32], and the sixth layer is a fully connected layer fc[12].
[066] In an embodiment of the invention, the CNN in the network is set to "conv[48,5, l,2] - max[2] - conv[64,5, l,2] - conv[128,5, l,2] - max[2] - conv[ 160,5, 1,2] - conv[192,5,l,2] - max[2] - conv[ 192,5, 1,2] - conv[192,5,l,2] - max[2] - conv[ 192,5, 1,2] - fc[3072] - fc[3072] - fc[2]". That is, the first layer is a convolutional layer conv[48,5,l,2], the second layer is a pooling layer max[2], the third layer is a convolutional layer conv[64,5, l,2], the fourth layer is a convolutional layer conv[128,5, l,2], the fifth layer is a pooling layer max[2], the sixth layer is a convolutional layer conv[160,5, l,2], the seventh layer is a convolutional layer conv[192,5,l,2], the eighth layer is a pooling layer max[2], the ninth layer is a convolutional layer conv[ 192,5, 1,2], the tenth layer is a convolutional layer conv[192,5,l,2], the eleventh layer is a pooling layer max[2], the twelfth layer is a convolutional layer conv[192,5,l,2], the thirteenth layer is a fully connected layer fc[3072], the fourteenth layer is a fully connected layer fc[3072], and the fifteenth layer is a fully connected layer fc[2].
[067] Further, in an embodiment, a softmax classifier is connected behind the last fully connected layer in the spatial transformer network, and a loss function thereof is shown as follows:
Figure imgf000018_0001
wherein m is the number of training samples; xj is an output of the j,h node in the fully connected layer; y"> is a tag class of the i,h sample, when y"> equals to j; a value of l(y(1)=j) being 1; otherwise, the value being 0, Θ is a parameter of the network, and J is a loss function value.
[068] Step 120: Model training is carried out on the spatial transformer network based on the training set. The so-called model training carried out on the spatial transformer network is actively carrying out recognition and judgment on input image samples and adjusting parameters correspondingly according to a recognition accuracy rate during automatic learning of the spatial transformer network based on the training set, such that a recognition result for a subsequently input image sample is more accurate.
[069] In an embodiment of the present invention, the spatial transformer network model is trained by using a stochastic gradient descent (SGD) method. A specific implementation is described as follows:
[070] First, the image samples included in the training set are divided into several batches based on the spatial transformer network, wherein one batch includes G image samples, and G is a positive integer greater than or equal to 1. Each image sample is a confirmed reproduced identity card image or a confirmed non-reproduced identity card image.
[071] Then, the following operations are performed sequentially for each batch included in the training set by using the spatial transformer network: carrying out spatial transformation processing and image processing on each image sample included in one batch by using current configuration parameters and obtaining a corresponding recognition result, wherein the configuration parameters include at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculating a recognition accuracy rate corresponding to the one batch based on recognition results of image samples included in the one batch; and judging whether the recognition accuracy rate corresponding to the one batch is greater than a first preset threshold; if so, keeping the current configuration parameters unchanged; otherwise, adjusting the current configuration parameters, and using the adjusted configuration parameters as current configuration parameters used for a next batch. [072] In an embodiment of the present invention, the image processing may certainly include, but is not limited to, appropriate image sharpening processing and the like carried out on the image to the edge, contour, and details of the image clearer. The spatial transformation processing may include, but is not limited to, any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
[073] Until it is judged that all the recognition accuracy rates corresponding to Q successive batches are greater than the first preset threshold, the model training carried out on the spatial transformer network can be determined as finished, and Q is a positive integer greater than or equal to 1.
[074] As can be appreciated, in an embodiment of the present invention, the current configuration parameters are preset initial configuration parameters for the first batch in the training set; preferably, initial configuration parameters are randomly generated by the spatial transformer network. For a batch other than the first batch, the current configuration parameters are configuration parameters used for a previous batch; or adjusted configuration parameters obtained after adjustment is carried out on the basis of the configuration parameters used for a previous batch.
[075] Preferably, the specific process of performing a training operation on each batch of image sample subset in the training set based on the spatial transformer network is described as follows:
[076] In an embodiment of the present invention, the last fully connected layer in the spatial transformer network includes two output nodes. Output values of the two output nodes are respectively a probability indicating that an image sample is a reproduced identity card image and a probability indicating that an image sample is a non-reproduced identity card image. When it is judged that, for a non-reproduced identity card image, an output probability indicating that the image sample is a non-reproduced identity card image is greater than or equal to 0.95 and an output probability indicating that the image sample is a reproduced identity card image is less than or equal to 0.05, the recognition is determined as correct. When it is judged that, for a reproduced identity card image, an output probability indicating that the image sample is a reproduced identity card image is greater than or equal to 0.95 and an output probability indicating that the image sample is a non-reproduced identity card image is less than or equal to 0.05, the recognition is determined as correct. For any image sample, a sum of the probability indicating that the image sample is a reproduced identity card image and the probability indicating that the image sample is a non- reproduced identity card image is l .In an embodiment of the present invention, 0.95 and 0.05 are used merely as examples; and other thresholds may certainly be set in actual embodiments according to operation and maintenance experiences, which will not be described in detail here.
[077] After image samples included in any batch of image sample subset are recognized, the number of correctly recognized image samples included in the any batch of image sample sub-set is counted, and the recognition accuracy rate corresponding to the any batch of image sample sub-set is calculated.
[078] In an embodiment, each image sample included in the first batch of image sample sub-set (briefly referred to as the first batch) in the training set may be recognized respectively based on preset initial configuration parameters, and a recognition accuracy rate corresponding to the first batch is obtained through calculation. The preset initial configuration parameters are configuration parameters set based on the spatial transformer network. For example, the configuration parameters include at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used in the spatial transformer.
[079] For example, assuming that initial parameters are set for 256 image samples included in the first batch in the training set; the characteristics of the 256 image samples included in the first batch are extracted respectively; and the 256 image samples included in the first batch are recognized respectively by using the spatial transformer network to obtain a recognition result of each of the image samples. A recognition accuracy rate corresponding to the first batch is calculated based on the recognition results.
[080] Then, each image sample included in the second batch of image sample subset (briefly referred to as the second batch) is recognized respectively. In an embodiment, if it is judged that the recognition accuracy rate corresponding to the first batch is greater than the first preset threshold, the image samples included in the second batch are recognized by using the initial configuration parameters preset for the first batch; and a recognition accuracy rate corresponding to the second batch is obtained. If it is judged that the recognition accuracy rate corresponding to the first batch is not greater than the first preset threshold, configuration parameter adjustment is carried out on the initial configuration parameters preset for the first batch, so as to obtain the adjusted configuration parameters; and the image samples included in the second batch are recognized by using the adjusted configuration parameters to obtain a recognition accuracy rate corresponding to the second batch.
[081] Likewise, related processing may be carried out on image sample subsets of the third batch, the fourth batch, and so on by using the same manner continuously, till all image samples in the training set are processed.
[082] In brief, during training, starting from the second batch in the training set, if it is judged that the recognition accuracy rate corresponding to the previous batch is greater than the first preset threshold, the image samples included in the current batch are recognized by using configuration parameters corresponding to the previous batch; and a recognition accuracy rate corresponding to the current batch is obtained. If it is judged that the recognition accuracy rate corresponding to the previous batch is not greater than the first preset threshold, parameter adjustment is carried out based on the configuration parameters corresponding to the previous batch, so as to obtain the adjusted configuration parameters; and the image samples included in the current batch are recognized by using the adjusted configuration parameters, to obtain a recognition accuracy rate corresponding to the current batch.
[083] Further, during model training carried out on the spatial transformer network based on the training set, when it is judged that all recognition accuracy rates of Q successive batches are greater than the first preset threshold after the spatial transformer network uses a set of configuration parameters, and Q is a positive integer greater than or equal to 1, the model training carried out on the spatial transformer network is determined as finished. In this case, it is determined to carry out subsequent model testing procedures by using configuration parameters finally set in the spatial transformer network.
[084] After the model training carried out on the spatial transformer network based on the training set is determined as finished, model testing may be carried out on the spatial transformer network based on the testing set. Moreover, a first threshold corresponding to a false positive rate (FPR) of reproduced identity card image equal to a second preset threshold (e.g., 1%) is determined according to an output result corresponding to each image sample included in the testing set. The first threshold is a value of the probability indicating that the image sample is a reproduced identity card image in the output result.
[085] During model testing carried out on the spatial transformer network, each image sample included in the testing set corresponds to one output result. The output result includes a probability indicating that the image sample is a reproduced identity card image and a probability indicating that the image sample is a non-reproduced identity card image. Values of the probability indicating that the image sample is a reproduced identity card image in different output results correspond to different FPRs. In an embodiment of the present invention, a value of the probability, indicating that the image sample is a reproduced identity card image, corresponding to the FPR equaling to the second preset threshold (e.g., 1%) is determined as the first threshold.
[086] Preferably, in an embodiment of the present invention, during model testing carried out on the spatial transformer network based on the testing set, a receiver operating characteristic (ROC) curve is drawn according to the output results corresponding to the image samples included in the testing set. A value of the probability, indicating that the image sample is a reproduced identity card image, corresponding to the FPR equaling to 1% is determined as the first threshold according to the ROC curve.
[087] Please refer to FIG. 5. A detailed procedure of carrying out model testing on a spatial transformer network based on the testing set according to an embodiment of the present invention is described as follows:
[088] Step 500: Spatial transformation processing and image processing are carried out on each image sample included in the testing set based on the spatial transformer network having finished the model training, so as to obtain a corresponding output result, wherein the output result includes a reproduced image probability value and a non-reproduced image probability value corresponding to each image sample.
[089] In an embodiment of the present invention, the image samples included in the testing set are used as original images for model testing carried out on the spatial transformer network, and each image sample included in the testing set is acquired respectively. Moreover, when the model training carried out on the spatial transformer network is finished, the acquired each image sample included in the testing set is recognized respectively by using configuration parameters that are set finally in the spatial transformer network.
[090] For example, assuming that the spatial transformer network is set as follows: the first layer is a convolutional layer 1, the second layer is a spatial transformer module, the third layer is a convolutional layer 2, the fourth layer is a pooling layer 1, and the fifth layer is a fully connected layer 1. Then, a specific procedure of carrying out image recognition on any original image x based on the spatial transformer network is described as follows:
[091] The convolutional layer 1 uses the original image x as an input image, carries out sharpening processing on the original image x, and uses the original image x after the sharpening processing is carried out as an output image xl .
[092] The spatial transformer uses the output image xl as an input image, carries out a spatial transformation operation (e.g., rotating clockwise by 60 degrees and/or translating leftward by 2 cm, and so on) on the output image xl, and uses the rotated and/or translated output image xl as an output image x2.
[093] The convolutional layer 2 uses the output image x2 as an input image, carries out fuzzy processing on the output image x2, and uses the output image x2 after the fuzzy processing is carried out as an output image x3.
[094] The pooling layer 1 uses the output image x3 as an input image, carries out compression processing on the output image x3 by using max pooling, and uses the compressed output image x3 as an output image x4.
[095] The last layer of the spatial transformer network is the fully connected layer 1. The fully connected layer 1 uses the output image x4 as an input image, and carries out classification processing on the output image x4 based on a characteristic chart of the output image x4. The fully connected layer 1 includes two output nodes (e.g., a and b), wherein a indicates a probability of the original image x being a reproduced identity card image, and b indicates a probability of the original image x being a non-reproduced identity card image. For example, a=0.05, and b=0.95.
[096] Then, a first threshold is set based on the output result, thereby determining that the model testing carried out on the spatial transformer network is finished. [097] With reference to Step 510, an ROC curve is drawn according to the output results corresponding to the image samples included in the testing set.
[098] In an embodiment of the present invention, a respective reproducing probability value of each image sample included in the testing set is used as a set threshold; an FPR and a true positive rate (TPR) corresponding to each set threshold are determined based on the reproduced image probability value and the non-reproduced image probability value corresponding to each image sample included in the output result. An ROC curve is drawn based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR aY- axis.
[099] For example, assuming that the testing set includes ten image samples, and each image sample included in the testing set corresponds to a probability used for indicating that the image sample is a reproduced identity card image and a probability used for indicating that the image sample is a non- reproduced identity card image. For any image sample, a sum of the probability used for indicating that the image sample is a reproduced identity card image and the probability used for indicating that the image sample is a non-reproduced identity card image is 1. In an embodiment of the present invention, different values of the probability used for indicating that the image sample is a reproduced identity card image correspond to different FPRs and TPRs. As a result, ten values of the probability, used for indicating that the image sample is a reproduced identity card image, corresponding to the ten image samples included in the testing set may be used as set thresholds respectively. An FPR and a TPR corresponding to each set threshold are determined based on a probability value used for indicating that the image sample is a reproduced identity card image and a probability value used for indicating that the image sample is a non-reproduced identity card image corresponding to each of the ten image samples included in the testing set. Please refer to FIG. 6, illustrating a schematic diagram of drawing an ROC curve based on 10 groups of different FPRs and TPRs according to an embodiment of the present invention; the ROC curve using the FPR as an X- axis and the TPR as a Y-axis.
[100] With reference to Step 520, a reproduced image probability value corresponding to the FPR equaling to a second preset threshold is set to a first threshold based on the ROC curve. [101] For example, assuming that in an embodiment of the present invention, after the ROC curve is drawn, if it is judged that a value of a probability, used for indicating that an image sample is a reproduced identity card image, corresponding the FPR equaling to 1% is 0.05, the first threshold is set to 0.05.
[102] In an embodiment of the present invention, 0.05 is merely used as an example; and other first thresholds may certainly be set in actual embodiments according to operation and maintenance experiences, which will not be described in detail here.
[103] In an embodiment of the present invention, after the model training carried out on the established spatial transformer network based on the training set is finished and the model testing carried out on the spatial transformer network based on the testing set is finished, it is determined that establishment of the spatial transformer network model is finished, and a threshold (e.g., T) when the spatial transformer network model is used actually is determined. Moreover, when the spatial transformer network model is used actually, a magnitude relationship between a value T' of a probability and T is judged, the probability being obtained after recognition processing is carried out on an input image by the spatial transformer network model and used for indicating that an image sample is a reproduced identity card image. A corresponding subsequent operation is carried out according to the magnitude relationship between T' and T.
[104] Please refer to FIG. 7, illustrating a detailed procedure of carrying out image recognition by using a spatial transformer network model online according to an embodiment of the present embodiments is described as follows:
[105] With reference to Step 700, an acquired to-be-recognized image is input to a spatial transformer network model.
[106] In an embodiment, after model training carried out on a spatial transformer network based on image samples included in a training set is finished, and model testing carried out on the spatial transformer network having finished the model training based on image samples included in a testing set is finished, a spatial transformer network model is obtained. The spatial transformer network model can carry out image recognition on a to-be-recognized image input to the model.
[107] For example, assuming that the acquired to-be-recognized image is an identity card image of Li, and then, the acquired identity card image of Li is input to the spatial transformer network model. [108] Step 710: Image processing and spatial transformation processing are carried out on the to-be- recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image.
[109] In an embodiment, the spatial transformer network model includes at least a CNN and a spatial transformer. The spatial transformer includes at least a positioning network, a grid generator, and a sampler. At least once convolution processing, at least once pooling processing, and at least once full connection processing are carried out on the to-be-recognized image based on the spatial transformer network model.
[110] For example, assuming that the spatial transformer network model includes the CNN and the spatial transformer module, and the spatial transformer includes at least a positioning network 1, a grid generator 1, and a sampler 1. The CNN is set to include a convolutional layer 1, a convolutional layer 2, a pooling layer 1, and a fully connected layer 1. Then, twice convolution processing, once pooling processing, and once full connection processing are carried out on the identity card image of Li input to the spatial transformer network model.
[I l l] Further, the spatial transformer is set behind any convolutional layer in the CNN included in the spatial transformer network model. Then, after any convolution processing is carried out on the to-be-recognized image by using the CNN, a transformation parameter set is generated by using the positioning network, sampling grids are generated by using the grid generator according to the transformation parameter set, and sampling and spatial transformation processing are carried out on the to-be-recognized image by using the sampler according to the sampling grids. The spatial transformation processing includes at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
[112] For example, assuming that the spatial transformer is set behind the convolutional layer 1 and before the convolutional layer 2. Then, after convolution processing is carried out once, by using the convolutional layer 1, on the identity card image of Li input to the spatial transformer network model, the identity card image of Li is rotated clockwise by 30 degrees and/or translated leftward by 2 cm and so on by using a transformation parameter set generated by using a location 1 included in the spatial transformer. [113] Step 720: The to-be-recognized image is determined as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
[114] For example, assuming that during image recognition carried out on an original image y by using the spatial transformer network model, the spatial transformer network model uses the original image y as an input image, and carries out corresponding sharpening processing, spatial transformation processing (e.g., rotating anticlockwise by 30 degrees and/or translating leftward by 3 cm, and so on), fuzzy processing, and compression processing on the original image y. After that, the last layer (fully connected layer) of the spatial transformer network model carries out classification processing. The last layer, i.e., the fully connected layer includes two output nodes. The two output nodes are respectively a value T' of a probability used for indicating that the original image y is a reproduced identity card image, and a value of a probability used for indicating that the original image y is a non-reproduced identity card image. Further, the value T' of the probability, used for indicating that the original image y is a reproduced identity card image, obtained after recognition processing is carried out on the original image y by using the spatial transformer network model is compared with the first threshold T determined during model testing carried out on the spatial transformer network. If T'<T, the original image y is determined as a non-reproduced identity card image, that is, a normal image. If T'≥T, the original image y is determined as a reproduced identity card image.
[115] Further, when it is judged that T'≥T, the original image y is determined as a suspected reproduced identity card image, and the procedure proceeds to a manual reviewing stage. During the manual reviewing state, if it is judged that the original image y is a reproduced identity card image, the original image y is determined as a reproduced identity card image. During the manual reviewing stage, if it is judged that the original image y is a non-reproduced identity card image, the original image y is determined as a non-reproduced identity card image.
[116] An embodiment of the present invention in an actual business scenario will be described in detail in the following. Please refer to FIG. 8 illustrating a detailed procedure of carrying out image recognition processing on a to-be-recognized image according to an embodiment of the present invention is described as follows: [117] Step 800: A to-be-recognized image uploaded by a user is received.
[118] For example, assuming that Zhang carries out real-person authentication on an e-commerce platform, and then, Zhang needs to upload an identity card image thereof to the e-commerce platform to carry out real-person authentication. The e-commerce platform receives the identity card image uploaded by Zhang.
[119] Step 810: Image processing is carried out on the to-be-recognized image when an image processing instruction triggered by the user is received, spatial transformation processing is carried out on the to-be-recognized image when a spatial transformation instruction triggered by the user is received, and the to-be-recognized image after the image processing and the spatial transformation processing are carried out is presented to the user.
[120] In an embodiment, when the image processing instruction triggered by the user is received, at least once convolution processing, at least once pooling processing, and at least once full connection processing are carried out on the to-be-recognized image.
[121] In an embodiment, after the to-be-recognized original image uploaded by the user is received, assuming that after convolution processing, e.g., image sharpening processing, is carried out on the to-be-recognized original image once, the sharpened to-be-recognized image having clearer edge, contour, and details of the image may be obtained.
[122] For example, assuming that Zhang uploads the identity card image thereof to the e-commerce platform, and then the e-commerce platform may present, to Zhang by using a terminal, whether image processing (e.g., convolution processing, pooling processing, and fully connected processing) is carried out on the identity card image. When receiving an instruction for carrying out image processing on the identity card image triggered by Zhang, the e-commerce platform carries out sharpening processing and compression processing on the identity card image.
[123] After a spatial transformation instruction triggered by the user is received, any one or a combination of the following operations is carried out on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
[124] In an embodiment of the present invention, after the spatial transformation instruction triggered by the user is received, assuming that rotation processing and translation processing are carried out on the image after the sharpening processing is carried out, the corrected to-be- recognized image may be obtained.
[125] For example, assuming that Zhang uploads the identity card image thereof to the e-commerce platform. Then the e-commerce platform may present, to Zhang by using the terminal, whether rotation processing and/or translation processing is carried out on the identity card image. When receiving an instruction for carrying out rotation processing and/or translation processing on the identity card image triggered by Zhang, the e-commerce platform rotates the identity card image clockwise by 60 degrees and then translates the identity card image leftward by 2 cm, to obtain the rotated and translated identity card image.
[126] In an embodiment of the present invention, after sharpening processing, rotation processing, and translation processing are carried out on the to-be-recognized image, the to-be-recognized image after the sharpening processing, rotation processing, and translation processing are carried out is presented to the user by using the terminal.
[127] With reference to Step 820, a reproduced image probability value corresponding to the to-be- recognized image is calculated according to a user instruction.
[128] For example, assuming that the e-commerce platform presents, to Zhang by using the terminal, the identity card image of Zhang after the image processing and spatial transformation processing are carried out, and prompts Zhang whether to calculate a reproduced image probability value corresponding to the identity card image. The e-commerce platform calculates the reproducing probability value corresponding to the identity card image when receiving the instruction for calculating the reproduced image probability value corresponding to the identity card image triggered by Zhang.
[129] With reference to Step 830, it is judged whether the reproduced image probability value corresponding to the to-be-recognized image is less than a preset first threshold; and if so, the to-be- recognized image is determined as a non-reproduced image, and the user is prompted that the recognition is successful; otherwise, the to-be-recognized image is determined as a suspected reproduced image.
[130] Further, when the to-be-recognized image is determined as the suspected reproduced image, the suspected reproduced image is presented to an administrator; and the administrator is prompted to review the suspected reproduced image. It is determined whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
[131] An embodiment is further illustrated in detail by using a specific scenario in as follows:
[132] For example, after receiving an identity card image uploaded by a user for carrying out real- person authentication, a computing device carries out image recognition by using the identity card image as an original input image, to judge whether the identity card image uploaded by the user is a reproduced identity card image, thereby performing a real-person authentication operation. In an embodiment, when receiving an instruction for carrying out sharpening processing on the identity card image triggered by the user, the computing device carries out corresponding sharpening processing on the identity card image. After the sharpening processing is carried out on the identity card image, according to an instruction for carrying out spatial transformation processing (e.g., processing such as rotation and translation) on the identity card image triggered by the user, the computing device carries out corresponding rotation and/or translation processing on the identity card image after the sharpening processing is carried out. Then, the computing device carries out corresponding fuzzy processing on the identity card image after the spatial transformation processing is carried out. Next, the computing device carries out corresponding compression processing on the identity card image after the fuzzy processing is carried out. Finally, the computing device carries out corresponding classification processing on the identity card image after the compression processing is carried out, to obtain a probability value corresponding to the identity card image and used for indicating that the identity card image is a reproduced image. When it is judged that the probability value meets a preset condition, the identity card image uploaded by the user is determined as a non-reproduced image, and the user is prompted that the real-person authentication is successful. When it is judged that the probability value does not meet the preset condition, the identity card image uploaded by the user is determined as a suspected reproduced image, and the suspected reproduced identity card image is transferred to a administrator for subsequent manual reviewing. In the manual reviewing stage, if the administrator judges the identity card image uploaded by the user as a reproduced identity card image, the user is prompted that the real-person authentication is failed, and it is necessary to upload a new identity card image. If the administrator judges the identity card image uploaded by the user as a non-reproduced identity card image, the user is prompted that the real-person authentication is successful. [133] Based on the above embodiments, please now refer to FIG. 9. In an embodiment of the present invention, an image recognition apparatus includes at least an input unit 90, a processing unit 91, and a determination unit 92.
[134] The input unit 90 is configured to input an acquired to-be-recognized image to a spatial transformer network model.
[135] The processing unit 91 is configured to carry out image processing and spatial transformation processing on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image.
[136] The determination unit 92 is configured to determine the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
[137] In an embodiment, before an acquired to-be-recognized image is input to a spatial transformer network model, the input unit 90 is further configured to: acquire image samples, and divide the acquired image samples into a training set and a testing set according to a preset ratio; and construct a spatial transformer network based on a convolutional neural network (CNN) and a spatial transformer module, carry out a model training on the spatial transformer network based on the training set, and carry out a model testing on the spatial transformer network with the model training finished based on the testing set.
[138] In an embodiment, when a spatial transformer network is constructed based on a CNN and a spatial transformer module, the input unit 90 is configured to: embed a learnable spatial transformer in the CNN to construct the spatial transformer network, wherein the spatial transformer includes at least a positioning network, a grid generator, and a sampler, the positioning network including at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
[139] In an embodiment, when carrying out a model training on the spatial transformer network based on the training set, the input unit 90 is configured to: divide the image samples included in the training set into several batches based on the spatial transformer network, wherein one batch includes G image samples, and G is a positive integer greater than or equal to 1; and sequentially perform the following operations for each batch included in the training set until it is judged that all recognition accuracy rates corresponding to Q successive batches are greater than a first preset threshold; determine that the model training carried out on the spatial transformer network is finished, and Q is a positive integer greater than or equal to 1; carry out spatial transformation processing and image processing on each image sample comprised in one batch by using current configuration parameters and obtain a corresponding recognition result, wherein the configuration parameters comprise at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculate a recognition accuracy rate corresponding to the one batch based on recognition results of the image samples included in the one batch; and judge whether the recognition accuracy rate corresponding to the one batch is greater than the first preset threshold; and if so, keep the current configuration parameters unchanged; otherwise, adjust the current configuration parameters, and use the adjusted configuration parameters as current configuration parameters used for a next batch.
[140] In an embodiment, when model testing is carried out on the spatial transformer network having finished the model training based on the testing set, the input unit 90 is configured to: carry out image processing and spatial transformation processing on each image sample included in the testing set based on the spatial transformer network having finished the model training, so as to obtain a corresponding output result, wherein the output result includes a reproduced image probability value and a non-reproduced image probability value corresponding to each image sample; and set the first threshold based on the output result, thereby determining that the model testing carried out on the spatial transformer network is finished.
[141] In an embodiment, when the first threshold is set based on the output result, the input unit 90 is configured to: use a respective reproducing probability value of each image sample included in the testing set as a set threshold; and determine a false positive rate (FPR) and a true positive rate (TPR) corresponding to each set threshold based on the reproduced image probability value and the non-reproduced image probability value corresponding to each image sample included in the output result; draw a receiver operating characteristic (ROC) curve based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR as a Y- axis; and set a reproduced image probability value corresponding to the FPR equaling to a second preset threshold as the first threshold based on the ROC curve.
[142] In an embodiment, when carrying out image processing on the to-be-recognized image based on the spatial transformer network model, the input unit 90 is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image based on the spatial transformer network model.
[143] In an embodiment, when carrying out spatial transformation processing on the to-be- recognized image, the input unit 90 is configured to: the spatial transformer network model including at least the CNN and the spatial transformer module, and the spatial transformer module including at least the positioning network, the grid generator, and the sampler; after any convolution processing is carried out on the to-be-recognized image by using the CNN, generate the transformation parameter set by using the positioning network; generate the sampling grids by using the grid generator according to the transformation parameter set; and carry out sampling and spatial transformation processing on the to-be-recognized image by using the sampler according to the sampling grids, wherein the spatial transformation processing includes at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
[144] Please refer to FIG. 10. In an embodiment of the present invention, an image recognition apparatus includes at least a receiving unit 100, a processing unit 110, a calculation unit 120, and a judging unit 130.
[145] The receiving unit 100 is configured to receive a to-be-recognized image uploaded by a user.
[146] The processing unit 110 is configured to carry out image processing on the to-be-recognized image when an image processing instruction triggered by the user is received; carry out spatial transformation processing on the to-be-recognized image when a spatial transformation instruction triggered by the user is received; and present to the user the to-be-recognized image after the image has gone through the image processing and the spatial transformation processing.
[147] The calculation unit 120 is configured to calculate a reproduced image probability value corresponding to the to-be-recognized image according to a user instruction. [148] The judging unit 130 is configured to judge whether the reproduced image probability value corresponding to the to-be-recognized image is less than a preset first threshold; and if so, determine the to-be-recognized image as a non-reproduced image, and prompt the user that the recognition is successful; otherwise, determine the to-be-recognized image as a suspected reproduced image.
[149] In an embodiment, after the to-be-recognized image is determined as a suspected reproduced image, the judging unit 130 is further configured to: present the suspected reproduced image to an administrator, and prompt the administrator to review the suspected reproduced image; and determine whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
[150] In an embodiment, when image processing is carried out on the to-be-recognized image, the processing unit 110 is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image.
[151] In an embodiment, when spatial transformation processing is carried out on the to-be- recognized image, the processing unit 110 is configured to: carry out any one or a combination of the following operations on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
[152] In view of the above, in embodiments of the present invention, during image recognition based on a spatial transformer network model, an acquired to-be-recognized image is inputted to the spatial transformer network model; image processing and spatial transformation processing are carried out on the to-be-recognized image based on the spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and the to-be-recognized image is determined as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold. By means of the image recognition method, a spatial transformer network model can be established by carrying out model training and model testing on a spatial transformer network only once. In this way, the workload for calibrating image samples during training and testing is reduced, and training and testing efficiencies are improved. Further, the model training is carried out based on a one-level spatial transformer network, and configuration parameters obtained by the training form an optimal combination, thereby improving the recognition effect when an image is recognized by using the spatial transformer network model online.
[153] Those skilled in the art should understand that, embodiments of the present invention may be provided as a method, a system, or a computer program product. Therefore, the present invention may be implemented as a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may be in the form of a computer program product implemented on one or more computer usable storage media (including, but not limited to, a magnetic disk memory, a CD-ROM, an optical memory and the like) including computer usable program codes.
[154] The present invention is described with reference to flowcharts and/or block diagrams according to the method, device (system) and computer program product according to embodiments of the present invention. It should be understood that a computer program instruction may be used to implement each process and/or block in the flowcharts and/or block diagrams and combinations of processes and/or blocks in the flowcharts and/or block diagrams. These computer program instructions may be provided for a general-purpose computer, a special-purpose computer, an embedded processor, or a processor of any other programmable data processing device to generate a machine, so that the instructions executed by a computer or a processor of any other programmable data processing device generate an apparatus for implementing a specified function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
[155] These computer program instructions may also be stored in a computer readable memory that can instruct the computer or any other programmable data processing device to work in a particular manner, such that the instructions stored in the computer readable memory generate an artifact that includes an instruction apparatus. The instruction apparatus implements a specified function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams as disclosed herein.
[156] These computer program instructions may also be loaded onto a computer or another programmable data processing device, such that a series of operation steps are performed on the computer or another programmable device, thereby generating computer-implemented processing. Therefore, the instructions executed on the computer or another programmable device provide steps for implementing a specified function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.
[157] Although preferred embodiments of the present invention have been described and claimed, those skilled in the art can make other variations and modifications based on these embodiments based upon their teachings. Therefore, the appended claims include all such embodiments and variations falling within the scope of the present claims

Claims

CLAIMS What is claimed is:
1. An image recognition method, comprising: acquiring a to-be-recognized image; carrying out spatial transformation processing on the to-be-recognized image based on a spatial transformer network model so as to obtain a reproduced image probability value
corresponding to the to-be-recognized image; and determining the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
2. The method of claim 1 , wherein before the step of acquiring a to-be-recognized image, the method further comprises: acquiring image samples, and dividing the acquired image samples into a training set and a testing set according to a preset ratio; and constructing a spatial transformer network based on a convolutional neural network (CNN) and a spatial transformer module, carrying out a model training on the spatial transformer network based on the training set, and carrying out a model testing on the spatial transformer network having finished the model training based on the testing set.
3. The method of claim 2, wherein the step of constructing a spatial transformer network based on a CNN and a spatial transformer module comprises: embedding a learnable spatial transformer module in the CNN to construct a spatial transformer network, wherein the spatial transformer module comprises at least a positioning network, a grid generator, and a sampler, the positioning network comprising at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
4. The method of claim 2, wherein the step of carrying out a model training on the spatial transformer network based on the training set comprises: dividing the image samples in the training set into several batches based on the spatial transformer network, wherein one batch comprises G image samples, and G is a positive integer greater than or equal to 1 ; sequentially performing the following operations for each batch in the training set until it is judged that all recognition accuracy rates corresponding to Q successive batches are greater than a first preset threshold, determining that the model training carried out on the spatial transformer network is finished, and Q is a positive integer greater than or equal to 1; carrying out spatial transformation processing and image processing on each image sample in one batch by using current configuration parameters and obtaining a corresponding recognition result, wherein the configuration parameters comprise at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculating a recognition accuracy rate corresponding to the one batch based on recognition results of the image samples comprised in the one batch; and judging whether the recognition accuracy rate corresponding to the one batch is greater than the first preset threshold; if so, keeping the current configuration parameters unchanged; otherwise, adjusting the current configuration parameters, and using the adjusted configuration parameters as current configuration parameters used for a next batch.
5. The method of claim 4, wherein the step of carrying out a model testing on the spatial transformer network having finished the model training based on the testing set comprises: carrying out image processing and spatial transformation processing on each image sample comprised in the testing set based on the spatial transformer network having finished the model training to obtain a corresponding output result, wherein the output result comprises a reproduced image probability value and a non-reproduced image probability value corresponding to each image sample; and setting the first threshold based on the output result, thereby determining that the model testing carried out on the spatial transformer network is finished.
6. The method of claim 5, wherein the step of setting the first threshold based on the output result comprises: using a respective reproducing probability value of each image sample comprised in the testing set as a set threshold, and determining a false positive rate (FPR) and a true positive rate (TPR) corresponding to each set threshold based on the reproduced image probability value and the non-reproduced image probability value corresponding to each image sample in the output result; drawing a receiver operating characteristic (ROC) curve based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR as a Y-axis; and setting a reproduced image probability value corresponding to the FPR equaling to a second preset threshold as the first threshold based on the ROC curve.
7. The method of claim 1, wherein the step of carrying out spatial transformation processing on the to-be-recognized image based on the spatial transformer network model comprises: carrying out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image based on the spatial transformer network model.
8. The method of claim 7, wherein the step of carrying out spatial transformation processing on the to-be-recognized image further comprises: using the spatial transformer network model comprising at least the CNN and the spatial transformer module, and the spatial transformer module comprising at least the positioning network, the grid generator, and the sampler; and after any convolution processing is carried out on the to-be-recognized image by using the CNN, generating the transformation parameter set by using the positioning network, generating the sampling grids by using the grid generator according to the transformation parameter set, and carrying out sampling and spatial transformation processing on the to-be-recognized image by using the sampler according to the sampling grids, wherein the spatial transformation processing comprises at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
9. An image recognition method, comprising: receiving a to-be-recognized image; carrying out spatial transformation processing on the to-be-recognized image when a spatial transformation instruction triggered by the user is received; presenting to the user the spatial transformation processing result; calculating a reproduced image probability value corresponding to the to-be-recognized image according to a user instruction; and based on the reproduced image probability value, determining the to-be-recognized image as a non-reproduced image or a suspected reproduced image.
10. The method of claim 9, wherein after the step of determining the to-be-recognized image as a suspected reproduced image, the method further comprises: presenting the suspected reproduced image to an administrator, and prompting the administrator to review the suspected reproduced image; and determining whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
11. The method of claim 9 or 10, wherein the step of spatial transformation processing comprises: carrying out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image.
12. The method of claim 11, wherein the step of carrying out spatial transformation processing on the to-be-recognized image further comprises: carrying out any one or a combination of the following operations on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
13. An image processing apparatus, comprising: an input unit, configured to acquire a to-be-recognized image; a processing unit, configured to carry out spatial transformation processing on the to-be- recognized image based on a spatial transformer network model so as to obtain a reproduced image probability value corresponding to the to-be-recognized image; and a determination unit, configured to determine the to-be-recognized image as a suspected reproduced image when it is judged that the reproduced image probability value corresponding to the to-be-recognized image is greater than or equal to a preset first threshold.
14. The apparatus of claim 13, wherein before the to-be-recognized image is acquired, the input unit is configured to: acquire image samples, and divide the acquired image samples into a training set and a testing set according to a preset ratio; and construct a spatial transformer network based on a convolutional neural network (CNN) and a spatial transformer module, carry out a model training on the spatial transformer network based on the training set, and carry out a model testing on the spatial transformer network having finished the model training based on the testing set.
15. The apparatus of claim 14, wherein when configured to construct a spatial transformer network based on a CNN and a spatial transformer module, the input unit is configured to: embed a learnable spatial transformer module in the CNN to construct a spatial transformer network, wherein the spatial transformer module comprises at least a positioning network, a grid generator, and a sampler, the positioning network comprising at least one convolutional layer, at least one pooling layer, and at least one fully connected layer, wherein the positioning network is configured to generate a transformation parameter set; the grid generator is configured to generate sampling grids according to the transformation parameter set; and the sampler is configured to sample the input image according to the sampling grids.
16. The apparatus of claim 14, wherein when configured to carry out a model training on the spatial transformer network based on the training set, the input unit is configured to: divide the image samples comprised in the training set into several batches based on the spatial transformer network, wherein one batch comprises G image samples, and G is a positive integer greater than or equal to 1 ; and sequentially perform the following operations for each batch in the training set until it is judged that all recognition accuracy rates corresponding to Q successive batches are greater than a first preset threshold, determine that the model training carried out on the spatial transformer network is finished, and Q is a positive integer greater than or equal to 1; carry out spatial transformation processing and image processing on each image sample in one batch by using current configuration parameters and obtain a corresponding recognition result, wherein the configuration parameters comprise at least a parameter used by at least one convolutional layer, a parameter used by at least one pooling layer, a parameter used by at least one fully connected layer, and a parameter used by the spatial transformer module; calculate a recognition accuracy rate corresponding to the one batch based on recognition results of the image samples in the one batch; and judge whether the recognition accuracy rate corresponding to the one batch is greater than the first preset threshold; and if so, keep the current configuration parameters unchanged; otherwise, adjust the current configuration parameters, and use the adjusted configuration parameters as current configuration parameters used for a next batch.
17. The apparatus of claim 16, wherein when configured to carry out a model testing on the spatial transformer network having finished the model training based on the testing set, the input unit is configured to: carry out image processing and spatial transformation processing on each image sample in the testing set based on the spatial transformer network having finished the model training to obtain a corresponding output result, wherein the output result comprises a reproduced image probability value and a non-reproduced image probability value corresponding to each image sample; and set the first threshold based on the output result, thereby determining that the model testing carried out on the spatial transformer network is finished.
18. The apparatus of claim 17, wherein when configured to set the first threshold based on the output result, the input unit is configured to: use a respective reproducing probability value of each image sample comprised in the testing set as a set threshold, and determine a false positive rate (FPR) and a true positive rate (TPR) corresponding to each set threshold based on the reproduced image probability value and the non- reproduced image probability value corresponding to each image sample comprised in the output result; draw a receiver operating characteristic (ROC) curve based on the determined FPR and TPR corresponding to each set threshold, the ROC curve using the FPR as an X-axis and the TPR as a Y- axis; and set a reproduced image probability value corresponding to the FPR equaling to a second preset threshold as the first threshold based on the ROC curve.
19. The apparatus of claim 13 , wherein when configured to carry out spatial transformation processing on the to-be-recognized image based on the spatial transformer network model, the processing unit is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image based on the spatial transformer network model.
20. The apparatus of claim 19, wherein when configured to carry out spatial transformation processing on the to-be-recognized image, the processing unit is configured to: use the spatial transformer network model comprising at least a CNN and the spatial transformer module, and the spatial transformer module comprising at least the positioning network, the grid generator, and the sampler; after any convolution processing is carried out on the to-be-recognized image by using the CNN, generate the transformation parameter set by using the positioning network, generate the sampling grids by using the grid generator according to the transformation parameter set, and carry out sampling and spatial transformation processing on the to-be-recognized image by using the sampler according to the sampling grids, wherein the spatial transformation processing comprises at least any one or a combination of the following operations: rotation processing, translation processing, and scaling processing.
21. An image recognition apparatus, comprising: a receiving unit, configured to receive a to-be-recognized image uploaded by a user; a processing unit, configured to carry out image processing on the to-be-recognized image when an image processing instruction triggered by the user is received, carry out spatial
transformation processing on the to-be-recognized image when a spatial transformation instruction triggered by the user is received, and present to the user the to-be-recognized image after the image has gone through the image processing and the spatial transformation processing; a calculation unit, configured to calculate a reproduced image probability value
corresponding to the to-be-recognized image according to a user instruction; and a judging unit, configured to judge whether the reproduced image probability value corresponding to the to-be-recognized image is less than a preset first threshold; and if so, determine the to-be-recognized image as a non-reproduced image, and prompt the user that the recognition is successful; otherwise, determine the to-be-recognized image as a suspected reproduced image.
22. The apparatus of claim 21, wherein after the to-be-recognized image is determined as a suspected reproduced image, the judging unit is further configured to: present the suspected reproduced image to an administrator, and prompt the administrator to review the suspected reproduced image; and determine whether the suspected reproduced image is a reproduced image according to a review feedback of the administrator.
23. The apparatus of claim 21 or 22, wherein when configured to carry out image processing on the to-be-recognized image, the processing unit is configured to: carry out convolution processing at least once, pooling processing at least once, and full connection processing at least once on the to-be-recognized image.
24. The apparatus of claim 23, wherein when configured to carry out spatial transformation processing on the to-be-recognized image, the processing unit is configured to: carry out any one or a combination of the following operations on the to-be-recognized image: rotation processing, translation processing, and scaling processing.
PCT/US2018/018692 2017-02-22 2018-02-20 Image recognition method and apparatus Ceased WO2018156478A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710097375.8A CN108460649A (en) 2017-02-22 2017-02-22 A kind of image-recognizing method and device
CN201710097375.8 2017-02-22

Publications (1)

Publication Number Publication Date
WO2018156478A1 true WO2018156478A1 (en) 2018-08-30

Family

ID=63167400

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2018/018692 Ceased WO2018156478A1 (en) 2017-02-22 2018-02-20 Image recognition method and apparatus

Country Status (4)

Country Link
US (1) US20180239987A1 (en)
CN (1) CN108460649A (en)
TW (1) TWI753039B (en)
WO (1) WO2018156478A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321964A (en) * 2019-07-10 2019-10-11 重庆电子工程职业学院 Identification model update method and relevant apparatus

Families Citing this family (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10262235B1 (en) 2018-02-26 2019-04-16 Capital One Services, Llc Dual stage neural network pipeline systems and methods
CN110335269A (en) * 2018-05-16 2019-10-15 腾讯医疗健康(深圳)有限公司 The classification recognition methods of eye fundus image and device
CN109447958B (en) * 2018-10-17 2023-04-14 腾讯科技(深圳)有限公司 Image processing method, image processing device, storage medium and computer equipment
CN109522900B (en) * 2018-10-30 2020-12-18 北京陌上花科技有限公司 Natural scene character recognition method and device
CN111241891B (en) * 2018-11-29 2024-04-30 中科视语(北京)科技有限公司 A method and device for cutting face images and a computer-readable storage medium
CN111435424B (en) * 2019-01-14 2024-10-22 北京京东乾石科技有限公司 Image processing method and device
CN109886275A (en) * 2019-01-16 2019-06-14 深圳壹账通智能科技有限公司 Reproduction image recognition method, device, computer equipment and storage medium
CN109859227B (en) * 2019-01-17 2023-07-14 平安科技(深圳)有限公司 Method and device for detecting flip image, computer equipment and storage medium
CN109635141B (en) * 2019-01-29 2021-04-27 京东方科技集团股份有限公司 Method, electronic device, and computer-readable storage medium for retrieving an image
US11699070B2 (en) * 2019-03-05 2023-07-11 Samsung Electronics Co., Ltd Method and apparatus for providing rotational invariant neural networks
CN110222736A (en) * 2019-05-20 2019-09-10 北京字节跳动网络技术有限公司 Method, apparatus, electronic equipment and the computer readable storage medium of training classifier
CN112149701B (en) * 2019-06-28 2024-05-10 杭州海康威视数字技术股份有限公司 Image recognition method, virtual sample data generation method and storage medium
CN110458164A (en) * 2019-08-07 2019-11-15 深圳市商汤科技有限公司 Image processing method, device, device and computer-readable storage medium
CN110659694B (en) * 2019-09-27 2022-10-11 华中农业大学 Method for detecting citrus fruit base based on machine learning
CN110751061B (en) * 2019-09-29 2023-04-07 五邑大学 SAR image recognition method, device, equipment and storage medium based on SAR network
CN110717450B (en) * 2019-10-09 2023-02-03 深圳大学 Training and detection methods for automatically identifying remakes of original documents
WO2021068142A1 (en) * 2019-10-09 2021-04-15 深圳大学 Training method and detection method for automatically identifying recaptured image of original document
CN110908901B (en) * 2019-11-11 2023-05-02 福建天晴数码有限公司 Automatic verification method and system for image recognition capability
CN112825140A (en) * 2019-11-21 2021-05-21 上海智臻智能网络科技股份有限公司 Recognition device for characters in image
CN111191550B (en) * 2019-12-23 2023-05-02 初建刚 Visual perception device and method based on automatic dynamic adjustment of image sharpness
CN111260214B (en) * 2020-01-15 2024-01-26 大亚湾核电运营管理有限责任公司 Nuclear power plant reserved work order picking methods, devices, equipment and storage media
CN111368889B (en) * 2020-02-26 2023-10-17 腾讯科技(深圳)有限公司 Image processing method and device
CN111626982A (en) * 2020-04-13 2020-09-04 中国外运股份有限公司 Method and device for identifying batch codes of containers to be detected
TWI775084B (en) * 2020-05-27 2022-08-21 鴻海精密工業股份有限公司 Image recognition method, device, computer device and storage media
CN113743427B (en) 2020-05-27 2023-10-31 富泰华工业(深圳)有限公司 Image recognition method, device, computer device and storage medium
CN111814636A (en) * 2020-06-29 2020-10-23 北京百度网讯科技有限公司 A safety belt detection method, device, electronic device and storage medium
RU2739059C1 (en) * 2020-06-30 2020-12-21 Анатолий Сергеевич Гавердовский Authentication method of marking
CN112149713B (en) * 2020-08-21 2022-12-16 中移雄安信息通信科技有限公司 Method and device for detecting insulator image based on insulator image detection model
CN112258481A (en) * 2020-10-23 2021-01-22 北京云杉世界信息技术有限公司 Portal photo reproduction detection method
CN112396058B (en) * 2020-11-11 2024-04-09 深圳大学 A document image detection method, device, equipment and storage medium
CN112506649A (en) * 2020-11-27 2021-03-16 深圳比特微电子科技有限公司 Ore machine configuration parameter determination method
CN112650875A (en) * 2020-12-22 2021-04-13 深圳壹账通智能科技有限公司 House image verification method and device, computer equipment and storage medium
CN112580621B (en) * 2020-12-24 2022-04-29 成都新希望金融信息有限公司 Identity card copying and identifying method and device, electronic equipment and storage medium
CN113344000A (en) * 2021-06-29 2021-09-03 南京星云数字技术有限公司 Certificate copying and recognizing method and device, computer equipment and storage medium
CN113649422A (en) * 2021-06-30 2021-11-16 云南昆钢电子信息科技有限公司 Hot image-based rough rolling billet quality detection system and method
CN114120453A (en) * 2021-11-29 2022-03-01 北京百度网讯科技有限公司 Living body detection method and device, electronic equipment and storage medium
CN114529890B (en) * 2022-02-24 2025-09-23 讯飞智元信息科技有限公司 State detection method, device, electronic device and storage medium
CN114564964B (en) * 2022-02-24 2023-05-26 杭州中软安人网络通信股份有限公司 An Unknown Intent Detection Method Based on K-Nearest Neighbor Contrastive Learning

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037059A1 (en) * 2008-08-11 2010-02-11 General Electric Company System and method for forensic analysis of media works
US20160350336A1 (en) * 2015-05-31 2016-12-01 Allyke, Inc. Automated image searching, exploration and discovery
US20160358038A1 (en) * 2015-06-05 2016-12-08 Google Inc. Spatial transformer modules

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070140551A1 (en) * 2005-12-16 2007-06-21 Chao He Banknote validation
CN104008369A (en) * 2014-05-16 2014-08-27 四川大学 Method and device for recognizing authenticity of seal
TWI655587B (en) * 2015-01-22 2019-04-01 美商前進公司 Neural network and method of neural network training
CN105989330A (en) * 2015-02-03 2016-10-05 阿里巴巴集团控股有限公司 Picture detection method and apparatus
CN106156161A (en) * 2015-04-15 2016-11-23 富士通株式会社 Model Fusion method, Model Fusion equipment and sorting technique
TW201702937A (en) * 2015-07-02 2017-01-16 Alibaba Group Services Ltd Method and device for preprocessing images accurately identifies suitable color images for biometric color and avoids the use of the biometric color model on pseudo-color images that are unsuitable for the biometric color model
CN105118048B (en) * 2015-07-17 2018-03-27 北京旷视科技有限公司 Identification method and device for copied certificate picture
CN105844653B (en) * 2016-04-18 2019-07-30 深圳先进技术研究院 A multi-layer convolutional neural network optimization system and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037059A1 (en) * 2008-08-11 2010-02-11 General Electric Company System and method for forensic analysis of media works
US20160350336A1 (en) * 2015-05-31 2016-12-01 Allyke, Inc. Automated image searching, exploration and discovery
US20160358038A1 (en) * 2015-06-05 2016-12-08 Google Inc. Spatial transformer modules

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321964A (en) * 2019-07-10 2019-10-11 重庆电子工程职业学院 Identification model update method and relevant apparatus

Also Published As

Publication number Publication date
CN108460649A (en) 2018-08-28
TW201832138A (en) 2018-09-01
US20180239987A1 (en) 2018-08-23
TWI753039B (en) 2022-01-21

Similar Documents

Publication Publication Date Title
US20180239987A1 (en) Image recognition method and apparatus
CN109214973B (en) Method for generating countermeasure security carrier aiming at steganalysis neural network
JP6994588B2 (en) Face feature extraction model training method, face feature extraction method, equipment, equipment and storage medium
US10880299B2 (en) Machine learning for document authentication
CN110222573B (en) Face recognition method, device, computer equipment and storage medium
WO2021047482A1 (en) Method and system for performing steganographic technique
CN113837942A (en) Super-resolution image generation method, device, equipment and storage medium based on SRGAN
CN111339897B (en) Living body identification method, living body identification device, computer device, and storage medium
CN112381092A (en) Tracking method, device and computer readable storage medium
CN111784624A (en) Object detection method, apparatus, device, and computer-readable storage medium
KR20230040848A (en) Method and apparatus for detecting identity card
Sari et al. The effect of error level analysis on the image forgery detection using deep learning
CN111259792A (en) Face liveness detection method based on DWT-LBP-DCT feature
TWI803243B (en) Method for expanding images, computer device and storage medium
CN112101296B (en) Face registration method, face verification method, device and system
CN109829475B (en) Image dark watermark processing method and device based on deep learning
CN103927530A (en) Acquiring method, application method and application system of final classifier
Yu et al. A multi-task learning CNN for image steganalysis
CN114241493B (en) Training method and training device for training data of augmented document analysis model
CN113537145B (en) Method, device and storage medium for rapidly solving false detection and missing detection in target detection
CN106599841A (en) Full face matching-based identity verifying method and device
CN118230066A (en) Image classification method, image authentication method, device, medium, equipment and product
CN113870210B (en) Image quality assessment method, device, equipment and storage medium
CN112037113B (en) Airspace steganography enhancement method and device for image
CN111368644B (en) Image processing method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18757314

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18757314

Country of ref document: EP

Kind code of ref document: A1