A woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning
By constructing a discriminative convolutional dictionary learning model and combining it with Tikhonov regularization and independent classifiers, the limitations of image reconstruction and classification tasks in existing technologies are overcome, and efficient global representation and accurate classification of woven fabric textures are achieved.
Patent Information
- Application Number
- CN202411678024.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-11-21
AI Technical Summary
The limitations of existing convolutional dictionary learning methods in image processing include the inability to effectively process high-dimensional signals. Existing technologies have limitations in image analysis, especially in image reconstruction and classification tasks, which lead to significant limitations in practicality and wide applicability.
A discriminative convolutional dictionary learning method was adopted to construct a discriminative convolutional dictionary learning model. Combined with the low-pass filtering operation with Tikhonov regularization, high-pass and low-pass components were extracted. The filter was trained in the time domain and an independent classifier was designed to achieve global characterization and classification of woven fabric texture.
By effectively utilizing the spatial information between image pixels, the global representation of woven fabric texture is achieved, and the model is given the ability to discriminate, thereby achieving accurate reconstruction and classification of woven fabric texture with high classification accuracy.
Smart Images

Figure CN119649350B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image analysis and processing, and relates to a woven fabric texture reconstruction and classification method based on discriminative convolution dictionary learning. Background Art
[0002] In sparse coding, each data sample is represented as a linear combination of a small number of dictionary columns (i.e., atoms). This representation cannot capture the displacement of local patterns in image samples. Furthermore, when processing high-dimensional signals, dictionary learning methods face the curse of dimensionality, which makes the task difficult to implement. To address these two issues, many algorithms propose to extract overlapping patches from the training samples and then train local models on these patches. This patch-based technique is similar to manually convolving the dictionary with the sample. However, patch-based methods are not optimal because the relationship between adjacent patches is ignored, which will result in the learned dictionary containing different shifted versions of the same pattern. Moreover, because each sample element (such as an image pixel) appears in multiple overlapping patches, the features learned separately may not be consistent. In addition, this representation is often highly redundant.
[0003] To address these challenges, the Convolutional Dictionary Learning (CDL) model provides an alternative approach that assumes that the signal can be represented by the sum of several filters convolved with the corresponding sparse feature maps. Therefore, it has a single numerical feature and translation-invariant properties, and can characterize the entire signal. Specifically, the CDL method learns a translation-invariant dictionary composed of multiple filters, which can extract local patterns of samples at different translation positions through convolution. Therefore, the CDL method no longer needs to use overlapping blocks. In the past few years, the CDL model has become a hot topic of extensive research, and its performance has surpassed traditional dictionary learning methods in a variety of image processing applications including super-resolution, image separation, image inpainting, and image fusion.
[0004] The CDL model assumes that a signal It can be approximately represented as the sum of a set of convolutional dictionaries and their corresponding sparse feature codes. In other words, the signal Z can be decomposed into in is the convolution dictionary, Represents the corresponding convolutional coding coefficient, n is the number of convolutional dictionaries, * is the convolution operator, and generally speaking m<<M. Therefore, in the CDL model, the optimization solution for the convolutional dictionary and convolutional coding coefficient is defined as the following minimization problem:
[0005]
[0006] When the convolution dictionary d i Given, the problem becomes to find Convolutional Sparse Coding (CSC) tracking task. Expressed in matrix form: Z = DX, where is composed of the local convolution dictionary The global convolution dictionary is formed by shifting 1 pixel down in the column direction for a total of n times. L Contains convolution dictionary As its atom, the global coding coefficient (also called global coding vector) X is obtained by Therefore, the convolution dictionary learning problem (1) can be reformulated as:
[0007]
[0008] like Figure 1 As shown in the paper 1 (ALocal Block Coordinate Descent Algorithm for the CSCModel[C].2019IEEE / CVF Conference on Computer Vision and Pattern Recognition), the local block coordinate descent (LoBCoD) method decomposes the global encoding vector X into M non-overlapping n-dimensional local encoding vectors Therefore, the signal Z can be expressed as in represents the operator for extracting the i-th m-dimensional vector in Y, then This means that the vector D L x i An operator placed at the i-th position and filling the rest of the elements with zeros. On the other hand, the m-dimensional vector P extracted from the signal Z i Z=P i DX=Ωγ i ,in is a D L At its center is a flat dictionary, is a vector containing the local code x i The stripe vector at its center. In short, the stripe vector γ i Responsible for coding P i Everything in Z, while the local encoding vector xi It is only responsible for encoding part of the information. The research in Reference 2 (Convolutional Dictionary Learning via Local Processing[C].2017IEEE International Conference on Computer Vision) shows that if all the stripe vectors γ i are sparse, then the convolutional sparse coding problem has a unique solution and can be solved by the Orthogonal Matching Pursuit (OMP) or Basic Pursuit (BP) algorithm. Therefore, the global CSC problem (2) can be transformed into a problem about the local coding vector x i and the local convolution dictionary D L The minimization problem is:
[0009]
[0010] In order to solve the problem efficiently, instead of optimizing all local encoding vectors at once, they transform the local encoding vector x i Considered as a set of coordinates extracted from the global encoding vector X, for each x i Therefore, when D L When , the update rule for each local encoding vector is:
[0011]
[0012] definition is the local encoding vector x i The residual when not contributing, the optimization problem (4) can be rewritten as:
[0013]
[0014] Since the above minimization problem involves global variables such as R i , which can be decomposed into the following local problems:
[0015]
[0016] The reason is that, based on the observation, the local encoding vector x i The update rule is only affected by its corresponding m-dimensional vector P i R i (corresponding to the original image The core idea of the group coordinate descent algorithm is to minimize the penalty term for a given coordinate group at each step, while keeping the latest value of other coordinate groups unchanged. This is also a preprocessing stage. The subsequent stages will update the local encoding vector in the next step based on the latest value of the local encoding vector in the previous step. In addition, this method can ensure that during the update process, each There will be no overlap between the local coding vectors of the dimensional image sub-blocks, so they can be updated in parallel, which is generally implemented using the LARS efficient batch processing algorithm. Specifically, the local coding vectors {x i} as a set and define it as the Lth i Layer, the LARS algorithm traverses these layers in turn and updates their respective local encoding vector sets in parallel. It is worth noting that this parallel update method can ensure that the number of internal iterations depends only on the vector P i R i The dimension m, rather than the local encoding vector x i Therefore, for a size of The total number of layers is m.
[0017] The common strategy for optimizing CDL models is to alternate between encoding vectors and dictionary updating steps within a predefined number of iterations. The goal of the dictionary updating step is to normalize the constraints on each convolutional dictionary d. i (dictionary atom), find the minimum value of the quadratic term in formula (3), that is:
[0018]
[0019] As a random online dictionary updating method, LoBCoD usually uses a small step size and finds only a few x i Instead of moving forward along the global gradient direction after completing the entire tracking phase, the dictionary is updated after the sparse representation of d is obtained. It should be noted that the convolution dictionary d should be updated after each dictionary update. i Perform normalization.
[0020] The traditional (convolutional) dictionary learning method is unsupervised, that is, the labels of the training samples are not considered in the filter training stage, and its role is only to be used as a feature extractor. In order to complete the classification task, some scholars have proposed a discriminant (convolutional) dictionary learning method that adds a discriminant term in the optimization process. For example, the Fisher discriminant dictionary learning method proposed in Reference 3 (Fisher discrimination dictionary learning for sparse representation [C]. 2011 International Conference on Computer Vision) regards the complete dictionary as consisting of category sub-dictionaries and imposes Fisher discriminant criterion constraints on it. The DL-COPAR method proposed in Reference 4 (A classification-oriented dictionary learning model: Explicitly learning the particularity and commonality across categories [J]. Pattern Recognition, 2014, 47 (2): 885-898.) adds a shared dictionary to the Fisher discriminant dictionary learning method to extract similar background features of the input image. Furthermore, the CSDL method proposed in Reference 5 (Learning category-specific dictionary and shared dictionary for fine-grained image categorization[J].IEEE Transactions on Image Processing, 2013, 23(2):623-634.) weights the incoherent terms of the objective function with the number of features to reduce the impact of feature size in dictionary learning.The D-KSVD method proposed in Reference 6 (Discriminative K-SVD for dictionary learning in face recognition [C]. 2010 IEEE computer society conference on computer vision and pattern recognition) and the LC-KSVD method proposed in Reference 7 (Label consistent K-SVD: Learning adiscriminative dictionary for recognition [J]. IEEE transactions on pattern analysis and machine intelligence, 2013, 35(11): 2651-2664.) add a classification error loss term to the objective function to improve the discriminability of the dictionary. The disadvantages of the above methods are that, first, they can only effectively process local blocks of the input image and cannot take the global image as the input model as a whole. Second, they increase the complexity of the model objective function, making the optimization process more difficult and time-consuming, and are prone to falling into local optimality rather than global optimality.
[0021] In addition, some scholars have proposed using other classifiers to complete classification tasks. Reference 8 (Convolutional sparse coding classification model for image classification [C]. 2016 IEEE International Conference on Image Processing) and Reference 9 (Convolutional sparse coding for face recognition [C]. 2017 4th International Conference on Information, Cybernetics and Computational Social Systems) proposed a convolutional sparse coding classification (CSCC) model that introduces labels during the training phase and uses it for image classification tasks. The CSCC model combines the convolutional sparse coding framework with the traditional sparse representation classification (SRC) method. However, the model relies on an ADMM solver operating in the Fourier frequency domain, thus losing its connection with the block-based paradigm.
[0022] To address this challenge, the paper 10 (Convolutional Dictionary Learning via Local Processing [C]. 2017 IEEE International Conference on Computer Vision) proposed the Slice-Based Dictionary Learning (SBDL) method. This method takes a local perspective and does not require the time domain to be converted into the frequency domain. Instead, it trains filters directly in the time domain. Compared with the CSCC method that uses Fourier transforms, the SBDL method demonstrates stronger performance. However, this method only considers the reconstruction error and the sparsity of the convolutional coding coefficients, which makes it perform well in applications such as image reconstruction and image fusion, but does not optimize the convolutional coding coefficients for classification tasks. In other words, although the learned convolutional dictionary has strong representational capabilities, it lacks certain discriminative capabilities.
[0023] In summary, existing (convolutional) dictionary learning methods show some obvious limitations and deficiencies in image reconstruction and classification tasks, resulting in significant restrictions on practicality and wide applicability.
[0024] Therefore, it is of great significance to study a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning to solve the problems existing in the existing technology. Summary of the Invention
[0025] The purpose of the present invention is to solve the problems existing in the prior art and provide a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning.
[0026] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0027] A woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning is proposed. First, all woven fabric texture images in the woven fabric texture image training set containing samples of different categories are subjected to a low-pass filtering operation based on Tikhonov regularization to extract their high-pass components and low-pass components. A discriminative convolutional dictionary learning model (DCDL) is constructed and the model is optimized and solved. Then, the high-pass components and corresponding category labels corresponding to the woven fabric texture sample images in the training set are input into the discriminative convolutional dictionary learning model for training. After the training, the learned local convolution dictionary D is output. L and the corresponding local classifier weight W L ; Finally, for the test image y q , first perform a low-pass filtering operation based on Tikhonov regularization to extract the low-pass component Then calculate its high-pass component The corresponding coding coefficient X q , and finally passed D L and X q For high-pass components and the test image y q Reconstruction, through W L and X q To determine the test image y q Category;
[0028] The discriminative convolutional dictionary learning model constructed is:
[0029]
[0030] Among them, Y is the training sample set, D is the global convolution dictionary, X is the global encoding coefficient, λ is the regularization parameter used to control the sparsity of the convolutional encoding coefficient, and γ is the regularization parameter that controls the proportion of the balance classifier loss in the total loss function; is the total number of training sample sets, n i is the number of samples in the i-th training sample set, and C is the number of categories of samples in the training sample set; Represents the training sample y i,jThe true label of (the jth sample in the i-th sample set), for the jth sample y in the i-th sample set i,j , and its corresponding convolutional coding coefficient is If y i,j Belongs to category c (i.e. when i=c), then H i,j The other elements in are 0; is the training sample y i,j The predicted label of To predict the label and the true label H i,j The cross-entropy discriminant loss function of the difference between L There is no corresponding relationship between the actual label of the training sample and the i,j =WX i,j Compute the output of the independent classifier
[0031]
[0032] Among them, X i,j is the convolutional coding coefficient corresponding to the jth sample in the i-th class sample set, and W is the global classifier weight;
[0033] The discriminative convolution dictionary learning model constructed by the present invention directly decomposes the input image into two key components - a series of convolution kernels (convolution dictionary) and the corresponding feature map (convolution coding coefficient). By performing convolution operations on these two components and then adding the results, a reconstructed image corresponding to the original input image can be obtained. Since the convolution operation has translation invariance (corresponding to the periodicity of woven fabric texture), it can effectively utilize the spatial information between image pixels and naturally capture the local pattern of the texture and its spatial continuity (corresponding to the spatial randomness of the woven fabric texture), thereby realizing the global characterization of the woven fabric texture. In addition, in order to give the model a certain discriminative ability, an independent classifier is designed. The independent classifier can be combined with the convolution coding coefficient learning to obtain the classifier weight. The model construction idea is as follows. Figure 2 It is worth noting that the discriminative convolutional dictionary learning model is an end-to-end model. Instead of training an independent classifier after outputting the convolutional coding coefficients, the model optimizes the convolutional dictionary, convolutional coding coefficients, and classifier weight set as a whole in the same loss function.
[0034] As the preferred technical solution:
[0035] The above-mentioned method for woven fabric texture reconstruction and classification based on discriminative convolutional dictionary learning has the following specific steps:
[0036] (1) For the woven fabric texture image training set containing C samples, define is the i-th class training sample set, where is the jth sample of the i-th category, n i It's Y i The number of samples, that is, the number of training samples of the i-th category; define the local convolution dictionary set D L =[d1,…,d p ,…,d n ],in is the pth convolution dictionary, n is the number of different dictionary atoms in the local convolution dictionary set; defines the convolution coding coefficient set of the i-th class sample in Contains M local encoding vectors for reconstructing sample y i,j ;
[0037] (2) All woven fabric texture images in the training set are subjected to a low-pass filtering operation based on Tikhonov regularization (Tikhonov regularization is a prior art, see the literature Tikhonov regularization and total least squares [J]. SIAM journal on matrix analysis and applications, 1999, 21 (1): 185-194.) to extract their high-pass component and low-pass component;
[0038] (3) Construct a discriminative convolutional dictionary learning model and iteratively update the model using the gradient descent method; the discriminative convolutional dictionary learning model includes a reconstruction error term and a classifier loss term; the classifier Z i,j =WX i,j It is just a simple linear transformation. Admittedly, it can be replaced by various more complex nonlinear transformations based on neural networks. However, considering the relatively simple texture structure of woven fabrics, such a complex network structure is not necessary, otherwise it may cause overfitting problems. The solution includes the solution of local encoding vectors, local convolutional dictionaries and local classifier weights.
[0039] (4) Hyperparameter initialization, i.e. setting the local convolution dictionary D L Neutron Dictionary d p The size and number of , as well as the regularization parameter λ used to control the sparsity of the convolutional coding coefficients, the regularization parameter γ used to balance the proportion of the classifier loss in the total loss function, and the maximum number of iterations;
[0040] (5) The high-pass components and corresponding category labels corresponding to the woven fabric texture sample images in the training set are input into the discriminative convolutional dictionary learning model for training until the training round reaches the maximum number of iterations, that is, the training is stopped; after the training of the discriminative convolutional dictionary learning model is completed, the learned local convolutional dictionary D is output. L and the corresponding local classifier weight W L ;
[0041] (6) For the test image y q First, perform a low-pass filtering operation based on Tikhonov regularization to extract its low-pass component Then calculate its high-pass component The corresponding coding coefficient X q , and finally passed D L and X q For high-pass components and the test image y q Reconstruction, through W L and X q To determine the test image y q Category.
[0042] As described above, in the woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning, the low-pass filtering operation based on Tikhonov regularization in step (2) is formulated as the following optimization problem:
[0043]
[0044] Among them, σ represents the Tikhonov regularization coefficient, which is used to balance the ratio between data fidelity and smoothness, and G i It is an operator that calculates the discrete gradient of the image in the i-th dimension; this optimization problem is usually solved by numerical optimization methods such as gradient descent or conjugate gradient.
[0045] As described above, a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning is proposed. In step (3), the discriminative convolutional dictionary learning model is iteratively updated and solved using the gradient descent method. In each iteration, the local convolutional dictionary D L and the local classifier weight W L The update steps are as follows:
[0046]
[0047] in, is an operator that normalizes the dictionary atoms, η represents the step size of each iterative update, Denote the objective function (8) for the local convolution dictionary D L The gradient, Represents the objective function (8) for the local classifier weight W L gradient.
[0048] The specific solution process is: For the global discriminant optimization problem of formula (8), use the local encoding vector Local convolution dictionary D L and the local classifier weight W L It can be expressed as:
[0049]
[0050] By fixing To D L and W L Update and fix D L and W L right Update to achieve alternating optimization D L 、W L and First, suppose D L and W L is fixed, then for the jth sample of the i-th category, its kth local encoding vector The update rule can be written as:
[0051]
[0052] Similar to the LoBCoD method, each local encoding vector x k It is considered as a set of coordinates taken from the global encoding vector X, and each set of coordinates is optimized separately:
[0053]
[0054] Similarly, define and
[0055]
[0056] For D L The goal of updating is to find the minimum value of the quadratic term in (14) while satisfying the constraints of normalizing all dictionary atoms:
[0057]
[0058] Update W L The goal of this stage is to solve the following optimization problem:
[0059]
[0060] Because D L and WL The update process of is independent, and the two update stages are performed simultaneously. In order to solve Equations (18) and (19) more efficiently, the projected steepest gradient descent method can be used. Specifically, first derive the objective function in Equation (18) relative to D L The gradient of is:
[0061]
[0062] The objective function in formula (17) is relative to W L The gradient of is:
[0063]
[0064] Then, along the gradient direction, a smaller step size η is taken to update D L and W L , and at the same time in each iteration the current D L Normalize all columns of until convergence. The mathematical expression for updating the local convolution dictionary is:
[0065]
[0066] in Is an operator that normalizes the dictionary atoms. The mathematical expression for updating the local classifier weight is:
[0067]
[0068] As described above, a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning, the local convolutional dictionary D in step (4) L Neutron Dictionary d p The size and number of are 5×5 and 80 respectively, the regularization parameter λ for controlling the sparsity of the convolutional coding coefficients is 0.01, the regularization parameter γ for balancing the proportion of the classifier loss in the total loss function is 1.0, and the maximum number of iterations is 200.
[0069] As described above, a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning is implemented by D L and X q For high-pass components and the test image y q Reconstruction is performed, specifically, the high-pass component is reconstructed by formula (22), and the test image is reconstructed by formula (23);
[0070]
[0071] in, for The local encoding vector of Contains M local encoding vectors.
[0072] As described above, a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning is implemented by W L and X q To determine the test image y q The category of the test image y is determined by formula (24) q Category;
[0073]
[0074] in, The index corresponding to the largest element in is the sample y to be queried q Category number
[0075]
[0076] In the above-mentioned woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning, the woven fabric texture image is a grayscale image with a bit depth of 8 bits or more.
[0077] Beneficial effects:
[0078] The present invention discloses a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning. The discriminative convolutional dictionary learning model constructed draws on the convolution operation in convolutional neural networks, can effectively utilize the spatial information between image pixels, and realize the global representation of woven fabric texture. At the same time, through the design of independent classifiers and the combination of convolutional coding coefficient learning to obtain classifier weights, the constructed model is given the ability to classify fabric textures. Moreover, the model is an end-to-end model, that is, instead of training an independent classifier after outputting the convolutional coding coefficients, the convolutional dictionary, convolutional coding coefficients and classifier weight set are comprehensively optimized in the same loss function, so that the woven fabric texture can be represented and classified simultaneously, and the classification is accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 It is a schematic diagram of the local group coordinate descent (LoBCoD) model;
[0080] Figure 2 This is a diagram of the construction idea of the discriminative convolutional dictionary learning model of the present invention;
[0081] Figure 3 It is a flow chart of a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning of the present invention;
[0082] Figure 4 is a schematic diagram of woven fabric texture samples;
[0083] Figure 5 It is a curve showing the change of the loss function value during the training process of the discriminative convolutional dictionary learning model of the present invention;
[0084] Figure 6 is the local convolution dictionary D L Visualization results, where (a) is the untrained local convolution dictionary and (b) is the trained local convolution dictionary.
[0085] Figure 7 is the local classifier weight W L Visualization results, where (a) shows the weight of the untrained local classifier and (b) shows the weight of the trained local classifier.
[0086] Figure 8 (a) is the high-pass component corresponding to the woven fabric texture sample image, Figure 8 (b) is the high-pass component reconstructed using the present invention, Figure 8 (c) is the original woven fabric texture sample image, Figure 8 (d) is a sample image of woven fabric texture reconstructed using the present invention.
[0087] Figure 9 (a) is the low-pass component of the plain fabric texture sample, Figure 9 (b) is the visualization result of its corresponding convolutional coding coefficient;
[0088] Figure 10 (a) is the low-pass component of eight five-fly weft satin fabric texture samples, Figure 10 (b) is the visualization result of its corresponding convolutional coding coefficient;
[0089] Figure 11 (a) is the low-pass component of the through-hole tissue texture sample, Figure 11 (b) is the visualization result of its corresponding convolutional coding coefficient;
[0090] Figure 12 (a) is the low-pass component of the honeycomb texture sample, Figure 12 (b) is the visualization result of its corresponding convolutional coding coefficient;
[0091] Figure 13 (a) is the low-pass component of the wick tissue texture sample, Figure 13 (b) is the visualization result of its corresponding convolutional coding coefficient;
[0092] Figure 14 (a) is the low-pass component of the horizontal convex stripe texture sample, Figure 14 (b) is the visualization result of the corresponding convolutional coding coefficients. DETAILED DESCRIPTION
[0093] Below in conjunction with specific embodiment, further set forth the present invention.Should be understood that these embodiments are only used to illustrate the present invention and are not used in limiting the scope of the present invention.In addition, should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall equally within the scope limited by the appended claims of the application.
[0094] A woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning is proposed. The specific steps are as follows:
[0095] (1) For the woven fabric texture image training set containing C samples, define is the i-th class training sample set, where is the jth sample of the i-th category, n i It's Y i The number of samples; define the local convolution dictionary set D L =[d1,…,d p ,…,d n ],in is the pth convolution dictionary, n is the number of different dictionary atoms in the local convolution dictionary set; defines the convolution coding coefficient set of the i-th class sample in Contains M local encoding vectors for reconstructing sample y i,j ;
[0096] Among them, the woven fabric texture image is a grayscale image with a bit depth of 8 bits or more;
[0097] (2) Perform a low-pass filtering operation based on Tikhonov regularization on all woven fabric texture images in the training set to extract their high-pass and low-pass components
[0098] The low-pass filtering operation based on Tikhonov regularization is formulated as the following optimization problem:
[0099]
[0100] Among them, σ represents the Tikhonov regularization coefficient, G i is the operator that calculates the discrete gradient of the image in the i-th dimension, y q is the test image;
[0101] (3) Construct a discriminative convolutional dictionary learning model and iteratively update the model using the gradient descent method; the discriminative convolutional dictionary learning model includes a reconstruction error term and a classifier loss term; the solution includes the solution of the local encoding vector, the local convolutional dictionary, and the local classifier weight;
[0102] The discriminative convolutional dictionary learning model constructed is:
[0103]
[0104] Among them, Y is the training sample set, D is the global convolution dictionary, X is the global encoding coefficient, λ is the regularization parameter used to control the sparsity of the convolutional encoding coefficient, and γ is the regularization parameter that controls the proportion of the balance classifier loss in the total loss function; is the total number of training sample sets, n i is the number of samples in the i-th training sample set, and C is the number of categories of samples in the training sample set; Represents the training sample y i,j The true label of y i,j Belongs to category c, then H i,j The other elements in are 0; is the training sample y i,j The predicted label of To predict the label and the true label H i,j The cross entropy discriminant loss function of the difference between them;
[0105]
[0106] Among them, X i,j is the convolutional coding coefficient corresponding to the jth sample in the i-th class sample set, and W is the global classifier weight;
[0107] The discriminative convolution dictionary learning model is iteratively updated using the gradient descent method. In each iteration, the local convolution dictionary D L and the local classifier weight W L The update steps are as follows:
[0108]
[0109] in, is an operator that normalizes the dictionary atoms, η represents the step size of each iterative update, Denote the objective function (ⅱ) for the local convolution dictionary D L The gradient, Represents the objective function (ⅱ) for the local classifier weight W L gradient;
[0110] (4) Hyperparameter initialization, i.e. setting the local convolution dictionary D L Neutron Dictionary d pThe size and number of , as well as the regularization parameter λ used to control the sparsity of the convolutional coding coefficients, the regularization parameter γ used to balance the proportion of the classifier loss in the total loss function, and the maximum number of iterations;
[0111] Among them, d p The size and number of are 5×5 and 80 respectively, λ=0.01, γ=1.0, and the maximum number of iterations is 200;
[0112] (5) The high-pass components and corresponding category labels corresponding to the woven fabric texture sample images in the training set are input into the discriminative convolutional dictionary learning model for training until the training round reaches the maximum number of iterations, that is, the training is stopped; after the training of the discriminative convolutional dictionary learning model is completed, the learned local convolutional dictionary D is output. L and the corresponding local classifier weight W L ;
[0113] (6) For the test image y q First, perform a low-pass filtering operation based on Tikhonov regularization to extract its low-pass component Then calculate its high-pass component The corresponding coding coefficient X q , and finally reconstruct the high-pass component through formula (ⅶ) Reconstruct the test image y through formula (ⅷ) q , determine the test image y by formula (ⅸ) q Category;
[0114]
[0115] in, for The local encoding vector of Contains M local encoding vectors; The index corresponding to the largest element in is the sample y to be queried q Category number
[0116] The following is an explanation of a woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning using a specific embodiment of the present invention, as follows:
[0117] Figure 3 This is the overall flow chart of the present invention. The hardware and programming language used to execute the method of the present invention are not limited and can be written in any language. Therefore, other working modes will not be described in detail.
[0118] This embodiment is built on a high-performance computing server for model training. The specific hardware configuration is a 32-core Intel E5-2620v4 CPU running at 2.10GHz, equipped with 64GB of system memory, and four NVIDIA GeForce RTX 2080 graphics cards, each with 8GB of video memory. In terms of the software environment, the model development and training are based on the Ubuntu 22.04 operating system, using the Python 3 programming environment, the Pytorch 2.1.2 deep learning platform, and CUDA 12.3 for GPU acceleration, realizing the present invention's woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning.
[0119] (1) Collect 100 images of woven fabric textures of 16 different categories with a bit depth of 8 bits, including plain weave, one-up three-down right twill, eight-piece five-fly weft satin, fancy square weave, four-up two-down reinforced twill, two-up one-down two-up three-down composite twill, reed mat twill, reinforced satin I, reinforced satin II, checkered weave, crepe weave, openwork weave, honeycomb weave, loose weave, wicker weave, and horizontal ribbed weave, for a total of N = 1600 images. The categories are numbered sequentially from 01 to 16, and their size is 512×512 pixels;
[0120] (2) 80 images are randomly selected from each category of woven fabric texture images as the training set, and the remaining images are used as the test set. All woven fabric texture images in the training set are subjected to low-pass filtering based on Tikhonov regularization, and their high-pass components and low-pass components are extracted and displayed in Figure 8 (a) and Figures 9-14 (a);
[0121] (3) Construct a discriminative convolutional dictionary learning model and iteratively update the model using the gradient descent method; the discriminative convolutional dictionary learning model includes the reconstruction error term and the classifier loss term; the solution includes the solution of the local encoding vector, the local convolutional dictionary and the local classifier weight. The solution results of the local convolutional dictionary and the local classifier weight are shown in Figure 6 (b) with Figure 7 (b); The convolutional coding coefficients composed of these local coding vectors are shown in Figures 9-14 (b);
[0122] The discriminative convolutional dictionary learning model constructed is:
[0123]
[0124] Among them, n i =80, C=16, Training sample set One of its column vectors Represents the jth training set sample from the i-th class. Training set samples from different classes (column vectors) can be reassembled into a size of The matrix is shown in Figure 4 ; It consists of a local convolution dictionary Constructed, constructed as Figure 1 As shown, D L Each column in can be reassembled into a size of The matrix is shown in Figure 6 ; One of its column vectors is the convolutional coding coefficient corresponding to the j-th training set sample of the i-th category; is the global classifier weight, which is composed of the local classifier weight Constructed and displayed in Figure 7 ; For the true label H i,j , if y i,j Belongs to category c, then H i,j The other elements in are 0;
[0125] (4) Hyperparameter initialization, i.e. setting the local convolution dictionary D L Neutron Dictionary d p The size and number of , as well as the regularization parameter λ used to control the sparsity of the convolutional coding coefficients, the regularization parameter γ used to balance the proportion of the classifier loss in the total loss function, and the maximum number of iterations;
[0126] Among them, d p The size and number of are 5×5 and 80 respectively, λ=0.01, γ=1.0, and the maximum number of iterations is 200;
[0127] (5) Input the high-pass components and corresponding category labels corresponding to the woven fabric texture sample images in the training set into the discriminative convolutional dictionary learning model for training until the training round reaches the maximum number of iterations, that is, the training is stopped; Figure 5 The figure shows a smooth curve in which the loss function value gradually decreases as the number of iterations increases during training. As can be seen from the figure, the loss function value decreases significantly during the iteration process and tends to be flat after about 200 iterations, indicating that the model has reached a convergence state.
[0128] After the discriminative convolutional dictionary learning model is trained, the learned local convolutional dictionary D is output. L and the corresponding local classifier weight W L ;like Figure 6 Shown is the local convolution dictionary D L The visualization results, such as Figure 7 Shown are the local classifier weights WL Visualization results;
[0129] (6) For the test image y q First, perform a low-pass filtering operation based on Tikhonov regularization to extract its low-pass component Then calculate its high-pass component The corresponding coding coefficient X q , and finally passed D L and X q For high-pass components and the test image y q Reconstruction, through W L and X q To determine the test image y q Category;
[0130] Table 1 shows the average reconstruction and classification performance indicators of woven fabric texture images with different structures, where PSNR (Peak Signal-to-Noise Ratio) is the peak signal-to-noise ratio and SSIM (Structural Similarity) is the structural similarity.
[0131] Table 1
[0132]
[0133] It can be seen from the data in Table 1 that, first, the method of the present invention can perform excellently in the reconstruction tasks of various types of woven fabric textures. Specifically, the peak signal-to-noise ratio of each category reached above 31.9dB, the structural similarity was higher than 97.5%, and the average peak signal-to-noise ratio and structural similarity were 34.02dB and 98.0984%, respectively. Second, the model also showed high accuracy in the woven fabric texture classification task, indicating that the model has strong texture analysis and recognition capabilities. Specifically, the classification accuracy of each category was higher than 99%, and the average classification accuracy was 99.19%.
Claims
1. A woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning, characterized by: Firstly, all the woven fabric texture images in the training set of woven fabric texture images containing samples of different categories are subjected to low-pass filtering based on Tikhonov regularization to extract their high-pass and low-pass components, and a discriminative convolutional dictionary learning model is constructed and the model is optimized and solved; then the high-pass components and corresponding category labels corresponding to the woven fabric texture sample images in the training set are input into the discriminative convolutional dictionary learning model for training, and the learned local convolution dictionary D is output after the training is completed. L and the corresponding local classifier weight W L ; Finally, for the test image y q , first perform a low-pass filtering operation based on Tikhonov regularization to extract the low-pass component Then calculate its high-pass component The corresponding coding coefficient X q , and finally passed D L and X q For high-pass components and the test image y q Reconstruction, through W L and X q To determine the test image y q Category; The discriminative convolutional dictionary learning model constructed is: Among them, Y is the training sample set, D is the global convolution dictionary, X is the global encoding coefficient, λ is the regularization parameter used to control the sparsity of the convolutional encoding coefficient, and γ is the regularization parameter that controls the proportion of the balance classifier loss in the total loss function; is the total number of training sample sets, n i is the number of samples in the i-th training sample set, and C is the number of categories of samples in the training sample set; Represents the training sample y i,j The true label of y i,j Belongs to category c, then H i,j The other elements in are 0; is the training sample y i,j The predicted label of To predict the label and the true label H i,j The cross entropy discriminant loss function of the difference between them; Among them, X i,j is the convolutional coding coefficient corresponding to the jth sample in the i-th class sample set, and W is the global classifier weight.
2. The method for woven fabric texture reconstruction and classification based on discriminative convolutional dictionary learning according to claim 1, characterized in that: The specific steps are as follows: (1) For the woven fabric texture image training set containing C samples, define is the i-th class training sample set, where is the jth sample of the i-th category, n i It's Y i The number of samples; define the local convolution dictionary set D L =[d1,…,d p ,…,d n ],in is the pth convolution dictionary, n is the number of different dictionary atoms in the local convolution dictionary set; defines the convolution coding coefficient set of the i-th class sample in Contains M local encoding vectors for reconstructing sample y i,j ; (2) Perform a low-pass filtering operation based on Tikhonov regularization on all woven fabric texture images in the training set to extract their high-pass and low-pass components; (3) Construct a discriminative convolutional dictionary learning model and iteratively update the model using the gradient descent method; the discriminative convolutional dictionary learning model includes a reconstruction error term and a classifier loss term; the solution includes the solution of the local encoding vector, the local convolutional dictionary, and the local classifier weight; (4) Hyperparameter initialization, i.e. setting the local convolution dictionary D L Neutron Dictionary d p The size and number of , as well as the regularization parameter λ used to control the sparsity of the convolutional coding coefficients, the regularization parameter γ used to balance the proportion of the classifier loss in the total loss function, and the maximum number of iterations; (5) The high-pass components and corresponding category labels corresponding to the woven fabric texture sample images in the training set are input into the discriminative convolutional dictionary learning model for training until the training round reaches the maximum number of iterations, that is, the training is stopped; after the training of the discriminative convolutional dictionary learning model is completed, the learned local convolutional dictionary D is output. L and the corresponding local classifier weight W L ; (6) For the test image y q First, perform a low-pass filtering operation based on Tikhonov regularization to extract its low-pass component Then calculate its high-pass component The corresponding coding coefficient X q , and finally passed D L and X q For high-pass components and the test image y q Reconstruction, through W L and X q To determine the test image y q Category.
3. The method for woven fabric texture reconstruction and classification based on discriminative convolutional dictionary learning according to claim 2, characterized in that: The low-pass filtering operation based on Tikhonov regularization in step (2) is formulated as the following optimization problem: Among them, σ represents the Tikhonov regularization coefficient, G i It is an operator that calculates the discrete gradient of an image in the i-th dimension.
4. The method for woven fabric texture reconstruction and classification based on discriminative convolutional dictionary learning according to claim 2, characterized in that: In step (3), the discriminative convolution dictionary learning model is iteratively updated using the gradient descent method. In each iteration, the local convolution dictionary D L and the local classifier weight W L The update steps are as follows: in, is an operator that normalizes the dictionary atoms, η represents the step size of each iterative update, Denote the objective function (8) for the local convolution dictionary D L The gradient, Represents the objective function (8) for the local classifier weight W L gradient.
5. The method for woven fabric texture reconstruction and classification based on discriminative convolutional dictionary learning according to claim 2, characterized in that: In step (4), d p The size and number of are 5×5 and 80 respectively, λ=0.01, γ=1.0, and the maximum number of iterations is 200.
6. The method for woven fabric texture reconstruction and classification based on discriminative convolutional dictionary learning according to claim 2, characterized in that: In step (6), D L and X q For high-pass components and the test image y q Reconstruction is performed, specifically, the high-pass component is reconstructed by formula (22), and the test image is reconstructed by formula (23); in, for The local encoding vector of Contains M local encoding vectors.
7. The method for woven fabric texture reconstruction and classification based on discriminative convolutional dictionary learning according to claim 2, characterized in that: In step (6), W L and X q To determine the test image y q The category of the test image y is determined by formula (24) q Category; in, The index corresponding to the largest element in is the sample y to be queried q Category number 8. A woven fabric texture reconstruction and classification method based on discriminative convolutional dictionary learning according to claim 1 or 2, characterized in that: The woven fabric texture image is a grayscale image with a bit depth of 8 bits or more.
Citation Information
Patent Citations
Image decomposition method based on convolution and K-SVD dictionary joint sparse coding
CN112734763A
Textile defect image classification method based on intra-class difference suppression discrimination dictionary learning
CN115018814A