CN117830710A - Image detection method, device, equipment and storage medium - Google Patents

Image detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN117830710A
CN117830710A CN202311808631.1A CN202311808631A CN117830710A CN 117830710 A CN117830710 A CN 117830710A CN 202311808631 A CN202311808631 A CN 202311808631A CN 117830710 A CN117830710 A CN 117830710A
Authority
CN
China
Prior art keywords
image
module
sub
filtering
detected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311808631.1A
Other languages
Chinese (zh)
Inventor
张帆
陈晓鸿
罗毅豪
董灿佳
黄华新
吴志强
罗朝彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202311808631.1A priority Critical patent/CN117830710A/en
Publication of CN117830710A publication Critical patent/CN117830710A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses an image detection method, an image detection device, an image detection equipment and a storage medium, wherein the method comprises the following steps: acquiring an image to be detected submitted during online business handling; inputting an image to be detected into a preset feature extraction network to obtain target image features, wherein the preset feature extraction network comprises a high-frequency filtering module, and the high-frequency filtering module obtains different types of high-frequency information of the image by setting different filtering parameters; and classifying the sources of the images to be detected according to the characteristics of the target images to obtain source detection results of the images to be detected. According to the embodiment, the high-frequency filtering module is introduced into the preset feature extraction network, and different types of high-frequency detail information of the image to be detected is obtained by setting different filtering parameters in the high-frequency filtering module, so that the expression capability of the extracted image features is improved, and the accuracy of the finally obtained source detection result of the image to be detected is further improved.

Description

