Image recognition method and device based on CNN learning in wavelet domain

Through wavelet transformation and channel screening technology, the high-resolution image is converted into the wavelet domain, low-frequency sub-band channels are screened and input into the CNN model, which solves the problem of inaccurate recognition caused by low image resolution in the existing technology and achieves high-precision Image recognition.

CN113762290BInactive Publication Date: 2024-10-18TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110897466.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-05
Publication Date
2024-10-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In image recognition, the input image resolution of the existing CNN model is low, resulting in inaccurate recognition results, and it is difficult to process high-resolution images, resulting in information loss and reduced accuracy.

Method used

Convert the image channels from the time domain to the wavelet domain through wavelet transform, filter out the low-frequency sub-band image channels, and input them into the image classifier model. Combine the color space transformation and energy calculation formula to determine the important sub-band channels, and dynamically select the channel weights. Decision vectors are formed to improve recognition accuracy.

Benefits of technology

It achieves accurate recognition of high-resolution images, improves image classification accuracy, avoids information loss, and improves the quality of input information without changing the structure of the pre-trained model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113762290B_ABST
    Figure CN113762290B_ABST
Patent Text Reader

Abstract

The present invention provides an image recognition method and device for wavelet domain CNN learning, wherein the method comprises converting an image channel of a target image from a time domain to a wavelet domain through wavelet transform to obtain a first number of sub-band image channels; screening the first number of sub-band image channels to determine a second number of sub-band image channels; inputting the second number of sub-band image channels into an image classifier model to obtain a classification result of the target image, wherein the image classifier model can recognize the sub-band channel images of a high-resolution target image, thereby improving the image recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an image recognition method and device based on wavelet domain CNN learning. Background Art

[0002] Convolutional Neural Networks (CNN) have been widely used in image recognition. In order to ensure the training and reasoning efficiency of CNN models, the input size of images is generally set to 224 pixels × 224 pixels. Although the high-definition images taken by cameras have far exceeded this resolution, the images have to be compressed to adapt to the input limitations of the CNN model, which causes a lot of information loss. How to use a larger image resolution input without changing the overall structure of the pre-trained CNN model and without increasing the model parameters, so as to improve the quality of the input information and thus improve the classification accuracy is an important issue. Summary of the invention

[0003] The present invention provides an image recognition method and device based on wavelet domain CNN learning, which are used to solve the defect of inaccurate recognition results caused by low resolution of CNN model input images in the prior art and achieve high-precision image recognition.

[0004] The present invention provides an image recognition method using wavelet domain CNN learning, comprising:

[0005] By wavelet transform, the image channel of the target image is converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels;

[0006] Screening the first number of sub-band image channels to determine a second number of sub-band image channels;

[0007] The second number of sub-band image channels are input into an image classifier model to obtain a classification result of the target image.

[0008] According to the image recognition method of wavelet domain CNN learning provided by the present invention, before converting the image channel of the target image from the time domain to the wavelet domain through wavelet transform, it also includes:

[0009] Convert the color space of the target image to YCbCr.

[0010] According to the image recognition method of wavelet domain CNN learning provided by the present invention, screening the first number of sub-band image channels to determine the second number of sub-band image channels includes:

[0011] A second number of low-frequency sub-band image channels are selected from the first number of sub-band image channels.

[0012] According to the image recognition method of wavelet domain CNN learning provided by the present invention, screening the first number of sub-band image channels to determine the second number of sub-band image channels includes:

[0013] By wavelet transform, image components of training images in the training set are converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels corresponding to each training image;

[0014] Calculate the energy of each sub-band image channel corresponding to each training image according to an energy calculation formula;

[0015] Determining the order of each sub-band image channel in the training image according to the energy of each sub-band image channel corresponding to each training image;

[0016] Calculating the overall energy ranking in the training set according to the ranking of each sub-band image channel in the training image;

[0017] Determining the ranking of the second number of sub-band image channels according to the overall energy ranking;

[0018] screening the first number of sub-band image channels according to the rankings of the second number of sub-band image channels to determine a second number of sub-band image channels;

[0019] The training set includes at least one training image.

[0020] According to the image recognition method of wavelet domain CNN learning provided by the present invention, the energy calculation formula is as follows:

[0021]

[0022] Among them, S c is the energy of the cth subband image channel in the training image, W c is the wavelet packet coefficient matrix of the c-th subband image channel in the training image, W c (x, y) is the value with position coordinate (x, y) in the wavelet packet coefficient matrix of the c-th subband image channel in the training image.

[0023] According to the image recognition method of wavelet domain CNN learning provided by the present invention, screening the first number of sub-band image channels to determine the second number of sub-band image channels includes:

[0024] Performing maximum pooling on the first number of sub-band image channels to obtain a first tensor, and performing average pooling on the first number of sub-band image channels to obtain a second tensor;

[0025] Inputting the first tensor and the second tensor into a multilayer perceptron MLP, and performing an element-by-element operation on an output result of the MLP to obtain a third tensor;

[0026] A fourth tensor is calculated according to the third tensor, the first pre-training parameter and the second pre-training parameter; wherein the first pre-training parameter represents a weight coefficient of a selected channel, and the second pre-training parameter represents a weight coefficient of a non-selected channel;

[0027] Determine, according to the fourth tensor, a probability of each sub-band image channel in the first number of sub-band image channels being selected and a probability of each sub-band image channel not being selected;

[0028] By using a reparameterization method, a final decision vector is obtained according to the probability of each sub-band image channel being selected and the probability of not being selected;

[0029] The final decision vector is multiplied by a tensor formed by stacking the first number of sub-band image channels to obtain a second number of sub-band image channels.

[0030] The image recognition method of wavelet domain CNN learning provided by the present invention also includes:

[0031] Training to obtain the image classifier model;

[0032] The training to obtain the image classifier model includes:

[0033] By wavelet transform, image components of training images in the training set are converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels corresponding to each training image;

[0034] Screening the first number of sub-band image channels corresponding to each training image to determine a second number of sub-band image channels corresponding to each training image;

[0035] Remove the first layer or the first and second layers of the CNN network model to obtain the pre-trained image classifier model;

[0036] Training the pre-trained image classifier model according to the second number of sub-band image channels corresponding to each training image and the type label corresponding to each training image to obtain the classifier model;

[0037] Wherein, the training set includes at least one training image.

[0038] The present invention provides an image recognition device for wavelet domain CNN learning, comprising:

[0039] A wavelet transform module, used for converting the image channel of the target image from the time domain to the wavelet domain through wavelet transform to obtain a first number of sub-band image channels;

[0040] a channel selection module, configured to select the first number of sub-band image channels to determine a second number of sub-band image channels;

[0041] The image classification model is used to input the second number of sub-band image channels into an image classifier model to obtain a classification result of the target image.

[0042] The present invention provides an electronic device, comprising a processor and a memory storing a computer program, wherein the processor implements the steps of the image recognition method of wavelet domain CNN learning when executing the computer program.

[0043] The present invention provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, and the computer program is used to implement the steps of the image recognition method of wavelet domain CNN learning.

[0044] The image recognition method and device of wavelet domain CNN learning provided by the present invention convert the image channel of the target image with YCbCr color space from the time domain to the wavelet domain, screen out a second number of sub-band image channels from a first number of sub-band image channels, input the second number of sub-band image channels into an image classifier model, and obtain the classification result of the target image, so that the image classifier model can recognize the sub-band channel images of the high-resolution target image, thereby improving the image recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 A schematic diagram of the flow chart of the image recognition method of wavelet domain CNN learning provided by the present invention;

[0047] Figure 2 A schematic diagram of the process flow of the one-dimensional dual-tree complex wavelet transform provided by the present invention;

[0048] Figure 3 A schematic diagram of a process of screening the first number of sub-band image channels to determine a second number of sub-band image channels provided by the present invention;

[0049] Figure 4A schematic diagram of the structure of the channel screening model provided by the present invention;

[0050] Figure 5 A schematic diagram of the process of training and obtaining the image classifier model provided by the present invention;

[0051] Figure 6 A schematic diagram of the structure of the image classifier model provided by the present invention;

[0052] Figure 7 A schematic diagram of the structure of an image recognition device for wavelet domain CNN learning provided by the present invention;

[0053] Figure 8 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] Figure 1 A flow chart of an image recognition method using wavelet domain CNN learning provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the following steps are included:

[0056] Step 100: transform the image channel of the target image from the time domain to the wavelet domain through wavelet transform to obtain a first number of sub-band image channels.

[0057] Optionally, the target image includes multiple image channels, for example, the color space of the target image is RGB or YCbCr. In RGB, R represents Red, G represents Green, and B represents Blue, that is, the image in the RGB color space includes three image channels. The resolution of the target image can be greater than 224 pixels×224 pixels, for example, the resolution of the target image is 448 pixels×448 pixels.

[0058] By wavelet transform, the image channel of the target image is transformed from the time domain to the wavelet domain to obtain a first number of sub-band image channels.

[0059] The wavelet transform may be a multi-level wavelet packet transform WPT or a dual-tree complex wavelet transform DTCWT.

[0060] Step 101: Screen the first number of sub-band image channels to determine a second number of sub-band image channels.

[0061] Optionally, the wavelet transform decomposes the target image into a large number of sub-band image channels, which represent different frequency components. Generally speaking, the low-frequency component covers most of the information of the target image and is the most important for image classification; while the high-frequency component contains the detailed information of the target image, which helps to further improve the accuracy of image classification. However, inputting too many sub-band image channels will not only affect the calculation speed of the network, but also reduce the classification performance due to the introduction of too much high-frequency noise. Therefore, for the wavelet transform network, how to choose the right channel is crucial.

[0062] In the specific implementation, we can adopt different channel selection methods, such as selecting according to the color space components of the sub-band image channels, or selecting according to the energy size of the sub-band image channels.

[0063] Step 102: Input the second number of sub-band image channels into an image classifier model to obtain a classification result of the target image.

[0064] Optionally, the image classifier is obtained by removing the first layer or the first layer and the second layer of the CNN network, and the second number of sub-band image channels are input into the image classifier model to obtain a classification result of the target image.

[0065] In an embodiment of the present invention, by converting the image channel of the target image from the time domain to the wavelet domain, a second number of sub-band image channels are screened out from the first number of sub-band image channels, and the second number of sub-band image channels are input into an image classifier model to obtain a classification result of the target image. Compared with the existing CNN model that can only recognize images with a resolution of 224 pixels × 224 pixels, the target image in the embodiment of the present invention can be 448 pixels × 448 pixels. The image classifier model recognizes the sub-band image channels of the high-resolution target image, thereby improving the image recognition accuracy.

[0066] In one embodiment, before converting the image channel of the target image from the time domain to the wavelet domain through wavelet transform, the method further includes:

[0067] Convert the color space of the target image to YCbCr.

[0068] Optionally, if the color space of the target image is RGB, the color space of the target image is transformed into YCbCr, where Y refers to a brightness component, Cb refers to a blue chrominance component, and Cr refers to a red chrominance component.

[0069] In the embodiment of the present invention, when the color space of the target image is RGB, the color space of the target image is transformed into YCbCr, thereby improving the image recognition accuracy.

[0070] In one embodiment, the wavelet transform is wavelet packet transform WPT or dual-tree complex wavelet transform DTCWT.

[0071] Among them, in the process of Wavelet Packet Transform (WPT), for a given target image, a 2-D Discrete Wavelet Transform (2D DWT) is performed on the target image. At this time, the original image is decomposed into 4 sub-band image channels: low-frequency component A1, horizontal detail H1, vertical detail V1 and diagonal detail C1. The size of the 4 sub-band image channels is 1 / 4 of the target image. Continue to perform a 2D DWT on each sub-band image channel A1, H1, V1 and C1 respectively, and the result of the second WPT of the target image is obtained. For example, for a target image of 3×448×448, the second WPT transformation can obtain a 48×112×112 tensor, that is, 48 ​​sub-band image channels of size 112×112. The third WPT transformation can obtain a 192×56×56 tensor.

[0072] Although the Discrete Wavelet Transform (DWT) has the advantage of adaptive time-frequency resolution over DCT or Discrete Fourier Transform (DFT), it also has its shortcomings. First, DWT has less directionality. For two-dimensional image decomposition, there are only three directions: horizontal, vertical, and diagonal. Second, downsampling causes DWT to produce aliasing of the spectrum, so it is not shift-invariant. A small shift of the signal in the time domain will produce a large change in the wavelet domain, which is not conducive to the neural network learning features in the wavelet domain.

[0073] Dual-Tree Complex Wavelet Transform (DTCWT) has approximate translation invariance and good directional selectivity, which significantly improves the above problems of DWT. DTCWT uses two sets of real wavelet transforms with different low-pass and high-pass filters to decompose the signal, and implements real and imaginary part operations in parallel to form a dual-tree structure. Figure 2 A schematic diagram of a one-dimensional dual-tree complex wavelet transform process provided by an embodiment of the present invention is shown in FIG. Figure 2As shown, h0 and h1 represent the low-pass and high-pass filter groups used in the real tree, respectively; g0 and g1 are the filter groups used in the imaginary tree. After the image is processed by two-dimensional DTCWT, high-frequency sub-band images in six directions of ±15, ±45 and ±75 degrees can be obtained, which can better describe the detailed features of the image such as texture and edges.

[0074] Each DTCWT will generate 2 low-frequency subband image channels and 6 high-frequency subband image channels in different directions. Since these 8 subband images are all complex values, for a neural network that calculates with real numbers, each subband requires two independent real-valued channels to be fully described, that is, a total of 16 channels, of which two independent real-valued channels are the modulus and the amplitude. Take the target image with the color space of YCbCr as an example. After one DTCWT, the target image composed of the three components of Y, Cb and Cr will generate 48 channels. After each DTCWT, the length and width of the image will be compressed to half of the original. The second DTCWT will transform the 3×448×448 target image into a 48×112×112 tensor; the third DTCWT will transform it into a 48×56×56 tensor.

