Pneumonia X-ray film identification method based on non-negative affine discrimination cooperative representation
Through the non-negative affine discrimination synergistic representation method, the existing pneumonia X-ray image classification algorithms have solved the problem of performance instability and insufficient use of training data in complex scenarios, and the high accuracy and robustness recognition of pneumonia X-ray images are achieved, especially in distinguishing different types of pneumonia.
Patent Information
- Application Number
- CN202510529555.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
AI Technical Summary
The existing pneumonia X-ray image classification algorithm has unstable performance in complex scenarios. It depends on image quality and feature extraction. When the training data volume is limited, the sample features cannot be effectively utilized. The existing methods have failed to fully explore the similarity and affine subspace information between similar samples.
The non-negative affine discriminant synergistic representation method is adopted, and the non-negative constraints force the coding coefficient to be positive is enhanced, and the representation consistency of similar samples is enhanced, and the test samples are applied to map the test samples to the affine space of the training samples. The discriminant regular terms are introduced to improve the ability to adapt to the morphological differences of pneumonia lesions, and the objective function is optimized by the alternating direction multipliers method.
It significantly improves the accuracy and robustness of pneumonia X-ray image recognition, especially in distinguishing different types of pneumonia such as new coronavirus infection, and improves the model's ability to accurately capture and represent complex data.
Smart Images