Image detection method, device, equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image detection method, apparatus, device, and storage medium.
Background
With the continuous development of the internet and information technology, images, videos, audios and other electronic documents are easy to acquire and copy, so that online business handling is gradually conducted into various industries. But in the image uploading process of online business handling, the uploaded image is found to prove that two types of problems exist in the material. Firstly, the image quality is poor, and the phenomenon that the mobile phone directly uploads the image shot by the mobile phone to a computer screen or directly uses the printing material shot by the mobile phone exists, rather than uploading the original image or scanning image as required. The definition, integrity and authenticity of such images are not guaranteed. Secondly, the uploaded image has tamper signs, the reprocessing signs of the image are obvious, and part of areas have obvious splicing signs, or the reprocessing actions of the original content, such as other contents, are modified after the original content is erased by software, so that the reliability is low, and the two problems are easy to cause the return of the bill due to poor material effect when the subsequent material is approved.
At present, the image evidence of the violation can be screened and removed by means of image source detection of a neural network, so that the problems of long approval process and low approval efficiency existing in the process of manually auditing the violation image are avoided. However, the conventional neural network has a problem of low accuracy of image source detection during image source detection. Therefore, there is a need for an image detection method with high accuracy and high efficiency.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide an image detection method, an image detection device and a storage medium, and aims to provide the technical problem of the image detection method with high precision and high efficiency.
In order to achieve the above object, the present invention provides an image detection method, comprising:
acquiring an image to be detected submitted during online business handling;
inputting the image to be detected into a preset feature extraction network to obtain target image features, wherein the preset feature extraction network comprises a high-frequency filtering module, and the high-frequency filtering module obtains different types of high-frequency information of the image by setting different filtering parameters;
and classifying the sources of the images to be detected according to the target image characteristics to obtain a source detection result of the images to be detected.
Optionally, the preset feature extraction network further includes: presetting a convolution module and a recursion residual error module;
the step of inputting the image to be detected into a preset feature extraction network to obtain the target image features comprises the following steps:
extracting features of the image to be detected through the preset convolution module to obtain shallow image features;
Inputting the shallow image characteristics into the high-frequency filtering module to obtain high-frequency image characteristics;
and carrying out feature enhancement on the high-frequency image features through the recursion residual error module to obtain target image features.
Optionally, the high-frequency filtering module comprises a plurality of sub-filtering modules;
the step of inputting the shallow image features into the high-frequency filtering module to obtain high-frequency image features comprises the following steps:
different types of feature mapping are carried out on the shallow image features through the filtering parameters corresponding to the sub-filtering modules, and mapped image features are obtained;
and performing feature stitching on the mapping image features output by each sub-filtering module to obtain high-frequency image features.
Optionally, the step of mapping the shallow image features by using the filtering parameters corresponding to the sub-filtering modules to obtain mapped image features includes:
if the sub-filtering module is a first sub-filtering module with the filtering parameter equal to a preset threshold value, carrying out preset average pooling on the shallow image characteristics through the first sub-filtering module to obtain average image characteristics;
and up-sampling the average image characteristic through the first sub-filtering module to obtain a mapping image characteristic.
Optionally, the step of mapping the shallow image features by using the filtering parameters corresponding to the sub-filtering modules to obtain mapped image features further includes:
if the sub-filtering module is a second sub-filtering module with the filtering parameter larger than the preset threshold, performing feature block division on the shallow image feature through the second sub-filtering module to obtain a sub-image feature;
and determining a mapping coefficient matrix through the filtering parameters corresponding to the second sub-filtering module, and carrying out feature mapping on the sub-image features according to the mapping coefficient matrix to obtain mapped image features.
Optionally, the recursive residual module is a multi-path network structure, each path includes residual units of different types, and the number of residual units included in each path is different, and the residual units include: the device comprises a normalization module, a preset activation function and a weight module.
Optionally, before inputting the image to be detected into a preset feature extraction network to obtain the target image feature, the method further includes:
determining training class loss according to the training sample image, the marked sample image and the sample discrimination parameters;
And carrying out iterative training on the initial feature extraction network based on the training class loss until the training class loss corresponding to the iterative initial feature extraction network is detected to be in a preset stable state, and taking the iterative initial feature extraction network as a preset feature extraction network.
In addition, in order to achieve the above object, the present invention also proposes an image detection apparatus including:
the image acquisition module is used for acquiring an image to be detected during online business handling;
the feature extraction module is used for inputting the image to be detected into a preset feature extraction network to obtain target image features, the preset feature extraction network comprises a high-frequency filtering module, and the high-frequency filtering module obtains different types of high-frequency information of the image to be detected by setting different filtering parameters;
and the image classification module is used for classifying the sources of the images to be detected according to the target image characteristics to obtain source detection results of the images to be detected.
In addition, in order to achieve the above object, the present invention also proposes an image detection apparatus including: the image detection device comprises a memory, a processor and an image detection program stored on the memory and executable on the processor, wherein the image detection program is configured to implement the steps of the image detection method as above.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon an image detection program which, when executed by a processor, implements the steps of the image detection method as described above.
The invention discloses an image detection method, an image detection device, an image detection equipment and a storage medium, wherein the method comprises the following steps: acquiring an image to be detected submitted during online business handling; extracting features of an image to be detected through a preset convolution module to obtain shallow image features; inputting the shallow image characteristics into a high-frequency filtering module to obtain high-frequency image characteristics; and carrying out feature enhancement on the high-frequency image features through a recursion residual error module to obtain target image features. And classifying the sources of the images to be detected according to the characteristics of the target images to obtain source detection results of the images to be detected. According to the invention, the high-frequency filtering module is introduced into the preset feature extraction network, and the high-frequency detail information of the image to be detected is acquired and stored by adjusting the filtering parameters of the high-frequency filtering module, so that the expression capability of the extracted image features is improved, and the precision of the source detection result of the final image to be detected is further improved. In addition, the invention can further enhance the expression capability of the extracted image features through the recursion residual error structure in the feature extraction network to obtain the target image features with higher precision, thereby further improving the precision of the image source detection result.
Drawings
FIG. 1 is a schematic diagram of an image detection device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of an image detection method according to the present invention;
FIG. 3 is a schematic diagram of a second flow chart of a first embodiment of the image detection method according to the present invention;
FIG. 4 is a diagram illustrating an image source detection process according to a first embodiment of the image detection method of the present invention;
FIG. 5 is a flowchart of a second embodiment of an image detection method according to the present invention;
FIG. 6 is a schematic diagram illustrating a high frequency filtering process according to a second embodiment of the image detection method of the present invention;
FIG. 7 is a schematic diagram illustrating a feature mapping process according to a second embodiment of the image detection method of the present invention;
FIG. 8 is a schematic diagram of a residual unit structure of a second embodiment of the image detection method according to the present invention;
FIG. 9 is a schematic diagram of a recursive residual module structure of a second embodiment of an image detection method according to the present invention;
FIG. 10 is a flowchart of a third embodiment of an image detection method according to the present invention;
fig. 11 is a block diagram showing the construction of a first embodiment of an image detection apparatus according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of an image detection device of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the image detection apparatus may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the image detection apparatus, and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 1, an operating system, a data storage module, a network communication module, a user interface module, and an image detection program may be included in the memory 1005 as one type of storage medium.
In the image detection apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the image detection apparatus of the present invention may be provided in the image detection apparatus, and the image detection apparatus calls the image detection program stored in the memory 1005 through the processor 1001 and executes the image detection method provided by the embodiment of the present invention.
An embodiment of the present invention provides an image detection method, referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the image detection method of the present invention.
It is easy to understand that the existing neural network is less concerned about the image edge information and the complex image texture part with higher relativity with the image source when extracting the image features, so that the final image source precision is lower. To solve the above-described problem, in the present embodiment, the image detection method includes the steps of:
Step S10: acquiring an image to be detected submitted during online business handling;
it should be noted that, the execution body of the method of the embodiment may be a computing service device having functions of data processing, network communication and program running, for example, a mobile phone, a television, a tablet computer, a personal computer, or other electronic devices capable of implementing the same or similar functions. The image detection method provided by the present embodiment and the embodiments described below will be specifically described herein with the above-described image detection apparatus (detection apparatus for short).
It should be understood that, in this embodiment, the image to be detected may be an image in a proof material submitted by a user when handling an online service, which may be an RGB image, an image obtained from a camera or a video stream, or an independent single image. It is easy to understand that the existing image detection method cannot focus on the parts with larger influence on edge information and texture complexity in the image, so that the neural network is slow in convergence and the extracted image features are redundant, and the detection efficiency and the detection precision are low. Therefore, the present embodiment can improve the accuracy of the finally obtained image detection result by improving the accuracy of the acquired image features.
Step S20: inputting an image to be detected into a preset feature extraction network to obtain target image features, wherein the preset feature extraction network comprises a high-frequency filtering module, and the high-frequency filtering module obtains different types of high-frequency information of the image by setting different filtering parameters;
it should be understood that, in this embodiment, the source of the image to be detected needs to be detected, that is, whether the image to be detected is a scanned original image or a secondarily edited image or an image with low pixels is determined, that is, according to an actual application scenario, the preset feature extraction network in this embodiment mainly focuses on not the image to be detected itself, but a noise portion of the image to be detected. Therefore, the embodiment introduces a high-frequency filtering module in the preset feature extraction network, and the high-frequency filtering module can acquire and save different types of high-frequency information of the image by setting different filtering parameters.
It is easy to understand from the above analysis that, in this embodiment, after the image to be detected is input into the preset feature extraction network, different types of high-frequency detail information of the image to be detected can be obtained and stored by adjusting the filtering parameters of the high-frequency filtering module. In addition, the preset feature network may further include a preset feature extraction network further including: further, as an implementation manner, as shown in fig. 3, fig. 3 is a second flow chart of a first embodiment of the image detection method according to the present invention, in this embodiment, step S20 includes:
Step S21: extracting features of an image to be detected through a preset convolution module to obtain shallow image features;
step S22: inputting the shallow image characteristics into a high-frequency filtering module to obtain high-frequency image characteristics;
step S23: and carrying out feature enhancement on the high-frequency image features through a recursion residual error module to obtain target image features.
It should be noted that before inputting the image to be detected into the preset feature network, the image to be detected may be first converted into a gray image, and then the gray image to be detected is input into a 3x3 convolution module, that is, the preset convolution module performs preliminary feature extraction to obtain the shallow image feature; then extracting high-frequency detail information through a high-frequency filtering module to obtain high-frequency image characteristics; and enhancing the feature expression capacity through a residual structure of the recursion residual module to obtain the target image features.
Step S30: and classifying the sources of the images to be detected according to the characteristics of the target images to obtain source detection results of the images to be detected.
It should be understood that, after the target image features are obtained, the embodiment can perform the source detection of the image to be detected based on the target image features, specifically, the embodiment can perform the source classification on the image to be detected according to the target image features by constructing an image classification network in advance, so as to obtain the source classification result of the image to be detected as an original or a non-original, thereby obtaining the source detection result of the image to be detected. It is easy to understand that the target image features obtained through the preset feature extraction network in this embodiment can make the image feature input of the image classification network more accurate and effective, so as to accelerate convergence of the image classification network, and further reduce the calculation cost and feature redundancy of the image source classification network.
In a specific implementation, taking fig. 4 as an example for illustration, fig. 4 is a schematic diagram of an image source detection process according to a first embodiment of the image detection method of the present invention. As shown in fig. 4, in this embodiment, an image to be detected submitted by an online transaction service is input to a preset convolution module to perform preliminary feature extraction, so as to obtain shallow image features; then extracting high-frequency detail information through a high-frequency filtering module to obtain high-frequency image characteristics; and enhancing the feature expression capacity through a residual structure of the recursion residual module to obtain the target image features. And finally, inputting the target image characteristics into an image classification network to quickly obtain a high-precision source classification result of the image to be detected. Compared with the existing scheme, the method and the device have the advantages that the method and the device are more in line with the actual landing condition and are closer to the actual application scene of image source screening, the quality problem of uploading image proving materials can be solved, natural images and processed secondary images can be automatically screened, the problems of unclear images, image re-shooting, obvious tampering marks of the images and other image unreal problems encountered in the auditing process can be avoided, the manpower cost of manual screening is reduced, the screening speed is increased, and the purposes of reducing cost and enhancing efficiency are achieved. Meanwhile, the invention can be directly embedded into the screening method of the proposal on the basis of the existing software flow, thereby realizing automatic screening, having low transformation cost, wide application range and saving manpower. Therefore, the method and the device can effectively identify noise in the image to be detected, detect sources of the image to be detected, and avoid illegal phenomena such as image copying and tampering when the business is handled on line, ensure the originality and the accuracy of the uploaded image when the business is handled on line, and effectively solve the problem of difficult deployment in actual production caused by the requirement of larger CPU and GPU communication bandwidth.
The embodiment discloses an image detection method, which comprises the following steps: acquiring an image to be detected submitted during online business handling; extracting features of an image to be detected through a preset convolution module to obtain shallow image features; inputting the shallow image characteristics into a high-frequency filtering module to obtain high-frequency image characteristics; and carrying out feature enhancement on the high-frequency image features through a recursion residual error module to obtain target image features. And classifying the sources of the images to be detected according to the characteristics of the target images to obtain source detection results of the images to be detected. According to the embodiment, the high-frequency filtering module is introduced into the preset feature extraction network, and the high-frequency detail information of the image to be detected is obtained and stored by adjusting the filtering parameters of the high-frequency filtering module, so that the expression capability of the extracted image features is improved, and the accuracy of the source detection result of the final image to be detected is further improved. In addition, the method can further enhance the expression capability of the extracted image features through a recursive residual structure in the feature extraction network, obtain the target image features with higher precision, and further improve the precision of the image source detection result.
Referring to fig. 5, fig. 5 is a flowchart illustrating a second embodiment of the image detection method according to the present invention, and based on the embodiment shown in fig. 2, the second embodiment of the image detection method according to the present invention is proposed.
It can be understood that the high frequency filtering module (High Fidelity Frequency Modulation, HFFM) may include a plurality of sub-filtering modules, and the filtering parameters of each sub-filtering module may be different, so as to extract different types of high frequency detail information, so in this embodiment, step S22 includes:
step S221: different types of feature mapping are carried out on the shallow image features through the filtering parameters corresponding to the sub-filtering modules, and mapped image features are obtained;
step S222: and performing feature stitching on the mapping image features output by each sub-filtering module to obtain high-frequency image features.
In this embodiment, the high-frequency filtering module is mainly used for extracting the high-frequency information of the feature map. Because the traditional Fourier transform method for extracting the image high-frequency information is difficult to embed into a network model to realize end-to-end training, the embodiment provides a micro high-frequency extraction method. Specifically, in this embodiment, first, different types of feature mapping may be performed on shallow image features through filtering parameters corresponding to each sub-filtering module, so as to obtain mapped image features; and then carrying out feature stitching on the mapping image features output by each sub-filtering module to obtain high-frequency image features. For ease of understanding, taking fig. 6 as an example for illustration, fig. 6 is a schematic diagram of a high-frequency filtering process according to a second embodiment of the image detection method of the present invention, as shown in fig. 6, if the high-frequency filtering module includes a sub-filtering module with a filtering parameter of 2 (i.e. k=2 HFFM in the figure), a sub-filtering module with a filtering parameter of 3 (i.e. k=3 HFFM in the figure), and a sub-filtering module with a filtering parameter of 5 (i.e. k=5 HFFM in the figure), after three different types of mapped image features are obtained based on the three sub-filtering modules, the embodiment may further perform feature stitching on the three different types of mapped image features through contacts to obtain the high-frequency image feature.
It can be appreciated that the present embodiment may capture the dependency between adjacent pixels in shallow image features by selecting different k values (or filtering parameters), and using different mapping methods for different size regions by different sub-filtering modules, so that the prediction of the image edge and the places with complex textures is more accurate. Specifically, as an implementation manner, in this embodiment, step S221 includes:
step S221a: if the sub-filtering module is a first sub-filtering module with the filtering parameter equal to a preset threshold value, carrying out preset average pooling on shallow image characteristics through the first sub-filtering module to obtain average image characteristics;
step S221b: and up-sampling the average image features through a first sub-filtering module to obtain mapped image features.
It should be understood that the preset threshold may be set according to practical situations, and in this embodiment, the preset threshold may be two. When the filtering parameter of the sub-filtering module is 2, the embodiment may acquire the average value of the shallow image features by using the average pooling with the scaling of 2 to obtain the average image feature, then upsample the average image feature, and restore the average image feature to the feature map size of the restored shallow image feature, so as to obtain the mapping image feature corresponding to the sub-filtering module when k=2, where the obtained mapping image feature is equivalent to subtracting the average information in a small area of the shallow image feature. For easy understanding, fig. 7 is an illustration of a feature mapping process according to a second embodiment of the image detection method of the present invention. As shown in fig. 7, assume a feature map F of input shallow image features 0 When the filter parameter is two (k=2), the average value of the average pooled acquisition regions with the scaling size of 2 is used to obtain the average image feature F K The size may be: cxH/kxW/k; then to F K Upsampling (i.e., upsampling in fig. 7) is performed to restore it to the shallow image feature F 0 The feature maps are consistent in size, so that the mapping image feature F when k=2 is obtained u The size is C×H×W. I.e. mapping image features F at this time R =Up(Avg(F 0 ) Where Up represents Upsampling (Upsampling), avg represents average pooling (Avgpooling).
Further, as an implementation manner, in this embodiment, step S221 further includes:
step S221c: if the sub-filtering module is a second sub-filtering module with the filtering parameter larger than a preset threshold value, performing feature block division on the shallow image features through the second sub-filtering module to obtain sub-image features;
step S221d: and determining a mapping coefficient matrix through the filtering parameters corresponding to the second sub-filtering module, and carrying out feature mapping on the sub-image features according to the mapping coefficient matrix to obtain the mapped image features.
It is easy to understand that when the filtering parameter of the sub-filtering module is greater than the preset threshold, the embodiment may perform feature mapping in another manner, specifically, the embodiment may divide the shallow image feature into a plurality of feature blocks according to the filtering parameter, and generate a corresponding mapping coefficient matrix according to the filtering parameter, so as to map the divided feature blocks, that is, the sub-image feature, into a new feature value, and further obtain a mapped image feature.
In a specific implementation, if the filtering parameter is 3 (i.e. k=3), the embodiment may divide the feature map of the shallow image feature into a plurality of 3×3 blocks, and the corresponding mapping coefficient matrix may be:
the mapping characteristics of each sub-image characteristic at this time are:
y=-x 1,1 +2x 1,2 -x 1,3 +2x 2,1 -4x 2,2 +2x 2,3 -x 3,1 +2x 3,2 -x 3,3
wherein x is i,j (i E (1, 3), j E (1, 3)) represents the pixel position in the block of the sub-image feature, and y represents the feature value after mapping the sub-image feature.
If the filtering parameter is 5 (i.e. k=5), the embodiment may divide the feature map of the shallow image feature into a plurality of blocks 5*5, and the corresponding mapping coefficient matrix may be:
in summary, in this embodiment, by selecting different k values and using different mapping manners through different areas, dependency between adjacent pixels in the feature map of the shallow image feature is captured, so that prediction on the image edge and the area with complex texture is more accurate when the image is classified subsequently, and further, the high-frequency image feature spliced by the mapping image features output by each sub-filtering module contains different types of high-frequency detail information.
It is easy to understand that the problem of gradient weakness in the training process is often caused by excessive parameters in the training process of the neural network, so that the convergence rate of the network is reduced. Therefore, in order to avoid this problem, in this embodiment, a recursive residual module including recursive blocks of different types may be designed, so that the network may learn image features better, improve training effects of the network, and facilitate floor application. Therefore, further, as an implementation manner, in this embodiment, the recursive residual module is a multi-path network structure, each path includes different types of residual units, and the number of residual units included in each path is different, where the residual units include: the device comprises a normalization module, a preset activation function and a weight module.
It should be noted that, in this embodiment, the recursive residual module may include a plurality of residual units, specifically, in this embodiment, conv may be used as a most basic residual unit, and each residual unit includes a normalization module (BN), a preset activation function (e.g. ReLU) and a weight module (weight), and the specific structure of each residual unit is shown in fig. 8, and fig. 8 is a schematic structural diagram of a residual unit in the second embodiment of the image detection method of the present invention.
In addition, in this embodiment, the recursive residual module may be a multi-path network structure, each path includes different types of residual units, and the number of residual units included in each path is different. For easy understanding, taking fig. 9 as an example for illustration, fig. 9 is a schematic diagram of a recursive residual module structure of a second embodiment of the image detection method of the present invention. As shown in fig. 9, the recursive residual module may be any of the structures of fig. 9, where x is shown in fig. 9 u And y u For the input and output of the recursive residual module, the weights of the basic residual units of the same color background are the same. As shown in fig. 9, the recursive residual module may be a multipath networkThe complex structure can alleviate the gradient weakening problem in the training process through the recursion block of the multipath structure, and the accuracy is improved by increasing the depth under the condition of not adding any weight parameters, so that the optimal performance is realized by using the minimum parameters.
The high-frequency filtering module in the embodiment comprises a plurality of sub-filtering modules; in the embodiment, different types of feature mapping are carried out on the shallow image features through the filtering parameters corresponding to the sub-filtering modules, so as to obtain mapped image features; and performing feature stitching on the mapping image features output by each sub-filtering module to obtain high-frequency image features. If the sub-filtering module is a first sub-filtering module with the filtering parameter equal to a preset threshold value, carrying out preset average pooling on shallow image characteristics through the first sub-filtering module to obtain average image characteristics; and up-sampling the average image features through a first sub-filtering module to obtain mapped image features. If the sub-filtering module is a second sub-filtering module with the filtering parameter larger than a preset threshold value, performing feature block division on the shallow image features through the second sub-filtering module to obtain sub-image features; and determining a mapping coefficient matrix through the filtering parameters corresponding to the second sub-filtering module, and carrying out feature mapping on the sub-image features according to the mapping coefficient matrix to obtain the mapped image features. In addition, in this embodiment, the recursive residual module is a multi-path network structure, each path includes different types of residual units, and the number of residual units included in each path is different, where the residual units include: the device comprises a normalization module, a preset activation function and a weight module. According to the embodiment, the sub-filtering modules with different filtering parameters can be used for capturing the dependence between adjacent pixels in the feature map of the shallow image features in different mapping modes for areas with different sizes of the shallow image features, so that the prediction of the image edges and places with complex textures in the subsequent image classification is more accurate, and finally, the high-frequency image features spliced by the mapping image features output by the sub-filtering modules comprise different types of high-frequency detail information. In addition, the recursive residual module in the present embodiment may be a multi-path network structure, so the present embodiment may alleviate the gradient weakening problem in the training process through the recursive block of the multi-path structure, and increase the accuracy by increasing the depth without adding any weight parameter, and achieve the best performance with the least parameters.
Referring to fig. 10, fig. 10 is a schematic flow chart of a third embodiment of the image detection method according to the present invention, based on the embodiment shown in fig. 2 or 5, the third embodiment of the image detection method according to the present invention is proposed, and fig. 4 is an example of the embodiment proposed based on the embodiment shown in fig. 1.
It is easy to understand that the loss function of the existing neural network is generally limited in distinguishing degree of positive and negative samples, so that the convergence speed and generalization capability of the model are affected. In order to solve the problem, the embodiment provides a new method for calculating the loss function, which can better control the distinguishing degree of the model to the positive and negative samples by introducing super parameters, thereby effectively improving the convergence rate and generalization capability of the model. Therefore, in this embodiment, before step S20, the method further includes:
step S11: determining training class loss according to the training sample image, the marked sample image and the sample discrimination parameters;
step S12: and carrying out iterative training on the initial feature extraction network based on the training class loss until the training class loss corresponding to the iterative initial feature extraction network is detected to be in a preset steady state, and taking the iterative initial feature extraction network as a preset feature extraction network.
It can be understood that in this embodiment, the classification of the image to be detected may be performed by the encoder, and in the training iteration process of the encoder model, whether the encoder parameter is good or bad or not may be determined by measuring the feature similarity between the training sample and the positive and negative samples, where the training sample is the training sample image and the positive and negative samples are the labeled sample images. In order to improve the convergence rate and generalization capability of the encoder model, the present embodiment may maximize the similarity between the training sample and the positive sample and reduce the similarity between the training sample and the negative sample by adding the super-parameters, i.e., the sample discrimination parameters described above, when the training converges. In this embodiment, the training class loss can be calculated by the following formula:
in the formula, h represents a training sample image, w is a positive sample, q is a negative sample, N represents all sample numbers, N+ represents a positive sample number, and alpha is a sample discrimination parameter.
It is easy to understand that, in this embodiment, the initial feature extraction network may be iteratively trained based on a training class loss including a sample discrimination parameter, and the discrimination of the positive and negative samples by the image classification network is controlled in the training process based on the sample discrimination parameter, until it is detected that the training class loss corresponding to the iterative initial feature extraction network is in a preset steady state (i.e., the fluctuation range does not exceed the preset range), which indicates that the iteration is completed, and the iterative initial feature extraction network at this time may be used as the preset feature extraction network. But care should be taken not to be too large. If alpha is too large, the distribution is smoother, positive and negative samples tend to be the same, and learning is invalid; if α is too small, the distribution is more concentrated, but particular attention is paid to the individual negative samples, resulting in difficult model convergence or poor generalization ability.
In summary, the embodiment provides a new method for calculating the loss function, which controls the distinguishing degree of the image classification network to the positive and negative samples through the introduced sample distinguishing parameter, so as to effectively improve the convergence speed and generalization capability of the image classification network.
According to the embodiment, training class loss is determined according to the training sample image, the marked sample image and the sample discrimination parameters; and carrying out iterative training on the initial feature extraction network based on the training class loss until the training class loss corresponding to the iterative initial feature extraction network is detected to be in a preset steady state, and taking the iterative initial feature extraction network as a preset feature extraction network. The embodiment provides a new method for calculating the loss function, the distinguishing degree of the image classification network to the positive and negative samples is controlled through the introduced sample distinguishing parameter, and the convergence speed and generalization capability of the image classification network are effectively improved.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium stores an image detection program, and the image detection program realizes the steps of the image detection method when being executed by a processor.
Referring to fig. 11, fig. 11 is a block diagram showing the structure of a first embodiment of an image detection apparatus according to the present invention.
As shown in fig. 11, an image detection apparatus according to an embodiment of the present invention includes:
the image acquisition module A1 is used for acquiring an image to be detected during online business handling;
the feature extraction module A2 is used for inputting the image to be detected into a preset feature extraction network to obtain target image features, wherein the preset feature extraction network comprises a high-frequency filtering module, and the high-frequency filtering module obtains different types of high-frequency information of the image to be detected by setting different filtering parameters;
and the image classification module A3 is used for classifying the sources of the images to be detected according to the target image characteristics to obtain the source detection results of the images to be detected.
Further, as an implementation manner, in this embodiment, the preset feature extraction network further includes: presetting a convolution module and a recursion residual error module; the feature extraction module A2 is further used for extracting features of the image to be detected through the preset convolution module to obtain shallow image features;
the feature extraction module A2 is also used for inputting the shallow image features into the high-frequency filtering module to obtain high-frequency image features;
and the feature extraction module A2 is also used for carrying out feature enhancement on the high-frequency image features through the recursion residual error module to obtain target image features.
The embodiment obtains the image to be detected submitted during online business handling; extracting features of an image to be detected through a preset convolution module to obtain shallow image features; inputting the shallow image characteristics into a high-frequency filtering module to obtain high-frequency image characteristics; and carrying out feature enhancement on the high-frequency image features through a recursion residual error module to obtain target image features. And classifying the sources of the images to be detected according to the characteristics of the target images to obtain source detection results of the images to be detected. According to the embodiment, the high-frequency filtering module is introduced into the preset feature extraction network, and the high-frequency detail information of the image to be detected is obtained and stored by adjusting the filtering parameters of the high-frequency filtering module, so that the expression capability of the extracted image features is improved, and the accuracy of the source detection result of the final image to be detected is further improved. In addition, the method can further enhance the expression capability of the extracted image features through a recursive residual structure in the feature extraction network, obtain the target image features with higher precision, and further improve the precision of the image source detection result.
Based on the above-described first embodiment of the image detection device of the present invention, a second embodiment of the image detection device of the present invention is proposed.
In this embodiment, the high-frequency filtering module includes a plurality of sub-filtering modules; the feature extraction module A2 is further used for carrying out different types of feature mapping on the shallow image features through the filtering parameters corresponding to the sub-filtering modules to obtain mapped image features;
the feature extraction module A2 is further used for performing feature stitching on the mapping image features output by each sub-filtering module to obtain high-frequency image features.
Further, as an implementation manner, in this embodiment, the feature extraction module A2 is further configured to, if the sub-filtering module is a first sub-filtering module with a filtering parameter equal to a preset threshold, perform preset average pooling on the shallow image feature through the first sub-filtering module to obtain an average image feature;
the feature extraction module A2 is further configured to upsample the average image feature through the first sub-filtering module to obtain a mapped image feature.
Further, as an implementation manner, in this embodiment, the feature extraction module A2 is further configured to, if the sub-filtering module is a second sub-filtering module with a filtering parameter greater than the preset threshold, perform feature block division on the shallow image feature through the second sub-filtering module to obtain a sub-image feature;
The feature extraction module A2 is further configured to determine a mapping coefficient matrix according to the filtering parameter corresponding to the second sub-filtering module, and perform feature mapping on the sub-image feature according to the mapping coefficient matrix, so as to obtain a mapped image feature.
Further, in this embodiment, the recursive residual module is a multi-path network structure, each path includes different types of residual units, and the number of residual units included in each path is different, where the residual units include: the device comprises a normalization module, a preset activation function and a weight module.
Further, as an implementation manner, in this embodiment, the feature extraction module A2 is further configured to determine a training class loss according to the training sample image, the labeled sample image, and the sample discrimination parameter;
the feature extraction module A2 is further configured to perform iterative training on the initial feature extraction network based on the training class loss, until it is detected that the training class loss corresponding to the iterative initial feature extraction network is in a preset steady state, and take the iterative initial feature extraction network as a preset feature extraction network.
The high-frequency filtering module in the embodiment comprises a plurality of sub-filtering modules; in the embodiment, different types of feature mapping are carried out on the shallow image features through the filtering parameters corresponding to the sub-filtering modules, so as to obtain mapped image features; and performing feature stitching on the mapping image features output by each sub-filtering module to obtain high-frequency image features. If the sub-filtering module is a first sub-filtering module with the filtering parameter equal to a preset threshold value, carrying out preset average pooling on shallow image characteristics through the first sub-filtering module to obtain average image characteristics; and up-sampling the average image features through a first sub-filtering module to obtain mapped image features. If the sub-filtering module is a second sub-filtering module with the filtering parameter larger than a preset threshold value, performing feature block division on the shallow image features through the second sub-filtering module to obtain sub-image features; and determining a mapping coefficient matrix through the filtering parameters corresponding to the second sub-filtering module, and carrying out feature mapping on the sub-image features according to the mapping coefficient matrix to obtain the mapped image features. In addition, in this embodiment, the recursive residual module is a multi-path network structure, each path includes different types of residual units, and the number of residual units included in each path is different, where the residual units include: the device comprises a normalization module, a preset activation function and a weight module. According to the embodiment, the sub-filtering modules with different filtering parameters can be used for capturing the dependence between adjacent pixels in the feature map of the shallow image features in different mapping modes for areas with different sizes of the shallow image features, so that the prediction of the image edges and places with complex textures in the subsequent image classification is more accurate, and finally, the high-frequency image features spliced by the mapping image features output by the sub-filtering modules comprise different types of high-frequency detail information. In addition, the recursive residual module in the present embodiment may be a multi-path network structure, so the present embodiment may alleviate the gradient weakening problem in the training process through the recursive block of the multi-path structure, and increase the accuracy by increasing the depth without adding any weight parameter, and achieve the best performance with the least parameters. In addition, the embodiment determines training class loss according to the training sample image, the marked sample image and the sample discrimination parameters; and carrying out iterative training on the initial feature extraction network based on the training class loss until the training class loss corresponding to the iterative initial feature extraction network is detected to be in a preset steady state, and taking the iterative initial feature extraction network as a preset feature extraction network. The embodiment provides a new method for calculating the loss function, the distinguishing degree of the image classification network to the positive and negative samples is controlled through the introduced sample distinguishing parameter, and the convergence speed and generalization capability of the image classification network are effectively improved.
Other embodiments or specific implementations of the image detection apparatus of the present invention may refer to the above method embodiments, and are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method of the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. An image detection method, characterized in that the image detection method comprises:
acquiring an image to be detected submitted during online business handling;
inputting the image to be detected into a preset feature extraction network to obtain target image features, wherein the preset feature extraction network comprises a high-frequency filtering module, and the high-frequency filtering module obtains different types of high-frequency information of the image by setting different filtering parameters;
and classifying the sources of the images to be detected according to the target image characteristics to obtain a source detection result of the images to be detected.
2. The image detection method according to claim 1, wherein the preset feature extraction network further includes: presetting a convolution module and a recursion residual error module;
the step of inputting the image to be detected into a preset feature extraction network to obtain the target image features comprises the following steps:
Extracting features of the image to be detected through the preset convolution module to obtain shallow image features;
inputting the shallow image characteristics into the high-frequency filtering module to obtain high-frequency image characteristics;
and carrying out feature enhancement on the high-frequency image features through the recursion residual error module to obtain target image features.
3. The image detection method according to claim 2, wherein the high frequency filtering module includes a plurality of sub-filtering modules;
the step of inputting the shallow image features into the high-frequency filtering module to obtain high-frequency image features comprises the following steps:
different types of feature mapping are carried out on the shallow image features through the filtering parameters corresponding to the sub-filtering modules, and mapped image features are obtained;
and performing feature stitching on the mapping image features output by each sub-filtering module to obtain high-frequency image features.
4. The image detection method as claimed in claim 3, wherein the step of performing different types of feature mapping on the shallow image features by using the filtering parameters corresponding to each of the sub-filtering modules to obtain mapped image features includes:
if the sub-filtering module is a first sub-filtering module with the filtering parameter equal to a preset threshold value, carrying out preset average pooling on the shallow image characteristics through the first sub-filtering module to obtain average image characteristics;
And up-sampling the average image characteristic through the first sub-filtering module to obtain a mapping image characteristic.
5. The image detection method as claimed in claim 3, wherein the step of performing different types of feature mapping on the shallow image features by using the filtering parameters corresponding to each of the sub-filtering modules to obtain mapped image features further comprises:
if the sub-filtering module is a second sub-filtering module with the filtering parameter larger than the preset threshold, performing feature block division on the shallow image feature through the second sub-filtering module to obtain a sub-image feature;
and determining a mapping coefficient matrix through the filtering parameters corresponding to the second sub-filtering module, and carrying out feature mapping on the sub-image features according to the mapping coefficient matrix to obtain mapped image features.
6. The image detection method according to claim 2, wherein the recursive residual module has a multi-path network structure, each path includes different types of residual units, and the number of residual units included in each path is different, and the residual units include: the device comprises a normalization module, a preset activation function and a weight module.
7. The image detection method according to claim 1, wherein the inputting the image to be detected into a preset feature extraction network, before obtaining the target image feature, further comprises:
determining training class loss according to the training sample image, the marked sample image and the sample discrimination parameters;
and carrying out iterative training on the initial feature extraction network based on the training class loss until the training class loss corresponding to the iterative initial feature extraction network is detected to be in a preset stable state, and taking the iterative initial feature extraction network as a preset feature extraction network.
8. An image detection apparatus, characterized in that the image detection apparatus comprises:
the image acquisition module is used for acquiring an image to be detected during online business handling;
the feature extraction module is used for inputting the image to be detected into a preset feature extraction network to obtain target image features, the preset feature extraction network comprises a high-frequency filtering module, and the high-frequency filtering module obtains different types of high-frequency information of the image to be detected by setting different filtering parameters;
and the image classification module is used for classifying the sources of the images to be detected according to the target image characteristics to obtain source detection results of the images to be detected.
9. An image detection apparatus, characterized in that the apparatus comprises: a memory, a processor and an image detection program stored on the memory and executable on the processor, the image detection program being configured to implement the steps of the image detection method according to any one of claims 1 to 7.
10. A storage medium having stored thereon an image detection program which, when executed by a processor, implements the steps of the image detection method according to any one of claims 1 to 7.
CN202311808631.1A 2023-12-26 2023-12-26 Image detection method, device, equipment and storage medium Pending CN117830710A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311808631.1A CN117830710A (en) 2023-12-26 2023-12-26 Image detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311808631.1A CN117830710A (en) 2023-12-26 2023-12-26 Image detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117830710A true CN117830710A (en) 2024-04-05

Family

ID=90522091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311808631.1A Pending CN117830710A (en) 2023-12-26 2023-12-26 Image detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117830710A (en)

Similar Documents

Publication Publication Date Title
CN112308095A (en) Picture preprocessing and model training method and device, server and storage medium
US11790499B2 (en) Certificate image extraction method and terminal device
Bi et al. Multi-scale feature extraction and adaptive matching for copy-move forgery detection
CN109948566B (en) Double-flow face anti-fraud detection method based on weight fusion and feature selection
CN112329702B (en) Method and device for rapid face density prediction and face detection, electronic equipment and storage medium
CN111062903A (en) Automatic processing method and system for image watermark, electronic equipment and storage medium
CN113344826B (en) Image processing method, device, electronic equipment and storage medium
CN112101386B (en) Text detection method, device, computer equipment and storage medium
CN110913205A (en) Video special effect verification method and device
Anjum et al. Recapture detection technique based on edge-types by analysing high-frequency components in digital images acquired through LCD screens
CN113505702A (en) Pavement disease identification method and system based on double neural network optimization
CN113436222A (en) Image processing method, image processing apparatus, electronic device, and storage medium
CN111144425A (en) Method and device for detecting screen shot picture, electronic equipment and storage medium
CN114444565A (en) Image tampering detection method, terminal device and storage medium
CN111178398B (en) Method, system, storage medium and device for detecting tampering of identity card image information
CN112116565A (en) Countermeasure sample generation method and device for tampered copied image and storage medium
CN111898544A (en) Character and image matching method, device and equipment and computer storage medium
CN116798041A (en) Image recognition method and device and electronic equipment
CN113065407B (en) Financial bill seal erasing method based on attention mechanism and generation countermeasure network
CN117830710A (en) Image detection method, device, equipment and storage medium
CN114842478A (en) Text area identification method, device, equipment and storage medium
CN113706636A (en) Method and device for identifying tampered image
CN117649358B (en) Image processing method, device, equipment and storage medium
CN116503721B (en) Method, device, equipment and storage medium for detecting tampering of identity card
CN114708467B (en) Bad scene identification method, system and equipment based on knowledge distillation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination