Image recognition method, device, electronic device and readable storage medium

By combining the recognition method of global noise and key area noise in the image recognition model, the problem of image tampering recognition is solved, and the accurate recognition of image tampering areas is achieved, and the security and reliability of the image are improved.

CN114612686BActive Publication Date: 2025-04-29CHUANGXIN QIZHI (CHONGQING) TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210392880.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2025-04-29
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify whether images have been tampered with, resulting in criminals using tampered images to conduct illegal activities.

Method used

An image recognition method is adopted to identify the tampered area in the image through a preset image recognition model. The model includes a tampering area identification backbone network, a global noise extraction branch network, and a critical area noise extraction branch network, and uses global noise and critical area noise for identification.

Benefits of technology

It can accurately identify the tampered area in the image, effectively prevent illegal elements from using the tampered image to engage in illegal activities, and improve the security and reliability of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114612686B_ABST
    Figure CN114612686B_ABST
Patent Text Reader

Abstract

The present application provides an image recognition method, device, electronic device and readable storage medium. The method includes: obtaining an image to be recognized; identifying the tampered area in the image to be recognized by using a preset image recognition model; wherein the preset image recognition model includes a tampered area recognition backbone network, a global noise extraction branch network and a key area noise extraction branch network, the global noise extraction branch network is used to extract the global noise of the image to be recognized, the key area noise extraction branch network is used to extract the key area noise of the image to be recognized, and the tampered area recognition backbone network is used to identify the tampered area in the image to be recognized according to the global noise and the key area noise, so as to be able to identify whether the image has been tampered with.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular, to an image recognition method, device, electronic device and readable storage medium. Background Art

[0002] With the continuous development of science and technology, images are becoming an important information carrier in all walks of life. For example, in the judicial field, images of judicial files carrying information such as prosecution opinions and appraisal reports are required. In the field of intelligent claims, images of medical invoices carrying information such as the amount of claims are required. However, in actual applications, criminals may tamper with images and then illegally use the tampered images. Therefore, it is necessary to identify whether the image has been tampered with. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide an image recognition method, device, electronic device and readable storage medium to solve the problems in the prior art.

[0004] A first aspect of an embodiment of the present application provides an image recognition method, comprising:

[0005] Obtain an image to be recognized;

[0006] The tampered area in the image to be identified is identified through a preset image recognition model; wherein the preset image recognition model includes a tampered area identification backbone network, a global noise extraction branch network and a key area noise extraction branch network, the global noise extraction branch network is used to extract the global noise of the image to be identified, the key area noise extraction branch network is used to extract the key area noise of the image to be identified, and the tampered area identification backbone network is used to identify the tampered area in the image to be identified based on the global noise and the key area noise.

[0007] In one embodiment, the tampered region identification backbone network specifically includes a feature map extraction layer, a suspected tampered region recommendation layer, a pooling layer and an output layer; and,

[0008] The tampered region identification backbone network is used to identify the tampered region in the image to be identified according to the global noise and the key region noise, specifically including:

[0009] The feature map extraction layer is used to extract the feature map of the image to be recognized;

[0010] The suspected tampering region recommendation layer is used to determine a plurality of suspected tampering regions according to the feature map;

[0011] The pooling layer is used to perform pooling processing on the feature map, each suspected tampering area, the global noise and the key area noise;

[0012] The output layer is used to output the recognition result of the tampered area in the image to be recognized according to the result of the pooling processing.

[0013] In one embodiment, the tampered region identification backbone network specifically includes a Faster R-CNN network;

[0014] The feature map extraction layer specifically includes a convolutional layer;

[0015] The suspected tampering area recommendation layer specifically includes a region recommendation network RPN; and

[0016] The pooling layer specifically includes a ROI pooling layer.

[0017] In one embodiment, the global noise extraction branch network specifically includes: a filter layer and a global noise extraction layer; and,

[0018] The global noise extraction branch network is used to extract the global noise of the image to be recognized, and specifically includes:

[0019] The filter layer is used to generate an intrinsic pattern noise feature map according to the image to be recognized;