Figure CN120451649A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a method for recognizing pneumonia X-rays. Background Art
[0002] Many existing pneumonia X-ray image classification algorithms have difficulty maintaining efficient performance in complex scenarios and are highly dependent on image quality and feature extraction. They are prone to instability in classification results when faced with external interference (such as noise and illumination changes). When the amount of training data is limited, existing methods often cannot effectively utilize sample features to achieve efficient model performance. Existing representation-based classification methods fail to fully exploit the similarities between similar samples and the information of samples in the affine subspace.
[0003] The invention patent application number 202410878095.0 discloses a meta-learning-based few-sample pneumonia classification method and medium, comprising the following steps: obtaining a chest X-ray image, inputting a trained few-sample pneumonia classification model, and obtaining the pneumonia category probability; wherein, the few-sample pneumonia classification model includes a hierarchical classification module and a related task module, and the hierarchical classification module is constructed based on a disease hierarchy tree, including a feature extractor and a hierarchical classifier, and the hierarchical classifier is used to further extract features of different granularity levels from the feature representation of the chest X-ray image and calculate the classification probability of different granularity levels; the parameters of the hierarchical classification module are first updated in two stages on the base disease dataset through a meta-learning algorithm, including local updates and global updates, and then further fine-tuned based on the similarity score between the base disease dataset and the new disease dataset calculated by the related task module. The few-sample pneumonia classification results can be obtained quickly and accurately. However, the above invention relies on a complex learning framework and requires multi-stage parameter updates to implement model training, which has high computational complexity. Summary of the Invention
[0004] In view of the technical problems of existing pneumonia X-ray image recognition methods, such as insufficient generalization ability, reliance on complex learning frameworks, and insufficient utilization of sample features, the present invention proposes a pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation, which enforces the encoding coefficient to be positive through non-negative constraints to enhance the representation consistency of similar samples. Affine constraints are imposed to map the test samples to the affine subspace spanned by the training samples, eliminating the influence of global offset noise caused by differences in image acquisition equipment. The introduction of discriminant regularization terms enhances the ability of this method to adapt to the morphological differences of pneumonia lesions. The ability to accurately capture and represent complex data of samples is improved, thereby achieving improved accuracy and robustness of image recognition.
[0005] In order to achieve the above object, the technical solution of the present invention is achieved as follows:
[0006] A pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation includes the following steps:
[0007] S1. Preprocess the X-ray images stored in a target image database with a number of categories K, extract the original features of each preprocessed X-ray image and the sub-band frequency domain features after wavelet transformation, and obtain a comprehensive feature vector for each preprocessed X-ray image; based on the categories to which the comprehensive feature vectors belong, use stratified random sampling to extract samples from all the comprehensive feature vectors and divide them into training samples and test samples in proportion;
[0008] S2. Based on the training samples obtained in step S1, a training data matrix is constructed; based on the training data matrix, a complete objective function including a data fidelity term, a discriminative regularization term, and a coding coefficient regularization term is established under non-negative constraints and affine constraints;
[0009] S3, using the alternating direction multiplier method to optimize the objective function constructed in step S2 to obtain the optimal coding coefficient for characterizing the correlation between the test sample and all categories of training samples;
[0010] S4. Based on the principle of minimizing the reconstruction error of each category, the test samples are accurately classified according to the optimal coding coefficients to achieve the recognition of pneumonia X-ray images.
[0011] Furthermore, the method for obtaining the comprehensive feature vector of each preprocessed X-ray image is:
[0012] The first-order statistical features of the preprocessed single X-ray image, the texture features based on the gray-level co-occurrence matrix, and the texture features based on the gray-level dependence matrix are calculated in sequence to generate the original features;
[0013] Then, the X-ray image after extracting the original features is decomposed into four sub-bands: LH, HL, HH, and LL through multi-scale wavelet transform. For each sub-band, the first-order statistical features of the same type as the original image, the texture features based on the gray-level co-occurrence matrix, and the texture features based on the gray-level dependence matrix are extracted to generate frequency domain features.
[0014] The original features and frequency domain features are concatenated into column vectors in the order of original features, wavelet subbands LH, HL, HH, and LL, and all eigenvalues are normalized to obtain the comprehensive feature vector of each preprocessed X-ray image.
[0015] Furthermore, the method for constructing the training data matrix is as follows: assuming that the training samples obtained in step S1 are N, the N training samples are used as column vectors in the training data matrix to obtain the training data matrix Among them, d is the dimension of the feature vector, X N is the Nth training sample.
[0016] Furthermore, the objective function including the reconstruction error term, the discriminative regularization term and the coding coefficient regularization term under the complete non-negative constraint and the affine constraint is:
[0017]
[0018] Among them, γ and λ are regularization parameters, represents the square of the L2 norm of the vector, Δ is the block diagonalization operator, y represents the test vector in the test sample, 1 is a vector with all elements set to 1; a is the encoding coefficient, corresponding to the weight of the test vector y in the training data matrix;
[0019] Represents the objective function The value of the encoding coefficient a when taking the minimum value;
[0020] is the reconstruction error term; γa T Δ(X T X)a is the discriminative regularization term; is the encoding coefficient regularization term;
[0021] sta≥0 is a non-negative constraint; st1 T a=1 is an affine constraint.
[0022] Furthermore, the method for obtaining the optimal coding coefficient for characterizing the correlation between the test sample and all categories of training samples is:
[0023] Introducing auxiliary variables into the objective function constructed in step S2 and constructing an augmented Lagrangian function;
[0024] Set the maximum number of iterations and optimize the augmented Lagrangian function using a minimization method. While fixing the other variables, minimize the loss of one variable. The specific steps are as follows:
[0025] ①Fix the Lagrangian multiplier and auxiliary variables, and calculate the partial derivative of the augmented Lagrangian function with respect to the coding coefficients;
[0026] When the partial derivative of the coding coefficient is zero, the closed-form update formula is solved and the coding coefficient is updated according to the closed-form update formula;
[0027] ② Fix the Lagrange multiplier and the coding coefficient, perform constrained optimization on the auxiliary variables, and obtain the subproblem of constrained optimization on the auxiliary variables. The subproblem of constrained optimization on the auxiliary variables is equivalent to projecting the intermediate variables into the non-negative affine simplex constraint space, obtaining the analytical solution, and updating the auxiliary variables.
[0028] ③ Update the Lagrange multiplier;
[0029] ④ Loop steps ① to ③, update the coding coefficient, auxiliary variables and Lagrange multipliers until the maximum number of iterations is reached to obtain the optimal coding coefficient.
[0030] Furthermore, the expression of the augmented Lagrangian function is:
[0031]
[0032] Where δ is the Lagrange multiplier, is the auxiliary variable introduced, is the augmented Lagrangian function, and μ is the penalty factor.
[0033] Furthermore, the expression for calculating the partial derivative of the augmented Lagrangian function with respect to the coding coefficient is:
[0034]
[0035] Furthermore, the closed-form update formula is:
[0036]
[0037] Where I is the identity matrix.
[0038] Furthermore, the auxiliary variables The subproblem for constrained optimization is:
[0039]
[0040] The intermediate variable The analytical solution is Among them, the projection operation For efficient simplex projection operations;
[0041] The expression for updating the Lagrange multiplier is:
[0042] Furthermore, in the process of accurately classifying the samples to be predicted based on the principle of minimizing the reconstruction error of each category and the optimal coding coefficient, the samples to be predicted y * Category label Classified as:
[0043]
[0044] in, is the sample y to be predicted * category, k∈{1, 2, ..., K} is the category index, X k is a sub-matrix of the k-th class training data matrix; is the optimal coding coefficient a *The value corresponding to the k-th class sample; Represents the objective function The value of category index k when taking the minimum value
[0045] Compared with the prior art, the present invention has the following beneficial effects:
[0046] This method uses a collaborative representation method with non-negative affine constraints, directly using sparse coding coefficients to reflect the correlation between test samples and training data. It achieves adaptive feature matching through a reconstruction error minimization mechanism, eliminating the need for predefined disease hierarchies or semantic similarity. This method, combined with the alternating direction multiplier method to optimize the objective function, addresses the computational complexity and limited generalization issues of existing technologies.
[0047] This method considers the similarity between samples and enhances the representation of homogeneous samples by imposing nonnegative constraints. Affine constraints are also applied to efficiently utilize the information within the affine subspace of each sample, enhancing the representation of homogeneous samples. This significantly improves the model's ability to accurately capture and represent the complex data of the samples, enhancing the accuracy and robustness of image recognition.
[0048] The present invention can significantly improve classification accuracy and robustness in the task of identifying pneumonia X-rays, especially in distinguishing different types of pneumonia (such as new coronavirus infection), and has broad application potential and practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 It is a schematic diagram of the process of the present invention.
[0051] Figure 2 This is an example diagram of preprocessed X-ray images in one embodiment of the present invention, from left to right: an X-ray image classified as COVID-19, an X-ray image classified as no lesion, and an X-ray image classified as pneumonia.
[0052] Figure 3 These are the first 125 comprehensive feature vectors of each type of X-ray image in one embodiment of the present invention.
[0053] Figure 4 This is a probability distribution diagram after predicting the sample in one embodiment of the present invention.
[0054] Figure 5This is the confusion matrix for identifying the ChestX-ray8 three-class dataset in one embodiment of the present invention. DETAILED DESCRIPTION
[0055] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without creative work are within the scope of protection of the present invention.
[0056] like Figure 1 As shown, a pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation includes the following steps:
[0057] S1. Preprocess the X-ray images stored in the target image database with a category number of K, extract the original features of each preprocessed X-ray image and the sub-band frequency domain features after wavelet transformation, and obtain the comprehensive feature vector of each preprocessed X-ray image; based on the category to which the comprehensive feature vector belongs, use stratified random sampling to extract samples from all the comprehensive feature vectors and divide them into training samples and test samples in proportion.
[0058] Furthermore, the preprocessing is to crop all X-ray images stored in the target image database with a category number of K, remove irrelevant background information in the X-ray images, and only retain the areas related to diagnosis in the clinical practice, thereby eliminating the interference of irrelevant information.
[0059] In this example, a target image database containing 500 “no lesion found” X-ray images, 500 “pneumonia” X-ray images, and 125 “COVID-19” X-ray images is used. The cropped X-ray images of each category are as follows: Figure 2 shown.
[0060] Furthermore, the method for obtaining the comprehensive feature vector of each preprocessed X-ray image is:
[0061] For a single cropped X-ray image, the first-order statistical features (including 18 items such as energy, entropy, standard deviation, and quantile), texture features based on the gray-level co-occurrence matrix (GLCM) (22 items), and texture features based on the gray-level dependence matrix (GLDM) (14 items) of the cropped X-ray image are calculated in sequence to generate 54-dimensional original features.
[0062] Then, the X-ray image after extracting the original features is decomposed into four sub-bands, LH, HL, HH, and LL, through multi-scale wavelet transform. For each sub-band, the first-order statistics, GLCM, and GLDM features of the same type as the original image are extracted, generating a total of 216-dimensional frequency domain features.
[0063] The 54-dimensional original features and the 216-dimensional frequency domain features are concatenated into a 270-dimensional column vector in the order of original features, wavelet subbands LH, HL, HH, and LL. All eigenvalues are normalized and mapped to the interval [0, 1] to eliminate dimensional differences, and the normalized comprehensive feature vector is obtained for subsequent analysis.
[0064] After normalized comprehensive feature extraction, the comprehensive feature vectors of X-ray images of the categories “no lesion found”, “pneumonia” and “COVID-19” are 500, 500 and 125 respectively. Figure 3 Only the first 125 comprehensive feature vectors of each type of X-ray image are shown and represented by curves of different colors.
[0065] Furthermore, all normalized comprehensive feature vectors are randomly sampled by category and divided into training samples and test samples in a ratio of 8:2 to ensure that the distribution ratio of training samples and test samples of each category in the training set and test set is consistent with the target image database. The training set is used for model training, and the test set is retained independently to verify the model performance.
[0066] In this embodiment, the number of training samples of the three categories of "no lesions found", "pneumonia" and "COVID-19" is 400, 400 and 100 respectively, and the number of test samples of the three categories of "no lesions found", "pneumonia" and "COVID-19" is 100, 100 and 25 respectively.
[0067] S2. Based on the training samples obtained in step S1, a training data matrix is constructed; based on the training data matrix, a complete objective function including a data fidelity term, a discriminative regularization term, and a coding coefficient regularization term is established under non-negative constraints and affine constraints.
[0068] Furthermore, the method of constructing the training data matrix is:
[0069] Assume that the number of training samples obtained in step S1 is N, and N training samples are used as column vectors in the training data matrix. The expression of the training data matrix is:
[0070]
[0071] Among them, d is the dimension of the feature vector, X N is the Nth training sample. The training data matrix stores the features of all training samples for subsequent tasks.
[0072] In this embodiment, the dimension d of the feature vector is 270, and the number N of training samples is 900.
[0073] Furthermore, the objective function including the reconstruction error term, the discriminative regularization term and the coding coefficient regularization term under the complete non-negative constraint and the affine constraint is:
[0074]
[0075] Among them, γ and λ are regularization parameters, represents the square of the L2 norm of the vector, Δ is the block diagonalization operator, y represents the test vector in the test sample; a is the encoding coefficient, corresponding to the weight of the test vector y in the training data matrix, which is used to reflect the similarity between the test vector y and each training sample. Represents the objective function The value of the encoding coefficient a when it takes the minimum value. 1 is a vector with all elements set to 1.
[0076] It is the reconstruction error term, which enables the test sample to be represented with high precision by a linear combination of similar training samples in the feature space spanned by the training data matrix, ensuring the minimization of the reconstruction error.
[0077] γa T Δ(X T X)a is a discriminative regular term that can promote the coding coefficient a to compete among similar samples (similar sample coefficients approach each other) and exclude heterogeneous samples (different sample coefficients approach zero).
[0078] It is the regularization term of the coding coefficient, which can control the sparsity of the coding coefficient a, prevent overfitting, and provide sufficient stability for recognizing X-ray images.
[0079] sta≥0 is a non-negative constraint that ensures that each training sample contributes positively to the representation of the test sample, making the representation of the test sample more concentrated on similar training samples and reducing redundant noise.
[0080] st1 T a=1 is an affine constraint, which can make the test sample lie in the affine subspace spanned by the training samples, enhance the recognition ability of pneumonia under different lighting changes and contrasts, and weaken the influence of global offset of X-ray images due to differences in equipment parameters or patient posture.
[0081] S3, using the alternating direction multiplier method to optimize the objective function constructed in step S2, to obtain the optimal coding coefficient a used to characterize the correlation between the test sample and all categories of training samples * .
[0082] In order to reduce the computational complexity and ensure the convergence speed and numerical stability of the algorithm, an auxiliary variable z is introduced into the objective function constructed in step S2 and an augmented Lagrangian function is constructed.
[0083]
[0084] Where δ is the Lagrange multiplier, is the auxiliary variable introduced, is the augmented Lagrangian function. μ is the penalty factor, and the penalty factor μ is set to 10 -3 , the regularization parameters γ and λ are set in {10 -7 , 10 -6 ,…,10 3} in the domain.
[0085] Set the maximum number of iterations and use the minimization method to calculate the augmented Lagrangian function Perform optimization to minimize the loss of one variable while fixing the rest of the variables. The specific steps are as follows:
[0086] ①Fixed Lagrange multiplier δ and auxiliary variables Compute the augmented Lagrangian function Regarding the partial derivative of the encoding coefficient a, the expression is:
[0087]
[0088] When the partial derivative of the coding coefficient a is zero, the closed-form update formula is obtained. The coding coefficient a is updated according to the closed-form update formula. The closed-form update formula is:
[0089]
[0090] Where I is the identity matrix.
[0091] ②Fix the Lagrange multiplier δ and the coding coefficient a, and Perform constrained optimization and adjust the auxiliary variables The subproblem for constrained optimization is:
[0092]
[0093] For auxiliary variables The subproblem of constrained optimization is equivalent to the intermediate variable Projecting onto the non-negative affine simplex constraint space, the analytical solution is:
[0094]
[0095] Among them, the projection operation is an efficient simplex projection operation.
[0096] ③ Update the Lagrange multiplier δ:
[0097]
[0098] ④ Loop steps ① to ③ to update the coding coefficient a and auxiliary variables and Lagrange multiplier δ until the maximum number of iterations, and the optimal coding coefficient a is obtained * .
[0099] S4, based on the principle of minimizing the reconstruction error of each category, according to the optimal coding coefficient a that characterizes the correlation between the test sample and all categories of training samples * Complete accurate classification of test samples and realize the recognition of pneumonia X-ray images.
[0100] Based on the principle of minimizing the reconstruction error of each category, according to the optimal coding coefficient a * Treat the prediction sample y * Classify and predict sample y * Category label Classified as:
[0101]
[0102] in, is the sample to be predicted y in the test sample * category, k∈{1, 2, ..., K} is the category index, X k is a sub-matrix of the k-th class training data matrix. is the optimal coding coefficient a * The value corresponding to the k-th class sample. Represents the objective function The value of category index k when taking the minimum value.
[0103] like Figure 4 As shown, in order to further illustrate the actual effect of the classification of the present invention, one sample is selected from each of the three test samples of "no lesion found", "pneumonia" and "COVID-19", and the optimal coding coefficient a obtained in step S3 is used. * Classify the test samples. Calculate the three category scores for each sample. The score is the probability that the test sample belongs to each category. Figure 4 The probability distribution of each selected sample during classification is shown.
[0104] like Figure 5 As shown in the figure, the present invention combines confusion matrix analysis with the three-class classification problem of the ChestX-ray8 dataset. The present invention demonstrates excellent classification accuracy, particularly in the identification of COVID-19 cases, achieving 100% accuracy and achieving the highest performance across all categories. In the task of distinguishing pneumonia, the present invention achieved an accuracy of 84.11%.
[0105] In addition, as shown in Table 1, the accuracy of the present invention and other advanced methods in the same field for pneumonia X-ray image recognition tasks on the ChestX-ray8 three-category dataset is compared. As can be seen, the present invention has the highest accuracy in all pneumonia X-ray image recognition tasks.
[0106] method Sensitivity Specificity Precision F1 score Accuracy DarkCovidNet 85.35 92.18 89.96 87.37 87.02 DenseNet169+XGBoost 90.05 93.77 92.59 91.21 89.70 SRC 68.94 83.03 83.00 71.15 70.67 CRC 85.45 90.25 86.93 86.13 84.00 CCRC 85.31 88.81 86.80 86.02 81.78 Support Vector Machine 90.33 93.07 91.74 90.80 88.44 BLS 92.67 94.13 93.05 92.64 90.22 CCBLS 93.67 94.93 94.29 93.63 91.56 ANCR 90.99 93.56 91.71 91.14 88.89 DRC 93.14 94.57 94.02 92.89 90.67 Method of the present invention 94.03 95.2 94.48 94.11 92.00
[0107] In the table, DarkCovidNet is the COVID-19 Detection Network. DenseNet169+XGBoost is the DenseNet169+eXtreme Gradient Boosting ensemble model. SRC is the Sparse Representation-based Classification method. CRC is the Collaborative Representation-based Classification method. CCRC is the Collaborative-Competitive Representation-based Classification method. SVM is the Support Vector Machine. BLS is the Broad Learning System. CCBLS is the Cross-component Broad Learning System. ANCR is the Affine Non-negative Collaborative Representation method. DRC is the Discriminative Representation-based Classification method.
[0108] In summary, the present invention fully considers the similarity between samples, and enforces the encoding coefficient to be positive through non-negative constraints, thereby enhancing the representation consistency of similar samples. An affine constraint is imposed to map the test sample to the affine subspace spanned by the training sample, eliminating the influence of global offset noise caused by differences in image acquisition equipment. The introduction of a discriminant regularization term enhances the ability of this method to adapt to the morphological differences of pneumonia lesions. The ability to accurately capture and represent complex data of samples is improved, thereby achieving an improvement in the accuracy and robustness of image recognition.
[0109] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation, characterized in that: The following steps are involved: S1. Preprocess the X-ray images stored in a target image database with a number of categories K, extract the original features of each preprocessed X-ray image and the sub-band frequency domain features after wavelet transformation, and obtain a comprehensive feature vector for each preprocessed X-ray image; based on the categories to which the comprehensive feature vectors belong, use stratified random sampling to extract samples from all the comprehensive feature vectors and divide them into training samples and test samples in proportion; S2. Construct a training data matrix based on the training samples obtained in step S1; Based on the training data matrix, a complete objective function including data fidelity term, discriminative regularization term and coding coefficient regularization term is established under non-negative constraints and affine constraints; S3, using the alternating direction multiplier method to optimize the objective function constructed in step S2 to obtain the optimal coding coefficient for characterizing the correlation between the test sample and all categories of training samples; S4. Based on the principle of minimizing the reconstruction error of each category, the test samples are accurately classified according to the optimal coding coefficients to achieve the recognition of pneumonia X-ray images.
2. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to claim 1 is characterized in that: The method for obtaining the comprehensive feature vector of each preprocessed X-ray image is: The first-order statistical features of the preprocessed single X-ray image, the texture features based on the gray-level co-occurrence matrix, and the texture features based on the gray-level dependence matrix are calculated in sequence to generate the original features; Then, the X-ray image after extracting the original features is decomposed into four sub-bands: LH, HL, HH, and LL through multi-scale wavelet transform. For each sub-band, the first-order statistical features of the same type as the original image, the texture features based on the gray-level co-occurrence matrix, and the texture features based on the gray-level dependence matrix are extracted to generate frequency domain features. The original features and frequency domain features are concatenated into column vectors in the order of original features, wavelet subbands LH, HL, HH, and LL, and all eigenvalues are normalized to obtain the comprehensive feature vector of each preprocessed X-ray image.
3. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to claim 2 is characterized in that: The method for constructing the training data matrix is as follows: assuming that the training samples obtained in step S1 are N, the N training samples are used as column vectors in the training data matrix to obtain the training data matrix Among them, d is the dimension of the feature vector, X N is the Nth training sample.
4. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to claim 3 is characterized in that: The objective function containing the reconstruction error term, the discriminative regularization term and the coding coefficient regularization term under the complete non-negative constraint and affine constraint is: Among them, γ and λ are regularization parameters, represents the square of the L2 norm of the vector, Δ is the block diagonalization operator, y represents the test vector in the test sample, 1 is a vector with all elements set to 1; a is the encoding coefficient, corresponding to the weight of the test vector y in the training data matrix; Represents the objective function The value of the encoding coefficient a when taking the minimum value; is the reconstruction error term; γa T Δ(X T X)a is the discriminative regularization term; is the encoding coefficient regularization term; sta≥0 is a non-negative constraint; st1 T a=1 is an affine constraint.
5. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to claim 4 is characterized in that: The method for obtaining the optimal coding coefficient for characterizing the correlation between the test sample and all categories of training samples is: Introducing auxiliary variables into the objective function constructed in step S2 and constructing an augmented Lagrangian function; Set the maximum number of iterations and optimize the augmented Lagrangian function using a minimization method. While fixing the other variables, minimize the loss of one variable. The specific steps are as follows: ①Fix the Lagrangian multiplier and auxiliary variables, and calculate the partial derivative of the augmented Lagrangian function with respect to the coding coefficients; When the partial derivative of the coding coefficient is zero, the closed-form update formula is solved and the coding coefficient is updated according to the closed-form update formula; ② Fix the Lagrange multiplier and the coding coefficient, perform constrained optimization on the auxiliary variables, and obtain the subproblem of constrained optimization on the auxiliary variables. The subproblem of constrained optimization on the auxiliary variables is equivalent to projecting the intermediate variables into the non-negative affine simplex constraint space, obtaining the analytical solution, and updating the auxiliary variables. ③ Update the Lagrange multiplier; ④ Loop steps ① to ③, update the coding coefficient, auxiliary variables and Lagrange multipliers until the maximum number of iterations is reached to obtain the optimal coding coefficient.
6. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to claim 4 is characterized in that: The expression of the augmented Lagrangian function is: Among them, δ is the Lagrange multiplier, z is the auxiliary variable introduced, is the augmented Lagrangian function, and μ is the penalty factor.
7. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to claim 4 is characterized in that: The expression for calculating the partial derivative of the augmented Lagrangian function with respect to the coding coefficient is:
8. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to claim 4 is characterized in that: The closed-form update formula is: Where I is the identity matrix.
9. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to claim 4 is characterized in that: The sub-problem of constrained optimization of the auxiliary variable z is: The intermediate variable z temp =a-δ / μ, the analytical solution is Among them, the projection operation For efficient simplex projection operations; The expression for updating the Lagrange multiplier is: δ←δ+μ(za).
10. The pneumonia X-ray recognition method based on non-negative affine discriminant collaborative representation according to any one of claims 1 or 5-9, characterized in that: In the process of accurately classifying the sample to be predicted based on the principle of minimizing the reconstruction error of each category and the optimal coding coefficient, the category label of the sample to be predicted y* Classified as: in, is the sample y to be predicted * The category of X, k∈{1, 2, ..., K} is the category index, k is a sub-matrix of the k-th class training data matrix; is the optimal coding coefficient a * The value corresponding to the k-th class sample; Represents the objective function The value of category index k when taking the minimum value.
Citation Information
Patent Citations
Metalearning-based few-sample pneumonia classification method and medium
CN118864946A