[0075] In an embodiment of the present invention, the wavelet transform is a wavelet packet transform WPT or a dual-tree complex wavelet transform DTCWT. The target image is transformed by the wavelet packet transform WPT or the dual-tree complex wavelet transform DTCWT to obtain a first number of sub-band image channels, thereby improving the image recognition accuracy. In one embodiment, the first number of sub-band image channels are screened to determine the second number of sub-band image channels, including:

[0076] A second number of low-frequency sub-band image channels are selected from the first number of sub-band image channels.

[0077] Since the low-frequency components cover most of the information of the target image, a second number of low-frequency sub-band image channels are screened out.

[0078] For example, when the target image color space is YCbCr, or is converted to YCbCr, a third number of low-frequency sub-band image channels of the Y component are selected; a fourth number of low-frequency sub-band image channels of the Cb component are selected; and a fifth number of low-frequency sub-band image channels of the Cr component are selected;

[0079] The second number is equal to the sum of the third number, the fourth number and the fifth number. Considering that the human eye is more sensitive to the Y component, more sub-bands of the Y component are retained, that is, the third number is greater than the fourth number, and the third number is greater than the fifth number.

[0080] Taking the sub-band image channel selection after the second WPT of the image 3×448×448 as an example, for the 48 112×112 channels obtained, 32 sub-band image channels need to be screened, that is, the second number is 32, and 16 low-frequency sub-band image channels of the Y component are selected; 8 low-frequency sub-band image channels of the Cb component are selected; and 8 low-frequency sub-band image channels of the Cr component are selected.

[0081] In the embodiment of the present invention, the number of low-frequency sub-band image channels of the Y component obtained by screening is greater than the number of low-frequency sub-band image channels of the Cb component, and the number of low-frequency sub-band image channels of the Y component is greater than the number of low-frequency sub-band image channels of the Cr component, thereby improving image recognition accuracy.

[0082] Figure 3 A schematic diagram of a process for screening the first number of sub-band image channels to determine a second number of sub-band image channels provided by an embodiment of the present invention. Figure 3 As shown, in one embodiment, the screening of the first number of sub-band image channels to determine the second number of sub-band image channels includes the following sub-steps:

[0083] Step 300: transform the image components of the training images in the training set from the time domain to the wavelet domain through wavelet transform, and obtain a first number of sub-band image channels corresponding to each training image.

[0084] Wherein, the training set includes at least one training image.

[0085] Optionally, the wavelet transform process for the training image is consistent with the wavelet transform process for the target image, and will not be described again to avoid repetition.

[0086] Step 301: Calculate the energy of each sub-band image channel corresponding to each training image according to an energy calculation formula.

[0087] Optionally, the energy calculation formula is as follows:

[0088]

[0089] Among them, S c is the energy of the cth subband image channel in the training image, W c is the wavelet packet coefficient matrix of the c-th subband image channel in the training image, W c (x, y) is the value with position coordinate (x, y) in the wavelet packet coefficient matrix of the c-th subband image channel in the training image.

[0090] According to the energy calculation formula, the energy of each sub-band image channel corresponding to each of the training images is calculated.

[0091] Step 302: Determine the order of each sub-band image channel in the training image according to the energy of each sub-band image channel corresponding to each training image.

[0092] Optionally, the order of the sub-band image channels in each training image is fixed, and the energy ranking of the sub-band image channels may be determined according to the energy of each sub-band image channel corresponding to each training image.

[0093] For example, in the first training image, the energy order of the 48 sub-band image channels is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48. In the second training image, the energy ranking of the 48 sub-band image channels is 2, 3, 4, 1, 6, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48. The smaller the energy ranking value, the greater the energy of the sub-band image channel.

[0094] Step 303: Calculate the overall energy ranking in the training set according to the ranking of each sub-band image channel in the training image.

[0095] Optionally, the ranking of each sub-band image channel in each training set image is added, and the overall energy ranking of each sub-band image channel in the training set can be obtained according to the size of the added value.

[0096] For example, the overall sorting is done by:

[0097]

[0098] in, is the energy ranking of the c-th subband channel image in the i-th training image, R c is the overall energy ranking of the cth sub-band channel image in the training set, and argsort() is a sorting operation function. Step 304: Determine the rank of the second number of sub-band image channels according to the overall energy ranking.

[0099] Optionally, the rankings of the second number of sub-band image channels with the smallest overall energy rankings are determined according to the overall energy rankings of the sub-band image channels in the training set.

[0100] Step 305: Screen the first number of sub-band image channels according to the rankings of the second number of sub-band image channels to determine a second number of sub-band image channels.

[0101] Optionally, among the first number of sub-band image channels determined according to the target image, a second number of sub-band image channels are screened out according to the rankings of the second number of sub-band image channels.

[0102] In an embodiment of the present invention, the ranking of the second number of sub-band image channels is determined according to the energy ranking of the sub-band image channels in the training image, the first number of sub-band channel images of the target image are screened according to the ranking, and the screening result is input into the image classifier model for recognition, thereby improving the image recognition accuracy.