[0020] The global noise extraction layer is used to extract the global noise of the image to be identified according to the intrinsic pattern noise feature map.

[0021] In one embodiment, the key area noise extraction branch network specifically includes: an image segmentation layer, a color space conversion layer, a key area identification layer and a key area noise extraction layer; and,

[0022] The key area noise extraction branch network is used to extract the key area noise of the image to be identified, specifically including:

[0023] The image segmentation layer is used to obtain a plurality of block images by segmenting the image to be identified;

[0024] The color space conversion layer is used to convert the color space of each block image to obtain a plurality of second block images accordingly;

[0025] The key area identification layer is used to identify the key blocks by comparing each block image with the corresponding second block image;

[0026] The noise extraction layer is used to extract the key area noise of the key block.

[0027] In one embodiment, each block image is compared with the corresponding second block image to identify the key block, which specifically includes:

[0028] For each block image, a key block is identified according to a difference between a variance of pixel values ​​of the block image and a variance of pixel values ​​of a corresponding second block image.

[0029] In one embodiment, the method further includes: pre-training to obtain the preset image recognition model.

[0030] A second aspect of an embodiment of the present application provides an image recognition device, including:

[0031] An acquisition unit, used for acquiring an image to be recognized;

[0032] A tampered region identification unit, used to identify the tampered region in the image to be identified through a preset image recognition model; wherein the preset image recognition model includes a tampered region identification backbone network, a global noise extraction branch network and a key area noise extraction branch network, the global noise extraction branch network is used to extract the global noise of the image to be identified, the key area noise extraction branch network is used to extract the key area noise of the image to be identified, and the tampered region identification backbone network is used to identify the tampered region in the image to be identified based on the global noise and the key area noise.

[0033] A third aspect of the embodiments of the present application provides an electronic device, including:

[0034] Memory for storing computer programs;

[0035] A processor is used to execute the method of the first aspect of the embodiment of the present application and any embodiment thereof.

[0036] A fourth aspect of an embodiment of the present application provides a readable storage medium, including: a program, which, when executed on an electronic device, enables the electronic device to execute a method in any embodiment of the present application.

[0037] By using the image method provided in the embodiment of the present application, after acquiring the image to be identified, the global noise of the image to be identified can be extracted through the global noise extraction branch network in the preset image recognition model, and the key area noise of the image to be identified can be extracted through the key area noise extraction branch network in the preset image recognition model. Then, the tampered area identification backbone network in the preset image recognition model identifies the tampered area in the image to be identified based on the global noise and the key area noise, so that it can be used to identify whether the image has been tampered with. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A schematic diagram of a specific structure of an electronic device provided in one embodiment of the present application;

[0040] Figure 2 A schematic diagram of a specific flow chart of an image recognition method provided in one embodiment of the present application;

[0041] Figure 3 A schematic diagram of a specific structure of a model structure of a preset image recognition model provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of the specific structure of an image recognition device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the present application, the terms "first", "second" and the like are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0044] As mentioned above, images are increasingly becoming an important information carrier in all walks of life. For example, in the judicial field, images of judicial files carrying information such as prosecution opinions and appraisal reports are required. In the field of intelligent claims, images of medical invoices carrying information such as the amount of claims are required. However, in actual applications, criminals may tamper with images and then illegally use the tampered images. Therefore, it is necessary to identify whether the image has been tampered with.

[0045] Based on this, an embodiment of the present application provides an electronic device. Figure 1 The electronic device 1 is a schematic diagram of a specific structure. The electronic device 1 includes: at least one processor 11 and a memory 12, Figure 1 A processor is used as an example. The processor 11 and the memory 12 may be connected via a bus 10, and the memory 12 stores instructions executable by the processor 11, and the instructions are executed by the processor 11, so that the electronic device 1 can execute all or part of the process of the method in the following embodiment.

[0046] In practical applications, the electronic device 1 may be a mobile phone, a tablet computer, a laptop computer, a desktop computer, or a large server or server cluster composed thereof.

[0047] like Figure 2 The image recognition method provided by an embodiment of the present application is shown, and the tampered area in the image can be identified by the method. Some or all steps of the method can be Figure 1 The method is performed by the electronic device 1 shown. The method comprises the following steps:

[0048] Step S21: Acquire the image to be recognized.

[0049] The image to be identified may be a judicial file image, a medical invoice image, a scene or a person image, a commodity image or other types of images, which are not limited here. For example, when it is necessary to identify whether an image has been tampered with, the image can be used as the image to be identified, so that the tampered area in the image can be identified by the method provided in the embodiment of the present application. When the tampered area is identified, it means that the image has been tampered with, or when the tampered area is not identified, it means that the image has not been tampered with.

[0050] In practical applications, there are many ways to obtain the image to be identified. For example, when it is necessary to identify whether each image stored in an image library has been tampered with, an image can be randomly obtained from the image library as the image to be identified, or an image can be obtained from the image library in a preset order (for example, the order of image file size, the order of image generation time, etc.) as the image to be identified.

[0051] In addition, in order to facilitate the identification of whether each image in the image library has been tampered with, a scheduled task can be constructed for each image, and the scheduled task includes a corresponding image identifier, which can be the name of the image or other information that can uniquely identify a certain image. In this way, when a scheduled task is triggered, the corresponding image can be obtained from the image library according to the image identifier in the scheduled task as the image to be identified.

[0052] Step S22: Identify the tampered area in the image to be identified by using a preset image recognition model.

[0053] In step S22, the image to be identified may be input into a preset image recognition model, so that the tampered area in the image to be identified is detected by the preset image recognition model.

[0054] In practical applications, the preset image recognition model can be a deep neural network model, a convolutional neural network model, or other types of models.

[0055] In one embodiment, the preset image recognition model may include a tampered area identification backbone network, a global noise extraction branch network and a key area noise extraction branch network, wherein the global noise extraction branch network can be used to extract the global noise of the image to be identified, the key area noise extraction branch network can be used to extract the key area noise of the image to be identified, and the tampered area identification backbone network can be used to identify the tampered area in the image to be identified based on the global noise and the key area noise.

[0056] In this way, in the process of identifying the tampered area in the image to be identified through a preset image recognition model, the global noise of the image to be identified can be extracted through the global noise extraction branch network, and the key area noise of the image to be identified can be extracted through the key area noise extraction branch network. Then, the tampered area identification backbone network identifies the tampered area in the image to be identified based on the global noise and the key area noise, so that it can be used to identify whether the image has been tampered with.

[0057] In practical applications, there is usually image noise in the image, that is, unnecessary or redundant interference information in the image. In this way, when an image is tampered with, the noise in the tampered area will be inconsistent with the noise in the untampered area. The present application combines the two perspectives of global noise and key area noise to measure the noise in the image to be identified, so as to identify whether the image to be identified has been tampered with. Among them, the global noise reflects the interference information of the image to be identified as a whole from the perspective of the image as a whole; the key area noise reflects the interference information of the key area of ​​the image to be identified from the perspective of the key area of ​​the image.

[0058] like Figure 3 The figure shows a structural schematic diagram of a preset image recognition model in an actual application, in which the preset image recognition model includes: a tampered area recognition backbone network 31, a global noise extraction branch network 32 and a key area noise extraction branch network 33, and the tampered area recognition backbone network 31 includes a feature map extraction layer 311, a suspected tampered area recommendation layer 312, a pooling layer 313 and an output layer 314.

[0059] In this Figure 3In the preset image recognition model shown, the feature map extraction layer 311 is connected to the suspected tampered region recommendation layer 312 and the pooling layer 313, the suspected tampered region recommendation layer 312 is also connected to the pooling layer 313, the pooling layer 313 is connected to the output layer 314, and the global noise extraction branch network 32 and the key area noise extraction branch network 33 are both connected to the pooling layer 313. In this way, after the image to be identified is input into the global noise extraction branch network 32, the key area noise extraction branch network 33 and the feature map extraction layer 311, the output result of the feature map extraction layer 311 is input into the suspected tampered region recommendation layer 312 and the pooling layer 313, the output result of the suspected tampered region recommendation layer 312 is also input into the pooling layer 313, and the output results of the global noise extraction branch network 32 and the key area noise extraction branch network 33 are also input into the pooling layer 313, the output result of the pooling layer 313 is input into the output layer 314, and the final recognition result is output through the output layer 314, that is, the tampered area in the image to be identified is identified.

