Image recognition method, device and equipment based on content security, and storage medium
By extracting multi-scale texture features and texture correlations from images using a multi-scale texture perception model, the robustness and generalization of existing computer-generated image recognition methods are addressed, achieving efficient and accurate image recognition.
Patent Information
- Application Number
- CN202210752086.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-06-28
AI Technical Summary
In existing technologies, computer-generated image identification methods lack consideration for differences in feature details, resulting in poor model robustness and generalization, making it difficult to adapt to large-scale image datasets, and requiring a high level of expertise.
A multi-scale texture perception model is adopted to extract multi-scale texture features of the image to be identified, determine the texture correlation between any two channels, and perform image type identification by combining texture enhancement features and fusion features.
It improves the accuracy and robustness of image recognition, expands the applicability of the model, reduces the professional requirements, and enhances the ability to recognize detailed information in images.
Smart Images

Figure CN115311475B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer vision, and in particular to an image recognition method and device based on content security, equipment and a storage medium. BACKGROUND
[0002] Images are very powerful and effective tools for disseminating information due to their good dissemination portability and efficient information expression. With the rapid development of computer generation technology and generative adversarial networks, the distinction between computer-generated images (CG) and real images (PG) obtained by camera shooting is becoming smaller, which increases the risk of high-quality computer-generated images being maliciously used to harm information security and content security, for example, fake news generated by computer-generated images may cause public panic.
[0003] In the prior art, the identification technology of computer-generated images includes the following two types:
[0004] (1) A method based on manually designed features, which requires professional knowledge in the field of image authentication to design special feature extraction operators for specific tasks, and has high professional requirements. At the same time, this type of method is usually trained and learned on a small-scale data set, which is difficult to adapt to large-scale image data sets, and the robustness and generalization of the model are poor.
[0005] (2) A method based on deep learning, most of which directly uses the global visual features output by the last layer of the neural network for classification, lacking consideration of feature detail differences. SUMMARY
[0006] The present application provides an image recognition method and device based on content security, equipment and a storage medium to solve the defect of lacking consideration of feature detail differences in the prior art, combining multi-scale texture features and subtle differences between different channels of each feature to improve image classification accuracy, robustness and generalization.
[0007] The present application provides an image recognition method based on content security, comprising:
[0008] Obtaining an image to be identified;
[0009] Inputting the image to be identified into a multi-scale texture perception model to output an image classification result for representing whether the image is fake;
[0010] The multi-scale texture perception model is obtained by training based on image sample data and corresponding image classification labels, and the multi-scale texture perception model is used to perform classification on the image to be identified based on the correlation between any two channels of the multi-scale texture features of the image to be identified.
[0011] The image recognition method based on content security provided by the application inputs the image to be recognized into a multi-scale texture perception model, and outputs an image category recognition result for characterizing whether the image is fake.
[0012] The image to be recognized is input into the multi-scale texture perception model to obtain multi-scale texture features of the image to be recognized.
[0013] Based on at least two texture extraction networks, visual texture features of each scale texture feature are determined, and the visual texture features are used to characterize the correlation between any two channels of the each scale texture feature.
[0014] According to the visual texture features of the each scale texture feature, an image category recognition result for characterizing whether the image is fake is output.
[0015] According to the application, the visual texture features of each scale texture feature are determined based on at least two texture extraction networks in the multi-scale texture perception model, and the visual texture features of each scale texture feature are determined based on at least two texture extraction networks in the multi-scale texture perception model.
[0016] The each scale texture feature is input into the corresponding texture extraction network to obtain texture enhanced features of the each scale texture feature.
[0017] The texture enhanced features are input into a GRAM matrix in the multi-scale texture perception model to determine texture correlation values between any two channels of the texture enhanced features.
[0018] Based on the texture correlation values, the visual texture features of the each scale texture feature are determined, and the visual texture features of the each scale texture feature are the same in channel.
[0019] According to the application, the visual texture features of each scale texture feature are determined based on at least two texture extraction networks in the multi-scale texture perception model, and the visual texture features of each scale texture feature are determined based on at least two texture extraction networks in the multi-scale texture perception model.
[0020] The backbone network features of the each scale texture feature are determined.
[0021] The texture mask features of the each scale texture feature are determined, and the texture mask features are used to characterize the enhancement amplitude of the each scale texture feature.
[0022] The backbone network features and the texture mask features are weighted and fused to obtain texture enhanced features.
[0023] According to the image recognition method based on content security provided in the application, the visual texture features of the respective scale texture features are outputted to obtain an image category recognition result for representing whether the image is fake or not, which comprises the following steps:
[0024] The visual texture features are fused to obtain a fusion feature.
[0025] The image category recognition result is outputted based on the fusion feature.
[0026] According to the image recognition method based on content security provided in the application, the visual texture features are fused to obtain a fusion feature, which comprises the following steps:
[0027] The visual texture features are serially fused in the channel direction to obtain the fusion feature.
[0028] The application further provides an image recognition device based on content security, which comprises the following steps:
[0029] An acquisition module is configured to acquire an image to be recognized.
[0030] An output module is configured to input the image to be recognized into a multi-scale texture perception model and output an image category recognition result for representing whether the image is fake or not.
[0031] The multi-scale texture perception model is obtained based on image sample data and corresponding image category labels, and the multi-scale texture perception model is used to perform category recognition on the image to be recognized based on the correlation between any two channels of the multi-scale texture features of the image to be recognized.
[0032] The application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the image recognition method based on content security as described above.
[0033] The application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the image recognition method based on content security as described above.
[0034] The application further provides a computer program product comprising a computer program, wherein the computer program is executable on a processor to implement the image recognition method based on content security as described above.
[0035] The application provides a content security-based image recognition method, device, equipment and storage medium, which extracts multi-scale texture features of an image to be recognized, meets the scale requirements of different identification scenes, determines the texture correlation between any two channels of the features based on the multi-scale texture features, identifies the image to be recognized based on the texture correlation, further determines the detail information of the image to be recognized based on the underlying texture features of the image, ensures the rationality and accuracy of the multi-scale texture perception model in image recognition, and further improves the robustness and generalization. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0037] Figure 1 is one of the flowcharts of the content security-based image recognition method provided by the application;
[0038] Figure 2 is the second flowchart of the content security-based image recognition method provided by the application;
[0039] Figure 3 is the third flowchart of the content security-based image recognition method provided by the application;
[0040] Figure 4 is the structural schematic diagram of the content security-based image recognition device provided by the application;
[0041] Figure 5 is the structural schematic diagram of the electronic equipment provided by the application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the application more clear, the technical solutions in the application will be described clearly and completely in combination with the drawings in the application. Obviously, the described embodiments are some embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.
[0043] Images are very powerful and effective tools for disseminating information due to their good dissemination portability and efficient information expression. With the rapid development of computer generation technology and generative adversarial networks, the distinction between computer-generated images (CG) and real images (PG) obtained by camera shooting is becoming smaller, making high-quality computer-generated images maliciously used to harm information security and increase the risk of content security, for example, fake news made by computer-generated images may cause public panic.
[0044] In the prior art, the identification technology of computer-generated images includes the following two types:
[0045] (1) A method based on manually designed features, for example: after feature extraction of CG images based on first-order and high-order wavelet features, classification is performed by SVM; classification is performed using features generated from the histogram of data filtered by wavelet; classification of CG and PG images based on second-order difference statistics; after extracting features in the HSV color space, classification is performed using a Fisher linear discriminator (FLD); classification is performed based on a fusion system of geometric, wavelet and cartoon features; classification is performed based on residual patterns existing in the photography process of real images, etc. This type of method requires professional knowledge in the field of image authentication, and a special feature extraction operator needs to be designed for a specific task, which requires high professionalism. At the same time, this type of method is usually trained and learned on a small-scale data set, which is difficult to adapt to large-scale image data sets, and the robustness and generalization of the model are poor.
[0046] (2) A method based on deep learning, for example: using a shallow network to filter images and extract statistical features, and classifying CG and PG images based on a weighted voting mechanism; using a prediction error filter as the main filter and classifying CG and PG images based on a deep convolutional network for CG image forensics; classifying by establishing a six-layer neural network and using a local-to-global strategy; using a customized VGG-19 network as a feature extractor and classifying by statistical feature information; removing low-frequency signals from input images by multiple high-pass filters and classifying CG and PG images by a five-layer CNN; classifying by designing a seven-layer convolutional neural network and using a majority voting mechanism; designing a self-encoding module to preprocess images and using a CNN-based model to distinguish CG images and PG images. In the above methods, most of them directly use the global visual features output by the last layer of the neural network for classification, lacking consideration of the details of the features.
[0047] The following will be described in detail Figures 1-3 The image recognition method based on content security of the present application.
[0048] Figure 1is one of the flowcharts of the image recognition method based on content security provided by the present application, as shown in Figure 1 The method comprises the following steps.
[0049] Step 110: obtaining an image to be recognized.
[0050] Specifically, the image to be recognized can be an image that needs to be recognized in a network social media, and the category of the image to be recognized can be a computer-generated image or a real image.
[0051] Step 120: inputting the image to be recognized into a multi-scale texture perception model to output an image category recognition result for characterizing whether the image is fake.
[0052] The multi-scale texture perception model is obtained based on image sample data and corresponding image category labels, and is used to perform category recognition on the image to be recognized based on the correlation between any two channels of multi-scale texture features of the image to be recognized.
[0053] Specifically, in the deep learning-based method, most methods directly use the global visual features output by the last layer of the neural network for classification, and lack consideration of feature detail differences. Therefore, in the embodiment of the present application, after the image to be recognized is input into the multi-scale texture perception model, multi-scale texture features are extracted from the low-level texture features of the image to be recognized under different receptive fields, a plurality of detail information of the image to be recognized is obtained, the texture correlation between any two channels is determined based on the texture features of each scale, the texture features in different pixel space ranges are fused to obtain fused features, and the category of the image to be recognized is distinguished based on the fused features, thereby increasing the diversity of features and improving the image recognition accuracy and robustness.
[0054] Optionally, before step 120 is performed, a data set can be constructed in advance, and an initial multi-scale texture perception model constructed in advance is trained. According to the data use, the data set can be divided into a training set, a validation set and a test set, and the ratio of the training set, the validation set and the test set can be 7:1:2. The initial multi-scale texture perception model is trained through the training set, the test set is input into the multi-scale texture perception model for testing after the training is completed, and the image category recognition result output by the multi-scale texture perception model is verified through the validation set. The training set comprises computer-generated images, real images and corresponding image category labels. The image category label of the computer-generated image can be 1, and the image category label of the real image can be 0. Alternatively, the image category label of the computer-generated image can be 1, and the image category label of the real image can be -1, which is not limited in the embodiment of the present application.
[0055] It should be noted that in the training set, the number ratio of computer generated images and real images is as close to 1:1 as possible, so that the sample ratio in the training set is balanced, and the identification result of the image category is avoided from being deviated due to the high proportion of one kind of image, and the rationality and accuracy of the prediction of the multi-scale texture perception model are further ensured.
[0056] Optionally, after the training set is constructed, an initial multi-scale texture perception model is constructed, the initial multi-scale texture perception model comprising an input layer, a multi-scale feature extraction layer, a visual texture feature extraction layer, a feature fusion layer, a prediction layer and an output layer, wherein the training set is transmitted from the input layer to the multi-scale feature extraction layer, and texture features at multiple scales are extracted through convolution operation of different depths, and the multi-scale feature extraction layer can be a VGG-19 convolutional neural network, and can also be a VGG-16 convolutional neural network, and the embodiments of the present application do not limit this.
[0057] For example, taking VGG-19 as an example, the network structure of VGG-19 is: the first convolutional block contains two 3*3conv64, the second convolutional block contains two 3*3conv128, the third convolutional block contains four 3*3conv256, the fourth convolutional block contains four 3*3conv512, the fifth convolutional block contains four 3*3conv512 and three fully connected layers, low-order texture features can be extracted from the third convolutional block, medium-order texture features can be extracted from the fourth convolutional block, and high-order texture features can be extracted from the fifth convolutional block, and as the network depth deepens, the texture features are more abstract and detailed, further enriching the training set and improving the prediction accuracy.
[0058] Optionally, the visual texture feature extraction layer comprises at least two texture extraction networks, and the structures of the at least two texture extraction networks are the same, and after the texture features at each scale are input into the texture extraction network, they are calculated in two ways, one way is to output 64-channel backbone network features through 3*3conv64 convolution operation, and the other way is to determine texture mask features based on the similarity of each region of the image, which are used to represent the enhancement amplitude of the texture features at each scale, and the calculation formula of the texture mask features is shown as formula (1), and formula (1) is:
[0059]
[0060] wherein x i represents the feature vector of feature x at position i, x j represents the feature vector of feature x at position j, and f represents an inner product function for calculating the similarity between two feature vectors, and the correlation degree is normalized and subjected to a softmax function to obtain the corresponding texture mask feature.
[0061] It should be noted that the number of texture extraction networks is the same as the number of scales of the multi-scale texture features.
[0062] To avoid feature loss, the texture mask features and the backbone network features are weighted and fused to obtain texture enhanced features, which are input into the GRAM matrix to calculate the correlation between the feature channels. The correlation between any two channels of the features is calculated as shown in equation (2), and based on the correlation between any two channels of the features, a global correlation matrix spanning different feature channels is obtained, as shown in equation (3).
[0063] Equation (2) is:
[0064]
[0065] Equation (3) is:
[0066]
[0067] wherein, represents the feature value at the (q, r) position of the qth channel of the image feature f, c q,r is a feature value in the global correlation matrix, which reflects the correlation between the qth channel and the rth channel, and N represents the total number of channels. In the global correlation matrix, the diagonal items represent the intensity of different channel features, and the non-diagonal items represent the correlation between different feature channels. Through the global correlation matrix, the global texture features of the image can be effectively represented.
[0068] Optionally, through the above global correlation matrix, the texture correlation value between any two channels of the texture enhanced features can be obtained. The same number of visual texture features can be obtained through convolution operation, which is convenient for subsequent feature fusion. For example, the convolution operation can be two layers of convolution operation, the first layer is 3*3conv 32 convolution operation, and the second layer is 3*3conv 64 convolution operation. Finally, the visual texture features with 64 channels are output.
[0069] Optionally, the visual texture features output by the plurality of texture extraction networks are concatenated in the channel direction to obtain fused features. The fused features and the image category labels corresponding to the sample images are input into a prediction layer for learning. The prediction layer can be two convolution layers and one fully connected layer. Based on the difference between the predicted value and the true output value, a loss function is obtained, and through back propagation, the parameters of the initial multi-scale texture perception model are updated. The next training sample is continuously input for training until the loss function is minimized, and the trained multi-scale texture perception model is obtained.
[0070] Optionally, the loss function can be a cross-entropy function, which can represent the difference between the sample label distribution and the output image category recognition result distribution.
[0071] Optionally, Figure 2 is a second flowchart of the image recognition method based on content security provided by the present application, as shown in Figure 2 The image to be identified is input into the multi-scale texture perception model, and an image category recognition result for characterizing whether the image is fake is output, and specifically includes:
[0072] The image to be identified is input into the multi-scale texture perception model, and multi-scale texture features of the image to be identified are obtained;
[0073] Based on at least two texture extraction networks in the multi-scale texture perception model, visual texture features of each scale texture feature are determined, and the visual texture features are used to characterize the correlation between any two channels of the each scale texture feature;
[0074] According to the visual texture features of the each scale texture feature, an image category recognition result for characterizing whether the image is fake is output.
[0075] Specifically, after the multi-scale texture perception model is trained, the image to be identified is input into the multi-scale texture perception model for image category recognition. In order to obtain detailed information, texture features in different pixel space ranges, i.e. multi-scale texture features, are obtained in the embodiment of the present application, and each scale texture feature is input into a corresponding texture extraction network (TEN) to obtain visual texture features of different scales output by the texture extraction network, and image category recognition is performed based on the visual texture features to improve the recognition accuracy.
[0076] Optionally, Figure 3 is a third flowchart of the image recognition method based on content security provided by the present application, as shown in Figure 3 Based on at least two texture extraction networks in the multi-scale texture perception model, visual texture features of each scale texture feature are determined, and the visual texture features are used to characterize the correlation between any two channels of the each scale texture feature;
[0077] The each scale texture feature is input into a corresponding texture extraction network to obtain texture enhanced features of the each scale texture feature;
[0078] The texture enhanced features are input into a GRAM matrix in the multi-scale texture perception model to determine texture correlation values between any two channels of the texture enhanced features;
[0079] Based on the texture correlation values, visual texture features of the each scale texture feature are determined, and the visual texture features of the each scale texture feature have the same channel.
[0080] Specifically, in order to further construct the fused features, it is necessary to determine the visual texture features of the texture features of each scale through a texture extraction network, and in the embodiment of the present application, first, the texture enhancement features of the texture features of each scale are determined based on the similarity of each region of the image to be recognized, and the texture correlation value between any two channels is calculated through the GRAM matrix as shown in formula (2) - formula (3), and after convolution operation, the visual texture features with the same channel are output, which is convenient for subsequent feature fusion.
[0081] Optionally, as shown in formula (1), the texture extraction network comprises: Figure 3
[0082] determining the backbone network features of the texture features of each scale;
[0083] determining the texture mask features of the texture features of each scale, the texture mask features being used to represent the enhancement amplitude of the texture features of each scale;
[0084] weighting and fusing the backbone network features and the texture mask features to obtain the texture enhancement features.
[0085] Specifically, in the embodiment of the present application, after the texture features of each scale are input into the texture extraction network (TEN), they are calculated in two parallel ways, one way is to convert the texture features of different pixel ranges into 64-channel backbone network features through 3*3conv 64 convolution calculation, and the other way is to calculate the texture mask features based on the similarity of each region of the image to be recognized through formula (1), and then weighting and fusing the texture mask features and the backbone network features to obtain the texture enhancement features.
[0086] Optionally, the image category recognition result used to represent whether the image is fake is output according to the visual texture features of the texture features of each scale, comprising:
[0087] fusing the visual texture features to obtain fused features;
[0088] outputting the image category recognition result based on the fused features.
[0089] Specifically, in order to further improve the recognition efficiency, the visual texture features can be fused to obtain fused features, and the category recognition is performed based on the fused features, and at the same time, the number of channels of each visual texture feature is the same, which is convenient for feature fusion.
[0090] Optionally, the fusing the visual texture features to obtain fused features comprises:
[0091] concatenating the visual texture features in the channel direction to obtain the fused features.
[0092] Specifically, after the multi-scale texture features are calculated by the texture extraction network, they are all converted into 64-channel visual texture features containing different detail information, the visual texture features are spliced in the channel direction, and the fusion features are obtained, so as to facilitate subsequent prediction of the image category based on the fusion features. In addition, the construction module of the fusion features can be combined with other classifiers, that is, the construction module of the fusion features has good portability and can be widely applied to different classification models.
[0093] Optionally, the multi-scale texture features of the to-be-identified image are determined based on a convolutional neural network.
[0094] Specifically, the convolutional neural network can be VGG-19 or VGG-16, and the multi-scale texture features can be extracted from different convolutional blocks of the convolutional neural network, and the specific structure of the convolutional neural network is not limited in the embodiment of the application.
[0095] The image recognition method based on content security provided by the application can meet the scale requirements of different authentication scenes by extracting the multi-scale texture features of the to-be-identified image. In addition, after the multi-scale texture features are enhanced, the texture correlation between any two channels of the features is determined, the fusion features are obtained based on the texture correlation, and the to-be-identified image is identified based on the fusion features. Based on the bottom texture features of the image, the detail information of the to-be-identified image is further determined to ensure the rationality and accuracy of the multi-scale texture perception model for image recognition, further improve the robustness and generalization, filter the false images in the network based on the image category recognition result, and further reduce the risk of damaging information security. At the same time, the image recognition method based on content security provided by the application has low professional requirement for the model, and can further expand the use range.
[0096] The image recognition device based on content security provided by the application is described below, and the image recognition device based on content security described below can be correspondingly referred to the image recognition method based on content security described above.
[0097] Figure 4 is a structural schematic diagram of the image recognition device based on content security provided by the application, as Figure 4 shown, the image recognition device based on content security 200 comprises an acquisition module 201 and an output module 202, wherein:
[0098] The acquisition module 201 is used for acquiring a to-be-identified image.
[0099] The output module 202 is configured to input the to-be-identified image into the multi-scale texture perception model, and output an image category identification result for representing whether the image is fake.
[0100] The multi-scale texture perception model is obtained by training based on image sample data and corresponding image category labels, and is used for performing category identification on the to-be-identified image based on the correlation between any two channels of the multi-scale texture features of the to-be-identified image.
[0101] The image identification method, device, equipment and storage medium based on content security provided by the application can meet the scale requirement of different identification scenes by extracting the multi-scale texture features of the to-be-identified image. In addition, the texture correlation between any two channels of the features is determined based on the multi-scale texture features, and the category identification is performed on the to-be-identified image based on the texture correlation. The details of the to-be-identified image are further determined based on the bottom texture features of the image, so that the rationality and accuracy of the multi-scale texture perception model for image identification are ensured, and the robustness and generalization are further improved.
[0102] Optionally, the output module 202 is specifically configured to:
[0103] input the to-be-identified image into the multi-scale texture perception model to obtain the multi-scale texture features of the to-be-identified image;
[0104] determine visual texture features of the multi-scale texture features based on at least two texture extraction networks in the multi-scale texture perception model, wherein the visual texture features are used to represent the correlation between any two channels of the multi-scale texture features;
[0105] output an image category identification result for representing whether the image is fake according to the visual texture features of the multi-scale texture features.
[0106] Optionally, the output module 202 is specifically configured to:
[0107] input the multi-scale texture features into corresponding texture extraction networks to obtain texture enhanced features of the multi-scale texture features;
[0108] input the texture enhanced features into a GRAM matrix in the multi-scale texture perception model to determine texture correlation values between any two channels of the texture enhanced features;
[0109] determine visual texture features of the multi-scale texture features based on the texture correlation values, wherein the visual texture features of the multi-scale texture features are the same in channel.
[0110] Optionally, the output module 202 is specifically configured to:
[0111] Determine the backbone network features of the texture features at each scale;
[0112] Determine the texture mask features for each scale of texture features, wherein the texture mask features are used to characterize the enhancement magnitude of each scale of texture features;
[0113] The backbone network features and the texture mask features are weighted and fused to obtain texture enhancement features.
[0114] Optionally, the output module 202 is specifically used for:
[0115] The visual texture features described above are fused to obtain the fused features;
[0116] Based on the fusion features, the image type recognition result is output.
[0117] Optionally, the output module 202 is specifically used for:
[0118] The visual texture features are fused in series along the channel direction to obtain the fused feature.
[0119] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device 300 may include a processor 310, a communications interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communications interface 320, and the memory 330 communicate with each other via the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute a content-secure image recognition method, which includes:
[0120] Acquire the image to be recognized;
[0121] The image to be identified is input into a multi-scale texture perception model, which outputs an image type identification result that characterizes whether the image is forged.
[0122] The multi-scale texture perception model is obtained by training based on image sample data and corresponding image category labels. The multi-scale texture perception model is used to identify the category of the image to be identified based on the correlation between any two channels of the multi-scale texture features of the image to be identified.
[0123] Further, the logic instructions in the memory 330 described above can be implemented in the form of software functional units and sold or used as standalone products, and can be stored in a computer readable storage medium. Based on such an understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0124] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, so that the computer can execute the content security-based image recognition method provided by the above-mentioned methods, and the method comprises:
[0125] obtaining an image to be recognized;
[0126] inputting the image to be recognized into a multi-scale texture perception model, and outputting an image category recognition result for representing whether the image is fake or not;
[0127] The multi-scale texture perception model is obtained based on image sample data and corresponding image category labels, and is used for performing category recognition on the image to be recognized based on the correlation between any two channels of multi-scale texture features of the image to be recognized.
[0128] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the content security-based image recognition method provided by the above-mentioned methods, and the method comprises:
[0129] obtaining an image to be recognized;
[0130] inputting the image to be recognized into a multi-scale texture perception model, and outputting an image category recognition result for representing whether the image is fake or not;
[0131] The multi-scale texture perception model is obtained by training based on image sample data and corresponding image category labels, and is used for category recognition of the to-be-identified image based on the correlation between any two channels of multi-scale texture features of the to-be-identified image.
[0132] The device embodiments described above are merely illustrative, wherein the units illustrated as separate components can or can not be physically separated, and the components illustrated as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0133] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary universal hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software product, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the method described in each embodiment or some parts of the embodiment.
[0134] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A content-security-based image recognition method, characterized in that, include: Acquire the image to be recognized; The image to be identified is input into a multi-scale texture perception model, which outputs an image type identification result that characterizes whether the image is forged. The multi-scale texture perception model is obtained by training based on image sample data and corresponding image category labels. The multi-scale texture perception model is used to identify the category of the image to be identified based on the correlation between any two channels of the multi-scale texture features of the image to be identified. The step of inputting the image to be identified into a multi-scale texture perception model and outputting an image type identification result to characterize whether the image is forged includes: The image to be identified is input into the multi-scale texture perception model to obtain the multi-scale texture features of the image to be identified; Based on at least two texture extraction networks in the multi-scale texture perception model, visual texture features of texture features at each scale are determined, and the visual texture features are used to characterize the correlation between any two channels of texture features at each scale. Based on the visual texture features of the texture features at each scale, output the image type identification result used to characterize whether the image is fake; The determination of visual texture features at each scale based on at least two texture extraction networks in the multi-scale texture perception model includes: The texture features at each scale are input into the corresponding texture extraction network to obtain the texture enhancement features at each scale. The texture enhancement feature is input into the GRAM matrix in the multi-scale texture perception model to determine the texture correlation value between any two channels of the texture enhancement feature. Based on the texture correlation value, the visual texture features of the texture features at each scale are determined, wherein the visual texture feature channels of the texture features at each scale are the same.
2. The content-security-based image recognition method according to claim 1, characterized in that, The step of inputting the texture features at each scale into the corresponding texture extraction network to obtain texture enhancement features at each scale includes: Determine the backbone network features of the texture features at each scale; Determine the texture mask features for each scale of texture features, wherein the texture mask features are used to characterize the enhancement magnitude of each scale of texture features; The backbone network features and the texture mask features are weighted and fused to obtain texture enhancement features.
3. The content-security-based image recognition method according to claim 1, characterized in that, The step of outputting an image type identification result to characterize whether an image is forged, based on the visual texture features of the texture features at each scale, includes: The visual texture features described above are fused to obtain the fused features; Based on the fusion features, the image type recognition result is output.
4. The content-security-based image recognition method according to claim 3, characterized in that, The step of fusing the visual texture features to obtain fused features includes: The visual texture features are fused in series along the channel direction to obtain the fused feature.
5. An apparatus for implementing the content-secure image recognition method according to any one of claims 1-4, characterized in that, include: The acquisition module is used to acquire the image to be recognized; The output module is used to input the image to be identified into the multi-scale texture perception model and output the image type identification result that characterizes whether the image is forged. The multi-scale texture perception model is obtained by training based on image sample data and corresponding image category labels. The multi-scale texture perception model is used to identify the category of the image to be identified based on the correlation between any two channels of the multi-scale texture features of the image to be identified.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the content-secure image recognition method as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the content-secure image recognition method as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the content-secure image recognition method as described in any one of claims 1 to 4.