[0103] In one embodiment, screening the first number of sub-band image channels to determine the second number of sub-band image channels includes:

[0104] Performing maximum pooling on the first number of sub-band image channels to obtain a first tensor, and performing average pooling on the first number of sub-band image channels to obtain a second tensor;

[0105] Inputting the first tensor and the second tensor into a multilayer perceptron MLP, and performing an element-by-element operation on an output result of the MLP to obtain a third tensor;

[0106] A fourth tensor is calculated according to the third tensor, the first pre-training parameter and the second pre-training parameter; wherein the first pre-training parameter represents a weight coefficient of a selected channel, and the second pre-training parameter represents a weight coefficient of a non-selected channel;

[0107] Determine, according to the fourth tensor, a probability of each sub-band image channel in the first number of sub-band image channels being selected and a probability of each sub-band image channel not being selected;

[0108] By using a reparameterization method, a final decision vector is obtained according to the probability of each sub-band image channel being selected and the probability of not being selected;

[0109] The final decision vector is multiplied by a tensor formed by stacking the first number of sub-band image channels to obtain a second number of sub-band image channels.

[0110] Alternatively, Xu et al. proposed a network structure that can be used to dynamically select DCT, which is based on a two-layer "Squeeze-and-Excitation Block" (SE-Block). SE-Block analyzes the relationship between channels and uses the global loss function of the neural network to automatically adjust the weights of the channels according to their importance.

[0111] However, SE-Block only uses average pooling to calculate channel attention. This embodiment uses the information of average pooling and maximum pooling at the same time.

[0112] Figure 4 A structural diagram of a channel screening model provided by an embodiment of the present invention, such as Figure 4 As shown in the figure, the dimension of the wavelet coefficients input to the neural network is 192×56×56, that is, the dimension of the input tensor Input Tensor is 192×56×56. It can be understood that the Input Tensor is obtained by stacking the first number of sub-band image channels. After max pooling and average pooling, the Input Tensor is compressed into two 192x1x1 dimensional tensors, namely the first tensor and the second tensor.

[0113] These two tensors are input into the same MLP, and then element-wise addition is performed, that is, element-by-element operation, to obtain Tensor1, the third tensor, whose dimension is still 192 × 1 × 1. In this way, the information generated by max pooling and average pooling is fused, and important channels are strengthened.

[0114] Then, two trainable parameters a1 and a2, i.e., the first pre-training parameter and the second pre-training parameter, are multiplied with Tensor1 to obtain Tensor2 of dimension 2×192×1×1, i.e., the fourth tensor. a1 and a2 represent the weight coefficients of whether a channel is selected or not. In Tensor2, the two values ​​corresponding to each channel are normalized to the range of 0-1, and then represent the probability of the channel being selected or not. Through the Softmax method, the sum of the probabilities of the channel being selected or not is guaranteed to be 1. The probability of the channel being selected is p, and the probability of not being selected is 1-p. This probability conforms to the Bernoulli distribution.

[0115] Since randomness is introduced into the neural network, it is necessary to sample the distribution through a sampling algorithm. However, since the sampling process itself is not differentiable, there is no way to directly use back propagation to optimize the parameters of the neural network. This problem can be solved through re-parameterization methods, such as the Gumbel Softmax trick. According to the probability of each sub-band image channel being selected and not being selected, the final decision vector is obtained. In the decision vector, each channel only corresponds to 0 or 1, representing whether the channel is actually selected.

[0116] After the input tensor is multiplied by the decision vector, the final output tensor output tensor is obtained. It can be understood that the output tensor is obtained by stacking the first number of sub-band image channels, where except for the selected second number of sub-band image channels, the other channels that are not selected are set to zero, and the channels that are set to zero no longer participate in the calculation after the input model. It should be noted that the second number is not a fixed value. For different pictures, after dynamic screening of the model, the number of sub-band channel images contained in the obtained output tensor may be different.

[0117] Since the number of selected channels is put into the loss function as a regular term for joint optimization, only relatively necessary channels will be selected in the end. The loss function is as follows:

[0118]

[0119] Among them, L acc is the original loss function used to optimize accuracy, λ is a weight coefficient, F(x i ) represents the process of filtering the i-th wavelet domain channel of the target image x, and its output is 0 or 1.

[0120] In the embodiment of the present invention, the results of maxpooling and average pooling of the Input Tensor obtained by stacking the first number of sub-band image channels are fused, important sub-band image channels are strengthened, and the image recognition accuracy is improved.

[0121] In one embodiment, the image recognition method using wavelet domain CNN learning also includes training to obtain the image classifier model. Figure 5 A flow chart of the training process for obtaining the image classifier model provided in the embodiment of the present invention. Figure 5 As shown, the training to obtain the image classifier model includes the following sub-steps:

[0122] Step 500: transform the image components of the training images in the training set from the time domain to the wavelet domain through wavelet transform, and obtain a first number of sub-band image channels corresponding to each training image.

[0123] Wherein, the training set includes at least one training image.

[0124] The wavelet transform process for the training image is consistent with that for the target image, and will not be described again here to avoid repetition.

[0125] Step 501: Screen a first number of sub-band image channels corresponding to each training image to determine a second number of sub-band image channels corresponding to each training image.

[0126] Optionally, the process of screening the first number of sub-band image channels corresponding to the training image is consistent with the process of screening the first number of sub-band image channels corresponding to the target image, and will not be described again to avoid repetition.

[0127] Step 502: Remove the first layer or the first layer and the second layer from the CNN network model to obtain a pre-trained image classifier model.

[0128] Taking MobileNet v2 as an example, the CNN network model is used to reduce the computational complexity of convolution in MobileNet v2, thereby accelerating the training and reasoning efficiency of the network. The first layer of the network is a traditional two-dimensional convolution structure Conv-BN-ReLU, where the kernel size is 3×3, the stride is 2, and the padding is 1. The input 3×224×224 image is converted into a 32×112×112 feature map after passing through the first layer structure.

[0129] Therefore, we simply remove the first layer of the MobileNet v2 network and use the second number of sub-band image channels as the input of the second layer of MobileNet v2, so that the wavelet channel can be used as input without changing the main structure of the MobileNet v2 network.

[0130] Optionally, the CNN network model can also be ResNet50. ResNet50 constructs residual blocks by means of identity mapping, solving the problem of gradient vanishing in deep networks that makes training difficult. Figure 6 A schematic diagram of the structure of the image classifier model provided by the embodiment of the present invention, such as Figure 6As shown in the figure, the model structure of ResNet50 includes a two-dimensional convolution structure Conv-BN-ReLU and a maxpooling with a stride of 2. The convolution kernel in Conv-BN-ReLU is 7×7, stride 2, padding 3, input 3 channels, and output 64 channels. After a 3x448x448 image passes through the first layer of the ResNet50 network, the output is 64×56×56. By performing WPT / DTCWT three times on the 3×448×448 training image, and then selecting c 56×56 channels in the wavelet domain, the c 56×56 channels can replace the output of the first two layers of ResNet50 and be input into the third layer of ResNet50.

[0131] Step 503: Train the pre-trained image classifier model according to the second number of sub-band image channels corresponding to each training image and the type label corresponding to each training image to obtain the classifier model.

[0132] The second number of sub-band image channels corresponding to each training image are input into the image classifier model, and the pre-trained image classifier model is trained according to the loss function and the type label corresponding to each training image to obtain the classifier model.

[0133] In an embodiment of the present invention, the first layer or the first layer and the second layer of the CNN network model are removed to obtain a pre-trained image classifier model, and the pre-trained image classifier model is trained through a second number of sub-band image channels corresponding to each training image and a type label corresponding to each training image to obtain the classifier model. The image classifier model can recognize sub-band channel images of a high-resolution target image, thereby improving image recognition accuracy.

[0134] The image recognition device of wavelet domain CNN learning provided by the present invention is described below. The image recognition device of wavelet domain CNN learning described below and the image recognition method of wavelet domain CNN learning described above can be referred to each other.

[0135] Another embodiment of the present invention provides an image recognition device for wavelet domain CNN learning, such as Figure 7 As shown, it includes: a wavelet transform module 710, a channel selection module 720 and an image classification model 730, wherein:

[0136] The wavelet transform module 710 is used to transform the image channel of the target image from the time domain to the wavelet domain through wavelet transform to obtain a first number of sub-band image channels;

[0137] A channel selection module 720, configured to select the first number of sub-band image channels to determine a second number of sub-band image channels;

[0138] The image classification model 730 is used to input the second number of sub-band image channels into an image classifier model to obtain a classification result of the target image.

[0139] Optionally, before converting the image channel of the target image from the time domain to the wavelet domain through wavelet transform, the method further includes:

[0140] When the color space of the target image is RGB, the color space of the target image is transformed into YCbCr. Optionally, the channel selection module 720 is used to select a third number of low-frequency sub-band image channels of the Y component;

[0141] Selecting a fourth number of low-frequency sub-band image channels of the Cb component;

[0142] selecting a fifth number of low-frequency sub-band image channels of the Cr component;

[0143] The second number is equal to the sum of the third number, the fourth number and the fifth number.

[0144] Optionally, the channel selection module 720 is used to convert the image components of the training images in the training set from the time domain to the wavelet domain through wavelet transform, so as to obtain a first number of sub-band image channels corresponding to each training image;

[0145] wherein the training set includes at least one training image;

[0146] Calculate the energy of each sub-band image channel corresponding to each training image according to an energy calculation formula;

[0147] Determining the order of each sub-band image channel in the training image according to the energy of each sub-band image channel corresponding to each training image;

[0148] Calculating the overall energy ranking in the training set according to the ranking of each sub-band image channel in the training image;

[0149] Determining the ranking of the second number of sub-band image channels according to the overall energy ranking;

[0150] The first number of sub-band image channels are screened according to the ranks of the second number of sub-band image channels to determine the second number of sub-band image channels.

[0151] Optionally, the energy calculation formula is as follows:

[0152]

[0153] Among them, S c is the energy of the cth subband image channel in the training image, W c is the wavelet packet coefficient matrix of the c-th subband image channel in the training image, W c (x, y) is the value with position coordinate (x, y) in the wavelet packet coefficient matrix of the c-th subband image channel in the training image.

[0154] Optionally, the channel selection module 720 is used to perform maximum pooling on the first number of sub-band image channels to obtain a first tensor, and perform average pooling on the first number of sub-band image channels to obtain a second tensor;

[0155] Inputting the first tensor and the second tensor into a multilayer perceptron MLP, and performing an element-by-element operation on an output result of the MLP to obtain a third tensor;

[0156] A fourth tensor is calculated according to the third tensor, the first pre-training parameter and the second pre-training parameter; wherein the first pre-training parameter represents a weight coefficient of a selected channel, and the second pre-training parameter represents a weight coefficient of a non-selected channel;

[0157] Determine, according to the fourth tensor, a probability of each sub-band image channel in the first number of sub-band image channels being selected and a probability of each sub-band image channel not being selected;

[0158] By using a reparameterization method, a final decision vector is obtained according to the probability of each sub-band image channel being selected and the probability of not being selected;

[0159] The final decision vector is multiplied by a tensor formed by stacking the first number of sub-band image channels to obtain a second number of sub-band image channels.

[0160] Optionally, the image recognition device for wavelet domain CNN learning further includes a model training module, wherein the model training module is used to convert image components of training images in a training set from a time domain to a wavelet domain through a wavelet transform, so as to obtain a first number of sub-band image channels corresponding to each training image;

[0161] Screening the first number of sub-band image channels corresponding to each training image to determine a second number of sub-band image channels corresponding to each training image;

[0162] Remove the first layer or the first and second layers of the CNN network model to obtain the pre-trained image classifier model;

[0163] Training the pre-trained image classifier model according to the second number of sub-band image channels corresponding to each training image and the type label corresponding to each training image to obtain the classifier model;

[0164] Wherein, the training set includes at least one training image.

[0165] The image recognition device for wavelet domain CNN learning provided by the present invention can realize Figures 1 to 6 The various processes implemented by the method embodiment and achieving the same technical effect are not described here to avoid repetition.

[0166] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the emotion determination method of the face image, and the method includes:

[0167] By wavelet transform, the image channel of the target image is converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels;

[0168] Screening the first number of sub-band image channels to determine a second number of sub-band image channels;

[0169] The second number of sub-band image channels are input into an image classifier model to obtain a classification result of the target image.

[0170] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0171] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can perform the image recognition method of wavelet domain CNN learning provided by the above methods, the method comprising:

[0172] By wavelet transform, the image channel of the target image is converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels;

[0173] Screening the first number of sub-band image channels to determine a second number of sub-band image channels;

[0174] The second number of sub-band image channels are input into an image classifier model to obtain a classification result of the target image.

[0175] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the above-mentioned image recognition method of wavelet domain CNN learning, the method comprising:

[0176] By wavelet transform, the image channel of the target image is converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels;

[0177] Screening the first number of sub-band image channels to determine a second number of sub-band image channels;

[0178] The second number of sub-band image channels are input into an image classifier model to obtain a classification result of the target image.

