An image recognition method, system and storage medium

By constructing a quaternion real representation matrix and optimization model based on quaternion generalized kernel sparse principal component analysis for image recognition, the problems of high computational cost and low recognition rate in medical image recognition are solved. This method achieves efficient and stable recognition under complex conditions, simplifies parameter adjustment, and improves recognition accuracy and robustness.

CN115775345BActive Publication Date: 2026-05-01VINNO TECH (SUZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VINNO TECH (SUZHOU) CO LTD
Filing Date
2022-12-28
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies for medical image recognition suffer from high computational costs, low and unstable recognition rates, require manual parameter tuning, and cannot effectively handle nonlinear features and complex interference factors. In particular, they perform poorly under conditions containing noise or fog.

Method used

An image recognition method based on quaternion generalized kernel sparse principal component analysis is adopted. By constructing a quaternion real representation matrix, utilizing the quaternion covariance kernel matrix and p-norm Euclidean distance, and combining the alternating direction multiplier method, the model is optimized to extract kernel sparse principal components. The p-value is flexibly adjusted to adapt to different interference factors, thus constructing a quaternion generalized kernel sparse principal component analysis optimization model.

Benefits of technology

It achieves efficient and stable image recognition under noisy and complex interference conditions, reduces computational costs, improves recognition accuracy and robustness, adapts to various complex and changing medical images, avoids training overfitting, and simplifies the parameter adjustment process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115775345B_ABST
    Figure CN115775345B_ABST
Patent Text Reader

Abstract

The application discloses an image recognition method based on quaternion generalized kernel sparse principal component analysis, and the method comprises the following steps: acquiring training and test sample images; extracting the entropy, red, green and blue four component information of each image, and performing quaternion matrix representation on the information to construct a corresponding quaternion real representation matrix; constructing a corresponding quaternion covariance kernel matrix and a quaternion p-norm Euclidean distance according to the quaternion real representation matrix, and then constructing a quaternion generalized kernel sparse principal component analysis optimization model; solving the optimization model, taking the calculated kernel sparse principal components of the training sample in the row and column directions as the final solution; calculating the projection matrix of the training and test sample covariance kernel matrix according to the final solution of the model in the row and column directions; and using the quaternion p-norm Euclidean distance to recognize the category to which the images in the test sample set belong, so that the recognition accuracy and robustness are improved.
Need to check novelty before this filing date? Find Prior Art

Description

An image recognition method, system, and storage medium Technical Field

[0001] This invention relates to the fields of pattern recognition and artificial intelligence, and in particular to an image recognition method, system and storage medium, which is based on quaternion generalized kernel sparse principal component analysis. Background Technology

[0002] Research shows that color medical image recognition is currently one of the important research topics in the field of pattern recognition. Two-dimensional quaternion principal component analysis (2DQPCA) proposed by Jia et al. solves the problem of high computational cost and loss of the inherent spatial structure of color images caused by stretching two-dimensional samples into vector form by directly processing the two-dimensional quaternion matrix [Z.Jia,S.Ling andM.Zhao. Color Two-Dimensional Principal Component Analysis for Face Recognition Based on Quaternion Model[J].Springer,Cham,2017.]. However, this method cannot handle nonlinear feature problems. Therefore, Chen improved quaternion principal component analysis into kernel quaternion principal component analysis (KQPCA) using kernel functions, transforming linear quaternion signals into nonlinear quaternion signals [B.Chen, J.Yang, B.Jeon and X.Zhang. Kernel quaternion principal component analysis and its application in RGB-D object recognition[J].Neurocomputing,266:293-303,2017.]. While these methods fully utilize the four channels of quaternions, they do not consider the computational efficiency, stability, and entropy of elements in the image, resulting in less than ideal performance in practical applications. For example, these methods are limited to face recognition applications in specific scenarios, and their recognition rate for medical images against a black background cannot meet engineering requirements. Furthermore, the complex and variable interference features of medical images, such as water mist, image brightness, lesion color, and current noise, cannot be represented by the limited features of existing 2DQPCA and KQPCA methods, which are insufficient to characterize massive amounts of lesion data.

[0003] To extract kernel sparse principal components from medical images containing noise, fog, and other interference factors, two-dimensional principal component analysis with sparse features has attracted widespread attention in the field of computer image recognition and classification. Xiao fully utilizes the advantages of norm 1 and norm 2 constraints to propose a sparse two-dimensional quaternion principal component analysis (S2DQPCA) model, which improves the robustness of classification [X.Xiao, Z.Yi. Two-Dimensional Quaternion PCA and Sparse PCA[J].IEEE transactions on neural networks and learning systems,30:2028-2042,2018.]. However, the model still has some unresolved issues. First, the model converts quaternions into complex numbers for operations, increasing computational costs. This results in excessively long training and testing time for sample features, making it impossible to update data features and identify samples in real time. Second, the model is limited to face recognition and cannot utilize kernel functions to handle nonlinear features. When dealing with medical images, it often encounters situations where lesion features are similar but the types are different, making it unable to accurately identify the correct image category. Finally, the model requires manual parameter adjustment for different data samples, limiting the algorithm's application value. Summary of the Invention

[0004] The purpose of this invention is to provide an image recognition method, system, and storage medium. The method and system are based on quaternion generalized kernel sparse principal component analysis, aiming to solve the problems of high computational cost, low and unstable recognition rate, and the need for manual parameter tuning in the prior art.

[0005] To achieve the aforementioned objectives, this invention provides an image recognition method based on quaternion generalized kernel sparse principal component analysis (SPM). The method includes the following steps: acquiring training and testing sample sets of images; extracting the entropy, red, green, and blue components of each training sample image and representing them as quaternions to construct a corresponding quaternion real representation matrix; constructing the quaternion covariance kernel matrix and the quaternion p-norm Euclidean distance of the quaternion real representation matrix, where p is any non-negative value; and based on the quaternion covariance kernel matrix, constructing the quaternion covariance kernel matrix and the quaternion p-norm Euclidean distance of the quaternion real representation matrix. A quaternion generalized kernel sparse principal component analysis (KPCA) optimization model is constructed using the difference kernel matrix and the quaternion p-norm Euclidean distance. The optimization model is solved, and the calculated kernel sparse principal components in the row and column directions of the training samples are used as the final solution. Based on the kernel sparse principal components in the row and column directions of the model, the projection matrices of the quaternion covariance kernel matrix of the training samples and the quaternion covariance kernel matrix of the test samples are calculated respectively. Based on the quaternion p-norm Euclidean distance, the category to which the image in the test sample set belongs is identified according to the projection matrices. The image category is then output.

[0006] As a further improvement of the present invention, the step of "extracting the entropy, red, green and blue component information of each training sample image" is followed by: representing each image in the sample set as a matrix of fixed size, wherein the sample set includes a training sample set and a test sample set.

[0007] As a further improvement of the present invention, the step of "extracting the entropy, red, green, and blue component information of each training sample image and representing it as a quaternion matrix to construct the corresponding quaternion real representation matrix" specifically includes: extracting the entropy, red, green, and blue component information corresponding to the nth sample image, denoted as E respectively. n R n G n B n Where n = 1, 2, ..., L, L is the number of images in the training sample set; based on the four component information, the quaternion matrix of the sample image is represented as: P n =E n +R n i+G n j+B n k, where P n ∈Q h×w Let h×w be the nth quaternion matrix, where h×w is the size of the matrix corresponding to the training sample image, and i, j, and k represent the three imaginary units of the quaternion. The quaternion matrix P is constructed using quaternion structure-preserving theory. n The real representation matrix M n .

[0008] As a further improvement of the present invention, the step of "constructing the quaternion covariance kernel matrix and the quaternion p-norm Euclidean distance of the quaternion real representation matrix" specifically includes: constructing the corresponding quaternion real representation matrix, denoted as X, based on the training sample set and the test sample set. train and X test Projecting the quaternion real representation matrix onto a high-dimensional quaternion feature space, the quaternion covariance kernel matrices of the training and test sample sets are calculated, respectively, as follows: in, Indicates by X train The training images after projection. Represented as The conjugate transpose of the matrix. Indicates by X test The test image after projection. Represented as The conjugate transpose of the quaternion matrix; the real representation matrix M of the quaternion matrix. n The p-norm Euclidean distance is: Wherein, the nonnegative parameter p represents the p-norm of the quaternion, E n R n G n B n These represent one real part and three imaginary parts of the quaternion, respectively.

[0009] As a further improvement of the present invention, the "construction of a quaternion generalized kernel sparse principal component analysis optimization model" specifically includes: defining the kernel sparse principal component matrix in the row and column directions of the training samples: U = [U1, ..., U2] k ]∈Q 4T×4T V = [V1, ..., V] s ]∈Q 4T×4T U and V are both composed of k and s columns of quaternion eigenvectors, respectively; for any nonnegative parameters μ1, μ2, λ3, λ4, and μ... i (1≤i≤k), λ m (1≤m≤s), if the row and column kernel sparse principal component matrices U and V satisfy: but Where w is the weighting coefficient, and These are respectively for φ rtrain and φ ctrain The result of performing Cholesky decomposition on quaternions, φ rtrainφ represents the quaternion covariance kernel matrix calculated along the row direction. ctrain This represents the quaternion covariance kernel matrix calculated along the column direction. They represent finding k optimal U values ​​respectively. i and s optimal V m To maximize the divergence of the model, the parameter μ i and λ m These represent the divergence adjustments in the row and column directions of the model, respectively.

[0010] As a further improvement of the present invention, the method further includes: the quaternion structure-preserving algorithm based on the alternating direction multiplier method is used to solve the quaternion generalized kernel sparse principal component analysis optimization model.

[0011] As a further improvement of the present invention, the method further includes: the initial value of the iteration selected by the quaternion structure-preserving algorithm based on the alternating direction multiplier method is either randomly generated data that satisfies a normal distribution or data obtained by iterative iteration based on the power method and the inverse power method of the quaternion real representation.

[0012] As a further improvement of the present invention, the step of "calculating the projection matrix of the training sample quaternion covariance kernel matrix and the projection matrix of the test sample quaternion covariance kernel matrix according to the final solution in the row and column directions of the model" specifically includes: the training sample quaternion covariance kernel matrix φ train projection matrix Where j = 1, 2, ..., T, v = 1, 2, ..., k, k represents the first k kernel sparse principal components of the training sample set; the test sample quaternion covariance kernel matrix φ rest projection matrix Where g = 1, 2, ..., m, m represents the first m kernel sparse principal components of the test sample set.

[0013] As a further improvement of the present invention, the "using the quaternion p-norm Euclidean distance to identify the type of images in the test sample set" specifically includes: based on the projection matrix of the training sample quaternion covariance kernel matrix. Find the projection matrix P of the quaternion covariance kernel matrix of the test samples. test The projection matrix of the quaternion covariance kernel matrix of the closest training samples Make it satisfy To determine the category c of the images in the test sample set, where, The Euclidean distance is the norm of the quaternion p, and p can be adjusted accordingly based on different images to be tested.

[0014] The present invention also provides an image recognition system based on quaternion generalized kernel sparse principal component analysis. The system includes a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute any of the steps of the image recognition method based on quaternion generalized kernel sparse principal component analysis.

[0015] The present invention also provides a storage medium storing a computer program, which, when executed by a processor, implements the image recognition method based on quaternion generalized kernel sparse principal component analysis as described above.

[0016] Compared with existing technologies, the image recognition method based on quaternion generalized kernel sparse principal component analysis of this invention has the following advantages:

[0017] 1. This invention utilizes quaternions to represent the entropy, red, green, and blue components of a color image, constructing a quaternion real representation matrix, thus solving the problem of lost image pixel entropy information.

[0018] 2. This invention obtains the quaternion covariance kernel matrix based on the quaternion real representation matrix, and constructs a quaternion generalized kernel sparse principal component analysis optimization model (QGKSPCA) using the quaternion p-norm Euclidean distance. This model can accurately extract kernel sparse principal components from noisy samples, thus ensuring the successful recognition of noisy color medical images.

[0019] 3. When constructing the optimization model, this invention connects the maximum projective divergence of the row and column directions of the training samples to calculate the maximization of the model divergence, and can flexibly adjust the relationship between the row and column directions, reflecting the two-sided nature, that is, considering the features of all directions of the training samples, ensuring the rationality of the optimization model method and the reliability of the recognition accuracy.

[0020] 4. The p-norm Euclidean distance constructed in this invention uses an adjustable, arbitrary non-negative value for p, which can reflect generalized features. Therefore, when extracting features from sample images, p can be flexibly adjusted to address interference factors such as noise, brightness, and fog. This not only prevents overfitting during training, thus ensuring the stability of recognition efficiency, but also ensures that the adjustable p model can recognize various complex and variable medical images, making it highly applicable.

[0021] 5. This invention employs an alternating direction multiplier method based on a quaternion-preserving structure algorithm, which has shorter computation time, less memory usage, and lower computational cost. Attached Figure Description

[0022] Figure 1 is a flowchart of the image recognition method for quaternion generalized kernel sparse principal component analysis in an embodiment of the present invention.

[0023] Figure 2 is a flowchart illustrating the image recognition method based on quaternion generalized kernel sparse principal component analysis in an embodiment of the present invention.

[0024] Figure 3 is a schematic diagram showing the changes in the accuracy calculated by the four color medical image recognition methods in the embodiments of the present invention as the number of kernel sparse principal components changes.

[0025] Figure 4 is a schematic diagram of the three-dimensional curve of the weight coefficient w changing with the number of kernel sparse principal components in the color medical image database in an embodiment of the present invention. Detailed Implementation

[0026] The present invention will now be described in detail with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the scope of protection of the present invention.

[0027] It should be noted that the term "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0028] This application discloses an image recognition method based on quaternion generalized kernel sparse principal component analysis. Although this application provides the method operation steps as described in the following embodiments or flowchart 1, the execution order of steps that do not logically have a necessary causal relationship, based on conventional or non-inventive methods, is not limited to the execution order provided in the embodiments of this application. As shown in Figure 1, this embodiment of the invention provides an image recognition method based on quaternion generalized kernel sparse principal component analysis, which includes the following steps, which are described below:

[0029] Step 101: Obtain images of the training sample set and the test sample set.

[0030] Step 102: Extract the entropy, red, green and blue components of each training sample image and represent them as quaternions to construct the corresponding quaternion real representation matrix.

[0031] In this embodiment of the invention, a noisy sample set is obtained, from which T training sample sets and LT test sample sets are randomly selected, denoted as Tr and Te, respectively. The L color images in the sample sets are first adjusted to matrices of a fixed size, for example, the sample images are adjusted to matrices of a fixed size of h×w, where h is the height of the image and w is the width of the image. Feature extraction is performed on each sample image. Specifically, assuming that the entropy, red, green, and blue components corresponding to the nth sample image are extracted, they are abbreviated as En. n R n G n B n Where n = 1, 2, ..., L, and they are represented as quaternion matrices according to formula (1):

[0032] P n =E n +R n i+G n j+B n k (1)

[0033] Among them, P n ∈Q h×w Let P be the nth quaternion matrix. n It belongs to a quaternion matrix, and the size of the quaternion matrix is ​​h rows and w columns, where i, j, and k represent the three virtual units of the quaternion matrix.

[0034] In this embodiment of the invention, each quaternion matrix P is constructed using quaternion structure-preserving theory based on the quaternion matrix representation. n The real representation matrix M n Specifically, as shown in formula (2):

[0035]

[0036] Where n = 1, 2, ..., L, R represents the real number field, and M... n ∈R 4h×4w The quaternion real representation matrix M n It belongs to the real number field matrix, and the size of the real number field matrix is ​​4h×4w. That is to say, the result obtained by the quaternion real representation matrix is ​​all real number, without imaginary number, which reduces the time and cost of subsequent calculation process and improves the calculation efficiency.

[0037] Step 103: Based on the quaternion real representation matrix, construct the quaternion covariance kernel matrix and the quaternion p-norm Euclidean distance of the quaternion real representation matrix.

[0038] In steps 101 and 102 of this embodiment, the quaternion real representation matrix has been obtained. Specifically, assuming that the quaternion matrix of T training samples and LT test samples is represented in real form, it is denoted as X. train and X test Furthermore, it is centralized and its calculation indicators are standardized to avoid errors in calculation results due to inconsistencies in the calculation indicators.

[0039] In this embodiment of the invention, to better extract features from training sample images, the present invention projects the sample feature space onto a high-dimensional quaternion space and introduces a kernel function. By using the kernel function to project the input training sample image feature matrix onto the high-dimensional feature space, the linear problem is transformed into a non-linear problem, making the extraction of image features more accurate. Specifically, a quaternion mapping ψ is defined: ψ is the mapping of the quaternion space matrix Q... m The vector data in the vector space is projected into a high-dimensional quaternion feature space G, where ψ:Q m →G, Where X represents the training sample image. This represents the image after mapping to a higher-dimensional space. After projection, the quaternion covariance kernel matrix of the training sample set and the test sample set is calculated according to formulas (3) and (4), respectively:

[0040]

[0041]

[0042] in, Indicates by X train The training sample images after projection. Represented as The conjugate transpose of the matrix. Indicates by X test The projected image of the test sample. Represented as The conjugate transpose of .

[0043] Based on the quaternion matrix described in formula (1), the quaternion real representation matrix M is defined using formula (5). n The p-norm Euclidean distance lays the foundation for subsequent model construction. The specific definition of formula (5) is as follows:

[0044]

[0045] Among them, E n R n G n B nThey represent one real part and three imaginary parts of the quaternion matrix, respectively, and the nonnegative parameter p represents the p-norm of the quaternion.

[0046] Step 104: Based on the quaternion covariance kernel matrix and the quaternion p-norm Euclidean distance, construct a quaternion generalized kernel sparse principal component analysis optimization model.

[0047] In this embodiment of the invention, the specific process of constructing the optimization model based on the p-norm Euclidean distance of the quaternion real representation matrix defined in step 103 is as follows:

[0048] First, define two quaternion real representation matrices U = [U1, ..., U2]. k ]∈Q 4T×4T V = [V1, ..., V] s ]∈Q 4T×4T It consists of quaternion feature vectors of k columns and s columns respectively, where U represents the kernel sparse principal component in the row direction of the training samples, and V represents the kernel sparse principal component in the column direction of the training samples. For any non-negative parameters μ1, μ2, λ3, λ4 and μ i (1≤i≤k), λ m (1≤m≤s), if the U=[U1,…,U k ]∈Q 4T×4T V = [V1, ..., V] s ]∈Q 4T×4T When formula (6) is satisfied, then Formula (6) is shown below:

[0049]

[0050] Where w is a weight coefficient, used to prevent the optimal solution from being obtained by calculating the projection values ​​in the row and column directions alone. The weight w is calculated in conjunction with the maximum projection divergence in the row and column directions, and the relationship between the projection values ​​in the two directions can be adjusted by adjusting the size of the weight, which reflects the bilateral nature. This takes into account the features of all directions of the training sample image, thereby ensuring the rationality of the model method and the accuracy and reliability of the image category recognition, making the calculated kernel sparse principal component feature matrix more consistent with the features of color images. and These are respectively for φ rtrain and φ ctrain The result of performing quaternion Cholesky decomposition, and φ rtrain This represents the quaternion covariance kernel matrix calculated along the row direction of the training set sample images after projection, φ. ctrain This represents the quaternion covariance kernel matrix calculated along the column direction of the training set sample images after projection. The orthogonality of the kernel sparse matrix solutions in the row direction is maintained; similarly, the kernel sparse matrix V in the column direction is maintained. m The solution is the same.

[0051] In formula (6) of this example he They represent finding k optimal U values ​​respectively. i and s optimal V m To maximize the divergence of the model, the parameter μ i and λ m These represent adjustments to the divergence in the row and column directions, respectively. and To adapt to different noise environments, the p-value is an adjustable, arbitrary non-negative value. Therefore, the model method constructed in this invention can flexibly adjust for interference factors such as noise, brightness, and fog when extracting features. This not only ensures the recognition of various complex and variable medical color images, but also prevents overfitting during training by flexibly adjusting p, thus ensuring the stability of image recognition efficiency. Furthermore, preferably, p in this invention can be incremented by 0.1, and the tedious process of manually adjusting the parameter p during training is solved by setting the maximum recognition accuracy through a cyclic iterative algorithm. μ2 and λ4 are used to control the number of non-zero elements in U and V, i.e., U... i Sparsity of solutions.

[0052] In addition, in formula (6) ||U i ||1 and|V m ||1 reflects that the embodiment of the present invention extracts the kernel sparse principal components of the training sample images, that is, it can accurately extract features from noisy samples, thereby ensuring that the model can successfully identify noisy color medical images.

[0053] Step 105: Solve the optimization model and use the calculated kernel sparse principal components in the row and column directions of the training samples as its final solution.

[0054] In this embodiment of the invention, the optimization model is solved according to its construction process, specifically including the following steps:

[0055] Step 1: Consider the i-th component U of each sample. i and each m-th component V m All solutions U = [U1, ..., U2] can be obtained by using a cyclic iterative method. k ]∈Q 4T×4T V = [V1, ..., V] s ]∈Q 4T×4T Therefore, formula (6) is optimized to obtain formula (7), as shown below:

[0056]

[0057] Step 2, introduce the intermediate variable z i (1≤i≤k) and w m (1≤m≤s), establish the quaternion real representation of the augmented Lagrangian function and simplify it to the formula (8):

[0058]

[0059] Where i = 1, 2, ..., k, m = 1, 2, ..., s,

[0060] Step 3: Iteratively solve formula (8) using the alternating direction multiplier method. In each iteration, U i M i , z i , l m V m , t m Divided into two groups, U i M i , z i Labeled as Group A, l m V m , t m Let's label this group B. Then, update only one variable from group A and one variable from group B, keeping the other two variables fixed. Specifically, update U in group A. i Fix M in group A i , z i Meanwhile, update V in group B. m Fix group B's l m , t m , get U i and V m Specifically, as shown in formulas (9) and (10):

[0061]

[0062]

[0063] Where i = 1, 2, ..., k, m = 1, 2, ..., s, I represents an identity matrix of size 4h × 4w, φ train ρ1 and ρ2 are the quaternion covariance kernel matrix in formula (6), and ρ1 and ρ2 are the penalty parameters in formula (8).

[0064] Step 4: Update z in group A i Fix U in group A i M iAt the same time, update l in group B. m Fixed V in group B m , t m z was calculated i and l m Specifically, as shown in formulas (11) and (12):

[0065]

[0066]

[0067] Where i = 1, 2, ..., k, m = 1, 2, ..., s.

[0068] Step 5: Update M in Group A. i Fix U in group A i , z i Simultaneously update t in group B. m Fixed V in group B m , l m M i and t m Specifically, as shown in formulas (13) and (14):

[0069]

[0070]

[0071] Where i = 1, 2, ..., k, m = 1, 2, ..., s, k ∈ [0, +∞), M represents i Randomly generated non-zero values, Indicates t m Randomly generated non-zero values, M represents i The result of the (k+1)th iteration Indicates t m The result of the (k+1)th iteration M represents i The result of the kth iteration Indicates t m The result of the kth iteration.

[0072] In this embodiment of the invention, according to formulas (13) and (14) obtained in Step 5, there are two options for selecting the initial value of the iteration. One is to randomly generate a number that satisfies a normal distribution as U. i M i , z i , lm V m , t m The initial value is obtained through a cyclic iteration using the power and inverse power methods of the quaternion real representation matrix. Then, a maximum recognition accuracy threshold is set, and iteration stops when this threshold is reached. The kernel sparse principal component corresponding to the highest recognition accuracy is taken as the final solution of the model. and

[0073] Step 106: Based on the kernel sparse principal components in the row and column directions of the model, calculate the projection matrix of the training sample quaternion covariance kernel matrix and the projection matrix of the test sample quaternion covariance kernel matrix, respectively.

[0074] In this embodiment of the invention, steps 101-105 are the sample training process, through which a quaternion generalized kernel sparse principal component analysis optimization model (QGKSPCA) is constructed and the corresponding kernel sparse principal components are solved. and As the final solution of the model, the projection matrices of the training sample covariance kernel matrix and the test sample covariance kernel matrix in the row and column directions are further calculated according to formulas (15) and (16), as shown below:

[0075]

[0076]

[0077] Where j = 1, 2, ..., T, v = 1, 2, ..., k, g = 1, 2, ..., m, k represents the first k kernel sparse principal components of the training sample set, and m represents the first m kernel sparse principal components of the test sample set. P train It is the quaternion covariance kernel matrix φ of the training samples. train The projection matrix, P test The test sample quaternion covariance kernel matrix φ test The projection matrix.

[0078] Step 107: Use the quaternion p-norm Euclidean distance to identify the category to which the images in the test sample set belong.

[0079] Step 108: Output the image category.

[0080] In this embodiment of the invention, the quaternion p-norm Euclidean distance is used for image recognition in the test sample set. Specifically, the projection matrix of the training sample quaternion covariance kernel matrix that is closest to the projection matrix of the test sample quaternion covariance kernel matrix is ​​calculated. Make it satisfy formula (17):

[0081]

[0082] In formula (17) The Euclidean distance of the quaternion p-norm defined in formula (8) is used to determine the category c of the image in the test sample set and output it. Specifically, in this embodiment, when 0 < p < 1, the quaternion generalized kernel sparse principal component analysis optimization model (QGKSPCA) becomes a concave model, while when p ≥ 1, the quaternion generalized kernel sparse principal component analysis optimization model (QGKSPCA) becomes a convex model. Therefore, using an adjustable p value makes it more effective to identify color images and better illustrates the rationality of the identification process.

[0083] Figure 2 shows a flowchart of an image recognition method based on quaternion generalized kernel sparse principal component analysis. Quaternions are used to represent the entropy, red, green, and blue information of a color image, constructing a quaternion real representation matrix. Next, based on the quaternion real representation matrix, row and column quaternion covariance kernel matrices are constructed, and quaternion Cholesky decomposition is performed on the quaternion covariance kernel matrix. Then, a quaternion generalized kernel sparse principal component analysis optimization model (QGKSPCA) is constructed using the quaternion p-norm Euclidean distance. Finally, a quaternion structure-preserving solution based on the alternating direction multiplier method is used to extract the kernel sparse feature solution of the model. This model can extract key features from training samples containing multiple types of noise. Using flexibly adjustable weight coefficients w and the quaternion p-norm, based on the quaternion structure-preserving algorithm, the kernel sparse principal component structure in the row and column directions is accurately calculated. Then, based on the kernel sparse principal component structure, the projection matrix of the quaternion covariance kernel matrix of the training samples and the projection matrix of the quaternion covariance kernel matrix of the test samples are calculated respectively. Finally, the p-norm Euclidean distance of the quaternion real representation is used to identify the test image and output the corresponding category.

[0084] Figure 3 shows the curves illustrating how the accuracy of four color medical image recognition methods varies with the number of kernel sparse principal components. The horizontal axis represents the number of kernel sparse principal components, and the vertical axis represents the image recognition accuracy. The four image recognition methods are column-dominant quaternion generalized kernel sparse principal component analysis (QGKSPCAcol), two-dimensional quaternion principal component analysis (2DQPCA), kernel quaternion principal component analysis (KQPCA), and row-dominant quaternion generalized kernel sparse principal component analysis (QGKSPCArow).

[0085] Specifically, Figure 3 compares the recognition performance of the four methods on noisy color image data. The column-dominant quaternion generalized kernel sparse principal component analysis (QGKSPCAcol) and row-dominant quaternion generalized kernel sparse principal component analysis (QGKSPCArow) proposed in this invention achieve the highest recognition rates of 0.92 and 0.91, respectively, outperforming other existing algorithms in image recognition. In Figure 3, when the number of extracted kernel sparse principal components exceeds 5, the recognition accuracy of the quaternion generalized kernel sparse principal component analysis model (QGKSPCA) described in this invention remains stable. In contrast, the existing kernel quaternion principal component analysis (KQPCA) method, due to its inability to extract precise kernel sparse principal components, sees its recognition accuracy drop to 0.39 when the number of extracted kernel sparse principal components is 18. This embodiment illustrates that the quaternion generalized kernel sparse principal component analysis model (QGKSPCA) of the present invention can extract and calculate accurate kernel sparse principal component features in medical images containing interference such as noise, brightness, and fog, thereby improving the recognition accuracy and robustness of color images.

[0086] Figure 4 is a schematic diagram of the three-dimensional curve of the weight coefficient w changing with the number of kernel sparse principal components in the color medical image database in an embodiment of the present invention. The weight coefficient w ranges from (0,1). w calculates the maximum projection divergence in the row and column directions together and can flexibly adjust the relationship between the row and column directions, reflecting the two-sided nature, that is, considering the features of all directions of the sample, thereby improving the reliability of image recognition accuracy.

[0087] This invention also provides an image recognition system based on quaternion generalized kernel sparse principal component analysis. The system includes a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute any of the steps of the image recognition method based on quaternion generalized kernel sparse principal component analysis.

[0088] This invention also provides a storage medium storing a computer program that, when executed by a processor, implements the image recognition method based on quaternion generalized kernel sparse principal component analysis as described above.

[0089] In summary, this invention provides an image recognition method, system, and storage medium. This method is based on quaternion generalized kernel sparse principal component analysis. First, it performs quaternion real representation based on the image's entropy and the four components (red, green, and blue), thus solving the problem of lost pixel entropy information.

[0090] Secondly, the sample feature space is projected to a high-dimensional space based on the quaternion real representation matrix. The kernel function method is used to transform linear features into nonlinear features, making it easier to distinguish image samples of different categories but with similar features. In addition, in the nonlinear projection process, the p-norm Euclidean distance used is an adjustable arbitrary non-negative value, which reflects a generalized feature. That is, it can be flexibly adjusted for interference factors such as noise, brightness, and fog during image feature extraction, enabling the recognition of complex and varied medical images. Furthermore, the flexible adjustment of the p value can not only prevent overfitting during training and ensure the stability of recognition efficiency, but also solve the tedious process of manually adjusting parameters during training.

[0091] Furthermore, the weight settings during kernel function construction link the maximum projection divergence in the row and column directions for calculation, reflecting the two-sided nature and comprehensively considering all directional features of the training samples, making the calculated kernel sparse principal components more reasonable and the subsequent image recognition accuracy more reliable and accurate. Finally, this invention also adopts the alternating direction multiplier method based on the quaternion-preserving structure algorithm, which results in shorter computation time, less memory usage, and lower computational cost.

[0092] It should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This way of describing the specification is only for clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

[0093] The detailed descriptions listed above are merely specific descriptions of feasible embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. All equivalent embodiments or modifications made without departing from the spirit of the present invention should be included within the scope of protection of the present invention.

Claims

1. An image recognition method based on quaternion generalized kernel sparse principal component analysis, characterized in that, The method includes: acquiring images from a training sample set and a test sample set; extracting the entropy, red, green, and blue components of each training sample image and representing them as quaternions to construct a corresponding quaternion real representation matrix; constructing the quaternion covariance kernel matrix and the quaternion p-norm Euclidean distance of the quaternion real representation matrix, where p is any non-negative value; constructing a quaternion generalized kernel sparse principal component analysis optimization model based on the quaternion covariance kernel matrix and the quaternion p-norm Euclidean distance of the quaternion real representation matrix; solving the optimization model and obtaining the calculated results. The kernel sparse principal components in the row and column directions of the training samples are used as the final solution; based on the kernel sparse principal components in the row and column directions of the optimized model, the projection matrix of the quaternion covariance kernel matrix of the training samples and the projection matrix of the quaternion covariance kernel matrix of the test samples are calculated respectively; based on the quaternion p-norm Euclidean distance, the category to which the image in the test sample set belongs is identified according to the projection matrix; the category to which the image belongs is output; wherein, the step of extracting the entropy, red, green and blue component information of each training sample image and representing it with a quaternion matrix to construct the corresponding quaternion real representation matrix specifically includes: extracting the entropy, red, green and blue component information of each training sample image and representing it with a quaternion matrix to construct the corresponding quaternion real representation matrix. The entropy, red, green, and blue components corresponding to each sample image are denoted as follows: Where n = 1, 2, ..., L, and L is the number of sample images in the training sample set; based on the four component information, the quaternion matrix of the sample image is represented as: ,in, Represents the nth quaternion matrix It belongs to the rational number field matrix, and the size of the rational number field matrix is h is the height of the sample image, w is the width of the sample image, and i, j, and k represent the three virtual units of the quaternion; the quaternion matrix is ​​constructed using quaternion structure-preserving theory. The real representation matrix 。 2. The image recognition method according to claim 1, characterized in that, Before the step of "extracting the entropy, red, green and blue components of each training sample image", the method further includes: representing each image in the sample set as a matrix of fixed size, wherein the sample set includes a training sample set and a test sample set.