[0060] Among them, the feature map extraction layer 311 can be used to extract the feature map of the image to be identified; the suspected tampering area recommendation layer 312 can be used to determine multiple suspected tampering areas based on the feature map; the pooling layer 313 is used to pool the feature map, each suspected tampering area, global noise and key area noise; the output layer 314 is used to output the identification result of the tampering area in the image to be identified based on the result of the pooling processing of the pooling layer 313.

[0061] In practical applications, the tampered region identification backbone network 31 can specifically be a Faster R-CNN network; thus, the feature map extraction layer 311 can be a convolutional layer (conv layers) in the Faster R-CNN network; the suspected tampered region recommendation layer 312 can specifically be a region recommendation network RPN (Region Proposal Network) in the Faster R-CNN network; and the pooling layer 313 can be a ROI pooling layer (Region of Interest Pooling) in the Faster R-CNN network.

[0062] The convolution layer may include multiple convolution kernels (conv), multiple activation layers (Relu) and multiple pooling layers (pooling). For example, the convolution layer may include 13 conv, 13 Relu and 4 pooling layers, and the convolution layer is formed by the arrangement and combination of these conv, Relu and pooling.

[0063] The region recommendation network RPN can determine multiple suspected tampering regions based on the feature map extracted by the convolution layer. Specifically, the region recommendation network RPN first maps the feature map to generate a probability value and multiple (for example, 4) coordinate values. The probability value reflects the probability of the existence of a suspected tampering region in the image to be identified, and each coordinate value is used to regress and define the position of the suspected tampering region in the image to be identified; then, the probability value and coordinate value are used to determine multiple suspected tampering regions.

[0064] Of course, after determining a plurality of suspected tampering regions, a detection frame may be set at the edge of each suspected tampering region to mark each suspected tampering region.

[0065] In the preset image recognition model provided in the embodiment of the present application, the global noise extraction branch network 32 may specifically include a filter layer 321 and a global noise extraction layer 322. The filter layer 321 can be used to generate an intrinsic pattern noise feature map according to the image to be recognized, such as converting the image to be recognized into an intrinsic pattern noise feature map; wherein the intrinsic pattern noise feature map is an image containing the intrinsic pattern noise in the image to be recognized. Intrinsic pattern noise is the noise generated in the image due to the inherent defects of the production process of the sensor of the image acquisition device (the image to be recognized is acquired by the image acquisition device). The main component of the intrinsic pattern noise is the photo response non-uniformity (PRNU, Photo Response Non-Uniformity) feature.

[0066] The global noise extraction layer 322 is connected to the filter layer 321, and can be used to extract the global noise of the image to be identified according to the inherent pattern noise feature map, and use the global noise as the output result of the global noise extraction branch network 32, and input it to the pooling layer 313. In practical applications, the global noise extraction layer 322 can be a deep neural network model, for example, the inherent pattern noise feature map is input into the deep neural network model, so as to obtain the output of the deep neural network model, that is, the global noise of the image to be identified.

[0067] It should be noted that, in the preset image recognition model, the key area noise extraction branch network 33 may include an image segmentation layer 331, a color space conversion layer 332, a key area recognition layer 333 and a key area noise extraction layer 334. Among them, the image segmentation layer 331 can be used to obtain a plurality of block images by segmenting the image to be recognized. For example, the image to be recognized can be segmented in a 3*3 or 4*4 manner to obtain 9 or 16 block images. Of course, other methods can also be used to segment the image to be recognized; after the image segmentation layer 331 obtains a plurality of block images by segmentation, each block image is input as an output result to the color space conversion layer 332 and the key area recognition layer 333.

[0068] The color space conversion layer 332 can be used to convert the color space of each block image, such as converting each block image from the current color space to the target color space, the current color space can be an RGB color space, and the target color space can be a grayscale color space. After the color space conversion layer 332 converts the color space of each block image, each block image after color space conversion is obtained, and the image is used as the output result of the color space conversion layer 332 and input into the key area identification layer 333.

