Semi-supervised image classification method based on anchor points and adaptive graph learning
By adopting anchor point and adaptive graph learning methods in semi-supervised image classification, the problem of long graph construction time is solved, and more efficient and accurate image classification is achieved.
Patent Information
- Application Number
- CN202411744142.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-03-07
AI Technical Summary
Graph construction between all data consumes a lot of time, resulting in a long training and testing process for semi-supervised image classification models.
A semi-supervised image classification method based on anchor point and adaptive graph learning is adopted to build an anchor graph model by acquiring and preprocessing the image dataset, and a sparse adjacency matrix is generated using an adaptive nearest neighbor method to accelerate the graph construction and model training process.
Through anchor graph model and adaptive graph learning methods, the time for graph construction and model training is significantly reduced, the efficiency and accuracy of image classification are improved, and high-precision image classification can be achieved under limited labeled data.
Smart Images

Figure CN119580002A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of traditional machine learning technology, and specifically is a semi-supervised image classification method based on anchor point and adaptive graph learning. Background Art
[0002] As the scale of data increases, data classification tasks face great challenges. Classification models based on semi-supervised learning (SSL) use a small number of labeled data samples and a large number of unlabeled data samples to construct a loss function. Compared with supervised learning models, this method saves a lot of time for labeling samples, so it has attracted the attention of many researchers. As a hot topic in recent years, SSL can be divided into propagation learning and inductive learning. The core idea of propagation learning is to propagate labels from limited samples to a large number of unlabeled samples. Inductive learning mainly learns a decision function (classifier) from labeled samples and unlabeled samples, and uses the classifier to predict the label of the test sample. Recently, the main semi-supervised learning methods include: graph-based semi-supervised learning (GSSL), co-training models, and regression models. Among them, the graph-based semi-supervised learning model is more popular because it can make full use of graph structure information and treat data as vertices for processing. Therefore, it has been widely used in many practical applications. Based on the prior consistency theory, nearby data should have the same label, and data in the same structure should also have the same label. Therefore, constructing a similarity graph between data to build a model can effectively capture the hidden structural information of the data itself, thereby achieving better classification results. The classification of graph-based semi-supervised learning models is mainly divided into two steps: 1) graph construction, 2) soft label acquisition.
[0003] In recent years, many graph-based semi-supervised classification methods have focused on the construction of similarity graphs and the use of label information. Nie et al. proposed a semi-supervised learning method with adaptive weight features and adaptive graphs (ANSSL), which simultaneously learns affinity matrices and infers unknown labels. The model extracts effective and robust features between all data points by automatic weighting; He et al. proposed a novel semi-supervised image segmentation method (BSOG), which uses limited labeled data and abundant unlabeled hyperspectral image (HS) samples to achieve simultaneous image segmentation and local structure learning. However, due to the graph construction of all data and the iterative process, the model takes a long time to obtain classification results. The above methods combine graph construction and label acquisition by building a unified model, and have achieved good performance on many datasets. However, graph construction between all data inevitably consumes a lot of time. Summary of the invention
[0004] The present invention provides a semi-supervised image classification method based on anchor point and adaptive graph learning, which solves the problem that a lot of time is consumed in graph construction between all data.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] Semi-supervised image classification methods based on anchor points and adaptive graph learning, including:
[0007] Acquire a data set of digital images or color pictures and perform preprocessing to obtain a processed data set;
[0008] Constructing an anchor graph model based on the processed data set;
[0009] Construct a semi-supervised classification model based on the anchor graph model;
[0010] Test the classification effect of the semi-supervised classification model;
[0011] Perform image classification based on the tested semi-supervised classification model and display the classification results.
[0012] Preferably, the steps of obtaining a data set of digital images or color pictures and preprocessing them are as follows:
[0013] Obtain a handwritten digit set and an image dataset as the datasets for the input model. Use the script to process the two image datasets into the form of a matrix n*d and perform a dimensionality reduction operation, where n represents the size of the dataset and d represents the dimension of the sample. Use a clustering algorithm to generate anchor points that conform to the image distribution.
[0014] Preferably, the dimensionality reduction algorithm is PCA. For the handwritten digit set, the scale is 70000*784. The PCA algorithm is used to reduce 784 dimensions to 82 dimensions. The clustering algorithm is k-means, and the number of anchor points is 2000. For the USPS data set, the scale is 9298*256 and the number of anchor points is 1000.
[0015] Preferably, the adjacency matrix of the anchor graph model is The following is obtained by the adaptive nearest neighbor method:
[0016]
[0017] Where m represents the number of anchor points. represents the i-th row of B, b ij represents the similarity relationship between the i-th sample and the j-th anchor point, and b ij ≥0,x i represents the i-th sample, the dimension is d, p j represents the jth anchor point, the dimension is j, and γ is the regularization parameter;
[0018] The adaptive nearest neighbor algorithm stipulates that a sample has a similar relationship with k anchor points, and the selection range of k is between 2 and 20.
[0019] Preferably, the steps of constructing a semi-supervised classification model based on the anchor graph model are specifically as follows:
[0020] The loss function of the semi-supervised classification model constructed using the basic clustering model and fitting terms is as follows:
[0021]
[0022] Where tr(.) represents trace, tr(F T L S F) is the basic clustering model, Represents the pseudo label matrix of the sample, and c is the number of classes. represents the Laplace matrix of S, D is the degree matrix of S, where the diagonal elements d i =∑ j S ij . is an adaptive term, is the label fitting term, where F l It means that we assume that we know the labels of the first l samples, Y l It means knowing the first l real sample labels, λ, α are penalty factors;
[0023] The label fitting term The true label Y l By randomly selecting l known labels containing all classes in the original sample, the F can be transformed and solved by using the similarity relationship between the anchor point and the sample, and the adaptive term The adjacency matrix W is obtained by W = BΛ -1 B T Obtain, among which Λ represents a diagonal matrix, and the diagonal elements correspond to the column sum of each column of B. An iterative algorithm is used to solve the optimal solution of the model, and the penalty factors λ and α are used to adjust the weights of different items in the loss function.
[0024] Preferably, the similarity relationship between the anchor point and the sample is expressed as F=BG, The pseudo label matrix of the anchor point is substituted into the model to convert it into the solution of G, and then the final soft label matrix is obtained through F=BG. The iterative method is to fix S to solve F, fix F to solve S, and the number of iterations is 30.
[0025] Preferably, the step of testing the classification effect of the semi-supervised classification model is specifically as follows:
[0026] The accuracy is used as the evaluation criterion for the correctness of label prediction, and the calculation formula is: Where prid represents the number of samples predicted correctly, and real represents the total number of samples;
[0027] By changing one of the parameters in the model and fixing the other parameters in the model, we can test the impact of the parameter change on the classification accuracy, and conduct comparative experiments with other algorithms to verify the performance of the semi-supervised classification model.
[0028] A semi-supervised image classification system based on anchor and adaptive graph learning, including:
[0029] Preprocessing module: used to obtain and preprocess the data set of digital images or color pictures to obtain the processed data set;
[0030] The first building module is used to build an anchor graph model based on the processed data set;
[0031] The second building module: used to build a semi-supervised classification model based on the anchor graph model;
[0032] Testing module: used to test the classification effect of the semi-supervised classification model;
[0033] Classification module: used to classify images based on the tested semi-supervised classification model and display the classification results.
[0034] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of a semi-supervised image classification method based on anchor point and adaptive graph learning are implemented.
[0035] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a semi-supervised image classification method based on anchor point and adaptive graph learning.
[0036] Compared with the prior art, the present invention has the following beneficial effects: the present invention proposes a semi-supervised image classification method based on anchor point and adaptive graph learning, and a processed data set can be obtained by obtaining a data set of digital images or color pictures and performing preprocessing. The anchor graph model constructed based on the processed data set can highlight the key information and features in the image, and provide strong support for subsequent semi-supervised classification. The semi-supervised classification model constructed based on the anchor graph model can make full use of limited labeled data and rich unlabeled data, and improve the generalization performance of the classifier by estimating the labels of unlabeled data and using them for training. When testing the classification effect of the semi-supervised classification model, the accuracy and reliability of the model can be verified by comparing with the actual labels. Finally, the image classification is performed according to the semi-supervised classification model after the test, and the classification results are displayed. It can be intuitively seen that the model has an effective recognition and classification ability for the image. It combines the feature extraction ability of the anchor graph model and the data utilization efficiency of semi-supervised learning, and can achieve high-precision image classification under limited labeled data. This not only reduces the cost and time of data annotation, but also improves the accuracy and efficiency of image classification.
[0037] Furthermore, data sets of different sizes and types such as digital images or color pictures are used to provide diverse and reliable data for semi-supervised image classification; the constructed semi-supervised classification model can use anchor points and linear propagation to convert predicted sample labels into first predicting anchor point labels and then linearly combining sample labels, and effectively speeds up the classification speed by using the characteristic that the number of anchor points is much less than the number of samples; the adaptive graph learning method is used to take the adaptive graph as the object of iterative optimization, and the adaptive graph and sample pseudo-label matrix are learned at the same time, which reduces the influence of the initial adjacency graph on the classification accuracy and improves the classification accuracy. The present invention has the advantages of fast classification speed and high classification accuracy, and can be used for label classification of image data sets. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flowchart of a semi-supervised image classification method based on anchor point and adaptive graph learning according to an embodiment of the present invention.
[0039] Figure 2 It is a schematic diagram of the structure of the adaptive nearest neighbor algorithm according to an embodiment of the present invention.
[0040] Figure 3 It is a schematic diagram of the structure of the initial adjacency matrix of the sample in the embodiment of the present invention.
[0041] Figure 4 It is a structural schematic diagram of the similarity relationship between anchor points and samples in an embodiment of the present invention.
[0042] Figure 5 It is a line graph showing the classification accuracy results of the embodiment of the present invention changing with the v parameter.
[0043] Figure 6 It is a line graph showing the classification accuracy results of the embodiment of the present invention changing with the m parameter.
[0044] Figure 7 This is a line graph showing the classification accuracy results of the embodiment of the present invention as the k parameter changes.
[0045] Figure 8 It is a block diagram of a semi-supervised image classification system based on anchor point and adaptive graph learning according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0047] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0049] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0050] like Figure 1 As shown, the steps of the semi-supervised image classification method based on anchor point and adaptive graph learning in one embodiment of the present invention are as follows:
[0051] (1) Data preprocessing
[0052] From the Kaggle platform, we select the common handwritten digits dataset MNIST and the image dataset USPS as the datasets for the input model. Through the script, we process the two image datasets into the form of matrix n*d and perform dimensionality reduction operations. n represents the size of the dataset, d represents the dimension of a sample, and use the clustering algorithm to generate anchor points that match the image distribution.
[0053] (2) Constructing the anchor chart model
[0054] For different datasets, the adjacency matrix of the anchor graph The following can be obtained by adaptive nearest neighbor method:
[0055]
[0056] Where m represents the number of anchor points. represents the i-th row of B, b ij represents the similarity relationship between the i-th sample and the j-th anchor point, and b ij ≥0,x i represents the i-th sample, the dimension is d, p j represents the jth anchor point, the dimension is j, and γ is the regularization parameter;
[0057] (3) Building a semi-supervised classification model
[0058] The sample initial adjacency graph matrix required to build the model
[0059] The loss function of the semi-supervised classification model constructed using the basic clustering model and fitting terms is as follows:
[0060]
[0061] where tr(F T L S F) is the basic clustering model, Represents the pseudo label matrix of the samples. represents the Laplace matrix of S, D is the degree matrix of S, where the diagonal elements d i =∑ j S ij . is an adaptive term, is the label fitting term, where F l It means that we assume that we know the labels of the first l samples, Y l Indicates knowing the first l true sample labels. λ, α represent penalty factors;
[0062] (4) Test the classification effect of the semi-supervised classification model
[0063] 1) Specify the classification assessment criteria:
[0064] Using accuracy as the evaluation criterion for label prediction, the calculation formula is: Where prid represents the number of samples predicted correctly, and real represents the total number of samples.
[0065] 2) Test method:
[0066] Change one of the parameters in the model and fix the other parameters in the model to test the effect of the parameter change on the classification accuracy, and conduct comparative experiments with other algorithms to verify the performance of the semi-supervised classification model;
[0067] (5) Display classification results
[0068] The data set and a small amount of label information are input into the classification model, the pseudo labels of all samples are calculated, and the accuracy of the classification is tested through the accuracy evaluation index, and the speed of the classification is verified through time.
[0069] In the data preprocessing step (1) of the present invention, the dimension reduction algorithm is PCA. For the handwritten digit set, the scale is 70000*784, and the PCA algorithm is used to reduce the 784 dimension to 82 dimensions. The clustering algorithm is k-means, and the number of anchor points is empirically selected as 2000. For the USPS data set, the scale is 9298*256, the anchor point selection is the same as above, and the number is empirically selected as 1000.
[0070] In step (2) of the anchor graph model of the present invention, the adaptive nearest neighbor algorithm stipulates that a sample has a similar relationship with k anchor points, and the selection range of k is between 2 and 20, and the default is 5. The algorithm is mainly used to generate a sparse and reliable adjacency matrix.
[0071] In the step (3) of constructing a semi-supervised classification model of the present invention, the label fitting term The true label Y l By randomly selecting l known labels containing all classes in the original sample, the F can be transformed and solved by using the similarity relationship between the anchor point and the sample, and the adaptive term The adjacency matrix W is obtained by W = BΛ -1 B T Obtain, among which Λ represents a diagonal matrix, and the diagonal elements correspond to the column sum of each column of B. An iterative algorithm is used to solve the optimal solution of the model, and the penalty factors λ and α are used to adjust the weights of different items in the loss function, which are all 1 by default.
[0072] In the step (3) of constructing a semi-supervised classification model of the present invention, the similarity relationship between the anchor point and the sample can be expressed as F=BG, The pseudo label matrix of anchor points is substituted into the model to convert it into the solution of G, and then the final soft label matrix is obtained through F=BG. The characteristic that the number of anchor points is much less than the number of samples is used to reduce the time of the solution process. The iterative method is to fix S to solve F, and fix F to solve S. The default number of iterations is 30. The model uses the known labels and the structural information of the original samples at the same time.
[0073] In the step (4) of constructing a semi-supervised classification model of the present invention, the parameters include the number v of labeled samples of each category, the number m of anchor points, the number k of nearest neighbors, and the other algorithms include a total of 5 classification algorithms in the directions of supervised learning and semi-supervised learning.
[0074] Another embodiment of the present invention provides a semi-supervised image classification method based on anchor point and adaptive graph learning, comprising:
[0075] (1) Data preprocessing
[0076] Download the common handwritten digits set MNIST and image dataset USPS from the Kaggle platform as the data sets for the input model. Use MATLAB to write a script to process the two image datasets into the form of a matrix n*d, with the suffix of the matrix table being .mat, and perform dimensionality reduction operations. The PCA weight parameter is set to 0.9. Use the k-means clustering algorithm to generate anchor points that match the image distribution. The algorithm can be executed 1 to 3 times, and the initial anchor points are selected by randomly scattering points.
[0077] (2) Constructing the anchor chart model
[0078] For different datasets, the adjacency matrix of the anchor graph The following can be obtained by adaptive nearest neighbor method:
[0079]
[0080] Where m represents the number of anchor points. represents the i-th row of B, b ij represents the similarity relationship between the i-th sample and the j-th anchor point, and b ij ≥0,x i represents the i-th sample, the dimension is d, p j represents the jth anchor point, the dimension is j, and γ is the regularization parameter;
[0081] exist Figure 2 In , each sample is in the k-neighborhood, and k is 5 by default, indicating the link relationship between the sample and k anchor points. The relationship value is calculated by the adaptive nearest neighbor algorithm, which also ensures that the sum of the k relationship values connected to each sample is 1, maintaining fairness. And the same anchor point may have an adjacency relationship with multiple samples, which is specifically represented in each column of the matrix B.
[0082] (3) Building a semi-supervised classification model
[0083] The sample initial adjacency graph matrix required to build the model exist Figure 3 In the example, the adjacency relationship between samples is connected through bridge B.
[0084] The loss function of the semi-supervised classification model constructed using the basic clustering model and fitting terms is as follows:
[0085]
[0086] where tr(FT L S F) is the basic clustering model, Represents the pseudo label matrix of the samples. represents the Laplace matrix of S, D is the degree matrix of S, where the diagonal elements d i =∑ j S ij . is an adaptive term, is the label fitting term, where F l It means that we assume that we know the labels of the first l samples, Y l Indicates that the first l true sample labels are known. λ, α represent penalty factors, which are 1 by default.
[0087] The loss function of the semi-supervised classification model can be further transformed into:
[0088]
[0089] in It is a diagonal matrix, the first l diagonal elements are 1, and the last nl diagonal elements are 0. Y is the initial label matrix. Knowing the labels of the first l samples, it is used for semi-supervised learning. The last ni samples are O, which represents unlabeled samples. The labels of these unlabeled samples need to be predicted through the pseudo-label matrix.
[0090] The iterative update algorithm is as follows:
[0091] Fix S and solve for F:
[0092] The semi-supervised classification model changes to:
[0093]
[0094] When solving the optimal solution of this model, the Lagrange multiplier method is used. If the solution is solved directly, then F = λ(L S +λU) - 1 UY, where This item involves the inverse calculation of the matrix, and the total time complexity is O(n 3 ).exist Figure 4 In , the similarity relationship between anchor points and samples is described. Anchor points can represent all samples within a range. Therefore, the labels of samples can also be represented by the labels of anchor points.
[0095] Substituting F=BG into the classification model, we get:
[0096]
[0097] The optimal solution of the model at this time is G = λ(B T L SB + λB T UB) -1 B T UY, where The time complexity of the calculation is O(m 3 ), and the time complexity of solving G is O(m 3 + nm 2 + nmc + m 2 c), where c is the number of classes, and L S contains the updated S. Then, find F through F = BG. The time complexity of this process is 0(nmc). The parameters related to the time complexity satisfy c << m, m << n, d << n. Therefore, the total time complexity is O(nm 2 ). Compared with O(n 3 ) without substituting F = BG, the speed is greatly accelerated.
[0098] Fix F and solve for S:
[0099] At this time, the semi-supervised classification model can be transformed into:
[0100]
[0101] To solve the optimal solution of the model at this time, the F obtained in the previous step needs to be used and substituted for solution. After obtaining S, substitute it into L in the previous step S , and the number of iterations is 30 times.
[0102] (4) Test the classification effect of the semi-supervised classification model
[0103] 1) Specify the classification evaluation criteria:
[0104] Use accuracy as the evaluation criterion for label prediction. The calculation formula is: where prid represents the number of samples with correct predictions, and real represents the total number of samples. In step (3) of constructing the semi-supervised classification model, after obtaining the final F, the position corresponding to the maximum value of each row of F represents the predicted label of the sample. Compare these labels with the indicator label matrix. The value of prid is the number of samples with successful comparison, and real is the sample size n.
[0105] 2) Test method:
[0106] Vary one parameter in the model and fix the other parameters in the model. Test the impact of the change in this parameter on the classification accuracy, and conduct a comparative experiment with other algorithms to verify the performance of this semi-supervised classification model.
[0107] The parameters involved in this semi-supervised classification model include the number of labeled samples v for each class, the number of anchor points m, and the number of nearest neighbors k. The total number of labeled samples, that is, the number of selected small amounts of label information, is l=cv. It means that the number of selected labels for each class is v to ensure fairness. The default value of v is 10. When testing its impact on classification accuracy, the range is 1-10, and the step length is 1. The default value of k is 5. When changing, the range is 2-20, and the step length is 2. For the MNIST dataset, the default number of anchor points is 2000. When testing the impact of its change on accuracy, the range is 500-5000, and the step length is 500. For the USPS dataset, the default number of anchor points is 1000. When testing the impact of its change on accuracy, the range is 500-5000, and the step length is 500.
[0108] Other algorithms include 1NN, PARW, AGR, OBGSSL, BGSSL- norma lized, mainly tests the accuracy value and its changes with parameters.
[0109] (5) Display classification results
[0110] The data set and a small amount of label information are input into the classification model, the pseudo labels of all samples are calculated, and the accuracy of the classification is tested through the accuracy evaluation index, and the speed of the classification is verified through time.
[0111] In order to verify the beneficial effects of the present invention, the inventors conducted a simulation experiment using the semi-supervised image classification method based on anchor points and adaptive graph learning in Example 1 of the present invention. The experimental results are as follows:
[0112] 1. Simulation conditions
[0113] The hardware requirements are: Windows 10, 2.30GHz, Intel i5-8300H CPU, 8GB RAM.
[0114] The software platform is: MATLAB 2022a.
[0115] 2. Simulation experiment
[0116] Table 1 shows the classification accuracy of the model. It can be seen that the semi-supervised classification model has guaranteed good classification accuracy on both MNIST and USPS datasets, and the results are better than those of most other algorithms, which fully proves that the model is capable of classifying large-scale image datasets.
[0117] Table 1 ACC (%) accuracy (OOM means memory overflow)
[0118]
[0119] exist Figure 5 , Figure 6 and Figure 7 In the figure, the classification accuracy of the model on the USPS dataset is shown as the parameters v, m, and k change. As can be seen from the figure, when v changes from 1 to 10, the classification accuracy gradually increases, and when m changes from 500 to 5000, the classification accuracy gradually increases. The main reason is that more anchor points obtain more accurate information, which fully proves that the use of anchor points can meet the accuracy requirements. When k changes from 2 to 20, the classification accuracy gradually decreases. The reason is that when constructing the anchor graph model, k is related to the sparsity of the graph. The larger k is, the less sparse the graph is, and some unimportant data will affect the experimental results.
[0120] Table 2 shows the time of the model on USPS. The left side shows the result without F=BG accelerated calculation, and the right side shows the result with accelerated calculation. It can be seen that the time loss of accelerated calculation is only about one sixth of that without acceleration. The experimental results fully verify that the model can achieve higher classification accuracy results in a shorter time.
[0121] Table 2 Time changes of non-acceleration and acceleration
[0122]
[0123] like Figure 8 As shown, the present invention provides a semi-supervised image classification system based on anchor point and adaptive graph learning, comprising:
[0124] Preprocessing module: used to obtain and preprocess the data set of digital images or color pictures to obtain the processed data set;
[0125] The first building module is used to build an anchor graph model based on the processed data set;
[0126] The second building module: used to build a semi-supervised classification model based on the anchor graph model;
[0127] Testing module: used to test the classification effect of the semi-supervised classification model;
[0128] Classification module: used to classify images based on the tested semi-supervised classification model and display the classification results.
[0129] A terminal device is provided in one embodiment of the present invention. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0130] The computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to accomplish the present invention.
[0131] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0132] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0133] The memory may be used to store the computer program and / or module, and the processor implements various functions of the terminal device by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory.
[0134] If the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0135] Although the embodiments of the present invention are described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments and application fields, and the above-mentioned specific embodiments are only illustrative and instructive, rather than restrictive. Under the guidance of the specification, a person skilled in the art can also make many forms without departing from the scope of protection of the claims of the present invention, all of which belong to the scope of protection of the present invention.
Claims
1. A semi-supervised image classification method based on anchor point and adaptive graph learning, characterized in that: include: Acquire a data set of digital images or color pictures and perform preprocessing to obtain a processed data set; Constructing an anchor graph model based on the processed data set; Construct a semi-supervised classification model based on the anchor graph model; Test the classification effect of the semi-supervised classification model; Perform image classification based on the tested semi-supervised classification model and display the classification results.
2. The semi-supervised image classification method based on anchor point and adaptive graph learning according to claim 1, characterized in that: The steps to obtain a data set of digital images or color pictures and preprocess them are as follows: Obtain a handwritten digit set and an image dataset as the datasets for the input model. Use the script to process the two image datasets into the form of a matrix n*d and perform a dimensionality reduction operation, where n represents the size of the dataset and d represents the dimension of a sample. Use a clustering algorithm to generate anchor points that conform to the image distribution.
3. The semi-supervised image classification method based on anchor point and adaptive graph learning according to claim 2, characterized in that: The dimensionality reduction algorithm is PCA. For the handwritten digit set, the scale is 70000*784. The PCA algorithm is used to reduce 784 dimensions to 82 dimensions. The clustering algorithm is k-means, and the number of anchor points is 2000. For the USPS data set, the scale is 9298*256 and the number of anchor points is 1000.
4. The semi-supervised image classification method based on anchor point and adaptive graph learning according to claim 1, characterized in that: Adjacency Matrix of Anchor Graph Model The following is obtained by the adaptive nearest neighbor method: Where m represents the number of anchor points. represents the i-th row of B, b ij represents the similarity relationship between the i-th sample and the j-th anchor point, and b ij ≥0,x i represents the i-th sample, the dimension is d, p j represents the jth anchor point, the dimension is d, and γ is the regularization parameter; The adaptive nearest neighbor algorithm stipulates that a sample has a similar relationship with k anchor points, and the selection range of k is between 2 and 20.
5. The semi-supervised image classification method based on anchor point and adaptive graph learning according to claim 1, characterized in that: The specific steps of building a semi-supervised classification model based on the anchor graph model are: The loss function of the semi-supervised classification model constructed using the basic clustering model and fitting terms is as follows: Where tr(.) represents trace, tr(F T L S F) is the basic clustering model, represents the pseudo label matrix of the sample, c is the number of classes, represents the Laplace matrix of S, D is the degree matrix of S, where the diagonal elements d i =∑ j S ij , is an adaptive term, is the label fitting term, where F l It means that we assume that we know the labels of the first l samples, Y l It means knowing the first l real sample labels, λ and α represent penalty factors; The label fitting term The true label Y l By randomly selecting l known labels containing all classes in the original sample, the F can be transformed and solved by using the similarity relationship between the anchor point and the sample, and the adaptive term The adjacency matrix W is obtained by W = BΛ -1 B T Obtain, among which Λ represents a diagonal matrix, and the diagonal elements correspond to the column sum of each column of B. An iterative algorithm is used to solve the optimal solution of the model, and the penalty factors λ and α are used to adjust the weights of different items in the loss function.
6. According to the semi-supervised image classification method based on anchor point and adaptive graph learning in claim 1, the similarity relationship between the anchor point and the sample is expressed as F=BG, The pseudo label matrix of the anchor point is substituted into the model to convert it into the solution of G, and then the final soft label matrix is obtained through F=BG. The iterative method is to fix S to solve F, fix F to solve S, and the number of iterations is 30.
7. The semi-supervised image classification method based on anchor point and adaptive graph learning according to claim 1, characterized in that: The specific steps for testing the classification effect of the semi-supervised classification model are as follows; The accuracy is used as the evaluation criterion for the correctness of label prediction, and the calculation formula is: Where prid represents the number of samples predicted correctly, and real represents the total number of samples; By changing one of the parameters in the model and fixing the other parameters in the model, the impact of the parameter change on the classification accuracy is tested, and a comparative experiment is performed to verify the performance of the semi-supervised classification model.
8. A semi-supervised image classification system based on anchor point and adaptive graph learning, characterized in that include: Preprocessing module: used to obtain and preprocess the data set of digital images or color pictures to obtain the processed data set; The first building module is used to build an anchor graph model based on the processed data set; The second building module: used to build a semi-supervised classification model based on the anchor graph model; Testing module: used to test the classification effect of the semi-supervised classification model; Classification module: used to classify images based on the tested semi-supervised classification model and display the classification results.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the semi-supervised image classification method based on anchor point and adaptive graph learning are implemented as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the semi-supervised image classification method based on anchor point and adaptive graph learning are implemented as described in any one of claims 1 to 7.