3. The image recognition method according to claim 1, characterized in that, The phrase "constructing the quaternion covariance kernel matrix and quaternion p-norm Euclidean distance of the quaternion real representation matrix" specifically includes: constructing the corresponding quaternion real representation matrix based on the training sample set and the test sample set, denoted as... Projecting the quaternion real representation matrix onto a high-dimensional quaternion feature space, the quaternion covariance kernel matrices of the training and test sample sets are calculated, respectively, as follows: ,in, Indicates by The training images after projection. Represented as The conjugate transpose of the matrix. Indicates by The test image after projection. Represented as The conjugate transpose matrix; the quaternion real representation matrix is ​​denoted as The corresponding p-norm Euclidean distance is: Wherein, the nonnegative parameter p represents the p-norm of the quaternion. It is achieved by extracting the entropy, red, green, and blue components corresponding to the nth sample image, which respectively represent one real part and three imaginary parts of the quaternion.

4. The image recognition method according to claim 1, characterized in that, The "construction of a quaternion-based generalized kernel sparse principal component analysis optimization model" specifically includes: defining the kernel sparse principal component matrices in the row and column directions of the training samples. Where U represents the kernel sparse principal components along the row direction of the training samples, and V represents the kernel sparse principal components along the column direction of the training samples. Let U and V represent rational number field matrices of size 4T×4T, where U and V are composed of k and s columns of quaternion eigenvectors, respectively; for any nonnegative parameter If the row and column kernel sparse principal component matrices U and V satisfy Where w is the weighting coefficient, and They are respectively for and The result of performing Cholesky decomposition on quaternions. This represents the quaternion covariance kernel matrix calculated along the row direction. This represents the quaternion covariance kernel matrix calculated along the column direction. They represent finding k optimal U values ​​respectively. i and s optimal V m To maximize the divergence of the model, the parameters and These represent the divergence adjustments in the row and column directions of the model, respectively.

5. The image recognition method according to claim 4, characterized in that, The method further includes: the quaternion structure-preserving algorithm based on the alternating direction multiplier method is used to solve the quaternion generalized kernel sparse principal component analysis optimization model.

6. The image recognition method according to claim 5, characterized in that, The method further includes: the quaternion structure-preserving algorithm based on the alternating direction multiplier method selects the initial value of iteration as randomly generated data that satisfies a normal distribution or as data obtained by iterative iteration based on the power method and inverse power method of the quaternion real representation matrix.

7. The image recognition method according to claim 1, characterized in that, The phrase "calculating the projection matrix of the training sample quaternion covariance kernel matrix and the projection matrix of the test sample quaternion covariance kernel matrix based on the kernel sparse principal components in the row and column directions of the optimized model" specifically includes: the training sample quaternion covariance kernel matrix projection matrix Where j=1,2,…,T, v=1,2,…,k, k represents the first k kernel sparse principal components of the training sample set, and T is the number of training samples. Let represent a rational number field matrix, and the size of the rational number field matrix is ​​h×v; the test sample quaternion covariance kernel matrix projection matrix Where g = 1, 2, ..., m, m represents the first m kernel sparse principal components of the test sample set, U represents the kernel sparse principal components along the row direction of the training samples, and V represents the kernel sparse principal components along the column direction of the training samples. and These represent the optimal solutions of the optimal model. Let represent a rational number field matrix, and let the size of the rational number field matrix be h×g.

8. The image recognition method according to claim 7, characterized in that, The phrase "identifying the category of an image in the test sample set based on the projection matrix according to the quaternion p-norm Euclidean distance" specifically includes: projecting the training sample quaternion covariance kernel matrix according to the projection matrix. Find the projection matrix of the quaternion covariance kernel matrix of the test samples. The projection matrix of the quaternion covariance kernel matrix of the closest training samples Make it satisfy To determine the category c of the images in the test sample set, The Euclidean distance is the p-norm of the quaternion, where p is adjusted according to different images to be tested.

9. An image recognition system based on quaternion generalized kernel sparse principal component analysis, characterized in that, The system includes a processor and a storage medium; the storage medium is used to store instructions; the processor is used to operate according to the instructions to perform the steps of the image recognition method as described in any one of claims 1-8.

10. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the image recognition method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Color face recognition method based on quaternion non-convex penalty sparse principal component analysis

    CN112507966A

  • Bilateral weighted two-dimensional principal component analysis method and system for processing color medical image

    CN115205944A