[0069] After obtaining the output results of the image segmentation layer 331 and the color space conversion layer 332, the key area identification layer 333 can identify the key blocks by comparing each block image with the corresponding block image after color space conversion (referred to as the second block image).

[0070] For example, the image segmentation layer 331 segments the image to be identified in a 3*3 manner to obtain 9 block images, and the 9 block images are input into the color space conversion layer 332 and the key area identification layer 333; then, the color space conversion layer 332 converts the color space of the 9 block images, thereby obtaining 9 second block images after color space conversion; the key area identification layer 333 compares the 9 block images with the corresponding second block images respectively, thereby identifying the key blocks.

[0071] Compared with the specific comparison method, for example, for each block image in each block image, the pixel value (which may be a brightness value, an RGB value or a grayscale value, etc.) of each pixel point in the block image may be counted, and then the variance of the pixel value of the block image is calculated; correspondingly, for the second block image corresponding to the block image, the pixel value of each pixel point in the second block image may also be counted, and then the variance of the pixel value of the second block image is calculated; then the difference between the variance of the pixel value of the block image and the variance of the pixel value of the second block image is calculated, and the larger the absolute value of the difference is, the greater the influence of the color space conversion on the block image is, and it also reflects that the block image is more likely to be tampered with.

[0072] In this way, for the multiple block images segmented by the image segmentation layer 331, one or more block images with the largest absolute value of difference can be identified as the key block based on the difference between the variance of the pixel values ​​of the block images and the variance of the pixel values ​​of the corresponding second block image, or one or more block images with the absolute value of difference greater than a preset threshold can be identified as the key block.

[0073] After the key area identification layer 333 identifies the key area, the key area noise extraction layer 334 can be used to extract the noise of the key area, that is, the key area noise. The specific method of extracting the noise of the key area by the key area noise extraction layer 334 can be to first obtain each block image corresponding to the key area, and then for each block image, calculate the difference between the pixel value of the block image and the pixel value of the corresponding second block image, so as to obtain the noise of the key area.

[0074] It should be further explained that the above-mentioned pooling layer 313 can be used to perform pooling processing on the feature map, each suspected tampering area, global noise and key area noise, and then the output layer 314 is used to output the recognition result of the tampered area in the image to be identified based on the result of the pooling processing of the pooling layer 313. In practical applications, in order to improve the accuracy of the recognition results, an attention mechanism can be further introduced into the preset image recognition model, such as strengthening the global noise and key area noise in a dynamic weighted manner (increasing the weights of the global noise and the key area noise), and then the pooling layer 313 can pool the features of the entire image to obtain a feature vector. The feature vector carries spatial position information, and cross entropy is used as the loss function for classification.

[0075] In practical applications, the method provided in the embodiment of the present application may further include: pre-training the preset image recognition model, so that the preset image recognition model can be used to identify the tampered area in the image to be identified.

[0076] Among them, the specific training method for the preset image recognition model can be: first use the image recognition model to be trained to process the target sample to obtain a recognition result, then compare the recognition result with the annotation in the target sample to determine the loss function, and then use the back propagation of the loss function to train the image recognition model to be trained until the recognition result converges, thereby obtaining the final image recognition model as the preset image recognition model.

[0077] The target sample can be obtained from the training set. Usually, after obtaining the target sample from the training set, it can be input into the image recognition model to be trained, so as to process the target sample using the image recognition model to be trained, and then obtain the recognition result and loss function. The training set can include multiple samples, and these samples may include or exclude tampered areas. For samples including tampered areas, information such as the location of the tampered areas in the samples can also be annotated.

[0078] When obtaining the target sample from the training set and then inputting it into the image recognition model to be trained, one of the samples in the training set can be randomly obtained as the target sample and then input into the image recognition model to be trained. Alternatively, samples can be obtained from the training set as the target sample according to a certain preset acquisition rule and then input into the image recognition model to be trained. For example, in the case of an imbalance between positive and negative samples, the number of times the samples with a smaller proportion are obtained needs to be appropriately increased.