[0179] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0180] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image recognition method based on CNN learning in wavelet domain, It is characterized in that include: By wavelet transform, the image channel of the target image is converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels; Screening the first number of sub-band image channels to determine a second number of sub-band image channels; Inputting the second number of sub-band image channels into an image classifier model to obtain a classification result of the target image; The screening of the first number of sub-band image channels to determine the second number of sub-band image channels comprises: By wavelet transform, image components of training images in the training set are converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels corresponding to each training image; Calculate the energy of each sub-band image channel corresponding to each training image according to an energy calculation formula; Determining the order of each sub-band image channel in the training image according to the energy of each sub-band image channel corresponding to each training image; Calculating the overall energy ranking in the training set according to the ranking of each sub-band image channel in the training image; Determining the ranking of the second number of sub-band image channels according to the overall energy ranking; screening the first number of sub-band image channels according to the rankings of the second number of sub-band image channels to determine a second number of sub-band image channels; wherein the training set includes at least one training image; The energy calculation formula is as follows: ; in, is the energy of the c-th subband image channel in the training image, is the wavelet packet coefficient matrix of the c-th subband image channel in the training image, In the wavelet packet coefficient matrix of the cth subband image channel in the training image, the position coordinates are The value of or, Performing maximum pooling on the first number of sub-band image channels to obtain a first tensor, and performing average pooling on the first number of sub-band image channels to obtain a second tensor; Inputting the first tensor and the second tensor into a multilayer perceptron MLP, and performing an element-by-element operation on an output result of the MLP to obtain a third tensor; A fourth tensor is calculated according to the third tensor, the first pre-training parameter and the second pre-training parameter; wherein the first pre-training parameter represents a weight coefficient of a selected channel, and the second pre-training parameter represents a weight coefficient of a non-selected channel; Determine, according to the fourth tensor, a probability of each sub-band image channel in the first number of sub-band image channels being selected and a probability of each sub-band image channel not being selected; By using a reparameterization method, a final decision vector is obtained according to the probability of each sub-band image channel being selected and the probability of not being selected; The final decision vector is multiplied by a tensor formed by stacking the first number of sub-band image channels to obtain a second number of sub-band image channels.

2. The image recognition method of wavelet domain CNN learning according to claim 1, It is characterized in that Before the image channel of the target image is converted from the time domain to the wavelet domain through wavelet transform, it also includes: Convert the color space of the target image to YCbCr.

3. The image recognition method of wavelet domain CNN learning according to claim 1, It is characterized in that Also includes: Training to obtain the image classifier model; The training to obtain the image classifier model includes: By wavelet transform, image components of training images in the training set are converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels corresponding to each training image; Screening the first number of sub-band image channels corresponding to each training image to determine a second number of sub-band image channels corresponding to each training image; Remove the first layer or the first and second layers of the CNN network model to obtain the pre-trained image classifier model; Training the pre-trained image classifier model according to the second number of sub-band image channels corresponding to each training image and the type label corresponding to each training image to obtain the classifier model; The training set includes at least one training image.

4. An image recognition device based on wavelet domain CNN learning, It is characterized in that include: A wavelet transform module, used for converting the image channel of the target image from the time domain to the wavelet domain through wavelet transform to obtain a first number of sub-band image channels; a channel selection module, configured to select the first number of sub-band image channels to determine a second number of sub-band image channels; An image classification model, used for inputting the second number of sub-band image channels into an image classifier model to obtain a classification result of the target image; The channel selection module is used for: By wavelet transform, image components of training images in the training set are converted from the time domain to the wavelet domain to obtain a first number of sub-band image channels corresponding to each training image; Calculate the energy of each sub-band image channel corresponding to each training image according to an energy calculation formula; Determining the order of each sub-band image channel in the training image according to the energy of each sub-band image channel corresponding to each training image; Calculating the overall energy ranking in the training set according to the ranking of each sub-band image channel in the training image; Determining the ranking of the second number of sub-band image channels according to the overall energy ranking; screening the first number of sub-band image channels according to the rankings of the second number of sub-band image channels to determine a second number of sub-band image channels; wherein the training set includes at least one training image; The energy calculation formula is as follows: ; in, is the energy of the c-th subband image channel in the training image, is the wavelet packet coefficient matrix of the c-th subband image channel in the training image, is the wavelet packet coefficient matrix of the c-th subband image channel in the training image, The position coordinates are the numerical values ​​of; The channel selection module is used for: Performing maximum pooling on the first number of sub-band image channels to obtain a first tensor, and performing average pooling on the first number of sub-band image channels to obtain a second tensor; Inputting the first tensor and the second tensor into a multilayer perceptron MLP, and performing an element-by-element operation on an output result of the MLP to obtain a third tensor; A fourth tensor is calculated according to the third tensor, the first pre-training parameter and the second pre-training parameter; wherein the first pre-training parameter represents a weight coefficient of a selected channel, and the second pre-training parameter represents a weight coefficient of a non-selected channel; Determine, according to the fourth tensor, a probability of each sub-band image channel in the first number of sub-band image channels being selected and a probability of each sub-band image channel not being selected; By using a reparameterization method, a final decision vector is obtained according to the probability of each sub-band image channel being selected and the probability of not being selected; The final decision vector is multiplied by a tensor formed by stacking the first number of sub-band image channels to obtain a second number of sub-band image channels.

5. An electronic device comprising a processor and a memory storing a computer program, It is characterized in that When the processor executes the computer program, the steps of the image recognition method of wavelet domain CNN learning according to any one of claims 1 to 3 are implemented.

6. A processor-readable storage medium, It is characterized in that The processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute the steps of the image recognition method of wavelet domain CNN learning according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method for describing texture of image with gradable wavelet packet transformation

    CN101702239A

  • Convolutional neural network face recognition algorithm based on wavelet transform and DCT

    CN110598584A