[0079] In addition, in order to improve the training efficiency of the model, multiple samples can usually be obtained from the training set in the form of batches, so that the obtained samples are regarded as a batch and then input into the image recognition model to be trained. At this time, the target sample can be one or more samples in the batch.

[0080] Based on the same inventive concept as the image recognition method provided in the embodiment of the present application, the embodiment of the present application also provides an image recognition device. For the specific content of the device embodiment, if there is any unclear point, please refer to the above method embodiment. Figure 4 As shown, the device 40 includes an acquisition unit 401 and a tampered area identification unit 402, wherein:

[0081] An acquisition unit 401 is used to acquire an image to be recognized;

[0082] The tampered area identification unit 402 is used to identify the tampered area in the image to be identified through a preset image recognition model; wherein the preset image recognition model includes a tampered area identification backbone network, a global noise extraction branch network and a key area noise extraction branch network, the global noise extraction branch network is used to extract the global noise of the image to be identified, the key area noise extraction branch network is used to extract the key area noise of the image to be identified, and the tampered area identification backbone network is used to identify the tampered area in the image to be identified based on the global noise and the key area noise.

[0083] The device 40 provided in the embodiment of the present application is adopted. Since the device 40 adopts the same inventive concept as the image recognition method provided in the embodiment of the present application, on the premise that the image recognition method can solve the technical problem, the device 40 can also solve the technical problem, which will not be repeated here.

[0084] In addition, in practical applications, the technical effects achieved by combining the device 40 with specific hardware equipment are also within the scope of protection of the present application, such as using a distributed cluster to deploy different units in the device 40 in different servers in the distributed cluster, thereby improving model training efficiency.

[0085] In practical applications, the tampered area identification backbone network specifically includes a feature map extraction layer, a suspected tampered area recommendation layer, a pooling layer and an output layer; and the tampered area identification backbone network is used to identify the tampered area in the image to be identified based on the global noise and the key area noise, and may specifically include: the feature map extraction layer, used to extract the feature map of the image to be identified; the suspected tampered area recommendation layer, used to determine multiple suspected tampered areas based on the feature map; the pooling layer, used to pool the feature map, each suspected tampered area, the global noise and the key area noise; the output layer, used to output the identification result of the tampered area in the image to be identified based on the result of the pooling processing.

[0086] The tampered area identification backbone network specifically includes a Faster R-CNN network; the feature map extraction layer specifically includes a convolutional layer; the suspected tampered area recommendation layer specifically includes a region recommendation network RPN; and the pooling layer specifically includes a ROI pooling layer.

[0087] The global noise extraction branch network specifically includes: a filter layer and a global noise extraction layer; and the global noise extraction branch network is used to extract the global noise of the image to be identified, and may specifically include: the filter layer, which is used to generate an inherent pattern noise feature map according to the image to be identified; the global noise extraction layer, which is used to extract the global noise of the image to be identified according to the inherent pattern noise feature map.

[0088] The key area noise extraction branch network is used to extract the key area noise of the image to be identified, and may specifically include: an image segmentation layer, a color space conversion layer, a key area identification layer and a key area noise extraction layer; and the key area noise extraction branch network is used to extract the key area noise of the image to be identified, and specifically includes: the image segmentation layer is used to obtain a plurality of block images by segmenting the image to be identified; the color space conversion layer is used to convert the color space of each block image, and correspondingly obtain a plurality of second block images;

[0089] The key area identification layer is used to identify the key blocks by comparing each block image with the corresponding second block image; the noise extraction layer is used to extract the key area noise of the key blocks.

[0090] Identifying the key block by comparing each block image with the corresponding second block image may specifically include: for each block image, identifying the key block according to the difference between the variance of the pixel value of the block image and the variance of the pixel value of the corresponding second block image.

[0091] The device 40 also includes a model training unit for pre-training to obtain the preset image recognition model.

[0092] The embodiment of the present application also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the training method provided in the embodiment of the present application, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0093] The embodiment of the present invention also provides a non-transitory electronic device readable storage medium, including: a program, when it is run on an electronic device, the electronic device can execute all or part of the process of the method in the above embodiment. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated: HDD) or a solid-state drive (SSD), etc. The storage medium can also include a combination of the above types of memory.

[0094] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. An image recognition method, characterized in that: include: Obtain an image to be recognized; Identify the tampered area in the image to be identified by a preset image recognition model; wherein the preset image recognition model includes a tampered area identification backbone network, a global noise extraction branch network and a key area noise extraction branch network, the global noise extraction branch network is used to extract the global noise of the image to be identified, the key area noise extraction branch network is used to extract the key area noise of the image to be identified, and the tampered area identification backbone network is used to identify the tampered area in the image to be identified according to the global noise and the key area noise; Among them, an attention mechanism is introduced into the preset image recognition model to increase the weights of global noise and key area noise in a dynamic weighted manner.

2. The method according to claim 1, characterized in that The tampered region identification backbone network specifically includes a feature map extraction layer, a suspected tampered region recommendation layer, a pooling layer, and an output layer; and, The tampered region identification backbone network is used to identify the tampered region in the image to be identified according to the global noise and the key region noise, specifically including: The feature map extraction layer is used to extract the feature map of the image to be recognized; The suspected tampering region recommendation layer is used to determine a plurality of suspected tampering regions according to the feature map; The pooling layer is used to perform pooling processing on the feature map, each suspected tampering area, the global noise and the key area noise; The output layer is used to output the recognition result of the tampered area in the image to be recognized according to the result of the pooling processing.

3. The method according to claim 2, characterized in that The tampered area identification backbone network specifically includes a Faster R-CNN network; The feature map extraction layer specifically includes a convolutional layer; The suspected tampering area recommendation layer specifically includes a region recommendation network RPN; and The pooling layer specifically includes a ROI pooling layer.

4. The method according to claim 1, characterized in that: The global noise extraction branch network specifically includes: a filter layer and a global noise extraction layer; and, The global noise extraction branch network is used to extract the global noise of the image to be recognized, and specifically includes: The filter layer is used to generate an intrinsic pattern noise feature map according to the image to be recognized; The global noise extraction layer is used to extract the global noise of the image to be identified according to the intrinsic pattern noise feature map.

5. The method according to claim 1, characterized in that The key area noise extraction branch network specifically includes: an image segmentation layer, a color space conversion layer, a key area recognition layer and a key area noise extraction layer; and, The key area noise extraction branch network is used to extract the key area noise of the image to be identified, specifically including: The image segmentation layer is used to obtain a plurality of block images by segmenting the image to be identified; The color space conversion layer is used to convert the color space of each block image to obtain a plurality of second block images accordingly; The key area identification layer is used to identify the key blocks by comparing each block image with the corresponding second block image; The noise extraction layer is used to extract the key area noise of the key block.

6. The method according to claim 5, characterized in that By comparing each block image with the corresponding second block image, the key block is identified, which specifically includes: For each block image, a key block is identified according to a difference between a variance of pixel values ​​of the block image and a variance of pixel values ​​of a corresponding second block image.

7. The method according to claim 1, characterized in that The method further includes: pre-training to obtain the preset image recognition model.

8. An image recognition device, characterized in that: include: An acquisition unit, used for acquiring an image to be recognized; a tampered region identification unit, configured to identify the tampered region in the image to be identified by using a preset image recognition model; wherein the preset image recognition model comprises a tampered region identification backbone network, a global noise extraction branch network, and a key region noise extraction branch network, wherein the global noise extraction branch network is configured to extract the global noise of the image to be identified, the key region noise extraction branch network is configured to extract the key region noise of the image to be identified, and the tampered region identification backbone network is configured to identify the tampered region in the image to be identified based on the global noise and the key region noise; Among them, an attention mechanism is introduced into the preset image recognition model to increase the weights of global noise and key area noise in a dynamic weighted manner.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the method according to any one of claims 1 to 8.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image tamper detection method, electronic device and readable storage medium

    CN107657259A

  • Image tampering detection method based on Mask R-CNN

    CN111340784A

  • Image falsification detection device, method, and program

    JP2014010736A